/**
 * theme.css — Teegnas One global design tokens.
 * Linked by header.php so every page gets these automatically.
 * Pages must NOT redefine :root variables — override here instead.
 */

:root {
    /* ── Backgrounds ── */
    --bg-primary:   #0f172a;
    --bg-secondary: #1e293b;
    --bg-card:      #1e293b;
    --bg-card-alt:  #283548;

    /* Aliases used by older pages (map to canonical names) */
    --bg:           #0f172a;
    --bg2:          #1e293b;
    --bg3:          #1a2236;
    --bg4:          #232f47;
    --card:         #1e293b;
    --card2:        #0f172a;
    --surface:      #1e293b;   /* network_report.php alias */

    /* ── Text ── */
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --link:           #7dd3fc;   /* links: readable on every dark surface (8.8:1 on cards) */
    --link-hover:     #bae6fd;
    /* ── Type: one UI font for all text; monospace only for addresses, MACs, IDs and code ── */
    --font-ui:   'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace;
    --fs-xs: 12px;   /* labels, table headers, hints: never smaller */
    --fs-sm: 13px;   /* table cells, secondary text */
    --fs-md: 14px;   /* body text */
    --fs-lg: 16px;   /* card and page titles */
    --fs-xl: 17px;   /* big numbers */
    --fs-2xl: 20px;  /* the one key number on a card */
    --fw-normal: 400; --fw-medium: 500; --fw-semi: 600; --fw-key: 600;   /* numbers stay semi-bold, never heavy */
    --text-dim:       #8a9ab0;   /* 5.1:1 on cards (WCAG AA); was #64748b, 3.1:1 */

    /* Aliases */
    --text:  #f1f5f9;
    --text2: #94a3b8;
    --text3: #8494ab;   /* 4.7:1 on cards; was #4b5e7a */
    --dim:   #94a3b8;
    --dimmer:#64748b;
    --muted: #64748b;   /* network_report.php alias → --dimmer */
    --tx:    #f1f5f9;   /* sitemap.php alias → --text */
    --tx2:   #94a3b8;   /* sitemap.php alias → --text2 */
    --tx3:   #4b5e7a;   /* sitemap.php alias → --text3 */

    /* ── Accent colours ── */
    --accent-blue:   #3b82f6;
    --accent-green:  #10b981;
    --accent-yellow: #f59e0b;
    --accent-red:    #ef4444;
    --accent-purple: #8b5cf6;
    --accent-cyan:   #06b6d4;
    --accent-teal:   #14b8a6;
    --accent-pink:   #ec4899;

    /* Aliases */
    --accent: #3b82f6;   /* network_report.php alias → --blue */
    --blue:   #3b82f6;
    --green:  #10b981;
    --yellow: #f59e0b;
    --red:    #ef4444;
    --purple: #8b5cf6;
    --cyan:   #06b6d4;
    --teal:   #14b8a6;
    --pink:   #ec4899;
    --amber:  #f59e0b;
    --orange: #f97316;

    /* Success/warning/danger semantic */
    --color-ok:      #10b981;
    --color-warn:    #f59e0b;
    --color-danger:  #ef4444;
    --color-info:    #3b82f6;

    /* ── Borders & surfaces ── */
    --border:        #334155;
    --border2:       #243244;
    --glass:         rgba(17,24,39,.72);
    --glass-border:  rgba(99,130,190,.12);

    /* ── Shape & motion ── */
    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --nav-h:     72px;
    --safe-b:    env(safe-area-inset-bottom, 0px);
    --transition: 0.2s ease;
    --shadow:    0 6px 20px rgba(0,0,0,.3);

    /* ── Surfaces and lines that pages used to hard-code (night values = the old literals) ── */
    --header-bg:     rgba(4,10,20,.95);
    --header-line:   rgba(59,130,246,.15);
    --tint-1:        rgba(255,255,255,.025);  /* table head, row hover */
    --tint-2:        rgba(255,255,255,.05);   /* buttons, chips */
    --row-line:      rgba(255,255,255,.04);
    --overlay:       rgba(0,0,0,.65);         /* modal / drawer backdrop */
    --shadow-lg:     0 24px 64px rgba(0,0,0,.6);
    --focus:         #7dd3fc;
    --status-bad:    #f87171;                 /* red dot and red text on cards */
    --text-ok:       #34d399;
    --text-warn:     #fcd34d;
    --text-bad:      #f87171;
    --text-info:     #93c5fd;
    --chart-grid:    rgba(148,163,184,.12);
    --chart-axis:    #94a3b8;
    --chart-1: #38bdf8; --chart-2: #34d399; --chart-3: #fbbf24; --chart-4: #f87171; --chart-5: #2dd4bf; --chart-6: #fb923c;
    --map-filter:    none;
    --text-strong:   #e2e8f0;
    --text-soft:     #cbd5e1;
    --text-blue:     #60a5fa;
    --text-amber:    #fbbf24;
    --bg-deep:       #0b1424;
    --bg-deeper:     #060d1a;
    --text-mint:     #dcfaf4;
    --text-sage:     #7ca8a0;
    --text-violet:   #a78bfa;
    --text-aqua:     #2de6b7;
    --brand-cyan:    #00d4ff;
    --panel-rgb:     10,18,40;
    --wash-rgb:      255,255,255;   /* light tints laid over dark cards */
    --ink-rgb:       4,10,20;       /* dark glass panels */
    --shade-rgb:     0,0,0;         /* shadows and backdrops */
    color-scheme: dark;
}


/* ── Shared base reset ── */
*, *::before, *::after { box-sizing: border-box; }

/* Form controls take the platform font (browsers give them their own) */
button, input, select, textarea, optgroup { font-family: inherit; }

body {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;   /* numbers line up in every table and card */
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ── Shared card component ── */
.t-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.t-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow);
}
.t-card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-secondary);
}

/* ── Shared modal ── */
.t-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.t-modal-backdrop.open { display: flex; }
.t-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: min(520px, 94vw);
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.t-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
}
.t-modal-title { font-size: 15px; font-weight: 700; }
.t-modal-close {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: var(--tint-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer; color: var(--text-secondary);
    font-size: 16px; line-height: 1;
    transition: all var(--transition);
}
.t-modal-close:hover { background: var(--tint-2); border-color: var(--accent-red); color: var(--text-bad); }
.t-modal-close:focus-visible, .t-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.t-modal-body { padding: 20px 22px; }
.t-modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Shared badge / pill ── */
.t-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 12px; font-weight: 400; letter-spacing: normal; text-transform: none;
    font-family: var(--font-mono);
}
.t-badge-green  { color: var(--text-ok); border: 1px solid rgba(16,185,129,.25); }
.t-badge-blue   { color: var(--text-info); border: 1px solid rgba(59,130,246,.25); }
.t-badge-yellow { color: var(--text-warn); border: 1px solid rgba(245,158,11,.25); }
.t-badge-red    { color: var(--text-bad); border: 1px solid rgba(239,68,68,.25); }
.t-badge-purple { color: #c4b5fd; border: 1px solid rgba(139,92,246,.25); }
.t-badge-cyan   { color: #67e8f9; border: 1px solid rgba(6,182,212,.25); }
.t-badge-gray   { color: var(--text-secondary); border: 1px solid rgba(100,116,139,.25); }

/* ── Shared button ── */
.t-btn {
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 700; letter-spacing: .04em;
    cursor: pointer; border: 1px solid transparent;
    transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.t-btn-primary  { background: var(--accent-blue);  color: #fff; border-color: var(--accent-blue); }
.t-btn-primary:hover  { background: #2563eb; box-shadow: 0 4px 14px rgba(59,130,246,.4); }
.t-btn-danger   { background: var(--accent-red);   color: #fff; border-color: var(--accent-red); }
.t-btn-danger:hover   { background: #dc2626; box-shadow: 0 4px 14px rgba(239,68,68,.4); }
.t-btn-ghost    { background: var(--tint-1); color: var(--text-secondary); border-color: var(--border); }
.t-btn-ghost:hover    { background: rgba(59,130,246,.1); border-color: var(--accent-blue); color: var(--text-info); }

/* ── Shared table ── */
.t-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.t-table th {
    padding: 10px 14px; text-align: left;
    font-size: 12px; font-weight: 700; letter-spacing: normal; text-transform: none;
    color: var(--text-secondary); background: var(--tint-1);
    border-bottom: 1px solid var(--border);
}
.t-table td { padding: 10px 14px; border-bottom: 1px solid var(--row-line); }
.t-table tr:last-child td { border-bottom: none; }
.t-table tr:hover td { background: var(--tint-1); }

/* ── Mobile topbar pad ── */
.mobile-topbar-pad { height: 60px; }

/* scrollbar.css — one scrollbar look for every Teegnas One page (loaded by header.php and standalone pages). */
:root{--sb-thumb:rgba(148,163,184,.28);--sb-thumb-hover:rgba(148,163,184,.5);--sb-track:transparent}
*{scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track)}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:var(--sb-track)}
::-webkit-scrollbar-thumb{background:var(--sb-thumb);border-radius:8px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-thumb:hover{background:var(--sb-thumb-hover);background-clip:padding-box;border:2px solid transparent}
::-webkit-scrollbar-corner{background:transparent}
::-webkit-scrollbar-button{display:none;width:0;height:0}

/* ── Links: never the browser's default blue / visited purple. :where() keeps this at zero
   specificity, so buttons, menu items and tags styled with a class keep their own colours. ── */
:where(a), :where(a):visited { color: var(--link); }
:where(a):hover, :where(a):active { color: var(--link-hover); }
:where(a:not([class])):hover { text-decoration: underline; }
:where(a):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

/* ── Theme switch in the header (sun / moon / auto), calm: icon only, no fill ── */
.tg-theme-btn{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:none;border:1px solid var(--border);border-radius:8px;cursor:pointer;color:var(--text-secondary);flex-shrink:0}
.tg-theme-btn:hover{color:var(--text-primary);border-color:var(--text-dim)}
.tg-theme-btn:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.tg-theme-btn svg{width:16px;height:16px}

/* ── Plain status: normal-weight text and a small coloured dot (or a thin outline). No filled or bold
   badge pills, no tinted verdict boxes, no all-caps labels. Bold only for the one key number on a card.
     <span class="status-line"><i class="status-dot ok"></i>Traffic box in service · 1.66 Gb/s</span>
     <span class="status-outline warn">2 to check</span>                                          ── */
.status-line{display:inline-flex;align-items:center;gap:6px;font-weight:400;color:var(--text-secondary);text-transform:none;letter-spacing:normal}
.status-dot{display:inline-block;flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:var(--text-dim)}
.status-dot.ok{background:var(--accent-green)}.status-dot.warn{background:var(--accent-yellow)}.status-dot.bad{background:var(--status-bad)}.status-dot.info{background:var(--link)}
.status-outline{display:inline-flex;align-items:center;gap:6px;padding:1px 8px;border:1px solid var(--border,rgba(148,163,184,.25));border-radius:99px;background:none;font-weight:400;color:var(--text-secondary);text-transform:none;letter-spacing:normal}
.status-outline.ok{border-color:rgba(16,185,129,.45)}.status-outline.warn{border-color:rgba(245,158,11,.5)}.status-outline.bad{border-color:rgba(248,113,113,.55)}
.status-key{font-weight:700;color:var(--text)}   /* the one key number on a card */

/* ── Type helpers (sentence case, no letter-spacing, readable grey) ──
     <span class="t-label">Ports up</span>  <b class="t-key">164,061</b>  <span class="t-mono">172.17.20.15</span> */
.t-label{font-family:var(--font-ui);font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text-secondary);text-transform:none;letter-spacing:normal}
.t-num{font-variant-numeric:tabular-nums}
.t-mono{font-family:var(--font-mono);font-size:inherit;letter-spacing:normal}
.t-key{font-size:var(--fs-2xl);font-weight:var(--fw-key);line-height:1.1;font-variant-numeric:tabular-nums}
