/* ── SYSTEM DESIGN SYSTEM ── */
:root {
    --font-primary: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme Palette - Cyber Obsidian */
    --bg-base: #060913;
    --bg-surface: rgba(15, 22, 42, 0.65);
    --bg-surface-solid: #0d1527;
    --bg-surface-hover: rgba(30, 41, 59, 0.8);
    --bg-card: rgba(22, 32, 58, 0.45);
    --border-light: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(99, 102, 241, 0.5);

    /* Indigo-to-Purple Neon Gradients */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #3b82f6;
    --accent: #a855f7;
    
    /* Semantic Colors */
    --color-green: #10b981;
    --color-green-light: rgba(16, 185, 129, 0.15);
    --color-amber: #f59e0b;
    --color-amber-light: rgba(245, 158, 11, 0.15);
    --color-red: #f43f5e;
    --color-red-light: rgba(244, 63, 94, 0.15);
    --color-blue: #06b6d4;
    --color-blue-light: rgba(6, 182, 212, 0.15);

    /* Text Hierarchy */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-disabled: #475569;

    /* Shadows & Glows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
    --glow-primary: 0 0 24px rgba(99, 102, 241, 0.3);
    --glow-red: 0 0 24px rgba(244, 63, 94, 0.25);
    
    /* System Globals */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET & STANDARDS ── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

body.dark-mode {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

body.light-mode {
    --bg-base: #f8fafc;
    --bg-surface-solid: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-card: #f8fafc;
    --border-light: rgba(15, 23, 42, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    
    --color-green-light: rgba(16, 185, 129, 0.08);
    --color-amber-light: rgba(245, 158, 11, 0.08);
    --color-red-light: rgba(244, 63, 94, 0.08);
    --color-blue-light: rgba(6, 182, 212, 0.08);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-disabled: #94a3b8;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

body.light-mode {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.02) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar Design */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Typography elements */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent);
}

/* ── GLASSMORPHISM CONTAINER UTILITY ── */
.glass {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* ── BUTTON SYSTEM ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
    filter: brightness(1.1);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--color-red-light);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fda4af;
}
.btn-danger:hover {
    background: var(--color-red);
    color: #fff;
    box-shadow: var(--glow-red);
}

.btn-warning {
    background: var(--color-amber-light);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fde047;
}
.btn-warning:hover {
    background: var(--color-amber);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon-only {
    padding: 10px;
    border-radius: 50%;
}

.btn-block {
    width: 100%;
}

/* ── AUTH LOCK SCREEN LAYOUT ── */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: #030712;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.auth-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-overlay.active .auth-card {
    transform: scale(1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.glow-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 16px;
    box-shadow: var(--glow-primary);
}
.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 6px;
    color: var(--text-main);
}
.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms and Inputs */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.password-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
input:focus,
select:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.password-wrapper input {
    padding-right: 50px;
}
.toggle-password-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}
.toggle-password-btn:hover {
    color: var(--text-main);
}

.auth-error-msg {
    margin-top: 15px;
    padding: 12px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.auth-error-msg.hidden {
    display: none !important;
}

/* ── APP MAIN WINDOW LAYOUT ── */
.app-layout {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 30px;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.app-layout.hidden {
    display: none !important;
}

/* Global brand header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.brand-text h1 {
    font-size: 1.3rem;
    line-height: 1.2;
}
.status-indicator-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-green);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--color-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--color-green);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 12px var(--color-green); }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.server-time {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

/* ── OVERVIEW METRICS GRID ── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.metric-card {
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}
.danger-glow:hover {
    box-shadow: var(--glow-red);
    border-color: rgba(244, 63, 94, 0.25);
}

.card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-data h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.card-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.col-products { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.col-keys { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.col-active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.col-crashes { background: rgba(244, 63, 94, 0.15); color: #f87171; }

/* ── TOOLBAR / CONTROLS ── */
.toolbar-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
    max-width: 700px;
}
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    flex-grow: 1;
}
.search-box i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
}
.search-box input {
    padding-left: 48px;
    border: none;
    background: transparent;
    height: 46px;
}

.select-box {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    min-width: 180px;
}
.select-box i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}
.select-box select {
    padding-left: 42px;
    border: none;
    background: transparent;
    height: 46px;
    cursor: pointer;
}

.toolbar-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.email-status-text {
    font-size: 0.78rem;
    color: #94a3b8;
    min-height: 1em;
    display: block;
}

/* ── TABS LAYOUT ── */
.tabs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-triggers {
    display: flex;
    padding: 6px;
    border-radius: var(--radius-md);
    align-self: flex-start;
}
.tab-trigger {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.tab-trigger:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}
.tab-trigger.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: var(--shadow-sm);
}

.tab-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-red {
    background: var(--color-red);
    color: #fff;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── DATA TABLES SYSTEM ── */
.table-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Font styles */
.font-mono {
    font-family: var(--font-mono);
}
.bold {
    font-weight: 600;
}
.text-right {
    text-align: right;
}
.text-muted {
    color: var(--text-muted);
}
.text-red {
    color: var(--color-red) !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px !important;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* Badges for active/expired/revoked keys */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-active { background: var(--color-green-light); color: #6ee7b7; }
.badge-expired { background: var(--color-amber-light); color: #fde047; }
.badge-revoked { background: var(--color-red-light); color: #fda4af; }
.badge-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border-light); }

/* System OS badges */
.badge-os {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}
.os-win32 { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }
.os-darwin { background: rgba(241, 245, 249, 0.1); color: #e2e8f0; }
.os-linux { background: rgba(249, 115, 22, 0.12); color: #fdba74; }

.key-code-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    color: #a5b4fc;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.key-code-block button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.key-code-block button:hover {
    color: #fff;
    transform: scale(1.1);
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── MODALS SYSTEM ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 900;
    background: rgba(3, 7, 18, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.01);
}
.modal-header h3 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 70vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.01);
}

/* Helpers inside forms */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.input-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -2px;
}
#valid-days-wrapper.hidden {
    display: none;
}

/* ── TELEMETRY EXTRA DETAILS VIEWER ── */
.crash-meta-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}
.meta-pillar {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pillar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pillar-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.crash-details-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.read-only-field {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.terminal-panel {
    background: #040812;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow: auto;
    max-height: 250px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}
.terminal-panel code {
    font-family: var(--font-mono);
    color: #fca5a5;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ── TOAST NOTIFICATIONS DRAWER ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1100;
}
.toast {
    background: #0d1527;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-main);
    font-size: 0.9rem;
}
.toast.active {
    transform: translateX(0);
}
.toast.toast-success { border-left-color: var(--color-green); }
.toast.toast-error { border-left-color: var(--color-red); }
.toast.toast-warning { border-left-color: var(--color-amber); }

.toast i {
    font-size: 1.1rem;
}
.toast-success i { color: var(--color-green); }
.toast-error i { color: var(--color-red); }
.toast-warning i { color: var(--color-amber); }

/* ── RESPONSIVE DESIGN ADAPTIONS ── */
@media (max-width: 768px) {
    .app-layout {
        padding: 15px 10px;
        gap: 16px;
    }
    .main-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 16px;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .toolbar-section {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-left {
        flex-direction: column;
        align-items: stretch;
        max-width: none;
    }
    .select-box {
        min-width: 0;
    }
    .toolbar-right {
        align-items: stretch;
    }
    .toolbar-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .toolbar-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    .email-status-text {
        text-align: center;
    }
    .table-container {
        overflow-x: auto;
    }
    .tab-triggers {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        align-self: stretch;
    }
    .tab-trigger {
        padding: 10px 16px;
    }
    .input-grid {
        grid-template-columns: 1fr;
    }
    .crash-meta-summary {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── LIGHT MODE OVERRIDES ── */
body.light-mode input[type="text"],
body.light-mode input[type="password"],
body.light-mode input[type="number"],
body.light-mode select,
body.light-mode textarea {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.15);
}
body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    background: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

body.light-mode .key-code-block {
    background: #f1f5f9;
    color: #4f46e5;
    border-color: rgba(15, 23, 42, 0.08);
}
body.light-mode .data-table th {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
body.light-mode .data-table td {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
body.light-mode .data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

body.light-mode .btn-secondary {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}
body.light-mode .btn-secondary:hover {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.2);
}

body.light-mode .tab-trigger:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.02);
}
body.light-mode .tab-trigger.active {
    color: #fff;
}
body.light-mode .read-only-field {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.08);
}
body.light-mode .badge-secondary {
    background: #e2e8f0;
    color: #475569;
    border-color: rgba(15, 23, 42, 0.08);
}
body.light-mode .server-time {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
}
