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

:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --primary-light: #e8f4fd;
    --sidebar-bg: #1e1e2e;
    --sidebar-text: #cdd6f4;
    --sidebar-active: #0078d4;
    --sidebar-hover: #2a2a3e;
    --content-bg: #f8f9fa;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --success: #107c10;
    --warning: #ff8c00;
    --danger: #d13438;
    --info: #0078d4;
    --sidebar-width: 240px;
    --header-height: 60px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    width: 160px;
    height: auto;
    margin-bottom: 16px;
    filter: brightness(0) invert(1);
}

.loading-text {
    font-size: 16px;
    color: var(--sidebar-text);
    margin-bottom: 32px;
    letter-spacing: 1px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Layout */
#app {
    height: 100vh;
    display: flex;
}

#main-app {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    width: 152px;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.sidebar-title {
    display: none;
}

/* Navigation */
.nav-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: var(--sidebar-text);
    font-size: 14px;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    opacity: 0.75;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    opacity: 1;
}

.nav-item.active {
    background: rgba(0, 120, 212, 0.15);
    border-left-color: var(--primary);
    color: #ffffff;
    opacity: 1;
}

.nav-icon {
    font-size: 10px;
    width: 16px;
    text-align: center;
    opacity: 0.6;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--sidebar-text);
    opacity: 0.6;
    margin-bottom: 12px;
}

.sign-out-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--sidebar-text);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sign-out-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    background: var(--content-bg);
}

#page-container {
    padding: 24px;
    max-width: 1400px;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-message {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.empty-state-source {
    font-size: 12px;
    color: var(--text-muted);
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
    margin-top: 8px;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f3f4f6; color: #374151; }

/* Integration Status */
.integration-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.integration-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.integration-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
}

.integration-dot.connected { background: var(--success); }
.integration-dot.error { background: var(--danger); }
.integration-dot.not-configured { background: #d1d5db; }

.integration-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.integration-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.fleet-row-clickable:hover {
    background: #f8f9fb;
    border-radius: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: #f9fafb; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-info {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.nav-section-label {
  display: block;
  padding: 16px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.4);
  list-style: none;
  pointer-events: none;
}


.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #b91c1c; }