/* ───────────────────────────────────────────────────────────────────────────
   portal-next.css — DESIGN PREVIEW. Demo / design_preview studios only.

   Editorial / line-based reimagine matching the marketing site. Type system,
   mirroring the homepage:
     • MONO UPPERCASE  → nav items, section titles, all labels (the "REPLACES")
     • mono regular    → secondary meta / sub text (the strikethrough items)
     • Inter display   → the one big page headline (the hero treatment)
   Thin straight rules instead of boxes. Compact but full-width. Collapsible to
   an icon rail. New markup (nx-*) — the live app is untouched.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
    --nx-line:   #e9e7e3;   /* hairline rules */
    --nx-line-2: #f1efec;   /* faintest divider */
    --nx-hover:  #faf8f5;   /* warm row hover */
    --nx-pad:    40px;      /* shared content / topbar gutter */
}

body.design-preview::after {
    content: "DESIGN PREVIEW";
    position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9999;
    padding: 4px 12px; background: #0a0a0a; color: #fff;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
    opacity: .7; pointer-events: none;
}

/* ── Shell ── */
.nx-body { background: #fff; color: var(--text); }
.nx-shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; min-height: 100dvh; transition: grid-template-columns .18s ease; }
.nx-menu-btn { display: none; }

/* ── Sidebar — airy, line-based, mono nav ── */
.nx-sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 18px;
    padding: 18px 16px; background: #fff; border-right: 1px solid var(--nx-line);
}
.nx-side-head { display: flex; align-items: center; gap: 8px; }
.nx-workspace { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nx-ws-mark { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 6px; background: #0a0a0a; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; overflow: hidden; }
.nx-ws-mark img { width: 100%; height: 100%; object-fit: cover; }
.nx-ws-text { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.nx-ws-name { font-family: var(--font-display); font-size: .9rem; font-weight: 600; letter-spacing: -.01em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-ws-plan { font-family: var(--font-mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .16em; color: var(--text-light); }
.nx-collapse { flex: 0 0 auto; width: 26px; height: 26px; border: 0; background: transparent; color: var(--text-light); border-radius: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.nx-collapse:hover { color: var(--text); background: var(--nx-hover); }
.nx-collapse i { font-size: .78rem; transition: transform .18s ease; }

.nx-newbtn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: 7px; background: var(--brand-accent); color: #fff; text-decoration: none; font-family: var(--font-mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; overflow: hidden; }
.nx-newbtn:hover { background: var(--brand-accent-strong); }
.nx-newbtn i { font-size: .8rem; }

.nx-nav { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; }
.nx-nav-group { font-family: var(--font-mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .2em; color: var(--text-light); padding: 16px 0 6px; }
.nx-nav-group:first-child { padding-top: 2px; }
.nx-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 0 7px 12px; text-decoration: none; color: var(--text-med); font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.nx-link:hover { color: var(--text); }
.nx-link.is-active { color: var(--brand-accent-strong); }
.nx-link.is-active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--brand-accent); }
.nx-link-icon { flex: 0 0 16px; text-align: center; font-size: .82rem; color: var(--text-light); }
.nx-link:hover .nx-link-icon { color: var(--text-med); }
.nx-link.is-active .nx-link-icon { color: var(--brand-accent); }
.nx-link-locked { opacity: .5; cursor: pointer; }
.nx-link-lock { margin-left: auto; font-size: .58rem; color: var(--text-light); }

.nx-storage { display: block; text-decoration: none; color: var(--text-light); }
.nx-storage-top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; }
.nx-storage-bar { height: 2px; background: var(--nx-line); overflow: hidden; }
.nx-storage-bar span { display: block; height: 100%; background: var(--brand-accent); }

/* ── Collapsed icon rail (desktop only) ── */
@media (min-width: 900px) {
    body.nx-nav-collapsed .nx-shell { grid-template-columns: 64px 1fr; }
    body.nx-nav-collapsed .nx-sidebar { padding: 18px 0; align-items: center; }
    body.nx-nav-collapsed .nx-side-head { flex-direction: column; gap: 14px; }
    body.nx-nav-collapsed .nx-workspace { flex: 0 0 auto; justify-content: center; }
    body.nx-nav-collapsed .nx-ws-text { display: none; }
    body.nx-nav-collapsed .nx-collapse i { transform: rotate(180deg); }
    body.nx-nav-collapsed .nx-newbtn { width: 34px; height: 34px; padding: 0; }
    body.nx-nav-collapsed .nx-newbtn-label { display: none; }
    body.nx-nav-collapsed .nx-nav { width: 100%; align-items: center; }
    body.nx-nav-collapsed .nx-nav-group { width: 24px; height: 1px; padding: 0; margin: 13px 0; background: var(--nx-line); overflow: hidden; text-indent: -999px; }
    body.nx-nav-collapsed .nx-link { width: 36px; justify-content: center; gap: 0; padding: 9px 0; }
    body.nx-nav-collapsed .nx-link-label, body.nx-nav-collapsed .nx-link-lock { display: none; }
    body.nx-nav-collapsed .nx-link.is-active::before { left: -14px; }
    body.nx-nav-collapsed .nx-storage { display: none; }
}

/* ── Main + topbar ── */
.nx-main { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.nx-topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    height: 52px; padding: 0 var(--nx-pad); border-bottom: 1px solid var(--nx-line);
    background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px);
}
.nx-topbar-title { font-family: var(--font-mono); font-size: .64rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; color: var(--text-light); margin: 0; }
.nx-topbar-right { display: flex; align-items: center; gap: 14px; }
.nx-search { display: flex; align-items: center; gap: 9px; padding: 6px 11px; border: 1px solid var(--nx-line); border-radius: 6px; background: #fff; color: var(--text-light); font-family: var(--font-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }
.nx-search:hover { border-color: var(--border-strong); color: var(--text-med); }
.nx-search kbd { font-size: .6rem; letter-spacing: 0; color: var(--text-light); }
.nx-icon-btn { position: relative; width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-med); cursor: pointer; }
.nx-icon-btn:hover { color: var(--text); }
.nx-account { width: 32px; height: 32px; border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.nx-avatar { width: 30px; height: 30px; border-radius: 50%; background: #f1efec; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .76rem; overflow: hidden; }
.nx-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nx-content { flex: 1 1 auto; padding: 30px var(--nx-pad) 64px; }

/* ── Dashboard — editorial, line-divided bands ── */
.nx-page-head { padding-bottom: 22px; border-bottom: 1px solid var(--nx-line); }
.nx-eyebrow { font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .2em; color: var(--text-light); margin: 0 0 11px; }
.nx-page-title { font-family: var(--font-display); font-size: 1.85rem; font-weight: 600; letter-spacing: -.035em; line-height: 1; margin: 0; }

/* Mission-critical numbers, doubling as quick cards (each links to its view). */
.nx-summary { display: flex; border-bottom: 1px solid var(--nx-line); }
.nx-metric { flex: 1 1 0; min-width: 0; display: block; padding: 20px 22px; border-left: 1px solid var(--nx-line-2); text-decoration: none; color: inherit; }
.nx-metric:first-child { border-left: 0; padding-left: 0; }
.nx-metric:hover { background: var(--nx-hover); }
.nx-metric:hover .nx-metric-val { color: var(--brand-accent-strong); }
.nx-metric-val { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.nx-metric-label { display: block; margin-top: 9px; font-family: var(--font-mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .16em; color: var(--text-light); }

.nx-attention { border-bottom: 1px solid var(--nx-line); }
.nx-attention-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; text-decoration: none; color: var(--text); }
.nx-attention-row:hover .nx-attention-cta { color: var(--brand-accent); }
.nx-attention-icon { color: var(--text-light); }
.nx-attention-row.is-warn .nx-attention-icon { color: var(--brand-accent-strong); }
.nx-attention-text { flex: 1 1 auto; font-size: .88rem; }
.nx-attention-sub { font-family: var(--font-mono); font-size: .76rem; color: var(--text-light); margin-left: 10px; }
.nx-attention-cta { flex: 0 0 auto; font-family: var(--font-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-accent-strong); }

.nx-grid { display: flex; flex-direction: column; gap: 40px; margin-top: 40px; }
.nx-block-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--nx-line); margin-bottom: 2px; }
.nx-block-title { font-family: var(--font-mono); font-size: .64rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; color: var(--text); margin: 0; }
.nx-block-link { font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-light); text-decoration: none; }
.nx-block-link:hover { color: var(--brand-accent-strong); }
.nx-empty { padding: 22px 0; color: var(--text-light); font-size: .88rem; }

/* ── Reused lists, stripped to lines (no boxes, no rounded wraps). ── */
.nx-block .data-table-wrap, .nx-block .dash-panel { border: 0; background: transparent; padding: 0; box-shadow: none; border-radius: 0; }
.nx-block .data-table { width: 100%; border: 0; border-collapse: collapse; }
.nx-block .data-table thead th { font-family: var(--font-mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-light); font-weight: 500; padding: 11px 16px; background: transparent; border-bottom: 1px solid var(--nx-line); }
.nx-block .data-table thead th:first-child { padding-left: 0; }
.nx-block .data-table thead th:last-child { padding-right: 0; }
.nx-block .data-table tbody td { font-size: .88rem; padding: 13px 16px; background: transparent; border-bottom: 1px solid var(--nx-line-2); }
.nx-block .data-table tbody td:first-child { padding-left: 0; }
.nx-block .data-table tbody td:last-child { padding-right: 0; }
.nx-block .data-table tbody tr:last-child td { border-bottom: 0; }
.nx-block .data-table tbody tr:hover td { background: var(--nx-hover); }
.nx-block .project-cover-thumb { border-radius: 2px; }

/* status chips → flat mono tags, like the marketing site (PAID / DELIVERED). */
.nx-block .status-chip { border-radius: 2px; font-family: var(--font-mono); font-size: .56rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; padding: 3px 7px; }

.nx-block .dash-week-list { list-style: none; margin: 0; padding: 0; border: 0; }
.nx-block .dash-week-item { border: 0; border-bottom: 1px solid var(--nx-line-2); }
.nx-block .dash-week-item:last-child { border-bottom: 0; }
.nx-block .dash-week-link { padding: 13px 0; border-radius: 0; }
.nx-block .dash-week-link:hover { background: var(--nx-hover); }
.nx-block .dash-week-sub { font-family: var(--font-mono); }
.nx-block .dash-week-action { font-family: var(--font-mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .12em; }

/* ── Mobile: sidebar → drawer ── */
.nx-menu-btn { width: 38px; height: 38px; border: 1px solid var(--nx-line); background: #fff; border-radius: 8px; color: var(--text); cursor: pointer; }
@media (max-width: 899px) {
    .nx-shell { grid-template-columns: 1fr; }
    .nx-collapse { display: none; }
    .nx-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 252px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
    body.portal-nav-open .nx-sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
    .nx-menu-btn { display: block; position: fixed; top: 10px; left: 12px; z-index: 50; }
    .nx-topbar { padding: 0 16px 0 62px; }
    .nx-content { padding: 26px 16px 56px; }
    .nx-summary { flex-wrap: wrap; }
    .nx-metric { flex-basis: 50%; padding: 18px 16px; border-left: 0; border-top: 1px solid var(--nx-line-2); }
    .nx-metric:first-child, .nx-metric:nth-child(2) { border-top: 0; }
    .nx-metric:first-child { padding-left: 16px; }
    .nx-block .data-table thead { display: none; }
}
