/**
 * My Netivi — the signed-in account area.
 *
 * Loads AFTER netivi.css and builds on it: same palette, same tokens, same
 * buttons and cards. What is here is only what the storefront does not need —
 * tabs, tiles, tables, the mail list.
 *
 * The storefront sells; this is used. So it is denser, quieter, and has no
 * animation to sit through. Somebody opening this page wants an answer, not an
 * experience.
 */

/* ── shell ──────────────────────────────────────────────────────────── */

.nv-app .nv-header .nv-wrap { gap: 14px; }
.nv-app .nv-who {
    margin-left: auto; font-size: .9rem; font-weight: 600; color: var(--nv-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
.nv-signout { display: flex; }

.nv-btn-sm { padding: 8px 16px; font-size: .85rem; }

.nv-main { padding: 28px 20px 10px; }

/* ── tabs ───────────────────────────────────────────────────────────── */

.nv-tabs {
    background: var(--nv-surface);
    border-bottom: 1px solid var(--nv-line);
    position: sticky; top: 70px; z-index: 60;
}
.nv-tabs .nv-wrap {
    display: flex; gap: 2px;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nv-tabs .nv-wrap::-webkit-scrollbar { display: none; }

.nv-tab {
    display: flex; align-items: center; gap: 7px;
    padding: 14px 16px; white-space: nowrap;
    color: var(--nv-muted); font-size: .9rem; font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.nv-tab:hover { color: var(--nv-body); }
.nv-tab.active { color: var(--nv-text); border-bottom-color: var(--nv-blue); }
.nv-tab svg { flex-shrink: 0; }

/* The unread pip. Kept as a count rather than a plain dot: "3" tells you
   whether it is worth opening; a dot does not. */
.nv-pip {
    font-style: normal; font-size: .68rem; font-weight: 700; line-height: 1;
    background: var(--nv-red); color: #fff; border-radius: 999px; padding: 3px 7px;
}

@media (max-width: 620px) {
    .nv-tab { padding: 13px 12px; font-size: .84rem; }
    .nv-tab span { display: none; }
    .nv-tab.active span { display: inline; }
    .nv-tabs { top: 70px; }
}

/* ── page heads ─────────────────────────────────────────────────────── */

.nv-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.nv-page-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.nv-page-head .nv-sub { margin: 0; color: var(--nv-muted); font-size: .92rem; }

.nv-back { font-size: .9rem; color: var(--nv-muted); }
.nv-back:hover { color: var(--nv-text); }

/* ── the overview card ──────────────────────────────────────────────── */

.nv-hero-card {
    display: flex; gap: 28px; flex-wrap: wrap; align-items: center;
    background: var(--nv-raised); border: 1px solid var(--nv-line);
    border-left: 4px solid var(--nv-line-2);
    border-radius: var(--nv-radius); padding: 26px 28px; margin-bottom: 22px;
}
.nv-hero-card-main { flex: 1 1 320px; }
.nv-hero-card-side { flex: 0 1 260px; }

.nv-hero-card h1 { font-size: 1.45rem; margin: 6px 0 2px; font-weight: 600; }
.nv-hero-card h1 strong { font-weight: 700; }
.nv-state {
    font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
    color: var(--nv-muted);
}
.nv-countdown { font-size: .95rem; color: var(--nv-body); margin: 2px 0 8px; }
.nv-countdown strong { font-size: 1.15rem; color: var(--nv-text); }
.nv-hero-note { font-size: .92rem; color: var(--nv-muted); margin: 0; max-width: 54ch; }

/* Tone drives the left edge, which is the only thing that needs to change
   colour. Recolouring the whole card makes a routine "ending soon" look like
   an emergency. */
.nv-tone-ok      { border-left-color: #25D366; }
.nv-tone-soon    { border-left-color: #F5A623; }
.nv-tone-warn    { border-left-color: var(--nv-red); }
.nv-tone-unknown { border-left-color: var(--nv-line-2); }

/* ── tiles ──────────────────────────────────────────────────────────── */

.nv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.nv-tile {
    background: var(--nv-raised); border: 1px solid var(--nv-line);
    border-radius: var(--nv-radius-sm); padding: 17px 19px;
    display: flex; flex-direction: column; gap: 3px;
}
.nv-tile.nv-tone-ok, .nv-tile.nv-tone-soon, .nv-tile.nv-tone-warn, .nv-tile.nv-tone-unknown {
    border-left: 3px solid;
}
.nv-tile-k {
    font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--nv-muted);
}
.nv-tile-v { font-size: 1.75rem; font-weight: 700; color: var(--nv-text); line-height: 1.1; }
.nv-tile-v small { font-size: .9rem; font-weight: 600; color: var(--nv-muted); }
.nv-tile-v-sm { font-size: 1.02rem; line-height: 1.3; }
.nv-tile-s { font-size: .82rem; color: var(--nv-muted); }

/* ── panels ─────────────────────────────────────────────────────────── */

.nv-panel {
    background: var(--nv-raised); border: 1px solid var(--nv-line);
    border-radius: var(--nv-radius); padding: 24px;
}
.nv-panel h2 { font-size: 1.05rem; margin: 0 0 4px; }
.nv-panel .nv-sub { font-size: .9rem; color: var(--nv-muted); margin: 0 0 16px; }

.nv-empty { text-align: center; padding: 44px 24px; }
.nv-empty h2 { margin-bottom: 8px; }
.nv-empty p { color: var(--nv-muted); font-size: .93rem; max-width: 46ch; margin: 0 auto 18px; }

.nv-bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.nv-bullets li { position: relative; padding-left: 17px; font-size: .92rem; color: var(--nv-body); }
.nv-bullets li::before {
    content: ''; position: absolute; left: 0; top: .55em;
    width: 5px; height: 5px; border-radius: 50%; background: var(--nv-blue);
}

/* ── credentials ────────────────────────────────────────────────────── */

.nv-creds { margin: 0 0 18px; display: grid; gap: 12px; }
.nv-creds div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nv-creds dt { font-size: .78rem; color: var(--nv-muted); min-width: 74px; margin: 0; }
.nv-creds dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nv-creds code {
    font-family: var(--font-mono); font-size: .92rem; color: var(--nv-text);
    background: var(--nv-bg); border: 1px solid var(--nv-line);
    border-radius: 7px; padding: 5px 10px; word-break: break-all;
}

.nv-mini {
    background: transparent; border: 1px solid var(--nv-line-2); color: var(--nv-muted);
    border-radius: 7px; padding: 4px 10px; font-size: .74rem; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.nv-mini:hover { border-color: var(--nv-blue); color: var(--nv-text); }
.nv-mini-danger:hover { border-color: var(--nv-red); color: var(--nv-red-lift); }
.nv-mini.done { border-color: #25D366; color: #25D366; }
.nv-danger:hover { border-color: var(--nv-red); color: var(--nv-red-lift); }

/* ── tables ─────────────────────────────────────────────────────────── */

.nv-table-wrap {
    background: var(--nv-raised); border: 1px solid var(--nv-line);
    border-radius: var(--nv-radius); overflow-x: auto;
}
.nv-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.nv-table th {
    text-align: left; padding: 13px 18px; font-size: .7rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--nv-muted);
    border-bottom: 1px solid var(--nv-line); white-space: nowrap;
}
.nv-table td { padding: 14px 18px; border-bottom: 1px solid var(--nv-line); color: var(--nv-body); }
.nv-table tr:last-child td { border-bottom: none; }
.nv-table .right { text-align: right; }
.nv-table code { font-family: var(--font-mono); font-size: .86rem; color: var(--nv-cyan); }
.nv-muted { color: var(--nv-muted); }

.nv-chip {
    display: inline-block; font-size: .74rem; font-weight: 700; white-space: nowrap;
    border-radius: 999px; padding: 4px 11px;
    background: var(--nv-surface); border: 1px solid var(--nv-line-2); color: var(--nv-muted);
}
.nv-chip.nv-tone-ok   { border-color: rgba(37,211,102,.4);  color: #7FE0A6; background: rgba(37,211,102,.1); }
.nv-chip.nv-tone-soon { border-color: rgba(245,166,35,.4);  color: #F7C46C; background: rgba(245,166,35,.1); }
.nv-chip.nv-tone-warn { border-color: rgba(255,58,85,.4);   color: #FF8DA0; background: rgba(255,0,36,.1); }
.nv-chip.nv-tone-mute { }

/* ── mail ───────────────────────────────────────────────────────────── */

.nv-mail-list {
    background: var(--nv-raised); border: 1px solid var(--nv-line);
    border-radius: var(--nv-radius); overflow: hidden;
}
.nv-mail {
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--nv-line); padding-right: 14px;
}
.nv-mail:last-child { border-bottom: none; }
.nv-mail:hover { background: rgba(255,255,255,.02); }

.nv-mail-main {
    flex: 1; min-width: 0; display: grid; align-items: baseline; gap: 2px 14px;
    grid-template-columns: 190px 1fr auto;
    padding: 14px 0 14px 18px; color: var(--nv-body);
}
.nv-mail-from {
    font-size: .89rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center; gap: 8px;
}
.nv-mail-subject {
    font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--nv-body);
}
.nv-mail-when { font-size: .78rem; color: var(--nv-muted); white-space: nowrap; }

/* Unread is carried by weight and a dot, not by colour alone — the difference
   has to survive a bright room and a colour-blind reader. */
.nv-mail.unread .nv-mail-from,
.nv-mail.unread .nv-mail-subject { color: var(--nv-text); font-weight: 600; }
.nv-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--nv-blue);
    flex-shrink: 0; display: inline-block;
}

.nv-mail-acts { display: flex; gap: 6px; flex-shrink: 0; }
.d-inline { display: inline; }

@media (max-width: 720px) {
    .nv-mail { flex-wrap: wrap; padding-bottom: 10px; }
    .nv-mail-main { grid-template-columns: 1fr auto; padding: 13px 0 6px 16px; }
    .nv-mail-subject { grid-column: 1 / -1; }
    .nv-mail-acts { padding-left: 16px; }
}

.nv-msg-subject { font-size: 1.3rem; margin: 0 0 12px; }
.nv-msg-meta {
    display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: .87rem; color: var(--nv-muted);
    padding-bottom: 18px; border-bottom: 1px solid var(--nv-line); margin-bottom: 20px;
}
.nv-msg-meta strong { color: var(--nv-text); }
.nv-msg-meta code { font-family: var(--font-mono); font-size: .82rem; }
.nv-msg-body {
    white-space: pre-wrap; word-break: break-word;
    font-size: .95rem; line-height: 1.7; color: var(--nv-body);
    max-height: 60vh; overflow-y: auto;
}
.nv-msg-acts {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--nv-line);
}

/* ── plan picker ────────────────────────────────────────────────────── */

.nv-plan-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; margin-bottom: 20px; }
.nv-pick {
    position: relative; display: flex; flex-direction: column; gap: 4px;
    padding: 16px 14px; cursor: pointer;
    background: var(--bg-3, #222226); border: 1px solid var(--nv-line-2);
    border-radius: var(--nv-radius-sm); transition: all .15s;
}
.nv-pick:hover { border-color: var(--nv-blue); }
.nv-pick input { position: absolute; opacity: 0; pointer-events: none; }
.nv-pick:has(input:checked) { border-color: var(--nv-blue); background: rgba(8,112,207,.14); }
.nv-pick:has(input:focus-visible) { outline: 3px solid var(--nv-blue); outline-offset: 2px; }
.nv-pick.current { opacity: .6; cursor: default; border-style: dashed; }
.nv-pick-n { font-size: .82rem; font-weight: 600; color: var(--nv-body); }
.nv-pick-p { font-size: 1.2rem; font-weight: 700; color: var(--nv-text); }
.nv-pick-p small { font-size: .74rem; font-weight: 500; color: var(--nv-muted); }
.nv-pick-tag { font-size: .72rem; font-weight: 700; color: var(--nv-muted); }
.nv-pick-tag.up   { color: #F7C46C; }
.nv-pick-tag.down { color: #7FE0A6; }

/* ── segmented control ──────────────────────────────────────────────── */

.nv-seg { display: inline-flex; background: var(--bg-3, #222226); border: 1px solid var(--nv-line-2);
          border-radius: 999px; padding: 3px; }
.nv-seg input { position: absolute; opacity: 0; pointer-events: none; }
.nv-seg label {
    padding: 8px 20px; border-radius: 999px; cursor: pointer; margin: 0;
    font-size: .87rem; font-weight: 600; color: var(--nv-muted); transition: all .15s;
}
.nv-seg input:checked + label { background: var(--nv-blue-deep); color: #fff; }
.nv-seg input:focus-visible + label { outline: 3px solid var(--nv-blue); outline-offset: 2px; }

/* ── referral ───────────────────────────────────────────────────────── */

.nv-refer { text-align: center; }
.nv-code {
    font-family: var(--font-mono); font-size: 2rem; font-weight: 700; letter-spacing: .16em;
    color: var(--nv-cyan); background: var(--nv-bg);
    border: 1px dashed var(--nv-line-2); border-radius: var(--nv-radius-sm);
    padding: 18px 12px; margin: 10px 0 14px; word-break: break-all;
}

/* ── print ──────────────────────────────────────────────────────────── */

@media print {
    .nv-tabs, .nv-float, .nv-signout, .nv-mail-acts, .nv-msg-acts { display: none !important; }
    .nv-table-wrap { border: none; }
}
