:root {
    /* Modern Dark Sidebar Theme */
    --primary: #3b82f6;
    /* Bright Blue */
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-bg: #eff6ff;

    --sidebar-bg: #1e293b;
    /* Slate 800 - Dark for sidebar */
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;

    --secondary: #64748b;
    --accent: #f59e0b;

    --background: #f1f5f9;
    /* Slate 100 - Light gray background, not white */
    --surface: #ffffff;

    --text: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    --text-light: #94a3b8;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border: #cbd5e1;
    /* Slightly darker border for visibility */

    --sidebar-width: 250px;
    /* Reduced width slightly */
    --header-height: 60px;
    /* Compact header */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --radius: 0.375rem;
    --radius-lg: 0.5rem;

    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    font-size: 14px;
    /* Slightly smaller base font for compactness */
}

a {
    text-decoration: none;
    color: inherit;
}

.app-container {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    flex-grow: 0;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: #0f172a;
    /* Darker header for logo */
    border-bottom: 1px solid #334155;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

/* Navigation - Compacted */
.nav-items {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Tight spacing */
}



.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.75rem;
    /* Reduced padding */
    color: var(--sidebar-text);
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-item.logout {
    margin-top: 2rem;
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.nav-item.logout:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: white;
}


/* Main Content */
.main-content {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--background);
    min-height: 0;
    height: 100vh;
}

/* Top Bar */
.top-bar {
    height: var(--header-height);
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    z-index: 40;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 0.75rem;
    color: var(--secondary);
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    min-height: 0;
    width: 100%;
}

/* Cards */
.card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--primary);
    /* Border on left for modern look */
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.stat-title {
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-bg);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tables */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
}

.section-header h2,
.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f1f5f9;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Table Utilities */
.text-right {
    text-align: right !important;
}

.col-id {
    width: 120px;
}

.col-plate {
    width: 180px;
}

.col-count {
    width: 140px;
}

.col-ip {
    width: 160px;
}

.table-compact th,
.table-compact td {
    padding: 0.5rem 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-size: 0.9rem;
    gap: 6px;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: white;
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: var(--secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 0.9rem;
}

/* Badges */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Login Page specific */
.login-page {
    /* Different background for login */
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* NOC Monitor Dashboard Dark Mode Overrides */
#telemetry-table-wrapper,
.noc-table-wrapper,
.telemetry-table {
    background: #090c14 !important;
    background-color: #090c14 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}