/* Kapstone Admin — matches the website palette (green #1E7A47, deep #0F4224, gold #C9A227, Inter) */
:root {
  --green: #1E7A47; --green-d: #155C33; --deep: #0F4224; --gold: #C9A227; --gold-d: #B08E1E;
  --mint: #E8F0EA; --ink: #111827; --text: #1F2933; --muted: #6B7280; --line: #E3E8E5; --bg: #F3F5F4; --card: #fff;
  --red: #C0392B; --radius: 12px; --shadow: 0 1px 2px rgba(15,66,36,.06), 0 4px 16px rgba(15,66,36,.05);
  --side: 252px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--mint); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ic-xl { width: 40px; height: 40px; color: #b8c4bd; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--side); background: var(--deep); color: #cfe1d6; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.nav { padding: 12px 10px; flex: 1; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7fa48d; margin: 18px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #d6e6dc; font-weight: 500; }
.nav-link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav-link.is-active { background: var(--green); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-count { margin-left: auto; background: var(--gold); color: var(--deep); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.sidebar-foot { padding: 12px 20px; font-size: 11px; color: #6f957e; }
.main { flex: 1; margin-left: var(--side); min-width: 0; overflow-x: clip; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.top-search input { border: 0; background: transparent; padding: 9px 0; flex: 1; outline: 0; font: inherit; }
.user-menu { margin-left: auto; position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 10px; font: inherit; color: inherit; text-align: left; }
.user-btn:hover { background: var(--bg); }
.user-meta strong { display: block; font-size: 13px; }
.user-meta small { display: block; color: var(--muted); font-size: 11.5px; }
.dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 190px; padding: 6px; }
[data-dropdown].is-open .dropdown { display: block; }
.dropdown a, .dropdown button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); text-decoration: none; }
.content { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }

/* Avatars */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 600; font-size: 12.5px; flex: none; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-xs { width: 22px; height: 22px; font-size: 9.5px; vertical-align: middle; }

/* Layout helpers */
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-s { gap: 8px; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 10px; } .mt-s { margin-top: 12px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 600; color: var(--ink); }
.text-red { color: var(--red); } .right { text-align: right; } .nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.inline { display: inline; }
.self-end { align-self: end; padding-bottom: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 16px 20px 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
details.card > summary { list-style: none; cursor: pointer; margin: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 14px; }
details.card > summary h2::after { content: " ▸"; color: var(--muted); }
details.card[open] > summary h2::after { content: " ▾"; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: 4px; transition: transform .12s, box-shadow .12s; }
.kpi:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(15,66,36,.09); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.kpi-value small { font-size: 15px; color: var(--muted); }
.kpi-foot { font-size: 12px; color: var(--muted); }
.kpi-foot em { font-style: normal; font-weight: 600; } .kpi-foot .up { color: var(--green); } .kpi-foot .down { color: var(--red); }
.kpi-accent { background: linear-gradient(135deg, var(--deep), var(--green)); border-color: transparent; }
.kpi-accent .kpi-label, .kpi-accent .kpi-foot { color: #cfe5d7; } .kpi-accent .kpi-value { color: #fff; }

/* Charts */
.barchart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--green), var(--green-d)); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bar-col:last-child .bar { background: linear-gradient(180deg, var(--gold), var(--gold-d)); }
.bar-val { font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.bar-lbl { font-size: 11px; color: var(--muted); margin-top: 6px; }
.stackbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 6px 0 14px; background: var(--bg); }
.seg { display: block; height: 100%; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.legend a { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text); font-size: 13px; }
.legend strong { margin-left: auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars a { display: grid; grid-template-columns: 190px 1fr 32px; gap: 10px; align-items: center; color: var(--text); font-size: 13px; }
.hb-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.hbars strong { text-align: right; }

/* Tones */
.tone-blue { background: #2F6FDE; } .tone-amber { background: var(--gold); } .tone-purple { background: #7C4DCC; } .tone-teal { background: #138A8A; }
.tone-orange { background: #E07B24; } .tone-green { background: var(--green); } .tone-red { background: var(--red); } .tone-grey { background: #9AA5AE; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-blue { background: #E6EEFC; color: #1E4FA8; } .badge-amber { background: #FBF3D9; color: #8A6D12; } .badge-purple { background: #EFE8FA; color: #5A31A3; }
.badge-teal { background: #E0F3F3; color: #0E6767; } .badge-orange { background: #FCEBDD; color: #A4520F; } .badge-green { background: var(--mint); color: var(--green-d); }
.badge-red { background: #FBE7E5; color: #9B2C20; } .badge-grey { background: #EEF1F3; color: #4B5563; }
.badge-outline { background: transparent; border: 1px solid currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 11px; color: #4B5563; }
.chip-red { background: #FBE7E5; border-color: #f2c4bf; color: #9B2C20; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font: 500 13.5px/1.3 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; } .btn-danger:hover { background: #a33024; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; padding: 11px; }
.danger { color: var(--red) !important; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.icon-sm { width: 24px; height: 24px; } .icon-sm .ic { width: 14px; height: 14px; }
.linklike { background: none; border: 0; padding: 0; color: var(--green); cursor: pointer; font: inherit; }
.link-small { font-size: 12.5px; font-weight: 500; }

/* Forms */
input, select, textarea { font: inherit; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: #374151; }
.field small { color: var(--muted); font-size: 12px; }
.field input:not([type=checkbox]):not([type=file]), .field select, .field textarea, .filters input, .filters select, .input-group input, .upload-box input:not([type=file]), .upload-box select, .note-form textarea, .stack > input, .input-sm {
  width: 100%; padding: 9px 11px; border: 1px solid #D5DDD8; border-radius: 8px; background: #fff; outline: 0; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(30,122,71,.15); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; }
.input-sm { width: 130px !important; padding: 5px 8px !important; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid.narrow { max-width: 760px; }
.span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--green); }
.check.inline { display: inline-flex; }
.checks { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.checks-inline { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.input-group { display: flex; gap: 8px; } .input-group input { flex: 1; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 38px; height: 22px; border-radius: 999px; background: #CBD5D0; position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(30,122,71,.25); }
.fs { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; margin: 0; }
.fs legend { font-weight: 600; padding: 0 6px; color: var(--deep); }

/* Filters / tabs */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; }
.filters .f-search { flex: 1 1 260px; }
.f-date { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab span { background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 11.5px; margin-left: 4px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--green); border-bottom-color: var(--green); }
.tab.is-active span { background: var(--mint); color: var(--green-d); }
.bulkbar { position: sticky; top: 62px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--deep); color: #fff; padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.bulkbar select { width: auto; padding: 6px 8px; border-radius: 7px; border: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #FAFBFA; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid #EEF1EF; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover, .row-link:hover { background: #F7FAF8; }
.row-link { cursor: pointer; }
.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.is-unread .strong { font-weight: 700; }
.is-muted { opacity: .55; }
.w-check { width: 36px; } .w-check input { accent-color: var(--green); width: 16px; height: 16px; }

/* Detail page */
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; }
.dl > div { min-width: 0; } .dl-wide { grid-column: 1 / -1; }
.dl-1 { grid-template-columns: 1fr; gap: 10px; }
.dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.dl dd { margin: 0; word-break: break-word; }
.files { display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FBFCFB; }
.file:hover { border-color: #c9d6ce; }
.file.is-missing { background: #FDF3F2; border-color: #f2c4bf; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-actions { display: flex; gap: 2px; align-items: center; }
.file-actions form { display: inline; }
.file-ic { width: 40px; height: 46px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; flex: none; background: #7B8794; text-transform: uppercase; }
.file-ic.sm { width: 32px; height: 36px; font-size: 9px; }
.ft-pdf { background: #D14836; } .ft-img { background: #2F6FDE; } .ft-xls { background: #1E7A47; } .ft-doc { background: #2B579A; } .ft-ppt { background: #C9592C; } .ft-zip { background: #8A6D12; }
.upload-box { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border: 2px dashed #CBD8D0; border-radius: 10px; color: var(--muted); text-align: center; cursor: pointer; font-size: 13px; position: relative; }
.drop.is-over, .drop:hover { border-color: var(--green); background: var(--mint); color: var(--green-d); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box .row select { width: auto; }
.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.note { display: flex; gap: 10px; }
.note-body { flex: 1; background: var(--bg); border-radius: 0 10px 10px 10px; padding: 10px 12px; }
.note.is-pinned .note-body { background: #FBF6E3; border: 1px solid #efe2b0; }
.note-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.note-head form { margin-left: auto; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 5px; flex: none; box-shadow: 0 0 0 3px var(--mint); }
.timeline.compact li { padding-bottom: 10px; font-size: 12.5px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #EEF1EF; color: var(--text); }
.mini-list li:last-child a { border-bottom: 0; }
.mini-list a:hover { text-decoration: none; color: var(--green); }
.recipients { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.recipient { padding: 12px 0; border-bottom: 1px solid #EEF1EF; }
.recipient-main { display: flex; align-items: center; gap: 12px; }
.recipient-main form { display: inline; }
.recipient-edit { margin-top: 12px; padding: 14px; background: var(--bg); border-radius: 10px; }
.add-recipient { background: #F7FAF8; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.credentials { border-color: var(--gold); background: #FFFCF2; margin-bottom: 16px; }
.cred-box { background: var(--deep); color: #E8F5EC; padding: 14px 16px; border-radius: 10px; font-size: 13.5px; white-space: pre-wrap; margin: 10px 0; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.role-card p { margin: 6px 0 10px; }
.role-meter { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.role-meter span { display: block; height: 100%; background: var(--green); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.perm { padding: 6px 0; border-bottom: 1px dashed #EEF1EF; }
.perm span { display: flex; flex-direction: column; }
.perm code { font-size: 10.5px; color: var(--muted); background: none; padding: 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.checklist span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.checklist .ok span { background: var(--green); } .checklist .bad span { background: #E07B24; }
.integrity { margin-top: 12px; } .integrity details { margin: 6px 0; }
ul.tight { margin: 6px 0; padding-left: 18px; } ul.tight li { margin: 3px 0; }

/* Alerts */
.alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid; flex-wrap: wrap; }
.alert-success { background: var(--mint); border-color: #c4dccb; color: var(--green-d); }
.alert-error { background: #FBE7E5; border-color: #f2c4bf; color: #8B271C; }
.alert-warning { background: #FBF3D9; border-color: #efdc9e; color: #6E570E; }
.alert-info { background: #E6EEFC; border-color: #c6d6f5; color: #1E4FA8; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert-close { background: none; border: 0; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; }

/* Empty / pager */
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state.big { padding: 80px 20px; }
.empty-state.big h1 { margin: 8px 0; }
.empty-code { font-size: 56px; font-weight: 800; color: var(--mint); -webkit-text-stroke: 1px var(--green); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,30,18,.6); }
.modal-panel { position: relative; background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-wide { width: min(1100px, 100%); height: 92vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { flex: 1; overflow: auto; }
.preview-body { background: #525659; display: grid; place-items: center; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Guest pages */
.guest { background: var(--deep); }
.guest-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.guest-side { background: radial-gradient(circle at 20% 20%, rgba(201,162,39,.18), transparent 50%), linear-gradient(160deg, var(--deep), var(--green)); color: #E3F0E8; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.guest-side h2 { font-family: "Playfair Display", Georgia, serif; font-size: 36px; color: #fff; margin: 28px 0 12px; max-width: 460px; }
.guest-side p { max-width: 420px; color: #c6ddcf; font-size: 15px; }
.guest-logo { width: 120px; background: #fff; border-radius: 16px; padding: 10px; }
.guest-main { background: var(--bg); display: grid; place-items: center; padding: 32px 20px; }
.guest-card { background: #fff; border-radius: 16px; padding: 32px; width: min(420px, 100%); box-shadow: var(--shadow); border: 1px solid var(--line); }
.guest-card-wide { width: min(720px, 100%); }
.guest-title { font-size: 24px; margin-bottom: 4px; }
.guest-card .stack { margin-top: 18px; }

/* Responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .grid-2, .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .guest-wrap { grid-template-columns: 1fr; }
  .guest-side { display: none; }
  .user-meta { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 10px 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 24px; }
  .form-grid, .dl { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .hbars a { grid-template-columns: 1fr 80px 28px; }
  .legend { grid-template-columns: 1fr; }
  .filters > * { flex: 1 1 140px; }
  .guest-card { padding: 22px; }
}
