/* =====================================================================
   NetworkDB - Next.js / Vercel Geist Design System
   Exact Vercel / Shadcn UI CSS Tokens, Typography & Aesthetics
   Minimalist Monochrome Slate, Razor-Sharp Borders, Zero Cheesy Saturated Glows
   Full Dark & Light Mode Theme Support + Mobile Responsive Layouts
   ===================================================================== */

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

/* ---------------------------------------------------------------------
   Design Tokens: Dark Mode (Default Vercel Black)
   --------------------------------------------------------------------- */
:root, [data-theme="dark"], .dark {
    color-scheme: dark;

    --background: #000000;
    --background-subtle: #0a0a0a;
    --foreground: #ededed;
    --foreground-muted: #888888;
    --foreground-subtle: #666666;

    --card: #0a0a0a;
    --card-foreground: #ededed;
    --card-hover: #111111;

    --popover: #0c0c0c;
    --popover-foreground: #ededed;

    /* Vercel stark white primary button in dark mode */
    --primary: #ffffff;
    --primary-foreground: #000000;
    --primary-hover: #e5e5e5;

    /* Secondary / outline */
    --secondary: #141414;
    --secondary-foreground: #ededed;
    --secondary-hover: #1e1e1e;

    --muted: #141414;
    --muted-foreground: #888888;

    --accent: #171717;
    --accent-foreground: #ffffff;

    --border: #222222;
    --border-subtle: #1c1c1c;
    --border-strong: #333333;
    --border-hover: #444444;

    --input: #121212;
    --ring: #0070f3; /* Vercel Blue reserved for focus rings */

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Geist Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.825rem;
    --text-base: 0.925rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.625rem;
    --text-3xl: 2.25rem;
    --text-4xl: 3rem;

    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);

    /* Semantic accents */
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;

    --accent-cyan: #38bdf8;
    --accent-purple: #c084fc;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #f43f5e;

    --badge-green-bg: rgba(16, 185, 129, 0.1);
    --badge-green-border: rgba(16, 185, 129, 0.3);
    --badge-rose-bg: rgba(244, 63, 94, 0.1);
    --badge-rose-border: rgba(244, 63, 94, 0.3);

    /* Backward-compatible variables */
    --text-primary: var(--foreground);
    --text-secondary: var(--foreground-muted);
    --text-muted: var(--foreground-subtle);
    --background-muted: var(--secondary);
    --bg-card: var(--card);
    --bg-card-sub: var(--background-subtle);
    --bg-surface: var(--background-subtle);
    --bg-surface-elevated: var(--secondary);
    --border-color: var(--border);

    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 0 0 1px var(--border), 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-popover: 0 0 0 1px var(--border), 0 10px 30px rgba(0, 0, 0, 0.8);

    --code-bg: #0d0d0d;
    --code-border: #222222;
}

/* ---------------------------------------------------------------------
   Design Tokens: Light Mode (Vercel Pure Crisp White)
   --------------------------------------------------------------------- */
[data-theme="light"] {
    color-scheme: light;

    --background: #ffffff;
    --background-subtle: #f8fafc;
    --foreground: #09090b;
    --foreground-muted: #52525b;
    --foreground-subtle: #71717a;

    --card: #ffffff;
    --card-foreground: #09090b;
    --card-hover: #f8fafc;

    --popover: #ffffff;
    --popover-foreground: #09090b;

    /* Vercel solid black primary button in light mode */
    --primary: #09090b;
    --primary-foreground: #ffffff;
    --primary-hover: #27272a;

    --secondary: #f4f4f5;
    --secondary-foreground: #09090b;
    --secondary-hover: #e4e4e7;

    --muted: #f4f4f5;
    --muted-foreground: #71717a;

    --accent: #f4f4f5;
    --accent-foreground: #09090b;

    --border: #e4e4e7;
    --border-subtle: #f1f5f9;
    --border-strong: #d4d4d8;
    --border-hover: #a1a1aa;

    --input: #ffffff;
    --ring: #0284c7;

    --status-success: #059669;
    --status-warning: #d97706;
    --status-danger: #dc2626;

    --accent-cyan: #0284c7;
    --accent-purple: #9333ea;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;

    --badge-green-bg: rgba(5, 150, 105, 0.08);
    --badge-green-border: rgba(5, 150, 105, 0.25);
    --badge-rose-bg: rgba(225, 29, 72, 0.08);
    --badge-rose-border: rgba(225, 29, 72, 0.25);

    --text-primary: var(--foreground);
    --text-secondary: var(--foreground-muted);
    --text-muted: var(--foreground-subtle);
    --background-muted: var(--secondary);
    --bg-card: var(--card);
    --bg-card-sub: #f8fafc;
    --bg-surface: #f8fafc;
    --bg-surface-elevated: #f4f4f5;
    --border-color: var(--border);

    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 0 0 1px var(--border), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-popover: 0 0 0 1px var(--border), 0 10px 30px rgba(0, 0, 0, 0.1);

    --code-bg: #f8fafc;
    --code-border: #e2e8f0;
}

/* ---------------------------------------------------------------------
   Base Reset & Next.js Typography
   --------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    letter-spacing: -0.01em;
}

/* Vercel subtle micro-dot background pattern */
.vercel-dots-bg {
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 65% 50% at 50% 0%, #000 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 65% 50% at 50% 0%, #000 60%, transparent 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 600px;
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .vercel-dots-bg {
    background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
    color: var(--foreground);
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
}

.ndb-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

.theme-icon-dark {
    display: inline-flex;
}

.theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: inline-flex;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* Typography Helpers */
.page-headline, .page-title {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--foreground);
    line-height: 1.25;
}

.page-description {
    font-size: 0.9rem;
    color: var(--foreground-muted);
    margin-top: 0.35rem;
    line-height: 1.6;
}

/* ---------------------------------------------------------------------
   Header (Vercel / Next.js Style Nav)
   --------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.88);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--foreground);
    letter-spacing: -0.03em;
}

.brand-slash {
    color: var(--foreground-subtle);
    font-weight: 300;
    margin: 0 0.15rem;
}

.brand-subtext {
    font-size: 0.8rem;
    color: var(--foreground-muted);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--foreground-muted);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--foreground);
    background-color: var(--secondary);
}

.nav-link.active {
    color: var(--foreground);
    background-color: var(--secondary);
}

.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    padding: 1rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-popover);
    animation: drawerDown 0.15s ease-out;
}

.mobile-nav-drawer.open {
    display: block;
}

@keyframes drawerDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mobile-nav-link {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--foreground-muted);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    color: var(--foreground);
    background-color: var(--secondary);
}

.mobile-only {
    display: none !important;
}

/* ---------------------------------------------------------------------
   Shadcn UI Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.875rem;
    height: 36px;
    padding: 0 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    text-decoration: none !important;
    white-space: nowrap;
    border: 1px solid transparent;
    user-select: none;
    outline: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: var(--primary-foreground);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--foreground);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    border-color: var(--border-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: var(--secondary);
    border-color: var(--border-hover);
}

.btn-ghost {
    background-color: transparent;
    color: var(--foreground-muted);
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--secondary);
    color: var(--foreground);
}

.btn-donor {
    background-color: var(--secondary);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.btn-donor:hover {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.btn-danger {
    background-color: var(--status-danger);
    color: #ffffff;
    border-color: var(--status-danger);
    font-weight: 500;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn-sm {
    height: 30px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    height: 44px;
    padding: 0 1.5rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------
   Forms, Inputs & Sliders
   --------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--foreground-muted);
    margin-bottom: 0.45rem;
}

.form-input,
.search-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    height: 38px;
    padding: 0.5rem 0.85rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--foreground);
    background-color: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

textarea {
    height: auto;
    min-height: 80px;
    line-height: 1.5;
}

.form-input:focus,
.search-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 1px var(--ring);
}

::placeholder {
    color: var(--foreground-subtle);
    opacity: 0.8;
}

/* Range Slider */
.cidr-slider-wrap {
    margin: 1.25rem 0;
    background-color: var(--background-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.cidr-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 9999px;
    outline: none;
    margin: 0.75rem 0 0.25rem;
}

.cidr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--foreground);
    cursor: pointer;
    border: 2px solid var(--background);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.cidr-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.cidr-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--foreground);
    cursor: pointer;
    border: 2px solid var(--background);
}

/* Preset Chips */
.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.75rem;
}

.preset-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    background-color: var(--secondary);
    color: var(--foreground-muted);
    text-decoration: none !important;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
}

.preset-chip:active {
    transform: scale(0.97);
}

.preset-chip:hover {
    background-color: var(--secondary-hover);
    color: var(--foreground);
    border-color: var(--border-hover);
}

.preset-chip.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    font-weight: 600;
}

/* ---------------------------------------------------------------------
   Search Hero Box
   --------------------------------------------------------------------- */
.search-hero-box {
    width: 100%;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
    box-shadow: var(--shadow-subtle);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-hero-box:focus-within {
    border-color: var(--ring);
    box-shadow: 0 0 0 1px var(--ring);
}

.search-hero-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.search-hero-icon {
    display: flex;
    align-items: center;
    color: var(--foreground-subtle);
    flex-shrink: 0;
}

.search-hero-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    height: 40px;
    font-size: 0.95rem;
    color: var(--foreground);
    padding: 0 !important;
}

.search-hero-input:focus {
    box-shadow: none !important;
    border: none !important;
}

.search-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Command Search Box */
.command-search-wrap {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
}

.command-search-box {
    display: flex;
    align-items: center;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .command-search-box {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.command-search-box:focus-within {
    border-color: var(--foreground-muted);
    box-shadow: 0 0 0 1px var(--foreground-muted), 0 12px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .command-search-box:focus-within {
    border-color: var(--foreground-muted);
    box-shadow: 0 0 0 1px var(--foreground-muted), 0 8px 24px rgba(0, 0, 0, 0.08);
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--foreground);
    padding: 0.5rem 0;
}

.command-input::placeholder {
    color: var(--foreground-subtle);
}

.command-kbd {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    color: var(--foreground-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    pointer-events: none;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Shadcn UI Badges & Status Indicators
   --------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background-color: var(--secondary);
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground-muted);
    font-family: var(--font-mono);
    line-height: 1;
    white-space: nowrap;
}

.badge-outline {
    background-color: transparent;
    color: var(--foreground);
}

.badge-emerald,
.badge-green {
    border-color: var(--badge-green-border);
    color: var(--status-success);
    background-color: var(--badge-green-bg);
}

.badge-amber {
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--status-warning);
    background-color: rgba(245, 158, 11, 0.08);
}

.badge-blue,
.badge-cyan {
    border-color: rgba(0, 112, 243, 0.3);
    color: var(--accent-cyan);
    background-color: rgba(0, 112, 243, 0.08);
}

.badge-purple {
    border-color: rgba(192, 132, 252, 0.32);
    color: var(--accent-purple);
    background-color: rgba(192, 132, 252, 0.09);
}

.badge-rose {
    border-color: var(--badge-rose-border);
    color: var(--accent-rose);
    background-color: var(--badge-rose-bg);
}

.tag-mono {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    background-color: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    line-height: 1;
    white-space: nowrap;
}

.status-dot-wrap {
    display: inline-flex;
    position: relative;
    width: 8px;
    height: 8px;
    margin-right: 0.45rem;
}

.status-dot-ping {
    position: absolute;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 9999px;
    background-color: #10b981;
    opacity: 0.75;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-dot-core {
    position: relative;
    display: inline-flex;
    border-radius: 9999px;
    height: 8px;
    width: 8px;
    background-color: #10b981;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ---------------------------------------------------------------------
   Shadcn UI Cards, Grids & Data Cells
   --------------------------------------------------------------------- */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    box-shadow: var(--shadow-subtle);
}

.card-hover:hover {
    border-color: var(--border-hover);
    background-color: var(--card-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.card-description {
    font-size: 0.825rem;
    color: var(--foreground-muted);
    margin-top: 0.2rem;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-subtle);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

/* Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.data-cell {
    background-color: var(--background-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    transition: border-color 0.15s ease;
}

.data-cell:hover {
    border-color: var(--border-hover);
}

.data-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.data-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

/* Split layout */
.layout-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.responsive-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---------------------------------------------------------------------
   Shadcn UI Segmented Tabs
   --------------------------------------------------------------------- */
.tabs-container {
    margin-bottom: 1.5rem;
}

.tabs-list {
    display: inline-flex;
    align-items: center;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3px;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: var(--radius-md);
    padding: 0.45rem 0.95rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--foreground-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.tab-trigger:hover {
    color: var(--foreground);
}

.tab-trigger.active {
    background-color: var(--card);
    color: var(--foreground);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Tables & Data Presentation
   --------------------------------------------------------------------- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
    color: var(--foreground);
}

.table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--foreground-muted);
    font-weight: 600;
    background-color: var(--background-subtle);
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--card-hover);
}

.leaderboard-bar-wrap {
    height: 6px;
    background-color: var(--secondary);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.leaderboard-bar-fill {
    height: 100%;
    background-color: var(--foreground);
    border-radius: 9999px;
}

/* ---------------------------------------------------------------------
   Vercel / Mac Style Terminal Box
   --------------------------------------------------------------------- */
.terminal-window,
.vercel-terminal {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin: 1rem 0;
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    background-color: var(--background-subtle);
    border-bottom: 1px solid var(--code-border);
    gap: 0.5rem;
}

.terminal-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot.dot-red,
.terminal-dot.red { background-color: #ef4444; }
.terminal-dot.dot-yellow,
.terminal-dot.yellow { background-color: #f59e0b; }
.terminal-dot.dot-green,
.terminal-dot.green { background-color: #10b981; }

.terminal-title {
    font-size: 0.75rem;
    color: var(--foreground-muted);
    font-family: var(--font-mono);
    margin-left: 0.5rem;
}

.terminal-content,
.terminal-body pre,
.vercel-terminal pre {
    padding: 1.25rem;
    overflow-x: auto;
    color: var(--foreground);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: anywhere;
    font-family: var(--font-mono);
    background: transparent;
    margin: 0;
}

.vercel-terminal pre code,
.terminal-body pre code {
    color: inherit;
    font-family: inherit;
}

/* Router CLI Snippet Rows */
.cli-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    margin-top: 0.3rem;
}

.cli-code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--foreground);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1;
}

/* ---------------------------------------------------------------------
   Subnet Calculator Visual Bitmask Octets & 32-Bit Track
   --------------------------------------------------------------------- */
.bitmask-track {
    display: grid;
    grid-template-columns: repeat(32, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 0.5rem;
}

.bitmask-octets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.octet-box {
    background-color: var(--background-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.octet-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--foreground-muted);
    margin-bottom: 0.5rem;
}

.octet-val {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.5rem;
}

.octet-bits {
    display: flex;
    gap: 3px;
}

.bit-cell {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 0.35rem 0;
    border-radius: 3px;
    user-select: none;
}

.bit-cell.net {
    background-color: var(--foreground);
    color: var(--background);
}

.bit-cell.host {
    background-color: var(--secondary);
    color: var(--foreground-muted);
    border: 1px solid var(--border);
}

.copy-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--foreground-subtle);
    cursor: pointer;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.copy-icon-btn:active {
    transform: scale(0.95);
}

.copy-icon-btn.copied,
.btn.copied {
    color: var(--status-success);
    border-color: var(--badge-green-border);
}

.copy-icon-btn:hover {
    color: var(--foreground);
    background-color: var(--secondary);
    border-color: var(--border);
}

/* ---------------------------------------------------------------------
   Supporter Paywall Card (Vercel Style Clean Banner)
   --------------------------------------------------------------------- */
.paywall-box {
    border: 1px solid rgba(245, 158, 11, 0.3);
    background-color: rgba(245, 158, 11, 0.04);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-top: 1.5rem;
    position: relative;
}

.paywall-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.paywall-text {
    font-size: 0.875rem;
    color: var(--foreground-muted);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* ---------------------------------------------------------------------
   History Timeline
   --------------------------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px;
    width: 2px;
    background-color: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--background);
    border: 2px solid var(--foreground-muted);
}

.timeline-content {
    background-color: var(--background-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--foreground-muted);
    flex-wrap: wrap;
}

.history-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: flex-end;
}

.history-actions-col {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ---------------------------------------------------------------------
   Alerts & Notifications
   --------------------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

.alert-info {
    background-color: rgba(0, 112, 243, 0.1);
    border-color: rgba(0, 112, 243, 0.25);
    color: #0070f3;
}

/* ---------------------------------------------------------------------
   Shadcn Dialog / Modal
   --------------------------------------------------------------------- */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.dialog-overlay.open {
    display: flex;
}

.dialog-content {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    box-shadow: var(--shadow-popover);
    position: relative;
    animation: dialogIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--foreground-muted);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.dialog-close:hover {
    color: var(--foreground);
}

/* ---------------------------------------------------------------------
   Breadcrumbs & Navigation Links
   --------------------------------------------------------------------- */
.breadcrumbs, .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.825rem;
    color: var(--foreground-subtle);
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.breadcrumbs a, .breadcrumb a {
    color: var(--foreground-muted);
}

.breadcrumbs a:hover, .breadcrumb a:hover {
    color: var(--foreground);
}

.breadcrumbs-sep,
.breadcrumbs-separator,
.breadcrumb-separator {
    color: var(--border-strong);
}

.breadcrumbs-current,
.breadcrumb-current {
    color: var(--foreground);
    font-weight: 500;
}

/* Filter Pills & Search Results */
.filter-pills-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-pill {
    background-color: var(--background-subtle);
    border: 1px solid var(--border);
    color: var(--foreground-muted);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.filter-pill:hover {
    color: var(--foreground);
    border-color: var(--border-hover);
    background-color: var(--secondary);
}

.filter-pill:active {
    transform: scale(0.97);
}

.filter-pill.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    font-weight: 600;
}

.search-result-item {
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.search-result-item:hover {
    border-color: var(--border-hover);
    background-color: var(--card-hover);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: min(440px, calc(100vw - 2rem));
}

.toast-bottom-center {
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background-color: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-popover);
    animation: toastIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-color: var(--badge-green-border); }
.toast-success .toast-icon { color: var(--status-success); }
.toast-error { border-color: var(--badge-rose-border); }
.toast-error .toast-icon { color: var(--status-danger); }
.toast-warning { border-color: rgba(245, 158, 11, 0.35); }
.toast-warning .toast-icon { color: var(--status-warning); }
.toast-info { border-color: rgba(56, 189, 248, 0.35); }
.toast-info .toast-icon { color: var(--accent-cyan); }

.toast-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.toast-message {
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--foreground-subtle);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
    margin-left: 0.25rem;
}

.toast-close:hover {
    color: var(--foreground);
}

.toast-exit {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    background-color: var(--background);
    padding: 3rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
}

.footer-links {
    list-style: none;
    font-size: 0.825rem;
    line-height: 2.1;
}

.footer-links a {
    color: var(--foreground-muted);
}

.footer-links a:hover {
    color: var(--foreground);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.775rem;
    color: var(--foreground-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---------------------------------------------------------------------
   Responsive Mobile Media Queries
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
    .layout-split {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav-menu {
        display: none;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: inline-flex !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .history-filter-grid {
        grid-template-columns: 1fr;
    }

    .history-actions-col {
        justify-content: flex-start;
    }

    .bitmask-octets {
        grid-template-columns: 1fr 1fr;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .responsive-grid-2 {
        grid-template-columns: 1fr !important;
    }

    /* Table Mobile Card Transformation */
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards, 
    .table-mobile-cards tbody, 
    .table-mobile-cards tr, 
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    .table-mobile-cards tr {
        margin-bottom: 0.85rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background-color: var(--card);
        padding: 0.5rem 0.75rem;
    }
    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-subtle);
        text-align: right;
    }
    .table-mobile-cards td:last-child {
        border-bottom: none;
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--foreground-muted);
        text-transform: uppercase;
        text-align: left;
        padding-right: 0.75rem;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .bitmask-octets {
        grid-template-columns: 1fr;
    }

    .bitmask-track {
        gap: 1px;
    }

    .bitmask-track .bit-cell {
        font-size: 0;
        padding: 0.28rem 0;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .command-kbd {
        display: none;
    }

    .table-mobile-cards td {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        text-align: left;
    }
}

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