/* ═══════════════════════════════════════════════════════════════════════════
   SWISH PAYOUT - NDS INSPIRED THEME
   ═══════════════════════════════════════════════════════════════════════════ */

/* #30 FIX: Font laddas nu via <link> i _Layout.cshtml istället för @import (blockerar rendering) */

:root {
    --nds-teal: #00B4B4;
    --nds-teal-light: #22D3D3;
    --nds-teal-dark: #008080;
    --nds-teal-glow: rgba(0, 180, 180, 0.4);
    --nds-amber: #F59E0B;
    --nds-amber-light: #FBBF24;
    --nds-amber-glow: rgba(245, 158, 11, 0.4);
    /* Keep --nds-orange as alias for backwards compat */
    --nds-orange: #F59E0B;
    --nds-orange-light: #FBBF24;
    --nds-orange-glow: rgba(245, 158, 11, 0.4);

    --bg-primary: #0B1120;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.95);
    --bg-glass: rgba(0, 180, 180, 0.03);
    --bg-hover: rgba(0, 180, 180, 0.08);

    --text-primary: #E2E8F0;
    --text-secondary: rgba(148, 163, 184, 0.9);
    --text-muted: rgba(148, 163, 184, 0.7);

    --border-color: rgba(51, 65, 85, 0.7);
    --border-focus: rgba(0, 180, 180, 0.5);

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══ LIGHT THEME ═══ */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-glass: rgba(0, 100, 100, 0.02);
    --bg-hover: rgba(0, 100, 100, 0.06);
    --text-primary: #0F172A;
    --text-secondary: rgba(71, 85, 105, 0.9);
    --text-muted: rgba(100, 116, 139, 0.6);
    --border-color: rgba(203, 213, 225, 0.8);
    --border-focus: rgba(0, 140, 140, 0.4);
    --nds-orange: #D97706;
    --nds-orange-light: #B45309;
    --nds-amber: #D97706;
    --nds-amber-light: #B45309;
}

[data-theme="light"] .nds-bg,
[data-theme="light"] .nds-hex-grid {
    display: none;
}

[data-theme="light"] .nds-sidebar {
    background: #0F172A;
}

[data-theme="light"] .nds-sidebar .nds-nav-item {
    color: rgba(148, 163, 184, 0.9);
}

[data-theme="light"] .nds-sidebar .nds-nav-item.active,
[data-theme="light"] .nds-sidebar .nds-nav-item:hover {
    color: #E2E8F0;
}

[data-theme="light"] .nds-sidebar .nds-nav-title {
    color: var(--nds-teal);
}

[data-theme="light"] .nds-input {
    background: #fff;
    border-color: #d0d5dd;
    color: #1a1a2e;
}

[data-theme="light"] .nds-card {
    border-color: #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══ ANIMATED BACKGROUND ═══ */
.nds-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.nds-hex-grid {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 0L60 15v22L30 52 0 37V15z' fill='none' stroke='%2300B4B4' stroke-width='0.3' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 60px 52px;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 52px); }
}

/* ═══ LAYOUT ═══ */
.nds-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.nds-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-glass), var(--bg-card));
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.nds-main {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
}

/* ═══ SIDEBAR ═══ */
.nds-logo {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.nds-logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--nds-teal);
    letter-spacing: 2px;
}

.nds-logo span {
    color: var(--nds-orange);
}

.nds-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nds-nav-group {
    margin-bottom: 24px;
}

.nds-nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--nds-teal);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

.nds-nav-title::before {
    content: '//';
    color: var(--nds-teal);
}

.nds-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: rgba(148, 163, 184, 0.9);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

.nds-nav-item:hover {
    background: rgba(0, 180, 180, 0.08);
    color: #E2E8F0;
}

.nds-nav-item.active {
    background: rgba(0, 180, 180, 0.1);
    color: var(--nds-teal-light);
    border-color: var(--nds-teal);
}

.nds-nav-item svg {
    width: 20px;
    height: 20px;
}

/* ═══ CARDS ═══ */
.nds-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.nds-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--nds-teal);
}

.nds-card:hover {
    border-color: rgba(0, 180, 180, 0.4);
}

.nds-card.orange::before {
    background: var(--nds-orange);
}

.nds-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.nds-card-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.nds-card-value.teal { color: var(--nds-teal); }
.nds-card-value.orange { color: var(--nds-orange); }

/* ═══ BUTTONS ═══ */
.nds-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.nds-btn-primary {
    background: linear-gradient(135deg, var(--nds-teal), var(--nds-teal-light));
    color: #000;
    box-shadow: 0 0 20px var(--nds-teal-glow);
}

.nds-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--nds-teal-glow);
}

.nds-btn-secondary {
    background: transparent;
    color: var(--nds-orange);
    border-color: var(--nds-orange);
}

.nds-btn-secondary:hover {
    background: rgba(255, 140, 0, 0.1);
    transform: translateY(-2px);
}

.nds-btn-ghost {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.nds-btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nds-btn-danger {
    background: var(--error);
    color: white;
}

/* ═══ FORMS ═══ */
.nds-form-group {
    margin-bottom: 20px;
}

.nds-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.nds-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}

.nds-input:focus {
    border-color: var(--nds-teal);
    box-shadow: 0 0 0 3px rgba(0, 180, 180, 0.1);
    outline: none;
}

.nds-input::placeholder {
    color: var(--text-muted);
}

/* ═══ BADGES ═══ */
.nds-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.nds-badge-success { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.nds-badge-warning { background: rgba(255, 184, 0, 0.15); color: var(--warning); }
.nds-badge-error { background: rgba(255, 71, 87, 0.15); color: var(--error); }
.nds-badge-info { background: rgba(0, 180, 180, 0.15); color: var(--nds-teal); }
.nds-badge-pending { background: rgba(255, 140, 0, 0.15); color: var(--nds-orange); }

/* ═══ TABLE ═══ */
.nds-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.nds-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass);
}

.nds-table-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nds-table-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--nds-teal), var(--nds-orange));
    border-radius: 2px;
}

.nds-table {
    width: 100%;
    border-collapse: collapse;
}

.nds-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.nds-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.nds-table tr:hover {
    background: var(--bg-hover);
}

.nds-table tr:last-child td {
    border-bottom: none;
}

/* ═══ ALERTS ═══ */
.nds-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nds-alert-success { background: rgba(0, 255, 136, 0.1); border: 1px solid var(--success); color: var(--success); }
.nds-alert-error { background: rgba(255, 71, 87, 0.1); border: 1px solid var(--error); color: var(--error); }
.nds-alert-warning { background: rgba(255, 184, 0, 0.1); border: 1px solid var(--warning); color: var(--warning); }
.nds-alert-info { background: rgba(0, 180, 180, 0.1); border: 1px solid var(--nds-teal); color: var(--nds-teal); }

/* ═══ PAGE HEADER ═══ */
.nds-page-header {
    margin-bottom: 30px;
}

.nds-page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.nds-page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ═══ GRID ═══ */
.nds-grid {
    display: grid;
    gap: 24px;
}

.nds-grid-2 { grid-template-columns: repeat(2, 1fr); }
.nds-grid-3 { grid-template-columns: repeat(3, 1fr); }
.nds-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .nds-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nds-sidebar { 
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }
    .nds-sidebar.open {
        transform: translateX(0);
    }
    .nds-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 150;
    }
    .nds-sidebar.open ~ .nds-sidebar-overlay,
    .nds-sidebar.open + .nds-sidebar-overlay {
        display: block;
    }
    /* Visa overlay när sidebar är öppen via sibling */
    .nds-layout:has(.nds-sidebar.open) .nds-sidebar-overlay {
        display: block;
    }
    .nds-mobile-toggle {
        display: flex;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 100;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        color: var(--nds-teal);
        cursor: pointer;
    }
    .nds-mobile-toggle svg { width: 24px; height: 24px; }
    .nds-main { margin-left: 0; padding-top: 70px; }
    .nds-stats-grid { grid-template-columns: 1fr; }
    .nds-form-row { grid-template-columns: 1fr; }
    .nds-filter-form .nds-form-row { grid-template-columns: 1fr; }
    .nds-info-grid { grid-template-columns: 1fr; }
}

/* Dölj hamburger på desktop */
.nds-mobile-toggle { display: none; }
.nds-sidebar-overlay { display: none; }

/* ═══ LOGIN PAGE ═══ */
.nds-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nds-login-box {
    width: 100%;
    max-width: 420px;
}

.nds-login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.nds-login-logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--nds-teal);
    letter-spacing: 3px;
}

.nds-login-logo span {
    color: var(--nds-orange);
}

.nds-login-tagline {
    color: var(--text-secondary);
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ═══ PASSWORD STRENGTH BARS ═══ */
.nds-pw-strength {
    margin-top: 6px;
}

.nds-pw-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.nds-pw-bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: var(--border-color);
    transition: background 0.3s;
}

/* ═══ TOGGLE SWITCH ═══ */
.nds-toggle-panel {
    background: rgba(243, 156, 18, 0.08);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(243, 156, 18, 0.25);
    margin-bottom: 20px;
}

[data-theme="light"] .nds-toggle-panel {
    background: rgba(243, 156, 18, 0.06);
}

.nds-toggle-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nds-toggle-title {
    color: var(--nds-amber);
    font-size: 14px;
    letter-spacing: 1px;
}

.nds-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.nds-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.nds-switch-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 28px;
    transition: 0.3s;
}

.nds-switch-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.nds-switch input:checked + .nds-switch-slider {
    background: #f39c12;
}

.nds-switch input:checked + .nds-switch-slider::before {
    transform: translateX(24px);
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nds-teal);
}

/* ═══ SELECTION ═══ */
::selection {
    background: var(--nds-teal);
    color: #000;
}


/* ═══ AUTH PAGES ═══ */
.nds-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nds-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
}

.nds-auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.nds-auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--nds-teal);
    letter-spacing: -0.3px;
}

.nds-auth-header h1 span { color: var(--nds-orange); }
.nds-auth-header p { color: var(--text-secondary); margin-top: 8px; }

.nds-auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.nds-auth-footer a { color: var(--nds-teal); text-decoration: none; }
.nds-auth-footer a:hover { text-decoration: underline; }

/* ═══ FORM ENHANCEMENTS ═══ */
.nds-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.nds-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.nds-form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.nds-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.nds-form-group.highlight .nds-input {
    border-color: var(--nds-orange);
    font-size: 18px;
}

.nds-input.large {
    font-size: 20px;
    padding: 18px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

/* ═══ BUTTONS EXTENDED ═══ */
.nds-btn.primary {
    background: linear-gradient(135deg, var(--nds-teal), var(--nds-teal-light));
    color: #000;
    border: none;
}

.nds-btn.secondary {
    background: transparent;
    color: var(--nds-teal);
    border: 1px solid var(--nds-teal);
}

.nds-btn.danger {
    background: var(--error);
    color: white;
    border: none;
}

.nds-btn.full-width { width: 100%; justify-content: center; }
.nds-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.nds-btn svg { width: 18px; height: 18px; }

.nds-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.nds-btn-icon:hover {
    background: var(--bg-hover);
    color: var(--nds-teal);
    border-color: var(--nds-teal);
}

.nds-btn-icon svg { width: 18px; height: 18px; }

/* ═══ ALERTS EXTENDED ═══ */
.nds-alert.success { background: rgba(0, 255, 136, 0.1); border: 1px solid var(--success); color: var(--success); }
.nds-alert.error { background: rgba(255, 71, 87, 0.1); border: 1px solid var(--error); color: var(--error); }
.nds-alert.warning { background: rgba(255, 184, 0, 0.1); border: 1px solid var(--warning); color: var(--warning); }
.nds-alert svg { width: 24px; height: 24px; flex-shrink: 0; }
.nds-alert a { color: inherit; font-weight: 600; }

/* ═══ HEADER ═══ */
.nds-header {
    margin-bottom: 30px;
}

.nds-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.nds-header p {
    color: var(--text-secondary);
}

/* ═══ CARD EXTENDED ═══ */
.nds-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.nds-card-header h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nds-card-body { }

.nds-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.nds-empty a { color: var(--nds-teal); }

/* ═══ STATS GRID ═══ */
.nds-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.nds-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nds-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nds-stat-icon svg { width: 24px; height: 24px; }
.nds-stat-icon.teal { background: linear-gradient(135deg, rgba(0, 180, 180, 0.15), rgba(0, 180, 180, 0.05)); color: var(--nds-teal); }
.nds-stat-icon.orange { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); color: var(--nds-amber); }
.nds-stat-icon.green { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05)); color: var(--success); }
.nds-stat-icon.yellow { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05)); color: var(--warning); }

.nds-stat-content { display: flex; flex-direction: column; }
.nds-stat-value { font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 700; }
.nds-stat-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }

/* ═══ BADGES EXTENDED ═══ */
.nds-badge.pending { background: rgba(255, 140, 0, 0.15); color: var(--nds-orange); }
.nds-badge.sent { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.nds-badge.completed { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.nds-badge.failed { background: rgba(255, 71, 87, 0.15); color: var(--error); }
.nds-badge.cancelled { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.nds-copyable:hover { color: var(--nds-orange-light); }
.nds-copyable:hover svg { opacity: 1 !important; }

/* ═══ FILTER FORM ═══ */
.nds-filter-form .nds-form-row {
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
}

/* ═══ CERTIFICATES ═══ */
.nds-cert-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.nds-cert-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.nds-cert-item.ok { border-color: var(--success); }
.nds-cert-item.missing { border-color: var(--error); }

.nds-cert-icon { width: 40px; height: 40px; }
.nds-cert-icon svg { width: 40px; height: 40px; }
.nds-cert-item.ok .nds-cert-icon { color: var(--success); }
.nds-cert-item.missing .nds-cert-icon { color: var(--error); }

.nds-cert-info { display: flex; flex-direction: column; gap: 4px; }
.nds-cert-info strong { font-size: 14px; }
.nds-cert-info span { font-size: 12px; color: var(--text-secondary); }
.nds-cert-expiry.warning { color: var(--warning); }

/* ═══ 2FA SETUP ═══ */
.nds-2fa-setup { text-align: center; }
.nds-qr-code { max-width: 200px; margin: 20px auto; border-radius: 8px; }
.nds-2fa-setup code {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-glass);
    border-radius: 6px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 14px;
    color: var(--nds-orange);
}

/* ═══ INFO GRID ═══ */
.nds-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.nds-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nds-info-item span { font-size: 11px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.nds-info-item strong { font-size: 16px; }

/* ═══ HELP SECTION ═══ */
.nds-help-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--nds-teal);
}

.nds-help-section ol {
    padding-left: 20px;
    color: var(--text-secondary);
}

.nds-help-section li { margin-bottom: 8px; }
.nds-help-section a { color: var(--nds-orange); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1200px) {
    .nds-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .nds-cert-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nds-stats-grid { grid-template-columns: 1fr; }
    .nds-form-row { grid-template-columns: 1fr; }
    .nds-filter-form .nds-form-row { grid-template-columns: 1fr; }
    .nds-info-grid { grid-template-columns: 1fr; }
}


/* ═══ DIALOG / MODAL ═══ */
.nds-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.nds-dialog {
    background: var(--bg-card);
    border: 1px solid var(--nds-orange);
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(255, 140, 0, 0.2);
}

.nds-dialog-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--nds-orange);
}

/* ═══ PAGINATION ═══ */
.nds-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.nds-pagination-info {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* ═══ RESPONSIVE GRID FIX ═══ */
@media (max-width: 768px) {
    .nds-grid-2, .nds-grid-3, .nds-grid-4 { grid-template-columns: 1fr; }
    .nds-cert-grid { grid-template-columns: 1fr; }
}

/* ═══ SIGNALR ANSLUTNINGSSTATUS ═══ */
.signalr-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 10px;
    vertical-align: middle;
    background: var(--text-secondary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.signalr-status.connected {
    background: #00e676;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

.signalr-status.reconnecting {
    background: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
    animation: signalr-pulse 1.5s ease-in-out infinite;
}

.signalr-status.disconnected {
    background: #ff5252;
    box-shadow: 0 0 6px rgba(255, 82, 82, 0.4);
}

@keyframes signalr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ═══ TOAST-NOTIFIKATIONER ═══ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(90vw, 400px);
}

.nds-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toast-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
}

.nds-toast.success {
    border-color: #00e676;
    box-shadow: 0 8px 32px rgba(0, 230, 118, 0.15);
}

.nds-toast.error {
    border-color: #ff5252;
    box-shadow: 0 8px 32px rgba(255, 82, 82, 0.15);
}

.nds-toast.warning {
    border-color: #ffc107;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.15);
}

.nds-toast.info {
    border-color: var(--nds-teal);
    box-shadow: 0 8px 32px rgba(0, 188, 212, 0.15);
}

.nds-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.nds-toast.success .nds-toast-icon { color: #00e676; }
.nds-toast.error .nds-toast-icon { color: #ff5252; }
.nds-toast.warning .nds-toast-icon { color: #ffc107; }
.nds-toast.info .nds-toast-icon { color: var(--nds-teal); }

.nds-toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.nds-toast-content strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.nds-toast-content span {
    font-size: 12px;
    color: var(--text-secondary);
}

.nds-toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.nds-toast-close:hover {
    color: var(--text-primary);
}

.nds-toast-exit {
    animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-slide-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ═══ RAD-UPPDATERINGSANIMATION ═══ */
.nds-row-updated {
    animation: row-highlight 2s ease-out;
}

@keyframes row-highlight {
    0% { background-color: rgba(0, 230, 118, 0.2); }
    100% { background-color: transparent; }
}

/* ═══ TOAST RESPONSIVE ═══ */
@media (max-width: 768px) {
    #toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* ═══ #34 FIX: FOCUS-VISIBLE FÖR TANGENTBORDSNAVIGERING ═══ */
:focus-visible {
    outline: 2px solid var(--nds-teal);
    outline-offset: 2px;
}

.nds-btn:focus-visible,
.nds-nav-item:focus-visible,
.nds-input:focus-visible {
    outline: 2px solid var(--nds-teal);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 180, 180, 0.2);
}

/* ═══ #33 FIX: FÖRBÄTTRAD KONTRAST FÖR MUTED TEXT (WCAG AA) ═══ */
.nds-stat-label,
.nds-hint,
.nds-empty,
.nds-pagination-info {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: FORM VALIDATION STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Inline field errors */
.nds-field-error {
    display: block;
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
    min-height: 1.2em;
    transition: opacity 0.2s ease;
}

.nds-field-error:empty {
    opacity: 0;
}

/* Input states */
.nds-input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2) !important;
}

.nds-input-valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1) !important;
}

/* Character counter */
.nds-char-counter {
    display: block;
    text-align: right;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    margin-top: 2px;
}

.nds-counter-warning {
    color: var(--warning);
}

.nds-counter-limit {
    color: var(--error);
    font-weight: 600;
}

/* Submit button ready state */
.nds-btn-ready {
    box-shadow: 0 0 20px rgba(0, 180, 180, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: SKELETON LOADERS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.nds-skeleton {
    background: linear-gradient(90deg,
        rgba(0, 180, 180, 0.05) 25%,
        rgba(0, 180, 180, 0.12) 50%,
        rgba(0, 180, 180, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.nds-skeleton-text {
    height: 1em;
    width: 60%;
    margin: 8px 0;
}

.nds-skeleton-stat {
    height: 2.5em;
    width: 80%;
    margin: 8px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: BREADCRUMB NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.nds-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.nds-breadcrumb a {
    color: var(--nds-teal);
    text-decoration: none;
    transition: color 0.2s;
}

.nds-breadcrumb a:hover {
    color: var(--nds-teal-light);
}

.nds-breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: ACCESSIBILITY — prefers-reduced-motion
   ═══════════════════════════════════════════════════════════════════════════ */

@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;
    }

    .nds-hex-grid {
        animation: none;
    }

    .nds-skeleton {
        animation: none;
        background: rgba(0, 180, 180, 0.08);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: IMPROVED MOBILE UX
   ═══════════════════════════════════════════════════════════════════════════ */

/* Better touch targets (minimum 44x44px) */
@media (max-width: 768px) {
    .nds-nav-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nds-btn {
        min-height: 44px;
        padding: 10px 20px;
    }

    .nds-input {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Horizontal scroll for tables on mobile */
    .nds-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    .nds-table {
        min-width: 600px;
    }

    /* Stack form rows */
    .nds-form-row {
        flex-direction: column;
    }

    /* Details page: stack grid */
    .nds-card-body > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Dialog: full-width on mobile */
    .nds-dialog {
        width: 95vw !important;
        max-width: none !important;
        margin: 16px;
    }

    .nds-dialog button {
        min-height: 48px;
        font-size: 16px;
    }

    /* Filter form: stack on mobile */
    .nds-filter-form .nds-form-row {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: DIALOG ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

.nds-dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.nds-dialog-overlay[open],
.nds-dialog-overlay[style*="display: flex"] {
    display: flex;
}

/* Offline indicator */
.nds-offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--error);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.nds-offline-bar.visible {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: LOADING SPINNER FOR FORM SUBMITS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nds-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 180, 180, 0.3);
    border-top-color: var(--nds-teal);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ─── Date input styling ─── */
input[type="date"].nds-input {
    color-scheme: dark;
}
input[type="date"].nds-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) saturate(3) hue-rotate(140deg);
    cursor: pointer;
}

[data-theme="light"] input[type="date"].nds-input {
    color-scheme: light;
}
[data-theme="light"] input[type="date"].nds-input::-webkit-calendar-picker-indicator {
    filter: none;
}

/* ─── Sidebar scroll fix — alltid visa Inställningar ─── */
.nds-nav {
    overflow-y: auto;
    max-height: calc(100vh - 160px);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 180, 180, 0.3) transparent;
}
.nds-nav::-webkit-scrollbar { width: 4px; }
.nds-nav::-webkit-scrollbar-thumb { background: rgba(0, 180, 180, 0.3); border-radius: 4px; }

/* ─── Details/Summary collapsible panels ─── */
details.nds-card > summary { user-select: none; }
details.nds-card > summary::-webkit-details-marker { display: none; }
details.nds-card[open] > summary span { display: none; }

/* ═══ SECTION LABEL ═══ */
.nds-section-label {
    margin-bottom: 10px;
    margin-top: 28px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ═══ PERIOD BAR (week / month compact summary) ═══ */
.nds-period-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 0;
}

.nds-period-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.nds-period-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nds-period-item strong {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--nds-teal);
}

.nds-period-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    margin: 0 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .nds-period-bar { gap: 12px; }
    .nds-period-divider { display: none; }
    .nds-period-item { min-width: calc(50% - 12px); }
}

/* ═══ DETAILS PAGE UTILITIES ═══ */
.nds-detail-amount {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-left: 8px;
}

.nds-detail-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nds-pre {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    color: var(--text-primary);
}

.nds-code {
    background: var(--bg-glass);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
}

.nds-text-error {
    color: var(--error);
}

/* ═══ AMOUNT COLUMN — right-aligned monospace ═══ */
.nds-table td.nds-amount,
.nds-table th.nds-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* ═══ EMPTY STATE ═══ */
.nds-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    text-align: center;
}

.nds-empty-state svg {
    color: var(--border-color);
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
}

.nds-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.nds-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 320px;
}

/* ═══ CONFIRM SUMMARY (payment dialog) ═══ */
.nds-confirm-summary {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nds-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.nds-confirm-row span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.nds-confirm-row strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.nds-confirm-amount {
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--nds-teal) !important;
}

.nds-confirm-warning {
    font-size: 12px;
    font-weight: 600;
    color: var(--nds-orange);
    text-align: center;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
}

/* ═══ A1: STAGGERED SLIDE-IN ANIMATIONS ═══ */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.nds-stat-card {
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nds-stat-card:nth-child(1) { animation-delay: 0ms; }
.nds-stat-card:nth-child(2) { animation-delay: 60ms; }
.nds-stat-card:nth-child(3) { animation-delay: 120ms; }
.nds-stat-card:nth-child(4) { animation-delay: 180ms; }

.nds-card {
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 100ms;
}

.nds-period-bar {
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 250ms;
}

/* ═══ B1: BADGE TRANSITION ANIMATIONS ═══ */
.nds-badge {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes badgeFlash {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.nds-badge.status-changed {
    animation: badgeFlash 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══ B3: SPARKLINE IN STAT CARDS ═══ */
.nds-stat-card {
    position: relative;
    overflow: hidden;
}

.nds-sparkline {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 36px;
    opacity: 0.35;
    pointer-events: none;
}

.nds-sparkline polyline {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nds-stat-card .nds-sparkline polyline { stroke: var(--nds-teal); }
.nds-stat-card:nth-child(2) .nds-sparkline polyline { stroke: var(--nds-amber); }
.nds-stat-card:nth-child(3) .nds-sparkline polyline { stroke: var(--success); }
.nds-stat-card:nth-child(4) .nds-sparkline polyline { stroke: var(--warning); }

/* ═══ C1: AUDIT TRAIL TIMELINE ═══ */
.nds-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 24px 0;
    position: relative;
}

.nds-timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.nds-timeline-step::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: -1;
}

.nds-timeline-step:last-child::before {
    display: none;
}

.nds-timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nds-timeline-dot svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.nds-timeline-step.completed .nds-timeline-dot {
    background: var(--success);
    border-color: var(--success);
}

.nds-timeline-step.completed .nds-timeline-dot svg {
    color: #fff;
}

.nds-timeline-step.completed::before {
    background: var(--success);
}

.nds-timeline-step.active .nds-timeline-dot {
    background: var(--nds-teal);
    border-color: var(--nds-teal);
    box-shadow: 0 0 12px var(--nds-teal-glow);
}

.nds-timeline-step.active .nds-timeline-dot svg {
    color: #fff;
}

.nds-timeline-step.failed .nds-timeline-dot {
    background: var(--error);
    border-color: var(--error);
}

.nds-timeline-step.failed .nds-timeline-dot svg {
    color: #fff;
}

.nds-timeline-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.nds-timeline-step.completed .nds-timeline-label,
.nds-timeline-step.active .nds-timeline-label {
    color: var(--text-primary);
}

.nds-timeline-time {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .nds-timeline {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 16px;
    }
    .nds-timeline-step {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .nds-timeline-step::before {
        top: auto;
        left: 16px;
        width: 2px;
        height: 100%;
    }
}

/* ═══ C2: SUCCESS OVERLAY ═══ */
.nds-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nds-success-content {
    text-align: center;
    max-width: 400px;
    animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes successPop {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.nds-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #34d399);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
}

.nds-success-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
    animation: checkDraw 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes checkDraw {
    from { stroke-dashoffset: 50; opacity: 0; }
    to { stroke-dashoffset: 0; opacity: 1; }
}

.nds-success-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.nds-success-content p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.nds-success-ref {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
    color: var(--nds-teal);
    background: var(--bg-glass);
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    margin: 12px 0 24px;
    border: 1px solid var(--border-color);
}

.nds-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ═══ B2: KEYBOARD SHORTCUT HINTS ═══ */
.nds-kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    margin-left: 8px;
}

/* ═══ COMMAND PALETTE ═══ */
.nds-command-palette {
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    animation: fadeIn 0.15s ease;
}

.nds-command-box {
    width: 90%;
    max-width: 500px;
    background: var(--bg-card);
    border: 1px solid var(--nds-teal);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: successPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nds-command-input {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.nds-command-input::placeholder {
    color: var(--text-muted);
}

.nds-command-results {
    max-height: 300px;
    overflow-y: auto;
}

.nds-command-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-primary);
    text-decoration: none;
}

.nds-command-item:hover,
.nds-command-item.active {
    background: var(--bg-hover);
}

.nds-command-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.nds-command-item span {
    flex: 1;
    font-size: 14px;
}

.nds-command-item .nds-kbd {
    margin-left: auto;
}

/* ═══ BRANDING PAGE ═══ */
.nds-logo-preview {
    margin: 20px 0;
    padding: 24px;
    background: var(--bg-glass);
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.nds-logo-img {
    max-height: 64px;
    max-width: 240px;
    margin-top: 8px;
}

/* ═══ REPORTS PERIOD SELECTOR ═══ */
.nds-period-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.nds-period-selector .nds-btn {
    font-size: 13px;
}

.nds-period-separator {
    color: var(--text-secondary);
    margin: 0 4px;
}

.nds-period-custom {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nds-input-sm {
    width: 150px;
    padding: 6px 10px;
    font-size: 13px;
}

.nds-stat-value.teal { color: var(--nds-teal); }

@media (max-width: 768px) {
    .nds-period-custom {
        flex-wrap: wrap;
    }
    .nds-input-sm {
        width: 100%;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .nds-btn {
        border: 2px solid ButtonText;
    }

    .nds-input {
        border: 1px solid ButtonText;
    }

    .nds-badge {
        border: 1px solid ButtonText;
    }
}

/* ═══ FIX #1: SIDEBAR FOOTER — replaces inline styles ═══ */
.nds-sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.nds-lang-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
    align-items: center;
}

.nds-lang-btn {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--nds-teal);
    border: 1px solid rgba(0, 180, 180, 0.25);
    background: none;
}

.nds-lang-btn.active {
    background: var(--nds-teal);
    color: #0a0a1a;
    border-color: var(--nds-teal);
}

.nds-theme-btn {
    margin-left: auto;
    background: none;
    border: 1px solid rgba(0, 180, 180, 0.25);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--nds-orange);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
}

.nds-theme-btn:hover {
    border-color: var(--nds-teal);
}

/* ═══ FIX #2: SANDBOX BANNER — proper spacing ═══ */
.nds-sandbox-banner {
    background: #f39c12;
    color: #000;
    text-align: center;
    padding: 6px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    z-index: 10000;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

body.sandbox-mode .nds-sidebar {
    top: 33px;
    height: calc(100vh - 33px);
}

body.sandbox-mode .nds-main {
    padding-top: 63px;
}

body.sandbox-mode .nds-mobile-toggle {
    top: 49px;
}

body.sandbox-mode #toast-container {
    top: 53px;
}

body.sandbox-mode .nds-offline-bar {
    top: 33px;
}

/* ═══ FIX #3: CLICKABLE TABLE ROWS ═══ */
.nds-table tr.nds-clickable-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.nds-table tr.nds-clickable-row:hover {
    background: var(--bg-hover);
}

/* ═══ FIX #4: STAT CARD LINK STYLE ═══ */
a.nds-stat-card {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a.nds-stat-card:hover {
    border-color: var(--nds-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 180, 180, 0.15);
}

/* ═══ FIX #8: IMPROVED EMPTY STATE ON DASHBOARD ═══ */
.nds-empty-state-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 12px;
    text-align: center;
}

.nds-empty-state-inline svg {
    color: var(--border-color);
    width: 48px;
    height: 48px;
    opacity: 0.6;
}

.nds-empty-state-inline p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.nds-empty-state-inline .nds-btn {
    margin-top: 8px;
}

/* ═══ FIX #10: MOBILE TABLE SCROLL INDICATOR ═══ */
.nds-table-scroll-wrapper {
    position: relative;
}

.nds-table-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, var(--bg-card), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.nds-table-scroll-wrapper.has-scroll::after {
    opacity: 1;
}

.nds-table-scroll-wrapper.scrolled-end::after {
    opacity: 0;
}

@media (max-width: 768px) {
    .nds-table-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ═══ FIX #11: SKELETON LOADING FOR DASHBOARD ═══ */
.nds-stat-card.skeleton .nds-stat-icon {
    background: rgba(0, 180, 180, 0.05);
}

.nds-stat-card.skeleton .nds-stat-value,
.nds-stat-card.skeleton .nds-stat-label {
    background: linear-gradient(90deg,
        rgba(0, 180, 180, 0.05) 25%,
        rgba(0, 180, 180, 0.12) 50%,
        rgba(0, 180, 180, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent;
}

/* ═══ FIX #7: LIGHT MODE — chart-friendly overrides ═══ */
[data-theme="light"] .nds-table tr:hover {
    background: rgba(0, 100, 100, 0.04);
}

[data-theme="light"] a.nds-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
