/* ==========================================================================
   SFT Software — design system
   Structure: 1 tokens · 2 base · 3 app shell · 4 components · 5 dashboard
              6 workflow widgets · 7 auth · 8 responsive
   Everything is plain CSS (no build step) so it deploys with the app.
   ========================================================================== */

/* 1 — tokens ------------------------------------------------------------- */
:root {
    color-scheme: light;

    /* brand */
    --navy: #0f172a;
    --navy-2: #1e293b;
    --accent: #2563eb;
    --accent-600: #1d4ed8;
    --accent-soft: #eff4ff;
    --accent-ring: rgba(37, 99, 235, .18);

    /* surfaces + text */
    --bg: #eef1f6;
    --card: #ffffff;
    --border: #e4e8ef;
    --border-strong: #cfd6e2;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;

    /* semantic */
    --ok: #15803d;      --ok-bg: #e8f6ee;
    --warn: #b45309;    --warn-bg: #fff4e0;
    --danger: #b91c1c;  --danger-bg: #fdeceb;
    --info: #1d4ed8;    --info-bg: #e8f0ff;

    /* shape */
    --radius: 6px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);

    --sidebar-w: 260px;
    --topbar-h: 52px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2 — base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); text-decoration: underline; }
h1, h2, h3 { color: var(--text); letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: .85rem; }
.small { font-size: .8rem; }
.r { text-align: right; }
.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 3 — app shell ----------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
#nav-toggle { display: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }

/* sidebar */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: linear-gradient(180deg, var(--navy) 0%, #0b1224 100%); color: #cbd5e1; padding-bottom: 1.5rem;
    scrollbar-width: thin; scrollbar-color: #334155 transparent;
}
.sidebar .brand {
    display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: .5rem;
}
.sidebar .brand:hover { text-decoration: none; color: #fff; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: -.02em;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; font-weight: 700; font-size: 1rem; }
.brand-text small { font-weight: 500; font-size: .72rem; color: #94a3b8; margin-top: .1rem; }

.nav-top-link, .nav-group a {
    display: flex; align-items: center; gap: .65rem; color: #cbd5e1; text-decoration: none; font-size: .9rem;
    margin: .1rem .65rem; padding: .5rem .75rem; border-radius: var(--radius-sm); transition: background .12s, color .12s;
}
.nav-top-link { font-weight: 600; }
.nav-top-link:hover, .nav-group a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-top-link.active, .nav-group a.active { background: rgba(59, 130, 246, .2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #60a5fa; }
.nav-top-link .icon { opacity: .85; }
.nav-group { margin-top: .35rem; }
.nav-group summary {
    list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: .6rem;
    padding: .6rem 1.25rem .35rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #7c8db0;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary .icon { width: 1.05em; height: 1.05em; }
.nav-group summary::after { content: ''; margin-left: auto; width: .42rem; height: .42rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(225deg); }
.nav-group a { padding-left: 2.05rem; font-size: .88rem; color: #b6c2d6; }

/* top bar */
.topbar {
    position: sticky; top: 0; z-index: 15; min-height: var(--topbar-h); padding: .55rem 1.75rem;
    display: flex; align-items: center; gap: .85rem; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--border);
}
.hamburger {
    display: none; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text-2);
}
.topsearch { position: relative; flex: 1; max-width: 460px; margin: 0; }
.topsearch .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topsearch input { padding: .55rem .8rem .55rem 2.4rem; background: #f1f4f9; border-color: transparent; border-radius: 999px; font-size: .9rem; }
.topsearch input:focus { background: #fff; }
.topbar-spacer { flex: 1; }
.bell {
    position: relative; display: inline-flex; align-items: center; gap: .4rem; color: var(--text-2); font-weight: 600; font-size: .88rem;
    padding: .45rem .7rem; border-radius: var(--radius-sm); text-decoration: none; white-space: nowrap;
}
.bell:hover { background: #f1f4f9; text-decoration: none; color: var(--text); }
.bell-count { background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1; padding: .2rem .42rem; border-radius: 999px; margin-left: .25rem; }
.sidebar .bell-count { margin-left: auto; }

.quicknew { position: relative; }
.quicknew summary {
    list-style: none; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: .4rem;
    background: var(--accent); color: #fff; font-weight: 600; font-size: .88rem; padding: .5rem .95rem; border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(37, 99, 235, .4);
}
.quicknew summary:hover { background: var(--accent-600); }
.quicknew summary::-webkit-details-marker { display: none; }
.quicknew-panel, .usermenu-panel {
    position: absolute; top: calc(100% + .4rem); z-index: 30; min-width: 240px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem 0; max-height: 70vh; overflow-y: auto;
}
.quicknew-panel { left: 0; }
.quicknew-panel a { display: block; padding: .42rem 1rem; color: var(--text); font-size: .9rem; text-decoration: none; }
.quicknew-panel a:hover { background: var(--accent-soft); color: var(--accent-600); }
.qn-group { padding: .55rem 1rem .2rem; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .25rem .4rem .25rem .25rem; border-radius: 999px; user-select: none; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: #f1f4f9; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-600); font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.who { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.who strong { font-size: .85rem; color: var(--text); }
.who span { font-size: .72rem; color: var(--muted); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu-panel { right: 0; min-width: 210px; padding: .4rem; }
.usermenu-panel .um-head { padding: .5rem .65rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem; }
.usermenu-panel .um-head strong { display: block; font-size: .9rem; }
.usermenu-panel button { width: 100%; justify-content: flex-start; background: transparent; color: var(--danger); box-shadow: none; padding: .5rem .65rem; }
.usermenu-panel button:hover { background: var(--danger-bg); }

/* page chrome */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; font-size: .8rem; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs i { font-style: normal; margin: 0 .4rem; color: #b6bfcd; }
.crumbs span { color: var(--text-2); font-weight: 600; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 1rem; letter-spacing: -.02em; }
.pagehelp { color: var(--muted); font-size: .9rem; margin: -.5rem 0 1.1rem; max-width: 780px; }
.tabbar { display: flex; gap: .15rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; }
.tabbar a { padding: .6rem .95rem; color: var(--muted); font-size: .9rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabbar a:hover { color: var(--text); }
.tabbar a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 4 — components ---------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }

label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], input[type=time], input[type=month], select, textarea {
    width: 100%; padding: .58rem .75rem; font: inherit; font-size: .92rem; color: var(--text); background: #fff;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.field { margin-bottom: 1rem; }
.error { color: var(--danger); font-size: .82rem; margin-top: .3rem; }

button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
    padding: .55rem 1.05rem; border: 1px solid transparent; border-radius: var(--radius-sm); text-decoration: none; line-height: 1.25;
    background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .35); transition: background .12s, box-shadow .12s;
}
button:hover, .btn:hover { background: var(--accent-600); color: #fff; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #f4f6fa; color: var(--text); }

.status { display: flex; gap: .6rem; background: var(--ok-bg); border: 1px solid #b7e1c7; color: #14532d; padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; }
.status.password { background: var(--warn-bg); border-color: #f0d49a; color: #713f12; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.card > table { margin: 0; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f8fafc; white-space: nowrap; }
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }

.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .73rem; font-weight: 600; padding: .18rem .6rem; border-radius: 999px; background: #eef1f6; color: #475569; margin-right: .25rem; white-space: nowrap; text-transform: capitalize; }
.badge[class*="st-"]::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge.st-green { background: var(--ok-bg); color: var(--ok); }
.badge.st-blue { background: var(--info-bg); color: var(--info); }
.badge.st-orange { background: var(--warn-bg); color: var(--warn); }
.badge.st-red { background: var(--danger-bg); color: var(--danger); }
.badge.st-gray { background: #eef1f6; color: #526071; }

.attention { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--warn-bg); border: 1px solid #f0d49a; color: #713f12; border-radius: var(--radius); padding: .9rem 1.2rem; margin-bottom: 1.25rem; }

/* 5 — dashboard ----------------------------------------------------------- */
.dash-section { margin-bottom: 2rem; }
.dash-section h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.02rem; font-weight: 700; margin: 0 0 .9rem; }
.dash-section h2 .dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card {
    position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card .label { grid-column: 1; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }
.stat-card .value { grid-column: 1; font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card .sub { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); margin-top: .4rem; }
.stat-icon { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon .icon { width: 1.25rem; height: 1.25rem; }

.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: stretch; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.chart-card h3 { font-size: .9rem; font-weight: 700; margin: 0 0 1rem; }
.chart-empty { color: var(--muted); font-size: .85rem; padding: 2rem 0; text-align: center; }
.status-bar-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; font-size: .83rem; }
.status-bar-row .sb-label { width: 108px; flex-shrink: 0; color: var(--muted); }
.status-bar-row .sb-track { flex: 1; background: #edf0f5; border-radius: 999px; height: 8px; overflow: hidden; }
.status-bar-row .sb-fill { height: 100%; border-radius: 999px; }
.status-bar-row .sb-count { width: 2.4rem; text-align: right; font-weight: 600; }

.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.ws-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem 1.05rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.ws-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), #60a5fa); }
.ws-card h3 { margin: .15rem 0 .55rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ws-card a { display: block; padding: .3rem 0; font-size: .9rem; color: var(--text-2); }
.ws-card a:hover { color: var(--accent); text-decoration: none; padding-left: .2rem; }
.ws-card a { transition: padding .1s, color .1s; }

/* 6 — workflow widgets ---------------------------------------------------- */
.nextstep { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: .95rem 1.2rem; margin-bottom: 1rem; display: flex; gap: 1.25rem; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.nextstep .steps { list-style: none; display: flex; gap: .35rem 1rem; flex-wrap: wrap; margin: 0; padding: 0; font-size: .85rem; }
.nextstep .steps li { display: flex; align-items: center; gap: .4rem; color: var(--muted); }
.nextstep .steps .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1.5px solid #c5cdda; font-size: .7rem; display: inline-flex; align-items: center; justify-content: center; }
.nextstep .steps li.done { color: var(--ok); }
.nextstep .steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.nextstep .steps li.current { color: var(--text); font-weight: 700; }
.nextstep .steps li.current .dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.nextstep .ns-action { display: flex; gap: .6rem; align-items: center; }

.checklist { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem 1.3rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); }
.checklist summary { cursor: pointer; font-weight: 700; }
.checklist .bar { height: 8px; background: #edf0f5; border-radius: 999px; overflow: hidden; margin: .65rem 0 .85rem; }
.checklist .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #22c55e); border-radius: 999px; }
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: .65rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1.5px solid #c5cdda; flex-shrink: 0; margin-top: .12rem; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist li.done a { color: var(--muted); text-decoration: line-through; }

/* 7 — auth (signed-out pages) -------------------------------------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--card); }
.auth-hero {
    position: relative; overflow: hidden; color: #e2e8f0; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(1200px 600px at 0% 0%, #1e3a8a 0%, transparent 60%), linear-gradient(160deg, #0f172a 0%, #0b1224 100%);
}
.auth-hero::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(96, 165, 250, .28), transparent 70%); }
.auth-hero .brand-mark { width: 44px; height: 44px; font-size: 1.05rem; }
.auth-brand { display: flex; align-items: center; gap: .85rem; font-weight: 700; font-size: 1.15rem; color: #fff; }
.auth-brand small { display: block; font-size: .75rem; font-weight: 500; color: #94a3b8; }
.auth-hero h2 { color: #fff; font-size: 2rem; line-height: 1.2; margin: 0 0 .9rem; letter-spacing: -.02em; max-width: 440px; }
.auth-hero p { color: #a5b4cc; max-width: 420px; margin: 0 0 1.5rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: .92rem; position: relative; z-index: 1; }
.auth-points li { display: flex; align-items: center; gap: .6rem; color: #cbd5e1; }
.auth-points .icon { color: #60a5fa; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
.auth-card .muted { margin: 0 0 1.4rem; }
.auth-card button { width: 100%; padding: .7rem 1rem; font-size: .95rem; }

/* 8 — responsive ---------------------------------------------------------- */
.sidebar-backdrop { display: none; }
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}
@media (max-width: 860px) {
    .hamburger { display: inline-flex; }
    main { padding: 1rem 1rem 2.5rem; }
    .topbar { padding: .5rem 1rem; gap: .5rem; }
    .who, .bell span.lbl { display: none; }
    .topsearch { order: 5; flex-basis: 100%; max-width: none; }
    .quicknew-panel { left: 0; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media print { .menubar, .topbar, .crumbs, .tabbar { display: none !important; } main { padding: 0; max-width: none; } body { background: #fff; } }

/* Jump bar (Ctrl/Cmd+K) and workspace pages */
.cmd-open { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; background: #f1f4f9; border: 1px solid transparent; border-radius: 999px; color: var(--muted); cursor: pointer; font-size: .85rem; }
.cmd-open:hover, .cmd-open:focus-visible { background: #fff; border-color: var(--border, #d6dce8); }
.cmd-open kbd { font: inherit; font-size: .72rem; padding: .05rem .35rem; border: 1px solid var(--border, #d6dce8); border-radius: 4px; background: #fff; }
.cmd-dialog { width: min(560px, 92vw); margin-top: 12vh; padding: 0; border: 1px solid var(--border, #d6dce8); border-radius: 12px; box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.cmd-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.cmd-input { width: 100%; box-sizing: border-box; padding: 1rem 1.1rem; border: 0; border-bottom: 1px solid var(--border, #d6dce8); font-size: 1rem; border-radius: 12px 12px 0 0; }
.cmd-input:focus { outline: 2px solid #2f6fed; outline-offset: -2px; }
.cmd-list { list-style: none; margin: 0; padding: .3rem; max-height: 50vh; overflow: auto; }
.cmd-item { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .8rem; border-radius: 8px; cursor: pointer; }
.cmd-item small { color: var(--muted); }
.cmd-item.active { background: #e8f0ff; outline: 1px solid #2f6fed; }
.cmd-empty { padding: .8rem; color: var(--muted); }
.cmd-hint { margin: 0; padding: .5rem 1rem .7rem; font-size: .78rem; }
.nav-area-link { font-size: .8rem; opacity: .75; }
@media (max-width: 760px) { .cmd-open kbd, .cmd-open .lbl { display: none; } }

/* Multi-line quotation editor */
.qline { border: 1px solid var(--border, #d6dce8); border-radius: 10px; margin: 0 0 .8rem; background: #fff; }
.qline > summary { cursor: pointer; padding: .7rem 1rem; list-style: none; }
.qline > summary::-webkit-details-marker { display: none; }
.qline[open] > summary { border-bottom: 1px solid var(--border, #d6dce8); background: #f7f9fc; border-radius: 10px 10px 0 0; }
.qline-body { padding: .6rem 1rem 0; }
.qline-actions { display: flex; gap: .6rem; padding: .4rem 0 .9rem; }
.qline-actions button[disabled] { opacity: .45; cursor: not-allowed; }
.qline-preview { padding: 0 1rem; }
.qline-preview:not(:empty) { padding-bottom: .8rem; border-top: 1px dashed var(--border, #d6dce8); }
.qline-table { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .88rem; }
.qline-table th, .qline-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--border, #e6eaf2); text-align: left; }
.qline-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.qline-toolbar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .2rem 0 1.2rem; }

/* 9 — NetSuite-style shell ------------------------------------------------
   Dark header (brand, search, New, Inbox, user), a light menu bar with one dropdown per area, and
   portlet-style panels on the home page. Tokens above give the tighter, flatter look. */
.shell { flex-direction: column; }
.topbar { background: #1b2a41; border-bottom: 0; color: #e6ecf5; backdrop-filter: none; padding: .4rem 1.25rem; gap: .75rem; }
.topbar .brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-right: .5rem; }
.topbar .brand:hover { text-decoration: none; color: #fff; }
.topbar .brand-mark { width: 30px; height: 30px; border-radius: 6px; font-size: .8rem; box-shadow: none; }
.topbar .brand-text { font-size: .95rem; line-height: 1.1; }
.topbar .brand-text small { color: #9fb0c8; font-size: .68rem; }
.topbar .topsearch { max-width: 520px; }
.topbar .topsearch input { padding-left: 2.4rem; background: rgba(255, 255, 255, .12); border: 1px solid transparent; color: #fff; border-radius: 4px; }
.topbar .topsearch input::placeholder { color: #aebbd0; }
.topbar .topsearch input:focus { background: #fff; color: var(--text); }
.topbar .topsearch .icon { color: #aebbd0; }
.topbar .cmd-open { background: rgba(255, 255, 255, .12); color: #d6deea; border-radius: 4px; }
.topbar .cmd-open:hover { background: rgba(255, 255, 255, .2); border-color: transparent; }
.topbar .cmd-open kbd { background: transparent; border-color: rgba(255, 255, 255, .3); color: #d6deea; }
.topbar .bell { color: #e6ecf5; }
.topbar .bell:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topbar .hamburger { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
.topbar .quicknew summary { background: #e8730c; box-shadow: none; border-radius: 4px; }
.topbar .quicknew summary:hover { background: #cf6508; }
.topbar .usermenu summary:hover { background: rgba(255, 255, 255, .12); }
.topbar .who strong { color: #fff; }
.topbar .who span { color: #aebbd0; }
.topbar .avatar { background: #3b82f6; color: #fff; border-radius: 4px; }

.menubar { position: sticky; top: var(--topbar-h); z-index: 14; display: flex; align-items: stretch; gap: .1rem; padding: 0 1.25rem; background: #fff; border-bottom: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.menubar > a, .mb-title { display: inline-flex; align-items: center; gap: .45rem; padding: .62rem .9rem; color: var(--text-2); font-weight: 600; font-size: .88rem; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.menubar > a:hover, .mb-menu:hover > .mb-title, .mb-menu:focus-within > .mb-title { background: #f1f5fb; color: var(--accent-600); text-decoration: none; }
.menubar > a.active, .mb-menu.active > .mb-title { color: var(--accent-600); border-bottom-color: var(--accent); }
.mb-menu { position: relative; }
.mb-title .caret { width: .38rem; height: .38rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-1px); margin-left: .1rem; }
.mb-drop { display: none; position: absolute; left: 0; top: 100%; z-index: 40; min-width: 250px; max-height: 75vh; overflow-y: auto; background: #fff; border: 1px solid var(--border-strong); border-top: 2px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg); padding: .35rem 0; }
.mb-menu:hover > .mb-drop, .mb-menu:focus-within > .mb-drop { display: block; }
.mb-drop a { display: block; padding: .42rem 1rem; color: var(--text); font-size: .88rem; text-decoration: none; }
.mb-drop a:hover { background: var(--accent-soft); color: var(--accent-600); }
.mb-drop a.active { color: var(--accent-600); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.mb-drop a.mb-all { border-bottom: 1px solid var(--border); margin-bottom: .25rem; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

/* portlet panels (home page and any panel that wants the NetSuite look) */
.dash-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 0 1rem 1rem; margin-bottom: 1.25rem; }
.dash-section h2 { margin: 0 -1rem 1rem; padding: .6rem 1rem; background: linear-gradient(#fafbfd, #eef2f8); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.portlet { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; overflow: hidden; }
.portlet > h2 { margin: 0; padding: .6rem 1rem; background: linear-gradient(#fafbfd, #eef2f8); border-bottom: 1px solid var(--border); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.portlet > h2 a { font-size: .75rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
.portlet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; }
.reminder { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--text); text-decoration: none; }
.reminder:last-child { border-bottom: 0; }
.reminder:hover { background: var(--accent-soft); text-decoration: none; }
.reminder .count { min-width: 1.8rem; text-align: center; font-weight: 700; font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.portlet-empty { padding: 1rem; color: var(--muted); font-size: .88rem; }
.stat-card { box-shadow: none; border-left: 3px solid var(--accent); }
.stat-card:hover { transform: none; box-shadow: none; }
.stat-card .value { font-size: 1.45rem; }
th { background: #eef2f8; border-bottom: 1px solid var(--border-strong); }

@media (max-width: 860px) {
    .menubar { position: fixed; left: -100%; top: 0; bottom: 0; z-index: 40; width: 82vw; max-width: 300px; flex-direction: column; overflow-y: auto; padding: .5rem 0; transition: left .18s ease; border-bottom: 0; }
    #nav-toggle:checked ~ .shell .menubar { left: 0; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 39; }
    #nav-toggle:checked ~ .shell .sidebar-backdrop { display: block; }
    .menubar > a, .mb-title { border-bottom: 0; padding: .7rem 1.1rem; }
    .mb-drop { display: block; position: static; box-shadow: none; border: 0; border-left: 2px solid var(--border); margin: 0 0 .25rem 1.4rem; padding: 0; max-height: none; }
    .mb-title .caret { display: none; }
    .topbar .brand-text { display: none; }
    .topbar { flex-wrap: wrap; padding: .4rem .75rem; }
    .topbar .cmd-open { display: none; }
}
