:root {
    --ink: #101722;
    --ink-2: #1b2636;
    --text: #172033;
    --muted: #667085;
    --line: #e4e7ec;
    --line-strong: #d0d5dd;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --success: #18794e;
    --warning: #9a6700;
    --danger: #b42318;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--surface-2);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background: var(--ink);
    color: #fff;
    padding: 22px 16px;
    z-index: 20;
}
.brand { padding: 0 10px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { font-size: 12px; letter-spacing: .16em; font-weight: 800; }
.brand-name { margin-top: 6px; font-size: 15px; color: rgba(255,255,255,.72); }
.nav { display: grid; gap: 6px; margin-top: 20px; }
.nav a {
    padding: 10px 12px;
    border-radius: 6px;
    color: rgba(255,255,255,.78);
    font-size: 14px;
    font-weight: 600;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.09); color: #fff; }

.main { margin-left: 248px; min-height: 100vh; }
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-title { font-size: 14px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color:#fff; display:grid; place-items:center; font-weight:700; }
.page { max-width: 1440px; margin: 0 auto; padding: 28px; }
.page-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:24px; }
.page-head h1 { margin:0; font-size:26px; letter-spacing:-.02em; color:var(--ink); }
.page-head p { margin:5px 0 0; color:var(--muted); font-size:14px; }

.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    min-height:40px; padding:9px 14px;
    border:1px solid var(--ink); border-radius:6px;
    background:var(--ink); color:#fff; font-weight:700; font-size:14px;
}
.btn:hover { background:#05090f; }
.btn-secondary { background:#fff; color:var(--ink); border-color:var(--line-strong); }
.btn-secondary:hover { background:#f9fafb; }
.btn-danger { background:#fff; color:var(--danger); border-color:#f0b7b2; }

.grid { display:grid; gap:16px; }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.card {
    background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
    box-shadow:var(--shadow); padding:20px;
}
.metric-label { font-size:13px; color:var(--muted); }
.metric-value { margin-top:7px; font-size:28px; line-height:1; font-weight:800; color:var(--ink); }
.metric-note { margin-top:9px; font-size:12px; color:var(--muted); }

.section { margin-top:22px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.section-head h2 { margin:0; font-size:17px; color:var(--ink); }
.section-head small { color:var(--muted); }

.table-wrap { overflow:auto; background:#fff; border:1px solid var(--line); border-radius:var(--radius); }
table { width:100%; border-collapse:collapse; min-width:760px; }
th,td { text-align:left; padding:13px 15px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:middle; }
th { background:#fafafa; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
tr:last-child td { border-bottom:0; }
.row-link { font-weight:700; color:var(--ink); }
.subtle { color:var(--muted); font-size:13px; }

.badge {
    display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px;
    font-size:11px; line-height:1; font-weight:800; letter-spacing:.03em;
    background:#eef1f4; color:#445164;
}
.badge-success { background:#ecfdf3; color:var(--success); }
.badge-warning { background:#fffaeb; color:var(--warning); }

.form-card { max-width:900px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.field { display:grid; gap:7px; }
.field.full { grid-column:1/-1; }
label { font-size:13px; font-weight:700; color:#344054; }
input, select, textarea {
    width:100%; border:1px solid var(--line-strong); border-radius:6px;
    padding:10px 11px; background:#fff; color:var(--text); outline:none;
}
input:focus, select:focus, textarea:focus { border-color:#667085; box-shadow:0 0 0 3px rgba(102,112,133,.08); }
textarea { min-height:92px; resize:vertical; }
.help { color:var(--muted); font-size:12px; }
.error-list { margin:0 0 16px; padding:12px 15px; border:1px solid #f7c6c2; background:#fff4f3; border-radius:6px; color:#912018; }
.flash { margin-bottom:16px; padding:11px 13px; border:1px solid #a6f4c5; background:#ecfdf3; color:#087443; border-radius:6px; font-size:14px; }

.property-hero { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.property-code { font-size:12px; color:var(--muted); letter-spacing:.08em; font-weight:800; text-transform:uppercase; }
.property-title { margin:4px 0 0; font-size:27px; color:var(--ink); }
.kv { display:grid; grid-template-columns:160px 1fr; gap:8px 16px; font-size:14px; }
.kv div:nth-child(odd) { color:var(--muted); }
.inline-actions { display:flex; flex-wrap:wrap; gap:8px; }

.stack { display:grid; gap:12px; }
.list-item { padding:14px 0; border-bottom:1px solid var(--line); }
.list-item:last-child { border-bottom:0; }
.list-title { font-weight:700; }
.empty { padding:24px; text-align:center; color:var(--muted); border:1px dashed var(--line-strong); border-radius:var(--radius); background:#fff; }

.mobile-bar { display:none; }

.auth-page { min-height:100vh; display:grid; grid-template-columns:1.15fr .85fr; background:#fff; }
.auth-brand { background:var(--ink); color:#fff; padding:56px; display:flex; flex-direction:column; justify-content:space-between; }
.auth-brand h1 { max-width:560px; margin:30px 0 0; font-size:42px; line-height:1.08; letter-spacing:-.035em; }
.auth-brand p { max-width:520px; color:rgba(255,255,255,.64); }
.auth-panel { display:grid; place-items:center; padding:32px; }
.auth-card { width:min(420px,100%); }
.auth-card h2 { margin:0; font-size:26px; color:var(--ink); }
.auth-card > p { color:var(--muted); margin:6px 0 26px; }

@media (max-width: 1050px) {
    .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .sidebar { width:214px; }
    .main { margin-left:214px; }
}
@media (max-width: 760px) {
    body { padding-bottom:64px; }
    .sidebar { display:none; }
    .main { margin-left:0; }
    .topbar { height:58px; padding:0 16px; }
    .page { padding:18px 14px; }
    .page-head { flex-direction:column; }
    .page-head .btn { width:100%; }
    .grid-4, .grid-2, .form-grid { grid-template-columns:1fr; }
    .field.full { grid-column:auto; }
    .card { padding:16px; }
    .property-hero { flex-direction:column; }
    .property-title { font-size:23px; }
    .kv { grid-template-columns:1fr; gap:3px; }
    .kv div:nth-child(even) { margin-bottom:8px; }
    .table-wrap { border:0; background:transparent; overflow:visible; }
    table, thead, tbody, th, td, tr { display:block; min-width:0; }
    thead { display:none; }
    tr { margin-bottom:10px; background:#fff; border:1px solid var(--line); border-radius:8px; padding:12px; }
    td { border:0; padding:5px 0; }
    td[data-label]::before { content:attr(data-label) ": "; color:var(--muted); font-size:12px; font-weight:700; }
    .mobile-bar {
        display:grid; grid-template-columns:repeat(4,1fr);
        position:fixed; inset:auto 0 0; z-index:30;
        background:#fff; border-top:1px solid var(--line); height:60px;
    }
    .mobile-bar a { display:grid; place-items:center; font-size:11px; font-weight:700; color:#667085; }
    .mobile-bar a.active { color:var(--ink); }
    .auth-page { grid-template-columns:1fr; background:var(--surface-2); }
    .auth-brand { padding:26px 22px; min-height:190px; }
    .auth-brand h1 { margin-top:18px; font-size:28px; }
    .auth-brand p { margin-bottom:0; }
    .auth-panel { padding:26px 18px; align-items:start; }
}
