/* ============================================================
   REFINED UI v2 - NOTHING EDITION
   Dot-matrix display type (Doto), pure monochrome surfaces,
   signature red #D71921 used sparingly, sharp edges, dotted
   hairlines, glyph details. Loads LAST on every page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Doto:wght@400;600;700;800;900&display=swap');

:root {
    --r-font-display: "Doto", "Space Grotesk", sans-serif;
    --r-font-body: "Space Grotesk", "Segoe UI", sans-serif;
    --r-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    /* dark theme - pure monochrome */
    --r-bg: #000000;
    --r-panel: #0a0a0a;
    --r-panel-raised: #111111;
    --r-panel-inset: rgba(255, 255, 255, 0.04);
    --r-line: #222222;
    --r-line-strong: #3a3a3a;
    --r-text: #f4f4f4;
    --r-text-2: #b8b8b8;
    --r-text-3: #7a7a7a;

    --r-accent: #d71921;
    --r-accent-deep: #a31016;
    --r-accent-wash: rgba(215, 25, 33, 0.1);
    --r-ok: #e8e8e8;
    --r-warn: #d71921;
    --r-bad: #d71921;
    --r-radius: 2px;

    /* re-point legacy brand tokens at the Nothing palette */
    --primary: #d71921;
    --primary-dark: #a31016;
    --primary-light: #ff4a52;
}

body.light-theme {
    --r-bg: #ffffff;
    --r-panel: #ffffff;
    --r-panel-raised: #fafafa;
    --r-panel-inset: rgba(0, 0, 0, 0.03);
    --r-line: #e4e4e4;
    --r-line-strong: #c9c9c9;
    --r-text: #0d0d0d;
    --r-text-2: #4a4a4a;
    --r-text-3: #8a8a8a;
    --r-accent-wash: rgba(215, 25, 33, 0.07);
}

/* ------------------------------------------------------------
   Foundations
   ------------------------------------------------------------ */

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-family: var(--r-font-body);
}

/* dot-grid backdrop, Nothing packaging style */
body:not(.nothing-home) {
    background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 22px 22px;
}

body.light-theme:not(.nothing-home) {
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

body::selection,
body *::selection {
    background: #d71921;
    color: #ffffff;
}

:focus-visible {
    outline: 2px solid var(--r-accent);
    outline-offset: 2px;
    border-radius: 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--r-line-strong);
    border-radius: 0;
    border: 3px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--r-accent); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* glyph LED strip - a row of dots, a few lit red */
.r-glyphs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.r-glyphs i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--r-line-strong);
}

.r-glyphs i.lit {
    background: var(--r-accent);
    animation: r-glyph-pulse 2.4s ease-in-out infinite;
}

.r-glyphs i:nth-child(3).lit { animation-delay: 0.3s; }
.r-glyphs i:nth-child(5).lit { animation-delay: 0.6s; }

@keyframes r-glyph-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* scrolling ticker */
.r-ticker {
    overflow: hidden;
    border-top: 1px solid var(--r-line);
    border-bottom: 1px solid var(--r-line);
    background: var(--r-panel);
}

.r-ticker-track {
    display: inline-flex;
    gap: 3rem;
    white-space: nowrap;
    padding: 0.55rem 0;
    animation: r-ticker-scroll 30s linear infinite;
    font-family: var(--r-font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--r-text-3);
}

.r-ticker-track b {
    color: var(--r-accent);
    font-weight: 500;
}

@keyframes r-ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ------------------------------------------------------------
   Dashboard shell
   ------------------------------------------------------------ */

body:not(.nothing-home) .dashboard-main {
    /* match style.css layout width (1560px) - a 1280px cap left large
       dead space on wide screens */
    max-width: min(1560px, 100%);
}

/* ------------------------------------------------------------
   Cards - flat monochrome panels, sharp corners, crosshairs
   ------------------------------------------------------------ */

body:not(.nothing-home) .glass-card,
body:not(.nothing-home) .dashboard-section,
body:not(.nothing-home) .widget {
    background: var(--r-panel);
    border: 1px solid var(--r-line);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: var(--r-radius);
    transition: border-color 160ms ease, transform 160ms ease;
}

body:not(.nothing-home) .glass-card:hover,
body:not(.nothing-home) .dashboard-section:hover {
    border-color: var(--r-line-strong);
}

body:not(.nothing-home) .hover-lift:hover {
    transform: translateY(-2px);
}

/* crosshair marks on section corners */
body:not(.nothing-home) .dashboard-section {
    position: relative;
}

body:not(.nothing-home) .dashboard-section::before,
body:not(.nothing-home) .dashboard-section::after {
    content: "+";
    position: absolute;
    font-family: var(--r-font-mono);
    font-size: 0.7rem;
    line-height: 1;
    color: var(--r-line-strong);
    pointer-events: none;
}

body:not(.nothing-home) .dashboard-section::before { top: 6px; right: 8px; }
body:not(.nothing-home) .dashboard-section::after { bottom: 4px; left: 8px; }

/* ------------------------------------------------------------
   Page header - dot-matrix masthead
   ------------------------------------------------------------ */

body:not(.nothing-home) .page-hero {
    background: var(--r-panel);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    position: relative;
    overflow: hidden;
    padding: clamp(1.25rem, 3vw, 1.75rem);
}

body:not(.nothing-home) .page-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--r-accent);
}

body:not(.nothing-home) .page-title {
    font-family: var(--r-font-display);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.05;
    text-transform: uppercase;
}

body:not(.nothing-home) .page-subtitle {
    color: var(--r-text-3);
    font-family: var(--r-font-mono);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

body:not(.nothing-home) .page-eyebrow {
    font-family: var(--r-font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--r-accent);
    margin-bottom: 0.6rem;
}

/* section headers - dotted rule + dot-matrix title */

body:not(.nothing-home) .section-header-formal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px dotted var(--r-line-strong);
}

body:not(.nothing-home) .section-title-formal {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    font-family: var(--r-font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--r-text);
}

.title-icon,
.quick-link-icon,
.stat-icon-large {
    filter: grayscale(1);
    opacity: 0.5;
}

body:not(.nothing-home) .title-icon { font-size: 0.9em; }

body:not(.nothing-home) .section-badge {
    font-family: var(--r-font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--r-text-3);
    background: transparent;
    border: 1px dotted var(--r-line-strong);
    border-radius: 0;
    padding: 0.28rem 0.6rem;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   Stat blocks - dot-matrix figures, red tick
   ------------------------------------------------------------ */

body:not(.nothing-home) .stat-box {
    position: relative;
    overflow: hidden;
    background: var(--r-panel);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    padding: 1.1rem 1.15rem 1rem;
    transition: border-color 160ms ease, transform 160ms ease;
}

body:not(.nothing-home) .stat-box::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--r-line);
    transition: background 160ms ease;
}

body:not(.nothing-home) .stat-box.success::before { background: var(--r-ok); }
body:not(.nothing-home) .stat-box.info::before    { background: var(--r-accent); }
body:not(.nothing-home) .stat-box.warning::before { background: var(--r-warn); }

body:not(.nothing-home) .stat-box:hover {
    transform: translateY(-2px);
    border-color: var(--r-line-strong);
}

body:not(.nothing-home) .stat-number {
    font-family: var(--r-font-display);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--r-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

body:not(.nothing-home) .stat-icon-large {
    position: absolute;
    top: 0.9rem;
    right: 0.95rem;
    font-size: 1.1rem;
}

body:not(.nothing-home) .stat-text {
    margin-top: 0.5rem;
    font-family: var(--r-font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--r-text-2);
}

body:not(.nothing-home) .stat-subtext {
    margin-top: 0.2rem;
    font-size: 0.76rem;
    color: var(--r-text-3);
}

/* ------------------------------------------------------------
   Today strip - status bar
   ------------------------------------------------------------ */

body:not(.nothing-home) .today-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: var(--r-panel);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    overflow: hidden;
}

body:not(.nothing-home) .today-cell {
    position: relative;
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

body:not(.nothing-home) .today-cell + .today-cell::before {
    content: "";
    position: absolute;
    left: 0; top: 14%;
    height: 72%;
    width: 1px;
    background: var(--r-line);
}

body:not(.nothing-home) .today-label {
    font-family: var(--r-font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--r-text-3);
}

body:not(.nothing-home) .today-label::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--r-accent);
    margin-right: 0.45rem;
    vertical-align: 1px;
}

body:not(.nothing-home) .today-value {
    font-family: var(--r-font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--r-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.nothing-home) .today-sub {
    font-size: 0.74rem;
    color: var(--r-text-3);
}

/* ------------------------------------------------------------
   Quick links - index cards
   ------------------------------------------------------------ */

body:not(.nothing-home) .quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 0.65rem;
}

body:not(.nothing-home) .quick-link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--r-panel-inset);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    padding: 0.75rem 0.85rem;
    text-decoration: none;
    transition: border-color 140ms ease, background 140ms ease;
}

body:not(.nothing-home) .quick-link-card:hover {
    border-color: var(--r-accent);
    background: var(--r-accent-wash);
}

body:not(.nothing-home) .quick-link-card h4 {
    font-family: var(--r-font-body);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--r-text);
}

body:not(.nothing-home) .quick-link-card p {
    font-size: 0.72rem;
    color: var(--r-text-3);
    margin-top: 0.1rem;
    line-height: 1.35;
}

body:not(.nothing-home) .quick-link-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    background: var(--r-panel);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
}

body:not(.nothing-home) .quick-link-card:hover .quick-link-icon {
    border-color: var(--r-accent);
}

/* ------------------------------------------------------------
   Buttons - rectangular, uppercase mono, invert on hover
   ------------------------------------------------------------ */

body:not(.nothing-home) .btn,
.nothing-home .btn {
    font-family: var(--r-font-mono);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: var(--r-radius);
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

body:not(.nothing-home) .btn-primary,
.nothing-home .btn-primary {
    background: var(--r-accent);
    border: 1px solid var(--r-accent);
    color: #ffffff;
    box-shadow: none;
}

body:not(.nothing-home) .btn-primary:hover,
.nothing-home .btn-primary:hover {
    background: var(--r-accent-deep);
    border-color: var(--r-accent-deep);
}

body:not(.nothing-home) .btn-outline,
.nothing-home .btn-outline {
    background: transparent;
    border: 1px solid var(--r-line-strong);
    color: var(--r-text);
    box-shadow: none;
}

body:not(.nothing-home) .btn-outline:hover,
.nothing-home .btn-outline:hover {
    border-color: var(--r-text);
    background: transparent;
}

body:not(.nothing-home) .btn:active { transform: translateY(1px); }
body:not(.nothing-home) .btn:hover  { transform: none; }

/* ------------------------------------------------------------
   Forms - sharp, dotted focus
   ------------------------------------------------------------ */

body:not(.nothing-home) input[type="text"],
body:not(.nothing-home) input[type="email"],
body:not(.nothing-home) input[type="password"],
body:not(.nothing-home) input[type="number"],
body:not(.nothing-home) input[type="date"],
body:not(.nothing-home) input[type="time"],
body:not(.nothing-home) input[type="search"],
body:not(.nothing-home) select,
body:not(.nothing-home) textarea,
.form-control {
    background: var(--r-panel-inset);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    color: var(--r-text);
    transition: border-color 140ms ease;
}

body:not(.nothing-home) input:focus,
body:not(.nothing-home) select:focus,
body:not(.nothing-home) textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--r-accent);
    box-shadow: none;
}

body:not(.nothing-home) label,
.form-label {
    font-family: var(--r-font-mono);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--r-text-3);
}

/* ------------------------------------------------------------
   Tables - dotted rows, mono heads
   ------------------------------------------------------------ */

body:not(.nothing-home) table th {
    font-family: var(--r-font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--r-text-3);
    border-bottom: 1px solid var(--r-line-strong);
    white-space: nowrap;
}

body:not(.nothing-home) table td {
    border-bottom: 1px dotted var(--r-line);
    color: var(--r-text-2);
}

body:not(.nothing-home) table tbody tr {
    transition: background 120ms ease;
}

body:not(.nothing-home) table tbody tr:hover {
    background: var(--r-panel-inset);
}

/* ------------------------------------------------------------
   Status pills - squared, mono
   ------------------------------------------------------------ */

.status-badge,
.badge {
    font-family: var(--r-font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 0;
    padding: 0.26rem 0.55rem;
    border: 1px solid transparent;
}

.status-good   { background: rgba(255,255,255,0.06); color: var(--r-ok);   border-color: var(--r-line-strong); }
.status-warning{ background: var(--r-accent-wash);   color: var(--r-warn); border-color: rgba(215,25,33,0.4); }
.status-danger { background: var(--r-accent);        color: #fff;          border-color: var(--r-accent); }

body.light-theme .status-good { background: rgba(0,0,0,0.05); color: #0d0d0d; }

/* ------------------------------------------------------------
   Sidebar - flat, mono labels, red tick on active
   ------------------------------------------------------------ */

body .universal-sidebar {
    background: #050505;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid var(--r-line);
}

body.light-theme .universal-sidebar {
    background: #ffffff;
}

body .sidebar-title {
    font-family: var(--r-font-display);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

body .sidebar-subtitle {
    font-family: var(--r-font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body .nav-link-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0;
    background: var(--r-accent);
}

/* ------------------------------------------------------------
   Empty states, loading, theme toggle
   ------------------------------------------------------------ */

.empty-state-label {
    font-family: var(--r-font-mono);
    font-size: 0.64rem !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--r-text-3);
}

.empty-state-hint {
    color: var(--r-text-3);
    font-size: 0.8rem;
}

.loading-text {
    font-family: var(--r-font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    color: var(--r-text-3);
}

.loading-text::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--r-accent);
    margin-right: 0.5rem;
    animation: r-glyph-pulse 1.2s ease-in-out infinite;
}

body:not(.nothing-home) .theme-toggle {
    background: var(--r-panel);
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    box-shadow: none;
}

body:not(.nothing-home) .theme-toggle:hover {
    border-color: var(--r-accent);
}

/* ------------------------------------------------------------
   LANDING PAGE - Nothing edition (scoped to .nothing-home)
   ------------------------------------------------------------ */

/* re-point the landing palette at Nothing red */
body.nothing-home {
    --home-accent: #d71921;
    --home-accent-soft: rgba(215, 25, 33, 0.16);
}

/* dot-grid over the landing backdrop */
body.nothing-home::before {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    mask-image: none;
    opacity: 0.5;
}

body.nothing-home.light-theme::before {
    background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
}

/* hero headline in dot-matrix */
.nothing-home .hero-title {
    font-family: var(--r-font-display);
    font-weight: 800;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    line-height: 1.02;
}

.nothing-home .micro-label {
    font-family: var(--r-font-mono);
    letter-spacing: 0.22em;
}

.nothing-home .micro-label::before {
    content: "+ ";
    color: var(--home-accent);
}

/* metric values in dot-matrix with red tick */
.nothing-home .metric-card {
    position: relative;
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease;
    border-radius: 0;
}

.nothing-home .metric-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 34px;
    height: 2px;
    background: var(--home-accent);
}

.nothing-home .metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--home-border-strong);
}

.nothing-home .metric-value {
    font-family: var(--r-font-display);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.nothing-home .feature-card,
.nothing-home .principle-card,
.nothing-home .program-card {
    border-radius: 0;
    transition: transform 180ms ease, border-color 180ms ease;
}

.nothing-home .feature-card:hover,
.nothing-home .principle-card:hover {
    border-color: var(--home-accent);
    transform: translateY(-2px);
}

.nothing-home .program-card:hover {
    transform: translateY(-3px);
    border-color: var(--home-accent);
}

.nothing-home .program-index {
    font-family: var(--r-font-display);
    font-weight: 700;
    color: var(--r-text-3);
}

/* route rows - terminal links */
.nothing-home .route-item {
    transition: background 140ms ease, border-color 140ms ease, padding-left 140ms ease;
}

.nothing-home .route-item:hover {
    padding-left: 1rem;
    border-color: var(--home-accent);
}

.nothing-home .shortcut-item {
    transition: background 140ms ease, border-color 140ms ease;
}

.nothing-home .shortcut-item:hover {
    border-color: var(--home-accent);
    background: var(--home-accent-soft);
}

/* nav underline draws from the left in red */
.nothing-home .nav-link {
    position: relative;
}

.nothing-home .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 1px;
    width: 100%;
    background: var(--home-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.nothing-home .nav-link:hover::after {
    transform: scaleX(1);
}

.nothing-home .nav-logo .logo-text {
    font-family: var(--r-font-display);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nothing-home footer a {
    transition: color 140ms ease;
}

/* ------------------------------------------------------------
   Auth pages
   ------------------------------------------------------------ */

.public-auth-page .btn-primary {
    box-shadow: none;
}

/* ------------------------------------------------------------
   Radius normalization - Nothing is sharp; beat legacy
   high-specificity radius rules from style.css layering
   ------------------------------------------------------------ */

body:not(.nothing-home) .dashboard-main .page-hero,
body:not(.nothing-home) .dashboard-main .dashboard-section,
body:not(.nothing-home) .dashboard-main .glass-card,
body:not(.nothing-home) .dashboard-main .stat-box,
body:not(.nothing-home) .dashboard-main .today-strip,
body:not(.nothing-home) .dashboard-main .widget,
body:not(.nothing-home) .dashboard-main .quick-link-card,
body:not(.nothing-home) .dashboard-main .btn,
body:not(.nothing-home) .dashboard-main table,
body:not(.nothing-home) .dashboard-main input,
body:not(.nothing-home) .dashboard-main select,
body:not(.nothing-home) .dashboard-main textarea,
body:not(.nothing-home) .page-hero,
body:not(.nothing-home) .dashboard-section,
body:not(.nothing-home) .stat-box,
body:not(.nothing-home) .today-strip,
body:not(.nothing-home) .glass-card {
    border-radius: var(--r-radius) !important;
}

body:not(.nothing-home) .universal-sidebar .sidebar-logo,
body:not(.nothing-home) .theme-toggle {
    border-radius: var(--r-radius) !important;
}

/* chatbot widget - square, no shadow, on every page */
.chatbot-toggle {
    border-radius: var(--r-radius) !important;
    box-shadow: none !important;
}

.chatbot-container {
    border-radius: var(--r-radius) !important;
    box-shadow: none !important;
    border: 1px solid var(--r-line, #1f1f1f) !important;
}

.chatbot-header {
    border-radius: var(--r-radius) var(--r-radius) 0 0 !important;
}

/* theme toggle squared on nothing-home pages too */
.nothing-home .theme-toggle {
    border-radius: var(--r-radius) !important;
    box-shadow: none !important;
}

/* password toggles and utility buttons */
.password-toggle-btn {
    border-radius: var(--r-radius) !important;
}

/* extended normalization - catches legacy radius rules in any stylesheet */
body:not(.nothing-home) .stat-card,
body:not(.nothing-home) .badge,
body:not(.nothing-home) .btn-icon,
body:not(.nothing-home) .btn-icon-sm,
body:not(.nothing-home) .progress-bar,
body:not(.nothing-home) .progress-fill,
body:not(.nothing-home) .progress-bar-fill,
body:not(.nothing-home) .chart-card,
body:not(.nothing-home) .priority-badge,
body:not(.nothing-home) .grade-badge,
body:not(.nothing-home) .form-group textarea,
body:not(.nothing-home) .id-card,
body:not(.nothing-home) .dashboard-nav,
body:not(.nothing-home) .chatbot-container,
body:not(.nothing-home) .chatbot-header,
body:not(.nothing-home) .legend-box,
body:not(.nothing-home) .heatmap-day,
body:not(.nothing-home) .empty-state,
body:not(.nothing-home) .modal-content,
body:not(.nothing-home) .modal-body,
body:not(.nothing-home) .data-table,
body:not(.nothing-home) .modern-table {
    border-radius: var(--r-radius) !important;
}

/* ponytail: ~150 long-tail radius values remain in legacy css on obscure/dead
   selectors (skeleton placeholders, inert orbs, orphaned rules). They are
   either overridden by the normalizers above or never render. Full purge =
   rewriting every legacy stylesheet, tracked as tech debt. */

/* ------------------------------------------------------------
   Small-screen safety
   ------------------------------------------------------------ */

@media (max-width: 720px) {
    body:not(.nothing-home) .today-strip {
        grid-template-columns: 1fr;
    }

    body:not(.nothing-home) .today-cell + .today-cell::before {
        display: none;
    }

    body:not(.nothing-home) .today-cell + .today-cell {
        border-top: 1px solid var(--r-line);
    }

    body:not(.nothing-home) .section-badge {
        display: none;
    }
}




/* Skip link - visually hidden until keyboard focus */
/* === dashboard consistency pass === */
/* Scope: /dashboard/*.html pages. Append-only block from the dashboard-wide
   visual consistency + readability sweep. Do not reorder above rules. */

/* 1) Header hierarchy parity - every dashboard h1/page-title area shares the
      same spacing rhythm, even on pages that predate .page-hero markup. */
body:not(.nothing-home) .dashboard-main h1.page-title,
body:not(.nothing-home) .dashboard-main .page-title {
    margin: 0;
}
body:not(.nothing-home) .dashboard-main .ai-header h1,
body:not(.nothing-home) .dashboard-main .soa-title {
    margin: 0;
}

/* 2) Contrast/readability floor.
   Light theme: secondary text was hardcoded #757575 (~4.6:1, borderline at
   small mono sizes). Raise to the token value used elsewhere. */
body.light-theme:not(.nothing-home) .dashboard-main p,
body.light-theme:not(.nothing-home) .dashboard-main li,
body.light-theme:not(.nothing-home) .dashboard-main td,
body.light-theme:not(.nothing-home) .dashboard-main th,
body.light-theme:not(.nothing-home) .dashboard-main .modern-table th,
body.light-theme:not(.nothing-home) .dashboard-main .data-table th,
body.light-theme:not(.nothing-home) .dashboard-main small,
body.light-theme:not(.nothing-home) .dashboard-main .text-muted,
body.light-theme:not(.nothing-home) .dashboard-main .ai-status-label,
body.light-theme:not(.nothing-home) .dashboard-main .ai-recommendation-item,
body.light-theme:not(.nothing-home) .dashboard-main .quick-link-content p {
    color: var(--r-text-2);
}
/* Dark theme: same elements must never fall below --r-text-2 on panels. */
body:not(.nothing-home):not(.light-theme) .dashboard-main p,
body:not(.nothing-home):not(.light-theme) .dashboard-main li,
body:not(.nothing-home):not(.light-theme) .dashboard-main td {
    color: var(--r-text-2);
}
/* Decorative micro-labels stay at --r-text-3 but keep a legible size. */
body:not(.nothing-home) .dashboard-main .page-subtitle,
body:not(.nothing-home) .dashboard-main .section-label,
body:not(.nothing-home) .dashboard-main .micro-label {
    font-size: 0.75rem;
}

/* 3) Invisible/broken element guards.
   Charts and async regions never collapse to zero height while loading. */
body:not(.nothing-home) .dashboard-main .chart-wrapper,
body:not(.nothing-home) .dashboard-main canvas {
    min-height: 220px;
}
body:not(.nothing-home) .dashboard-main .glass-card:empty,
body:not(.nothing-home) .dashboard-main .stat-box:empty,
body:not(.nothing-home) .dashboard-main .widget:empty {
    min-height: 0;
    display: none;
}

/* 4) Async region fallback label - shared mono style for LOADING / EMPTY /
   ERROR states so no container ever renders fully blank. */
body:not(.nothing-home) .dashboard-main [data-state]:empty::after {
    content: attr(data-state);
    display: block;
    padding: 2rem 0;
    font-family: var(--r-font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--r-text-3);
}

/* 5) Buttons: uniform height/radius; disabled state visibly off but readable. */
body:not(.nothing-home) .dashboard-main .btn {
    min-height: 40px;
    border-radius: var(--r-radius);
}
body:not(.nothing-home) .dashboard-main .btn:disabled,
body:not(.nothing-home) .dashboard-main button:disabled,
body:not(.nothing-home) .dashboard-main .btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
body:not(.nothing-home) .dashboard-main .btn:disabled:hover {
    transform: none;
}

/* 6) Tables: horizontal scroll containment + consistent header/row styling
   regardless of which wrapper class a page uses. */
body:not(.nothing-home) .dashboard-main .table-wrap,
body:not(.nothing-home) .dashboard-main .table-container,
body:not(.nothing-home) .dashboard-main .table-responsive,
body:not(.nothing-home) .dashboard-main .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
body:not(.nothing-home) .dashboard-main table th {
    font-family: var(--r-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}
body:not(.nothing-home) .dashboard-main table tbody tr:nth-child(even) {
    background: var(--r-panel-inset);
}

/* 7) Notification bell badge (injected by notification-center.js) keeps a
   readable size/contrast in both themes inside dashboards. */
body:not(.nothing-home) .notification-bell .notification-badge {
    min-width: 16px;
    height: 16px;
    font-family: var(--r-font-mono);
    font-size: 0.6rem;
    line-height: 16px;
    color: var(--r-text);
}

/* 8) Spacing rhythm: normalize section/card gap outliers to the shared scale
   (multiples of the existing card gap). */
body:not(.nothing-home) .dashboard-main .dashboard-section + .dashboard-section {
    margin-top: 1.5rem;
}
