/* ═══════════════════════════════════════════════════════════════════════════
   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: #00E5E5;
    --nds-teal-dark: #008080;
    --nds-teal-glow: rgba(0, 180, 180, 0.6);
    --nds-orange: #FF8C00;
    --nds-orange-light: #FFB347;
    --nds-orange-glow: rgba(255, 140, 0, 0.6);
    
    --bg-primary: #030508;
    --bg-secondary: #0a0f14;
    --bg-card: rgba(10, 20, 30, 0.95);
    --bg-glass: rgba(0, 180, 180, 0.03);
    --bg-hover: rgba(0, 180, 180, 0.1);
    
    --text-primary: #E0F7F7;
    --text-secondary: rgba(0, 180, 180, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --border-color: rgba(0, 180, 180, 0.2);
    --border-focus: rgba(0, 180, 180, 0.5);
    
    --success: #00FF88;
    --warning: #FFB800;
    --error: #FF4757;
    --info: #3B82F6;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

/* ═══ 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.12'/%3E%3C/svg%3E");
    background-size: 60px 52px;
    animation: gridMove 40s linear infinite;
}

@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-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--nds-teal);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nds-nav-title::before {
    content: '//';
    color: var(--nds-orange);
}

.nds-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 4px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
}

.nds-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(6px);
}

.nds-nav-item.active {
    background: var(--bg-hover);
    color: var(--nds-teal);
    border-color: var(--border-color);
}

.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 {
    transform: translateY(-4px);
    border-color: var(--nds-teal);
    box-shadow: 0 10px 30px rgba(0, 180, 180, 0.2);
}

.nds-card.orange::before {
    background: var(--nds-orange);
}

.nds-card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.nds-card-value {
    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: 14px 24px;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    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-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.nds-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    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: 6px 14px;
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    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-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    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: 14px 20px;
    text-align: left;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.nds-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.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-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.nds-page-subtitle {
    font-family: 'Share Tech Mono', monospace;
    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);
}

/* ═══ 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-family: 'Orbitron', sans-serif;
    font-size: 28px;
    color: var(--nds-teal);
    letter-spacing: 2px;
}

.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-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.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-family: 'Share Tech Mono', monospace;
    letter-spacing: 2px;
}

/* ═══ 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-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.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-family: 'Orbitron', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.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: rgba(0, 180, 180, 0.15); color: var(--nds-teal); }
.nds-stat-icon.orange { background: rgba(255, 140, 0, 0.15); color: var(--nds-orange); }
.nds-stat-icon.green { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.nds-stat-icon.yellow { background: rgba(255, 184, 0, 0.15); color: var(--warning); }

.nds-stat-content { display: flex; flex-direction: column; }
.nds-stat-value { font-size: 24px; font-weight: 700; }
.nds-stat-label { font-size: 13px; 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); }

/* ═══ 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: 'Share Tech Mono', monospace;
    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: 12px; color: var(--text-secondary); text-transform: uppercase; }
.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);
}

/* ═══ 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-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    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: 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-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.nds-toast-content span {
    font-family: 'Share Tech Mono', monospace;
    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 ═══ */
.nds-stat-label,
.nds-hint,
.nds-empty,
.nds-pagination-info {
    color: rgba(255, 255, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10/10 UPGRADE: FORM VALIDATION STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Inline field errors */
.nds-field-error {
    display: block;
    color: var(--error);
    font-size: 0.8rem;
    font-family: 'Rajdhani', sans-serif;
    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: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    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: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-family: 'Share Tech Mono', monospace;
}

.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;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   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: 0.85rem;
    font-family: 'Share Tech Mono', monospace;
    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;
}

/* ─── 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; }

/* 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;
    }
}
