/* ==========================================================================
   Admin panel + client portal — dark theme matching the public site
   ========================================================================== */
:root {
    --bg: #0b0b0d;
    --bg-2: #101013;
    --surface: #16161a;
    --surface-2: #1d1d22;
    --surface-3: #24242a;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .15);
    --ink: #f3f1ec;
    --ink-soft: #a3a19a;
    --ink-faint: #6d6b66;
    --accent: #d4ff3a;
    --accent-ink: #0b0b0d;
    --accent-soft: rgba(212, 255, 58, .1);
    --glow-1: #7c5cff;
    --danger: #ff7a6b;
    --radius: 18px;
    --radius-sm: 11px;
    --views: #7c5cff;
    --visitors: #d4ff3a;
    --display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
    --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.15; letter-spacing: -.02em; font-family: var(--display); font-weight: 700; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { background: var(--surface-3); padding: .12em .4em; border-radius: 6px; font-size: .88em; color: var(--ink); }
.muted { color: var(--ink-soft); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.admin { display: flex; min-height: 100vh; }
.sidebar {
    width: 252px; flex-shrink: 0; background: var(--bg-2); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 1.5rem 1.4rem 1rem; }
.sidebar-brand a { color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.03em; display: flex; align-items: center; gap: .5rem; }
.sidebar-brand a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sidebar-brand span { font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-faint); margin-left: 1.05rem; }
.sidebar nav { padding: 0 .8rem; flex: 1; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-faint); margin: 1.4rem .7rem .45rem; }
.sidebar nav a {
    display: flex; justify-content: space-between; align-items: center; padding: .55rem .75rem; margin-bottom: 2px;
    border-radius: 10px; color: var(--ink-soft); text-decoration: none; font-weight: 500; transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.count { background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; padding: .12em .6em; border-radius: 999px; }
.sidebar-foot { padding: 1rem 1.4rem 1.5rem; border-top: 1px solid var(--line); font-size: .88rem; display: grid; gap: .55rem; }
.sidebar-foot a, .sidebar-foot .link { color: var(--ink-soft); text-decoration: none; }
.sidebar-foot a:hover, .sidebar-foot .link:hover { color: var(--ink); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; color: inherit; }
.main { flex: 1; min-width: 0; position: relative; isolation: isolate; }
.main::before {
    content: ""; position: absolute; z-index: -1; top: -260px; right: -160px; width: 560px; height: 560px; border-radius: 50%;
    background: var(--glow-1); filter: blur(150px); opacity: .18; pointer-events: none;
}
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1.6rem 2.2rem .4rem; }
.topbar h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 0; letter-spacing: -.035em; }
.menu-btn { display: none; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.content { padding: 1.4rem 2.2rem 3rem; max-width: 1240px; }

/* Maintenance banner shown to the admin while maintenance mode is on */
.maint-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: repeating-linear-gradient(-45deg, rgba(255, 196, 61, .14) 0 12px, rgba(255, 196, 61, .07) 12px 24px);
    border-bottom: 1px solid rgba(255, 196, 61, .35); color: #ffd36b; padding: .65rem 2.2rem; font-size: .88rem; font-weight: 500;
}
.maint-banner a { color: #ffd36b; font-weight: 700; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.6rem; margin-bottom: 1.4rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
.panel-head a:not(.btn) { font-size: .88rem; text-decoration: none; }
.empty { padding: 3rem; text-align: center; color: var(--ink-soft); margin: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; margin-bottom: 1.4rem; }
.grid-3 > .panel { margin-bottom: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.4rem; align-items: start; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.toolbar p { margin: 0; }

/* ---------- KPIs & chart ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; position: relative; overflow: hidden; }
.kpi:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kpi:first-child span, .kpi:first-child small { color: rgba(11, 11, 13, .65); }
.kpi:first-child a { color: var(--accent-ink); }
.kpi span { display: block; font-size: .8rem; color: var(--ink-soft); }
.kpi strong { display: block; font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -.04em; margin: .25rem 0 .15rem; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--ink-soft); }
.kpi small a { text-decoration: none; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 220px; padding-top: 10px; border-bottom: 1px solid var(--line);
    background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 25%; }
.bar { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; border-radius: 4px; }
.bar:hover { background: rgba(255, 255, 255, .04); }
.bar-views, .bar-visitors { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; }
.bar-views { background: var(--views); opacity: .55; }
.bar-visitors { background: var(--visitors); left: 28%; right: 28%; }
.chart-axis { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-faint); margin-top: .5rem; }
.legend { font-size: .8rem; color: var(--ink-soft); display: flex; align-items: center; gap: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: .7rem; }
.lg-views { background: var(--views); opacity: .55; }
.lg-visitors { background: var(--visitors); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.rank li:last-child { border: 0; }
.rank span { overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.rank b { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Segmented control & search ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg a { padding: .4rem .95rem; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .88rem; transition: color .15s, background .15s; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
.search input { padding: .6rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px; font: inherit; min-width: 260px; background: var(--surface); color: var(--ink); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); font-weight: 600; padding: .85rem 1.3rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.table td { padding: .95rem 1.3rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.panel:not(.flush) .table td, .panel:not(.flush) .table th { padding-left: 0; }
.clickable { cursor: pointer; transition: background .15s; }
.clickable:hover td { background: rgba(255, 255, 255, .025); }
.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.unread strong { color: var(--ink); }
.actions { text-align: right; white-space: nowrap; }
.actions form { display: inline; }
.icon-cell { color: var(--accent); width: 48px; }
.thumb-cell { width: 74px; }
.thumb-cell img, .thumb-ph { width: 58px; height: 44px; object-fit: cover; border-radius: 8px; background: linear-gradient(135deg, var(--glow-1), #ff5c8a); opacity: .9; }
.thumb-cell img { opacity: 1; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .25em .7em; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--ink-soft); white-space: nowrap; border: 1px solid transparent; }
.badge-new, .badge-pending { background: rgba(255, 196, 61, .12); color: #ffd36b; border-color: rgba(255, 196, 61, .25); }
.badge-read, .badge-planning { background: rgba(92, 160, 255, .12); color: #9cc4ff; border-color: rgba(92, 160, 255, .25); }
.badge-replied, .badge-paid, .badge-completed { background: rgba(61, 220, 132, .12); color: #7ff0b2; border-color: rgba(61, 220, 132, .25); }
.badge-in_progress { background: var(--accent-soft); color: var(--accent); border-color: rgba(212, 255, 58, .3); }
.badge-review { background: rgba(124, 92, 255, .15); color: #c2b3ff; border-color: rgba(124, 92, 255, .3); }
.badge-on_hold, .badge-expired { background: rgba(255, 255, 255, .06); color: var(--ink-faint); }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 1.05rem; }
.form-wide { max-width: 860px; }
.form-wide h2:not(:first-of-type) { margin-top: .8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
label { display: block; font-weight: 500; font-size: .88rem; color: var(--ink-soft); }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=file]), textarea, select {
    display: block; width: 100%; margin-top: .4rem; padding: .7rem .9rem;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    font: inherit; font-size: .95rem; background: rgba(0, 0, 0, .3); color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:disabled { opacity: .55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(212, 255, 58, .13); }
select option { background: var(--surface-2); color: var(--ink); }
select[multiple] { padding: .4rem; }
select[multiple] option { padding: .4rem .6rem; border-radius: 6px; }
input[type=file] { display: block; margin-top: .5rem; color: var(--ink-soft); font: inherit; font-size: .88rem; }
input[type=file]::file-selector-button { margin-right: .8rem; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }
input[type=range] { width: 100%; margin-top: .7rem; }
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; margin-top: .5rem; color: var(--ink); }
.thumb { max-width: 220px; border-radius: 12px; margin: .6rem 0; border: 1px solid var(--line); }
.icon-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.icon-pick legend { font-weight: 500; font-size: .88rem; color: var(--ink-soft); margin-bottom: .5rem; }
.icon-pick label input { position: absolute; opacity: 0; }
.icon-pick label span { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--ink-soft); cursor: pointer; transition: all .15s; }
.icon-pick label span:hover { color: var(--ink); border-color: var(--ink-soft); }
.icon-pick input:checked + span { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }

/* Toggle switch */
.switch { display: flex; align-items: center; gap: .9rem; cursor: pointer; color: var(--ink); font-weight: 600; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 48px; height: 28px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; flex-shrink: 0; transition: background .2s, border-color .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-soft); transition: transform .2s, background .2s; }
.switch input:checked + .track { background: #ffc43d; border-color: #ffc43d; }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(255, 196, 61, .25); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .62rem 1.2rem; border-radius: 999px; border: 1px solid var(--line-strong);
    background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem;
    text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:hover { border-color: var(--ink-soft); background: rgba(255, 255, 255, .04); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 30px -8px rgba(212, 255, 58, .55); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-danger { color: var(--danger); border-color: rgba(255, 122, 107, .3); }
.btn-danger:hover { background: rgba(255, 122, 107, .1); border-color: var(--danger); }
.btn-small { padding: .36rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; margin-top: .6rem; }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------- Flash ---------- */
.flash { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.3rem; font-size: .92rem; border: 1px solid; }
.flash a { color: inherit; font-weight: 600; }
.flash-success { background: rgba(61, 220, 132, .1); border-color: rgba(61, 220, 132, .3); color: #8af0b6; }
.flash-error { background: rgba(255, 92, 92, .1); border-color: rgba(255, 92, 92, .3); color: #ff9c9c; }
.flash-warning { background: rgba(255, 196, 61, .1); border-color: rgba(255, 196, 61, .3); color: #ffd36b; }
.flash-info { background: rgba(124, 92, 255, .12); border-color: rgba(124, 92, 255, .3); color: #c5b8ff; }

/* ---------- Details, progress, chips ---------- */
.details { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.2rem; margin: 0 0 1rem; font-size: .92rem; }
.details dt { color: var(--ink-faint); }
.details dd { margin: 0; word-break: break-word; }
.message-body { line-height: 1.7; font-size: 1rem; }
.reply { border-left: 3px solid var(--accent); }
.credentials { background: var(--accent-soft); border: 1px dashed rgba(212, 255, 58, .45); padding: 1.1rem 1.3rem; border-radius: var(--radius-sm); margin-bottom: 1.4rem; line-height: 1.9; }
.credentials code { font-size: .95rem; background: rgba(0, 0, 0, .4); color: var(--accent); }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #a8e000, var(--accent)); border-radius: 999px; box-shadow: 0 0 12px rgba(212, 255, 58, .4); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: .3rem .5rem .3rem .85rem; font-size: .86rem; display: inline-flex; align-items: center; gap: .4rem; }
.chip a { color: var(--ink); text-decoration: none; }
.chip form { display: inline; }
.chip button { border: 0; background: rgba(255, 255, 255, .08); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; color: var(--ink-soft); padding: 0; font-size: .95rem; line-height: 1; }
.chip button:hover { background: var(--danger); color: #fff; }
.copy-link { margin-top: .45rem !important; font-size: .76rem !important; padding: .35rem .6rem !important; color: var(--ink-soft) !important; cursor: copy; max-width: 360px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: 600px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.4rem; }
.chat-head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chat-head h2 { margin: 0; display: flex; align-items: center; gap: .55rem; }
.chat-head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }
.chat-log {
    flex: 1; overflow-y: auto; padding: 1.4rem; display: flex; flex-direction: column; gap: .8rem;
    background: radial-gradient(circle at 100% 0%, rgba(124, 92, 255, .08), transparent 50%), var(--bg-2);
}
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
.msg { max-width: 75%; display: flex; flex-direction: column; }
.msg .bubble { padding: .7rem 1rem; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; }
.msg .who { font-size: .72rem; color: var(--ink-faint); margin: 0 .4rem .25rem; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; font-weight: 500; }
.msg.theirs { align-self: flex-start; }
.msg.theirs .bubble { background: var(--surface-3); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.system { align-self: center; max-width: 92%; }
.msg.system .bubble { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--ink-soft); font-size: .8rem; text-align: center; padding: .35rem .9rem; border-radius: 999px; }
.chat-empty { margin: auto; color: var(--ink-faint); text-align: center; }
.chat-form { display: flex; gap: .6rem; padding: 1rem; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.chat-form textarea { margin: 0 !important; resize: none; height: 48px; max-height: 160px; border-radius: 24px !important; padding: .75rem 1.1rem !important; }
.chat-form .btn { flex-shrink: 0; height: 48px; padding: 0 1.4rem; }

/* ---------- Auth pages ---------- */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; position: relative; overflow: hidden; isolation: isolate; }
.auth-page::before, .auth-page::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(130px); }
.auth-page::before { width: 520px; height: 520px; background: var(--glow-1); opacity: .35; top: -180px; right: -120px; }
.auth-page::after { width: 420px; height: 420px; background: #ff5c8a; opacity: .18; bottom: -200px; left: -100px; }
.auth-box { width: 100%; max-width: 420px; background: rgba(22, 22, 26, .85); backdrop-filter: blur(20px); border: 1px solid var(--line-strong); border-radius: 24px; padding: 2.4rem; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.auth-box h1 { font-size: 1.9rem; letter-spacing: -.035em; }
.auth-box .btn-block { padding: .85rem; font-size: .95rem; }
.auth-brand { margin-bottom: 1.6rem; }
.auth-brand a { color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; gap: .5rem; }
.auth-brand a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- Client portal ---------- */
.portal { display: block; position: relative; isolation: isolate; overflow-x: hidden; }
.portal::before { content: ""; position: absolute; z-index: -1; top: -240px; right: -160px; width: 560px; height: 560px; border-radius: 50%; background: var(--glow-1); filter: blur(150px); opacity: .2; pointer-events: none; }
.portal-bar { position: sticky; top: 14px; z-index: 50; padding: 0 16px; }
.portal-inner { width: min(1140px, 100% - 32px); margin-inline: auto; }
.portal-bar .portal-inner {
    width: min(1140px, 100%);
    display: flex; justify-content: space-between; align-items: center; height: 60px; gap: 1rem; padding: 0 8px 0 22px;
    background: rgba(17, 17, 20, .75); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 999px;
}
.portal-brand { font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.03em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.portal-brand::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.portal-brand span { font-family: var(--sans); font-weight: 500; color: var(--ink-faint); font-size: .8rem; letter-spacing: 0; margin-left: .2rem; }
.portal-bar nav { display: flex; align-items: center; gap: .2rem; }
.portal-bar nav a, .portal-bar .link { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .9rem; padding: .5rem .9rem; border-radius: 999px; }
.portal-bar nav a:hover, .portal-bar .link:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.portal-bar form { margin: 0; }
.portal-content { padding: 3rem 0 4rem; }
.portal-content > h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.04em; margin-bottom: .2em; }
.portal-content > h1 + .muted { font-size: 1.1rem; margin-bottom: 2rem; }
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.2rem; }
.project-card { display: block; text-decoration: none; color: inherit; transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .2s; margin: 0; }
.project-card:hover { transform: translateY(-4px); border-color: rgba(212, 255, 58, .4); }
.project-card h2 { font-size: 1.35rem; }
.project-card-foot { display: flex; justify-content: space-between; align-items: center; margin: .8rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: -270px; z-index: 100; transition: left .25s; }
    .sidebar-open .sidebar { left: 0; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
    .menu-btn { display: block; }
    .topbar { padding: 1.2rem 16px .2rem; }
    .content { padding: 1.2rem 16px 2rem; }
    .maint-banner { padding: .65rem 16px; }
    .two-col, .form-row { grid-template-columns: 1fr; }
    .table { display: block; overflow-x: auto; }
    .search, .search input { min-width: 0; width: 100%; }
    .msg { max-width: 88%; }
    .chat { height: 520px; }
}
@media (max-width: 600px) {
    .portal-brand span { display: none; }
    .portal-bar .portal-inner { padding: 0 6px 0 16px; }
    .portal-bar nav a, .portal-bar .link { padding: .45rem .55rem; font-size: .84rem; }
    .project-cards { grid-template-columns: 1fr; }
    .auth-box { padding: 1.8rem; }
}
.chat-form textarea { overflow-y: hidden; line-height: 1.45; }
