/* OfferPex — original design system.
   Palette sampled from the OfferPex artwork: deep navy #0E1D31, gold
   #D9AE57, teal #016155. Dark-background-first: ivory #F7F5EF body text
   on navy (contrast well above 4.5:1); teal is used ONLY as a button
   background with white text (about 6.8:1), never as text on navy. */
:root {
    --navy: #0E1D31;
    --navy-2: #12263F;
    --panel: #16283F;
    --panel-2: #1B3050;
    --line: #2C4767;
    --ivory: #F7F5EF;
    --muted: #B9C6D6;
    --gold: #D9AE57;
    --gold-bright: #F8D77F;
    --teal: #016155;
    --teal-dark: #01594D;
    --ok-bg: #123B31; --ok: #9FE8C4; --ok-line: #1E5C4B;
    --err-bg: #3E1F24; --err: #F5B8BE; --err-line: #6E3238;
    --warn-bg: #3A2F16; --warn: #F3DCA3; --warn-line: #8A6D2F;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--navy); color: var(--ivory); }
a { color: var(--gold-bright); }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: "Gabarito", "Manrope", system-ui, sans-serif; color: var(--ivory); margin: 0 0 .4em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
h1 .accent, h2 .accent { color: var(--gold); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; font-weight: 400; }
.mt { margin-top: 1rem; }
code { background: #0A1727; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: .88em; color: var(--gold-bright); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 252px; flex: 0 0 252px; position: sticky; top: 0; height: 100vh;
    background: linear-gradient(178deg, #0A1727 0%, #0E1D31 55%, #12283F 100%);
    border-right: 1px solid var(--line);
    color: var(--ivory); display: flex; flex-direction: column; padding: 20px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 4px 6px 18px; }
.brand-emblem { width: 44px; height: 44px; }
.brand-text { font-family: "Gabarito", system-ui, sans-serif; font-size: 1.25rem; letter-spacing: .2px; color: var(--ivory); }
.brand-text strong { color: var(--gold); font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.side-nav a {
    color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .97rem;
    display: flex; gap: 10px; align-items: center;
}
.side-nav a:hover { background: rgba(217, 174, 87, .12); color: #fff; }
.side-nav a.on { background: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(1, 97, 85, .5); }
.side-nav .ic { width: 20px; text-align: center; opacity: .95; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.side-tenant { font-size: .9rem; font-weight: 700; color: var(--ivory); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.side-user { font-size: .85rem; color: var(--muted); margin-bottom: 8px; word-break: break-all; }
.main { flex: 1; padding: 28px 34px 60px; max-width: 1220px; min-width: 0; }
.page-head { margin-bottom: 20px; }
.page-head p { margin: 0; }

/* ---------- cards & layout ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card h2 { color: var(--gold); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; margin-bottom: 0; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--ivory); font-family: "Gabarito", system-ui, sans-serif; }
.stat-num.small { font-size: 1.3rem; }
.stat-label { color: var(--muted); font-size: .9rem; }
.card-link { margin-top: 8px; font-weight: 700; text-decoration: none; font-size: .92rem; }
.warn-card { border-color: var(--warn-line); background: linear-gradient(180deg, #2E2410, var(--panel)); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.content-card { margin-bottom: 0; display: flex; flex-direction: column; }
.content-img, .preview-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; max-height: 260px; background: #0A1727; }
.preview-img.empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); text-align: center; padding: 16px; }
.post-text { white-space: pre-wrap; }
.preview-grid { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 22px; }
@media (max-width: 860px) { .preview-grid { grid-template-columns: 1fr; } .shell { flex-direction: column; } .sidebar { width: 100%; flex: none; height: auto; position: static; } .main { padding: 20px 16px 50px; } }

/* ---------- dashboard checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li.done .check-body strong { color: var(--muted); text-decoration: line-through; }
.check-mark { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: .9rem; margin-top: 1px; }
.checklist li.done .check-mark { background: var(--teal); border-color: var(--teal); color: #fff; }
.check-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.guide-steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 9px; line-height: 1.55; }
.help-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 7px; }

/* ---------- forms & buttons ---------- */
.stack { display: flex; flex-direction: column; gap: 13px; }
.stack label, .filter-grid label, .inline-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .93rem; color: var(--ivory); }
.stack label .hint { font-weight: 400; }
.form-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; margin: 0; }
.form-group legend { font-weight: 700; color: var(--gold); padding: 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], input[type="number"], select, textarea {
    font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #0F2238; color: var(--ivory); width: 100%;
}
input::placeholder, textarea::placeholder { color: #8298B0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(217, 174, 87, .55); border-color: var(--gold); }
label.check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: auto; }
.btn {
    display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; cursor: pointer;
    border-radius: 10px; border: 1.5px solid transparent; padding: 9px 16px; text-decoration: none; font-size: .95rem;
}
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 4px 12px rgba(1, 97, 85, .4); }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-bright); color: var(--navy); }
.btn-soft { background: var(--panel-2); color: var(--ivory); border-color: var(--line); }
.btn-soft:hover { background: #23406A; color: #fff; }
.btn-ghost { background: transparent; color: var(--ivory); border-color: var(--line); }
.btn-ghost:hover { background: rgba(217, 174, 87, .12); color: #fff; }
.btn-danger { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.btn-lg { padding: 12px 22px; font-size: 1.03rem; }
.btn-sm { padding: 6px 11px; font-size: .86rem; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; align-items: center; }
.btn-row.wrap { flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.file-label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
.file-chosen { color: var(--muted); font-size: .88rem; font-weight: 400; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; align-items: end; }
.toolbar-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: end; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .desc { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.table .actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 230px; }
.table.kv th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ivory); width: 180px; }
.badge { display: inline-block; background: var(--panel-2); color: var(--ivory); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: .76rem; font-weight: 700; }
.badge-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.badge.sample { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

/* ---------- alerts ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-weight: 600; border: 1px solid var(--line); }
.alert.ok, .alert.success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert.err, .alert.error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.alert.warn, .alert.warning, .alert.info { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

/* ---------- auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1100px 600px at 20% -10%, #1B3A5E 0%, transparent 60%), linear-gradient(160deg, #0A1727, #0E1D31 55%, #123B33); padding: 24px; }
.auth-card { background: var(--navy-2); border: 1px solid var(--line); border-radius: 18px; padding: 34px 36px; max-width: 430px; width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.auth-card.install-card { max-width: 560px; }
.auth-logo { width: 250px; max-width: 100%; display: block; margin: 0 auto 10px; }
.auth-emblem { width: 74px; height: 74px; display: block; margin: 0 auto 8px; }
.auth-card h1 { text-align: center; color: var(--gold); }
.auth-card .muted { text-align: center; }
.auth-alt { text-align: center; color: var(--muted); margin-bottom: 0; }
