:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-panel-hover: rgba(30, 41, 59, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Brand Colors */
    --ns-yellow: #ffc917;
    --ns-yellow-dim: rgba(255, 201, 23, 0.2);
    --bn-blue: #1a5e9a;
    --bn-blue-dim: rgba(26, 94, 154, 0.2);
    
    /* UI Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Layout */
    --sidebar-width: 280px;
    --border-radius: 16px;
    --border-color: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(26, 94, 154, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 201, 23, 0.1), transparent 25%);
}

.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
}

.ns-yellow { color: var(--ns-yellow); font-weight: bold; }
.blauwnet-blue { color: #60a5fa; font-weight: bold; } /* Slightly lighter for dark mode */

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 100;
}

.brand {
    padding: 32px 24px;
}

.logo {
    font-size: 24px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.divider { color: var(--text-muted); font-weight: 300; }
.subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
    font-weight: 500;
}

.nav-menu {
    flex: 1;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--ns-yellow-dim) 0%, transparent 100%);
    border-left: 3px solid var(--ns-yellow);
    color: var(--ns-yellow);
}

.user-profile {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.info {
    display: flex;
    flex-direction: column;
}

.info .name { font-weight: 600; font-size: 14px; }
.info .role { font-size: 12px; color: var(--text-muted); }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid var(--border-color);
}

.topbar h1 {
    font-size: 24px;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 12px 16px 12px 48px;
    border-radius: 24px;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--ns-yellow);
    background: rgba(255, 255, 255, 0.08);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.content-area {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

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

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    background: var(--bg-panel-hover);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ns-bg { background: var(--ns-yellow-dim); color: var(--ns-yellow); }
.bn-bg { background: var(--bn-blue-dim); color: #60a5fa; }
.success-bg { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.warning-bg { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.stat-details h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-details .value {
    font-size: 28px;
    font-weight: 700;
    margin: 4px 0;
}

.trend { font-size: 12px; font-weight: 500; }
.trend.positive { color: var(--success); }
.trend.negative { color: var(--danger); }
.trend.neutral { color: var(--text-muted); }

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.panel {
    padding: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--ns-yellow);
    color: #000;
}

.btn-primary:hover {
    background: #e5b414;
    transform: translateY(-2px);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.route-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.route-info i {
    color: var(--text-muted);
    font-size: 12px;
}

.train-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.crew-info {
    display: flex;
    gap: 8px;
}

.crew-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.crew-badge.op i { color: var(--bn-blue); }
.crew-badge.cond i { color: var(--ns-yellow); }

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.on-time { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-badge.delayed { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Map Preview */
.map-preview-panel {
    display: flex;
    flex-direction: column;
}

.map-placeholder {
    flex: 1;
    min-height: 300px;
    background: url('https://www.openrailwaymap.org/images/logo.png') center/contain no-repeat rgba(0,0,0,0.2);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.map-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 24px;
}

.map-overlay i {
    font-size: 48px;
    color: var(--ns-yellow);
}

.map-overlay p {
    color: var(--text-muted);
    font-weight: 500;
}
