:root {
    --bg-primary: #030810;
    --bg-secondary: #0a1221;
    --bg-tertiary: #0f1a2e;
    --bg-card: #0d1729;
    --bg-card-hover: #122038;
    --bg-input: #070d18;
    --border-color: #162540;
    --border-light: #1e3356;
    --text-primary: #eaf0fa;
    --text-secondary: #8899b4;
    --text-muted: #556a87;
    --accent-cyan: #00e5c7;
    --accent-cyan-dim: rgba(0, 229, 199, 0.12);
    --accent-orange: #ff6b3d;
    --accent-blue: #4d94ff;
    --accent-green: #00d68f;
    --accent-red: #ff4757;
    --accent-yellow: #ffc107;
    --accent-purple: #b366ff;
    --accent-pink: #ff6b9d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

.font-mono { font-family: 'JetBrains Mono', monospace; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 272px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 229, 199, 0.25);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: logoShine 3s infinite;
}

@keyframes logoShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo-text span { color: var(--accent-cyan); }

.logo-version {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.85rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    padding: 0 0.85rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.85rem;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 3px;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    padding-left: 1rem;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-cyan-dim), rgba(77, 148, 255, 0.08));
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 229, 199, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-cyan);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    min-width: 22px;
    text-align: center;
}

.nav-badge.critical { background: rgba(255, 71, 87, 0.15); color: var(--accent-red); }
.nav-badge.warning { background: rgba(255, 193, 7, 0.15); color: var(--accent-yellow); }
.nav-badge.success { background: rgba(0, 214, 143, 0.15); color: var(--accent-green); }
.nav-badge.info { background: rgba(77, 148, 255, 0.15); color: var(--accent-blue); }

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 0.85rem;
    border-top: 1px solid var(--border-color);
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.user-profile-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.user-avatar-lg {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
}

.user-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--accent-green);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: 272px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Top Header */
.top-header {
    background: rgba(10, 18, 33, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.75rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.menu-toggle-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item.current { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep { color: var(--border-light); }

.search-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    padding: 0.6rem 1rem;
    width: 380px;
    transition: all 0.25s ease;
}

.search-container:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px var(--accent-cyan-dim), 0 4px 20px rgba(0, 229, 199, 0.1);
}

.search-container input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
}

.search-container input::placeholder { color: var(--text-muted); }

.header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.notification-indicator {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
}

.notification-count {
    position: absolute;
    top: 7px;
    right: 7px;
    min-width: 18px;
    height: 18px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.82rem;
}

.date-display svg { color: var(--accent-cyan); }

/* Page Content */
.page-content {
    padding: 1.75rem;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title-group h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #00c9ae);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 229, 199, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 229, 199, 0.35);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ============ KPI CARDS ============ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.4rem;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kpi-accent, var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover {
    border-color: var(--kpi-border, var(--kpi-accent, var(--accent-cyan)));
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -12px var(--kpi-glow, rgba(0, 229, 199, 0.2));
}

.kpi-card:hover::before { opacity: 1; }

.kpi-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.1rem;
}

.kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpi-bg, var(--accent-cyan-dim));
    color: var(--kpi-color, var(--accent-cyan));
}

.kpi-trend-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.trend-up {
    background: rgba(0, 214, 143, 0.12);
    color: var(--accent-green);
}

.trend-down {
    background: rgba(255, 71, 87, 0.12);
    color: var(--accent-red);
}

.trend-neutral {
    background: rgba(136, 153, 180, 0.12);
    color: var(--text-secondary);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.2rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

.kpi-label {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
}

.kpi-sparkline {
    height: 36px;
    opacity: 0.7;
}

/* ============ CHARTS SECTION ============ */
.charts-section {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-cyan);
}

.card-actions {
    display: flex;
    gap: 0.4rem;
}

.card-tab {
    padding: 0.4rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.card-tab:hover { color: var(--text-secondary); }

.card-tab.active {
    background: var(--accent-cyan-dim);
    border-color: rgba(0, 229, 199, 0.2);
    color: var(--accent-cyan);
}

.card-body {
    padding: 1.4rem;
}

/* Bar Chart */
.chart-area {
    height: 280px;
    position: relative;
}

.bar-chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 230px;
    padding-top: 20px;
    gap: 10px;
}

.bar-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    max-width: 70px;
}

.bars-stack {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.bar-segment {
    flex: 1;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.bar-segment:hover {
    filter: brightness(1.2);
    transform: scaleY(1.02);
    transform-origin: bottom;
}

.bar-segment.primary { background: var(--accent-cyan); }
.bar-segment.secondary { background: var(--accent-blue); opacity: 0.5; }

.bar-day-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* Donut Chart */
.donut-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.donut-chart-svg {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    position: relative;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.donut-center-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.donut-legend-list {
    flex: 1;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.donut-legend-item:last-child { border-bottom: none; }

.donut-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.donut-legend-name {
    flex: 1;
    font-size: 0.84rem;
}

.donut-legend-value {
    font-size: 0.84rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.donut-legend-pct {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 35px;
    text-align: right;
}

/* Quick Stats Row */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.quick-stat-item {
    text-align: center;
    padding: 0.85rem 0.5rem;
    background: var(--bg-input);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.quick-stat-item:hover {
    border-color: var(--border-light);
}

.quick-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.15rem;
}

.quick-stat-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============ DATA TABLES SECTION ============ */
.tables-section {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.9rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.95rem 1rem;
    font-size: 0.86rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.order-id-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-cyan);
    font-size: 0.82rem;
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.customer-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.customer-info { min-width: 0; }
.customer-name { font-weight: 500; white-space: nowrap; }
.customer-type { font-size: 0.72rem; color: var(--text-muted); }

.route-cell {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.route-arrow { color: var(--text-muted); margin: 0 0.3rem; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.72rem;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-delivered {
    background: rgba(0, 214, 143, 0.12);
    color: var(--accent-green);
}
.status-delivered::before { background: var(--accent-green); }

.status-in-transit {
    background: rgba(77, 148, 255, 0.12);
    color: var(--accent-blue);
}
.status-in-transit::before {
    background: var(--accent-blue);
    animation: pulse-dot 1.5s infinite;
}

.status-pending {
    background: rgba(255, 193, 7, 0.12);
    color: var(--accent-yellow);
}
.status-pending::before { background: var(--accent-yellow); }

.status-delayed {
    background: rgba(255, 71, 87, 0.12);
    color: var(--accent-red);
}
.status-delayed::before { background: var(--accent-red); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.amount-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.86rem;
}

.date-cell {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-cell {
    display: flex;
    gap: 0.35rem;
}

.action-btn-mini {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-mini:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Table Pagination */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border-color);
}

.table-info {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    gap: 0.35rem;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.page-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

/* Activity Feed */
.activity-feed {
    max-height: 420px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.activity-item:last-child { border-bottom: none; }

.activity-item:hover {
    padding-left: 0.5rem;
}

.activity-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-main { flex: 1; min-width: 0; }

.activity-text {
    font-size: 0.86rem;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.activity-text strong { color: var(--text-primary); }

.activity-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.activity-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    background: rgba(0, 214, 143, 0.12);
    color: var(--accent-green);
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 600;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

/* ============ BOTTOM WIDGETS ============ */
.bottom-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
}

/* Map Widget */
.map-widget {
    background: var(--bg-input);
    border-radius: 12px;
    height: 200px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(0, 229, 199, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(77, 148, 255, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-input), var(--bg-card));
}

.map-grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

.map-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    z-index: 2;
}

.map-marker.active {
    animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 199, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(0, 229, 199, 0); }
}

.map-center-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.map-center-stat {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-cyan);
}

.map-center-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Tasks Widget */
.tasks-list {
    max-height: 220px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.task-item:last-child { border-bottom: none; }

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.task-checkbox:hover { border-color: var(--accent-cyan); }

.task-checkbox.checked {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.task-content { flex: 1; min-width: 0; }

.task-title {
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.task-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-high { background: var(--accent-red); }
.priority-medium { background: var(--accent-yellow); }
.priority-low { background: var(--accent-green); }

/* Alerts Widget */
.alerts-list {
    max-height: 220px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.alert-item:last-child { border-bottom: none; }

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-content { flex: 1; min-width: 0; }

.alert-title {
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.alert-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.alert-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ============ MODAL OVERLAY ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.modal-body { padding: 1.5rem; }

.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px var(--accent-cyan-dim);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23556a87' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Notification Panel */
.notification-panel {
    display: none;
    position: fixed;
    top: 68px;
    right: 1.75rem;
    width: 380px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    z-index: 150;
    animation: slideDown 0.25s ease-out;
    overflow: hidden;
}

.notification-panel.active { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.notif-panel-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notif-count-badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-weight: 700;
}

.mark-all-read {
    font-size: 0.78rem;
    color: var(--accent-cyan);
    cursor: pointer;
    font-weight: 500;
}

.mark-all-read:hover { text-decoration: underline; }

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item.unread { background: rgba(0, 229, 199, 0.03); }

.notif-item:last-child { border-bottom: none; }

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }

.notif-text {
    font-size: 0.84rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notif-text strong { color: var(--text-primary); }

.notif-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.notif-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.4rem;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 16, 0.7);
    z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* Responsive */
@media (max-width: 1400px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-section { grid-template-columns: 1fr; }
    .tables-section { grid-template-columns: 1fr; }
    .bottom-widgets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle-btn { display: flex; }
    .search-container { width: 260px; }
    .bottom-widgets { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .top-header { padding: 0 1rem; }
    .search-container { display: none; }
    .date-display { display: none; }
    .page-content { padding: 1rem; }
    .kpi-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .donut-wrapper { flex-direction: column; text-align: center; }
    .quick-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .notification-panel {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}