/* =========================================================================
   Nexavorix Cloud — admin theme
   A clean, professional dark-on-light dashboard. No external dependencies.
   ========================================================================= */

:root {
    --bg:        #f4f6fb;
    --surface:   #ffffff;
    --ink:       #161a23;
    --ink-soft:  #5b6475;
    --ink-faint: #9aa3b2;
    --line:      #e6e9f0;
    --brand:     #1e3a5f;
    --brand-700: #142a47;
    --brand-50:  #e9eef4;
    --gold:      #b8995a;
    --ribbon-h:  26px;
    --ok:        #0f9d58;
    --ok-50:     #e7f6ee;
    --warn:      #b8860b;
    --warn-50:   #fbf3e0;
    --danger:    #d23b3b;
    --danger-50: #fbe9e9;
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
    --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------- brand --------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), #7c75ff);
    color: #fff; font-weight: 800; font-size: 18px;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-name span { color: var(--brand); }

/* =========================================================================
   AUTH (login / setup) — centered card
   ========================================================================= */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(1200px 600px at 50% -10%, #e9ecfb 0%, transparent 60%),
        var(--bg);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 30px;
}
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-title { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--ink-soft); margin: 6px 0 20px; font-size: 14px; }
.auth-foot { text-align: center; color: var(--ink-faint); font-size: 12px; margin: 22px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* =========================================================================
   APP SHELL
   ========================================================================= */
.app-body { min-height: 100vh; display: flex; flex-direction: column; }
.layout { display: grid; grid-template-columns: 244px 1fr; flex: 1; }

.sidebar {
    background: #0e1c2e;
    color: #c7cdda;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: sticky;
    top: var(--ribbon-h);
    height: calc(100vh - var(--ribbon-h));
    border-right: 1px solid #0a1622;
}
.sidebar .brand { padding: 6px 8px 22px; }
.sidebar .brand-name { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #aab2c4;
    font-size: 14.5px;
    font-weight: 500;
    transition: background .12s, color .12s;
}
.nav-link:hover { background: #16293d; color: #fff; text-decoration: none; }
.nav-link.is-active { background: #1e3a5f; color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-foot { border-top: 1px solid #232a3a; padding-top: 12px; margin-top: 12px; }
.nav-logout {
    width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
    font: inherit; color: #aab2c4;
}
.nav-logout:hover { background: #16293d; color: #fff; }
.nav-abort {
    width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
    font: inherit; font-weight: 700; letter-spacing: .5px; color: #ff6b72; margin-top: 4px;
}
.nav-abort:hover { background: #3a1115; color: #ff8e94; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    position: sticky; top: var(--ribbon-h); z-index: 5;
}
.topbar-title { font-size: 17px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.user-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
.user-name { font-weight: 600; color: var(--ink); }

.content { padding: 28px; max-width: 1200px; width: 100%; }

/* =========================================================================
   COMPONENTS
   ========================================================================= */
.stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat-label { color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; }
.stat-sub { color: var(--ink-faint); font-size: 12px; margin-top: 2px; }
.stat-of { color: var(--ink-faint); font-size: 18px; font-weight: 600; }
a.stat-link { display: block; transition: border-color .12s, box-shadow .12s; }
a.stat-link:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; color: var(--ink); }
.hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; color: var(--ink-soft); font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: .03em;
    padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.table th a { color: inherit; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .strong, .table .nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

/* badges */
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; text-transform: capitalize;
}
.badge-active   { background: var(--ok-50);     color: var(--ok); }
.badge-draft    { background: var(--warn-50);   color: var(--warn); }
.badge-archived { background: #eef0f4;          color: var(--ink-soft); }
.badge-action   { background: var(--brand-50);  color: var(--brand-700); text-transform: none; }
.badge-good { background: var(--ok-50);   color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-bad  { background: var(--danger-50); color: #9a2a2a; }
.badge-prospect    { background: var(--brand-50); color: var(--brand-700); }
.badge-building    { background: var(--warn-50);  color: var(--warn); }
.badge-maintenance { background: #e9eef4;         color: #2b5b8a; }
.badge-inactive    { background: #f1f1f4;         color: var(--ink-faint); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    padding: 10px 0; border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.t-action { font-weight: 600; font-size: 14px; }
.t-meta { color: var(--ink-soft); font-size: 13px; }
.t-time { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--ink-faint); font-size: 12.5px; white-space: nowrap; }

/* empty state */
.empty { text-align: center; padding: 36px 20px; color: var(--ink-soft); }
.empty p { margin: 0 0 14px; }

/* toolbar / filters */
/* Tab strip — segmented sub-nav within a page */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab {
    padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--ink-soft);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Wide tables (e.g. Clients) scroll inside their panel instead of spilling out. */
.table-scroll { width: 100%; overflow-x: auto; }
.table-clients .cl-name { font-weight: 600; white-space: normal; min-width: 220px; max-width: 360px; }
.table-clients td, .table-clients th { vertical-align: middle; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* forms */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field > span small { font-weight: 400; color: var(--ink-faint); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { grid-template-columns: 1fr 1fr 1fr; }
input[type=text], input[type=password], input[type=search], input[type=email],
textarea, select, .input {
    width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s; outline: none;
}
input:focus, textarea:focus, select:focus, .input:focus {
    border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
textarea { resize: vertical; }
.input { width: auto; }
.filters .input[type=search], .filters input[type=search] { min-width: 240px; }

/* key/value editor */
.kv-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.kv-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 8px; }
.btn-icon { padding: 0 12px; line-height: 38px; }

.record-form .cols { margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.meta-list dt { color: var(--ink-soft); }
.meta-list dd { margin: 0; font-weight: 600; }

/* buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; font: inherit; font-weight: 600; font-size: 14px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: var(--radius-sm); cursor: pointer; transition: all .12s;
    white-space: nowrap;
}
.btn:hover { background: #f7f8fb; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 6px; }

/* alerts */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-error { background: var(--danger-50); color: #9a2a2a; border-color: #f2c4c4; }
.alert-ok { background: var(--ok-50); color: #0b6e3d; border-color: #bfe6cf; }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager-info { color: var(--ink-soft); font-size: 13px; }
.pager-links { display: flex; align-items: center; gap: 10px; }
.pager-pos { color: var(--ink-soft); font-size: 13px; }

/* ---------- uptime monitor ----------------------------------------------- */
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.status-up-text { color: var(--ok); }
.status-down-text { color: var(--danger); }

.status-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.status-pill .status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-up      { background: var(--ok-50);    color: var(--ok); }
.status-down    { background: var(--danger-50); color: var(--danger); }
.status-unknown { background: #eef0f4;          color: var(--ink-soft); }
.status-paused  { background: #eef0f4;          color: var(--ink-faint); }

.row-muted { opacity: .55; }
.site-url { font-size: 12.5px; color: var(--ink-soft); word-break: break-all; }
.site-url:hover { color: var(--brand); }
.site-err { font-size: 12px; color: var(--danger); margin-top: 2px; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.row-actions form { display: inline; }

.add-site { position: relative; }
.add-site > summary { list-style: none; cursor: pointer; }
.add-site > summary::-webkit-details-marker { display: none; }
.add-site-form {
    display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm);
}
.add-site-form .input { min-width: 220px; }

.uptime-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.uptime-of { color: var(--ink-soft); font-size: 13px; }
.down-list { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.down-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.down-list .site-err { margin: 0; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-down { background: var(--danger); }

details.panel > summary { cursor: pointer; font-size: 14px; }

/* responsive */
@media (max-width: 920px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
    .sidebar .brand { padding: 6px; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-foot { border: 0; margin: 0; padding: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .cols, .field-row { grid-template-columns: 1fr; }
}

/* =========================================================================
   Lockout interstitial — shown when the security-question cooldown is active.
   Calm, light card matching the sign-in pages (CSP-safe: no inline styles).
   ========================================================================= */
.lockdown-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1100px 520px at 50% -10%, #eef1f7 0%, transparent 60%),
        var(--bg);
    color: var(--ink);
    font-family: var(--font);
}
.lock-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.lock-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--warn);
    border-radius: 14px;
    padding: 32px 30px 26px;
    box-shadow: var(--shadow);
    text-align: center;
}
.lock-seal { display: block; width: auto; height: 60px; margin: 0 auto 14px; }
.lock-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}
.lock-sub {
    margin: 8px 0 22px;
    font-size: 14px;
    color: var(--ink-soft);
}
.lock-timer {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.lock-timer-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--ink-faint);
}
.lock-count {
    font-variant-numeric: tabular-nums;
    font-size: 34px; font-weight: 750; letter-spacing: 1px;
    color: var(--warn);
}
.lock-note {
    margin: 18px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-faint);
}
@media (max-width: 520px) {
    .lock-card { padding: 28px 22px 22px; }
}

/* =========================================================================
   Sign-in theme — applied to the auth pages (login / setup / security
   question) via <body class="auth-body auth-official">. A calm, light card
   with a subtle official accent (a lighter touch than the lockdown screen).
   CSP-safe: no inline styles.
   ========================================================================= */
.auth-body.auth-official {
    display: flex;
    flex-direction: column;
    place-items: initial;
    padding: 0;
    background:
        radial-gradient(1100px 520px at 50% -10%, #eef1f7 0%, transparent 60%),
        var(--bg);
    color: var(--ink);
}
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 36px 20px; width: 100%; }
.auth-official .auth-card {
    max-width: 410px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 32px 30px 24px;
}
.auth-emblem { text-align: center; margin-bottom: 4px; }
.auth-seal { display: block; width: 84px; height: 84px; margin: 0 auto 12px; }
.auth-logo { display: block; width: auto; height: 62px; margin: 0 auto 10px; }
.auth-org {
    text-transform: uppercase; letter-spacing: 3px; font-weight: 700;
    font-size: 15px; color: var(--ink);
}
.auth-org-sub {
    text-transform: uppercase; letter-spacing: 2px; font-size: 10px;
    color: var(--ink-faint); margin-top: 5px;
}
.auth-official .auth-title {
    color: var(--ink-soft); text-transform: uppercase; letter-spacing: 2px;
    font-size: 12px; font-weight: 600; text-align: center;
    margin: 16px 0 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.auth-official .auth-foot {
    color: var(--ink-faint); font-size: 11px; letter-spacing: .3px; margin-top: 20px;
}

/* =========================================================================
   Official dashboard chrome — restrained government/agency styling layered
   over the standard light dashboard (a lighter touch than the lockdown).
   ========================================================================= */
.gov-ribbon {
    position: sticky; top: 0; z-index: 20;
    height: var(--ribbon-h);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    background: linear-gradient(180deg, #14233a, #0e1b2b);
    border-bottom: 1px solid rgba(184,153,90,.35);
    color: #c2cdde;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 10.5px; letter-spacing: 3px; text-transform: uppercase;
    white-space: nowrap; overflow: hidden;
}
.gov-ribbon b { color: #d8b86c; font-weight: 700; letter-spacing: 3px; }
.gov-ribbon .dot { color: var(--gold); opacity: .7; }

/* Sidebar seal + sub-label */
.brand-seal { width: 34px; height: 34px; display: block; flex: none; }
.brand-logo { height: 42px; width: auto; display: block; flex: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.brand-block { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar .brand-name span { color: #c9a85f; }
.brand-sub {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase;
    color: #6f8095; margin-top: 3px;
}

/* Topbar classification chip */
.topbar-title { letter-spacing: .3px; }
.gov-chip {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: #8a6d2f; background: #faf4e6; border: 1px solid #e6d6a8;
    padding: 3px 9px; border-radius: 4px;
}

/* Footer classification strip */
.gov-foot {
    border-top: 1px solid var(--line);
    padding: 14px 28px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--ink-faint); text-align: center;
}

@media (max-width: 920px) {
    .gov-ribbon { letter-spacing: 2px; gap: 8px; font-size: 9.5px; }
}

/* =========================================================================
   Outreach messages — collapsible, copyable message cards.
   ========================================================================= */
.msg-group-title {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--ink-soft); font-weight: 700; margin: 26px 0 12px;
}
.msg-group-title:first-of-type { margin-top: 4px; }
.msg-panel { padding: 0; overflow: hidden; }
.msg-panel > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 10px;
    padding: 15px 20px;
}
.msg-panel > summary::-webkit-details-marker { display: none; }
.msg-summary::before {
    content: '▸'; display: inline-block; color: var(--ink-faint);
    font-size: 12px; transition: transform .15s; flex: none;
}
.msg-panel[open] .msg-summary::before { transform: rotate(90deg); }
.msg-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.msg-inner { padding: 0 20px 18px; }
.msg-actions { margin-bottom: 12px; }
.msg-body {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 16px 18px;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.65;
    color: var(--ink);
    background: #fbfcfe;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.btn.is-copied {
    background: var(--ok-50);
    border-color: #bfe6cf;
    color: #0b6e3d;
}

/* =========================================================================
   Email check — result checklist.
   ========================================================================= */
.check-list { list-style: none; margin: 6px 0 0; padding: 0; }
.check-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-list li:last-child { border-bottom: 0; }
.chk { display: inline-block; width: 20px; font-weight: 800; }
.chk-yes { color: var(--ok); }
.chk-no { color: var(--danger); }
.chk-warn { color: var(--warn); }
.check-notes { margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 13px; }
.check-notes li { margin-bottom: 4px; }

/* =========================================================================
   Pipeline board — clients grouped by stage.
   ========================================================================= */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.board-col {
    flex: 0 0 240px;
    background: #f0f2f7;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}
.board-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.board-col-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); }
.board-col-count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 1px 8px; color: var(--ink-soft); }
.board-empty { color: var(--ink-faint); text-align: center; margin: 8px 0; }
.pcard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
    margin-bottom: 9px;
}
.pcard-name { display: block; font-weight: 600; color: var(--ink); font-size: 14px; line-height: 1.3; }
.pcard-name:hover { text-decoration: none; color: var(--brand); }
.pcard-domain { font-size: 12px; margin-top: 2px; }
.pcard-fee { font-size: 12px; font-weight: 600; color: var(--ok); margin-top: 4px; }
.pcard-move { margin-top: 8px; }
.pcard-move select { width: 100%; padding: 5px 8px; font-size: 12.5px; }

/* SSL expiry pills on the uptime page */
.ssl-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ssl-ok   { background: var(--ok-50);     color: var(--ok); }
.ssl-warn { background: var(--warn-50);   color: var(--warn); }
.ssl-bad  { background: var(--danger-50); color: #9a2a2a; }
.ssl-na   { color: var(--ink-faint); }
.dot-warn { background: var(--warn); }

/* =========================================================================
   Tasks
   ========================================================================= */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--ink-faint); }
.task-check { flex: none; }
.task-box {
    width: 22px; height: 22px; border: 1.5px solid var(--line); background: var(--surface);
    border-radius: 6px; cursor: pointer; color: var(--ok); font-weight: 800; line-height: 1;
    display: grid; place-items: center; padding: 0;
}
.task-box:hover { border-color: var(--ok); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14.5px; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.task-due { font-size: 12.5px; color: var(--ink-soft); }
.task-due.is-overdue { color: var(--danger); font-weight: 600; }
.task-due.is-soon { color: var(--warn); font-weight: 600; }

/* =========================================================================
   Work log + credentials (client page)
   ========================================================================= */
.linklike { background: none; border: 0; color: var(--ink-faint); cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.linklike:hover { color: var(--danger); text-decoration: underline; }
.log-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-add input[type=text] { flex: 1; min-width: 180px; }
.log-add input[type=date] { width: auto; }
.cred-list { list-style: none; margin: 0 0 12px; padding: 0; }
.cred-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.cred-top { display: flex; align-items: center; gap: 10px; }
.cred-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; }
.cred-row > span:first-child { color: var(--ink-soft); width: 56px; flex: none; }
.cred-secret { flex: 1; padding: 5px 8px; }
.cred-note { margin-top: 6px; }
.cred-add { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cred-add-wrap > summary { display: inline-flex; list-style: none; }
.cred-add-wrap > summary::-webkit-details-marker { display: none; }

/* =========================================================================
   Printable documents (proposals / reports)
   ========================================================================= */
.doc-body { background: #eef1f7; margin: 0; }
.doc-bar { max-width: 760px; margin: 0 auto; padding: 16px 0 0; display: flex; gap: 8px; justify-content: flex-end; }
.doc {
    max-width: 760px; margin: 16px auto 40px; background: #fff;
    border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
    padding: 48px 52px;
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brand); padding-bottom: 18px; }
.doc-brand { display: flex; align-items: center; gap: 12px; }
.doc-logo { height: 46px; width: auto; }
.doc-org { font-weight: 800; font-size: 20px; letter-spacing: 1px; color: var(--ink); }
.doc-org-sub { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1.5px; }
.doc-meta { text-align: right; font-size: 13px; color: var(--ink-soft); }
.doc-kind { font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--brand); font-size: 14px; }
.doc-title { font-size: 26px; margin: 26px 0 4px; }
.doc-for { color: var(--ink-soft); margin: 0 0 18px; }
.doc-intro { line-height: 1.7; color: var(--ink); }
.doc-table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14px; }
.doc-table th { text-align: left; border-bottom: 2px solid var(--line); padding: 8px 10px; color: var(--ink-soft); text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.doc-table td { padding: 10px; border-bottom: 1px solid var(--line); }
.doc-amt { text-align: right; white-space: nowrap; }
.doc-total-label { text-align: right; font-weight: 700; }
.doc-total { font-weight: 800; font-size: 16px; color: var(--brand); }
.doc-h2 { font-size: 15px; margin: 24px 0 8px; }
.doc-terms { color: var(--ink); line-height: 1.7; font-size: 14px; }
.doc-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-faint); font-size: 12px; }
@media print {
    .no-print { display: none !important; }
    body, .doc-body { background: #fff; }
    .doc { border: 0; box-shadow: none; margin: 0; max-width: none; padding: 0; }
}

/* Report stat grid (printable) */
.rep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.rep-stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.rep-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.rep-val { font-size: 20px; font-weight: 750; margin-top: 4px; }
.doc-list { margin: 8px 0; padding-left: 20px; line-height: 1.8; }
@media print { .rep-stat { break-inside: avoid; } }

/* Live timer + finance */
.timer-live { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 700; color: var(--brand); min-width: 78px; flex: none; }
.fin-pos { color: var(--ok); }
.fin-neg { color: var(--danger); }
.mrr-bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin: 8px 0 4px; }
.mrr-bar { flex: 1; background: var(--brand-50); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.mrr-bar > span { position: absolute; bottom: 100%; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-soft); padding-bottom: 2px; }
.mrr-bar-label { font-size: 10px; color: var(--ink-faint); text-align: center; margin-top: 4px; }

/* Service log doc bits */
.doc-info { width: 100%; border-collapse: collapse; margin: 20px 0 6px; font-size: 14px; }
.doc-info td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.doc-info-k { color: var(--ink-soft); width: 90px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.doc-sign { display: flex; gap: 40px; margin-top: 48px; }
.doc-sign-box { flex: 1; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; }
.doc-sign-line { border-bottom: 1px solid var(--ink-soft); height: 40px; margin-bottom: 8px; }
@media print { .doc-sign { margin-top: 60px; } }

/* =========================================================================
   Utility classes — CSP-safe replacements for inline style="" attributes.
   The site's Content-Security-Policy has no 'unsafe-inline', so inline styles
   are blocked; these classes carry the same intent. Defined last so they win.
   ========================================================================= */
.m-0       { margin: 0; }
.mt-6      { margin-top: 6px; }
.mt-8      { margin-top: 8px; }
.mt-10     { margin-top: 10px; }
.mt-12     { margin-top: 12px; }
.mt-14     { margin-top: 14px; }
.mb-18     { margin-bottom: 18px; }
.ml-auto   { margin-left: auto; }
.d-inline  { display: inline; }
.is-hidden { display: none; }
.flex-1    { flex: 1; }
.flex-row-6 { display: flex; gap: 6px; }
.w-full    { width: 100%; }
.minw-320  { min-width: 320px; }
.mw-120    { max-width: 120px; }
.mw-140    { max-width: 140px; }
.mw-150    { max-width: 150px; }
.mw-420    { max-width: 420px; }
.mw-480    { max-width: 480px; }
.mw-640    { max-width: 640px; }
.text-soft { color: var(--ink-soft); }
.fw-normal { font-weight: 400; }
.fs-11     { font-size: 11.5px; }
.csv-hint  { margin: 10px 0 6px; }
.divider-top { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.badge-btn { border: 0; cursor: pointer; }
.cell-check { width: 24px; color: var(--ok); }
.cell-date  { width: 120px; color: var(--ink-soft); }

/* =========================================================================
   Emergency "abort" theatrics (Tools -> Emergency). Pure effect; no data ops.
   ========================================================================= */
.abort-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: #050708; color: #29ff5b;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    display: flex; flex-direction: column;
    padding: 22px clamp(16px, 5vw, 60px);
    overflow: hidden;
    animation: abort-flicker .12s steps(2) infinite;
}
.abort-overlay::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.32) 2px 4px);
    mix-blend-mode: multiply;
}
.abort-overlay::after {
    content: ""; position: absolute; left: 0; right: 0; height: 140px; top: -140px;
    background: linear-gradient(180deg, rgba(41,255,91,0), rgba(41,255,91,.08) 50%, rgba(41,255,91,0));
    animation: abort-scan 3.2s linear infinite; pointer-events: none;
}
.abort-title {
    color: #ff2e3e; font-size: clamp(20px, 4vw, 40px); font-weight: 800;
    letter-spacing: 3px; text-transform: uppercase; text-shadow: 0 0 14px rgba(255,46,62,.7);
    animation: abort-blink 1s steps(2) infinite; margin: 0 0 4px; position: relative; z-index: 1;
}
.abort-title.arming { color: #ffd23f; text-shadow: 0 0 12px rgba(255,210,63,.55); animation: none; }
.abort-sub { color: #ffb3b8; font-size: 13px; letter-spacing: 2px; margin-bottom: 14px; position: relative; z-index: 1; }
.abort-bar-wrap { height: 16px; border: 1px solid #ff2e3e; background: #1a0305; margin: 8px 0 6px; overflow: hidden; position: relative; z-index: 1; }
.abort-bar { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #ff2e3e 0 10px, #b3121d 10px 20px); transition: width .25s linear; }
.abort-pct { color: #ff6a73; font-size: 12px; margin-bottom: 10px; position: relative; z-index: 1; }
.abort-log {
    flex: 1; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end;
    font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
    opacity: .94; position: relative; z-index: 1;
}
.abort-log > div { flex: none; }
.abort-log .ok   { color: #29ff5b; }
.abort-log .del  { color: #ff5a64; }
.abort-log .warn { color: #ffd23f; }
.abort-log .sys  { color: #86b7ff; }
.abort-gate { border-top: 1px solid #1f3b25; margin-top: 12px; padding-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.abort-gate label { color: #ffd23f; letter-spacing: 2px; font-size: 13px; }
.abort-pin {
    background: #0b0f10; color: #29ff5b; border: 1px solid #29ff5b; border-radius: 4px;
    font-family: inherit; font-size: 18px; letter-spacing: 6px; padding: 8px 12px; width: 150px; text-align: center;
}
.abort-pin:focus { outline: none; box-shadow: 0 0 0 2px rgba(41,255,91,.35); }
.abort-go {
    background: #ff2e3e; color: #fff; border: 0; border-radius: 4px; cursor: pointer;
    font: inherit; font-weight: 700; letter-spacing: 1px; padding: 9px 18px;
}
.abort-go:hover { background: #ff4756; }
.abort-msg { font-size: 13px; letter-spacing: 1px; min-height: 18px; }
.abort-msg.bad  { color: #ff2e3e; }
.abort-msg.good { color: #29ff5b; }
.abort-shake { animation: abort-shake .35s; }
.abort-overlay.restored { animation: none; background: #03140a; }
.abort-overlay.restored::before, .abort-overlay.restored::after { display: none; }

@keyframes abort-flicker { 0%{opacity:1} 50%{opacity:.97} 100%{opacity:1} }
@keyframes abort-blink   { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
@keyframes abort-scan    { 0%{top:-140px} 100%{top:100%} }
@keyframes abort-shake   { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(9px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }

/* Intake form helpers + brief */
.field-hint { display: block; color: var(--ink-faint); font-size: 12px; margin-top: 4px; }
.font-ref { margin-top: 6px; background: var(--brand-50); border: 1px solid #dbe3ee; border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; color: var(--ink-soft); }
.font-ref strong { color: var(--brand-700); }
.font-ref-row { display: block; margin-top: 3px; }
.font-ref-row em { color: var(--ink); font-style: normal; font-weight: 600; }
.doc-qa { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 14px; }
.doc-qa td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-qa-q { color: var(--ink-soft); width: 38%; }
.doc-qa-a { color: var(--ink); }

/* =========================================================================
   Tools (toolbox) + global search
   ========================================================================= */
.topbar-search { flex: 1; max-width: 280px; margin: 0 16px; }
.topbar-search input { width: 100%; padding: 7px 12px; font-size: 14px; }
@media (max-width: 760px) { .topbar-search { display: none; } }

.tool-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.tool-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.tool-out { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.gen-out { flex: 1; background: #0e1c2e; color: #d7e3f0; border-radius: var(--radius-sm); padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.gen-pre { white-space: pre-wrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.sw { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); display: inline-block; }
.fav-dl { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px; font-size: 11px; color: var(--ink-soft); text-decoration: none; }
.fav-dl canvas { border: 1px solid var(--line); border-radius: 6px; background: #f7f8fb; }
.fav-dl:hover { color: var(--brand); }
.qr-out { margin-top: 12px; }
.qr-out svg { max-width: 220px; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li { border-bottom: 1px solid var(--line); }
.search-list li:last-child { border-bottom: 0; }
.search-list a { display: block; padding: 9px 4px; text-decoration: none; color: var(--ink); }
.search-list a:hover { background: var(--brand-50); }

/* Intake inline palette picker */
.ik-palette { margin: -6px 0 16px; padding: 12px; background: #f7f9fc; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ik-palette .tool-row { margin-bottom: 8px; }
.ik-palette .sw { width: 26px; height: 26px; }

/* CSV import box (copy template + paste-or-upload) */
.csv-panel { margin-top: 10px; max-width: 720px; }
.csv-panel .gen-out { max-height: 130px; overflow: auto; }
.csv-form textarea { width: 100%; margin-top: 10px; }
.csv-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.csv-actions input[type=file] { font-size: 13px; }
