/* ═══════════════════════════════════════════════════
   STMKG Monitoring System - Design System
   Sistem Monitoring Curah Hujan Jawa Barat
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables / Design Tokens ────────────── */
:root {
    /* BMKG Ocean Blue */
    --primary-900: #0c4a6e;
    --primary-800: #075985;
    --primary-700: #0369a1;
    --primary-600: #0284c7;
    --primary-500: #0ea5e9;
    --primary-400: #38bdf8;
    --primary-300: #7dd3fc;
    --primary-200: #bae6fd;
    --primary-100: #e0f2fe;

    /* Accent / CTA */
    --accent-500: #f97316;
    --accent-400: #fb923c;
    --accent-300: #fdba74;

    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #eab308;
    --warning-bg: rgba(234, 179, 8, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.15);

    /* Category Colors */
    --ringan: #22c55e;
    --sedang: #f97316;
    --lebat: #ef4444;
    --sangat-lebat: #7c3aed;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Theme (light default) */
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: var(--primary-900);
    --bg-header: var(--primary-800);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-on-dark: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Sizing */
    --sidebar-width: 220px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-xs: 6px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-main: #070b14; /* Deeper dark for high contrast */
    --bg-card: rgba(19, 27, 46, 0.6); /* Glass effect */
    --bg-card-hover: rgba(26, 37, 64, 0.85);
    --bg-sidebar: #05080f;
    --bg-header: rgba(11, 17, 33, 0.85);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* Muted & Glowing Status Colors for Dark Mode */
    --success: #34d399; 
    --success-bg: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24; 
    --warning-bg: rgba(251, 191, 36, 0.15);
    --danger: #f87171; 
    --danger-bg: rgba(248, 113, 113, 0.15);
    --info: #38bdf8; 
    --info-bg: rgba(56, 189, 248, 0.15);
    
    /* Vibrant Rainfall Colors */
    --ringan: #34d399;
    --sedang: #fbbf24;
    --lebat: #f87171;
    --sangat-lebat: #c084fc;
}

/* ─── Global Reset ────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* ─── Layout ──────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1100;
    transition: transform var(--transition-normal);
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-400), var(--info));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.brand-text h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text span {
    font-size: 0.75rem;
    opacity: 0.6;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #fff;
    background: var(--primary-500);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.nav-link .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link .icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    opacity: 0.5;
}

.system-live {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.system-live-text {
    font-size: 0.75rem;
}

.system-live-text strong {
    color: var(--success);
    display: block;
    font-size: 0.8rem;
}

/* ─── Main Content ─────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Header ──────────────────────────────────── */
.top-header {
    background: var(--bg-header);
    color: var(--text-on-dark);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.header-title h1 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.header-title span {
    font-size: 0.72rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    transition: background var(--transition-fast);
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    text-align: right;
}

.user-info .name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.7rem;
    opacity: 0.6;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
}

/* ─── Page Content ────────────────────────────── */
.page-content {
    flex: 1;
    padding: 24px 28px;
}

.page-title {
    margin-bottom: 8px;
}

.page-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ─── Cards ───────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-body {
    padding: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ─── Summary Cards (Dashboard) ───────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.summary-card .card-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.summary-card .card-icon.blue {
    background: var(--primary-100);
    color: var(--primary-500);
}

.summary-card .card-icon.cyan {
    background: var(--info-bg);
    color: var(--info);
}

.summary-card .card-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.summary-card .card-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="dark"] .summary-card .card-icon.blue {
    background: rgba(37, 99, 235, 0.2);
}

.summary-card .card-info {
    flex: 1;
    min-width: 0;
}

.summary-card .card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-card .card-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 4px;
}

.summary-card .card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    gap: 4px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-type {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-type.aws {
    background: var(--primary-500);
    color: #fff;
}

.badge-type.arg {
    background: var(--success);
    color: #fff;
}

.badge-type.aaws {
    background: var(--accent-500);
    color: #fff;
}

.badge-category {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-category.ringan {
    background: var(--success-bg);
    color: var(--success);
}

.badge-category.sedang {
    background: var(--warning-bg);
    color: var(--accent-500);
}

.badge-category.lebat {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-category.sangat-lebat {
    background: rgba(124, 58, 237, 0.15);
    color: var(--sangat-lebat);
}

/* Online/Offline dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-dot.offline {
    background: var(--gray-400);
}

/* ─── Dashboard Grid ───────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.map-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 400px;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: var(--border-radius);
    z-index: 1;
}

/* ─── Station Cards (Dashboard bottom) ─────── */
.station-cards-section {
    margin-top: 16px;
}

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

.filter-pills {
    display: flex;
    gap: 8px;
}

.filter-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--primary-500);
    color: #fff;
    border-color: var(--primary-500);
}

.station-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.station-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.station-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-500);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.station-card.type-aws::before {
    background: var(--primary-500);
}

.station-card.type-arg::before {
    background: var(--success);
}

.station-card.type-aaws::before {
    background: var(--accent-500);
}

.station-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.station-card:hover::before {
    transform: scaleX(1);
}

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

.station-card-name {
    font-size: 1rem;
    font-weight: 700;
}

.station-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.station-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.station-metrics {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.metric-circle {
    text-align: center;
}

.circle-progress {
    width: 56px;
    height: 56px;
    position: relative;
}

.circle-progress svg {
    transform: rotate(-90deg);
}

.circle-progress .track {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 4;
}

[data-theme="dark"] .circle-progress .track {
    stroke: var(--gray-700);
}

.circle-progress .fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.circle-progress .value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
}

.metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.station-card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-detail {
    width: 100%;
    padding: 8px;
    border-radius: var(--border-radius-xs);
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-detail:hover {
    background: var(--primary-500);
    color: #fff;
}

/* ─── Daftar Stasiun Page ──────────────────── */
.search-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 16px 10px 42px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
    position: relative;
}

.search-input:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.filter-select {
    padding: 10px 36px 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    min-width: 160px;
}

.filter-select:focus {
    border-color: var(--primary-400);
}

/* Station List Grid */
.station-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.station-list-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.station-list-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.slc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.slc-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.slc-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.slc-location {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.slc-update {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.slc-data {
    background: var(--bg-main);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    margin-bottom: 16px;
}

.slc-data-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slc-data-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.slc-data-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.slc-data-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.slc-sparkline {
    flex: 1;
    height: 30px;
}

.slc-footer .btn-detail {
    background: var(--bg-main);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.pagination .info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination .pages {
    display: flex;
    gap: 6px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-500);
    color: #fff;
    border-color: var(--primary-500);
}

/* ─── Detail Page ──────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-500);
}

.breadcrumb .current {
    color: var(--accent-500);
    font-weight: 600;
}

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

.detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 18px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-400);
    color: var(--primary-500);
}

.btn-primary {
    background: var(--accent-500);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

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

.info-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.info-card-title .icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.metric-item {
    background: var(--bg-main);
    border-radius: var(--border-radius-xs);
    padding: 10px;
}

.metric-item .label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.metric-item .value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 2px;
}

.metric-item .value.temp {
    color: var(--accent-500);
}

.metric-item .value.humidity {
    color: var(--primary-500);
}

.metric-item .value.pressure {
    color: var(--text-primary);
}

/* Chart Container */
.chart-card {
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 300px;
    padding: 16px;
}

/* Bottom Detail Cards */
.detail-bottom-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.detail-metric-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.detail-metric-card .card-icon-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.detail-metric-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.detail-metric-card .metric-visual {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}

.detail-metric-card .metric-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── Prediksi Page ────────────────────────── */
.forecast-banner {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
    border-radius: var(--border-radius);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.forecast-banner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='80' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='2'/%3E%3Ccircle cx='100' cy='100' r='50' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='2'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.forecast-banner h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.forecast-banner p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.day-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.day-tab {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.day-tab:hover,
.day-tab.active {
    background: var(--primary-500);
    color: #fff;
    border-color: var(--primary-500);
}

.prediction-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 20px;
    margin-bottom: 24px;
}

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

.prediction-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.prediction-table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.prediction-table tr:hover {
    background: var(--bg-card-hover);
}

.prediction-table .rainfall-value {
    font-weight: 700;
}

.prediction-table .rainfall-value.sedang {
    color: var(--accent-500);
}

.prediction-table .rainfall-value.lebat {
    color: var(--danger);
}

.prediction-table .rainfall-value.sangat-lebat {
    color: var(--sangat-lebat);
}

/* Model Performance */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.perf-item {
    text-align: center;
    padding: 16px;
}

.perf-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.perf-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.perf-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.perf-change {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.accuracy-gauge {
    text-align: center;
}

.accuracy-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--success);
}

.accuracy-bar {
    width: 100%;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    margin-top: 8px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--success), var(--primary-400));
    transition: width 1s ease;
}

/* ─── Footer ──────────────────────────────── */
.app-footer {
    text-align: center;
    padding: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

/* ─── Legend for map ──────────────────────── */
.map-legend {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
}

.map-legend h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.aws {
    background: var(--primary-500);
}

.legend-dot.arg {
    background: var(--success);
}

.legend-dot.aaws {
    background: var(--accent-500);
}

/* ─── Leaflet Custom ──────────────────────── */
.leaflet-popup-content-wrapper {
    border-radius: var(--border-radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
}

.map-popup {
    font-family: 'Inter', sans-serif;
    padding: 4px;
}

.map-popup h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.map-popup p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.map-coords {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: monospace;
    z-index: 1000;
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .prediction-grid {
        grid-template-columns: 1fr;
    }

    .detail-bottom-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .perf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .station-list-grid {
        grid-template-columns: 1fr;
    }

    .detail-bottom-grid {
        grid-template-columns: 1fr;
    }

    .perf-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-content {
        padding: 16px;
    }

    .search-filter-bar {
        flex-direction: column;
    }
}

/* ─── Animations ──────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slide {
    animation: slideInLeft 0.4s ease forwards;
}

/* Stagger children animations */
.stagger>* {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.stagger>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger>*:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger>*:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger>*:nth-child(8) {
    animation-delay: 0.4s;
}

/* ─── Loading Skeleton ────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, var(--gray-800) 25%, var(--gray-700) 50%, var(--gray-800) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Custom Scrollbar ───────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ─── Tooltip ────────────────────────────── */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: var(--gray-900);
    color: #fff;
    font-size: 0.72rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.tooltip:hover::after {
    opacity: 1;
}

/* ─── Export button ──────────────────────── */
.btn-export {
    background: var(--primary-500);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-export:hover {
    background: var(--primary-400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ─── Type Badges (Station Table) ──────────── */
.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.type-aws {
    background: var(--primary-500);
    color: #fff;
}

.type-badge.type-arg {
    background: var(--success);
    color: #fff;
}

.type-badge.type-aaws {
    background: var(--accent-500);
    color: #fff;
}

/* ─── Pagination Buttons ───────────── */
.pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary-400);
    color: var(--primary-400);
    background: rgba(37, 99, 235, 0.08);
}

.page-btn.active {
    background: var(--primary-500);
    color: #fff;
    border-color: var(--primary-500);
}

.page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.info {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ─── Category Badges (Prediction) ──────── */
.badge-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-category.ringan {
    background: rgba(34, 197, 94, 0.15);
    color: var(--ringan);
}

.badge-category.sedang {
    background: rgba(249, 115, 22, 0.15);
    color: var(--sedang);
}

.badge-category.lebat {
    background: rgba(239, 68, 68, 0.15);
    color: var(--lebat);
}

.badge-category.sangat-lebat {
    background: rgba(124, 58, 237, 0.15);
    color: var(--sangat-lebat);
}

/* ─── Notification Dropdown ──────────────── */
.notif-wrapper {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    animation: notif-pulse 2s infinite;
}

@keyframes notif-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    display: none;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

.notif-dropdown.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
}

.notif-header strong {
    font-size: 0.85rem;
}

.notif-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.notif-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.notif-body {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}

.notif-item {
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    transition: background var(--transition-fast);
    cursor: default;
}

.notif-item:hover {
    background: var(--bg-card-hover);
}

.notif-item.danger {
    border-left: 3px solid var(--danger);
}

.notif-item.warning {
    border-left: 3px solid var(--warning);
}

.notif-item.prediction {
    border-left: 3px solid var(--sangat-lebat);
}

.notif-item .notif-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.notif-item .notif-title.danger {
    color: var(--danger);
}

.notif-item .notif-title.warning {
    color: var(--warning);
}

.notif-item .notif-title.prediction {
    color: var(--sangat-lebat);
}

.notif-item .notif-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-item .notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.notif-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ─── Parameter Modules Redesign (Detail Page) ─── */
.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.param-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.param-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.param-header span.time {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.param-visual {
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

/* Visual Gauges */
.circle-gauge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid var(--primary-500);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--primary-100);
}

.circle-gauge.danger { border-color: var(--danger); background: var(--danger-bg); }
.circle-gauge.warning { border-color: var(--warning); background: var(--warning-bg); }

.text-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.text-gauge-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}
.text-gauge-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.arc-gauge-container {
    position: relative;
    width: 140px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.arc-bg {
    position: absolute;
    bottom: 0;
    width: 140px;
    height: 70px;
    border-top-left-radius: 70px;
    border-top-right-radius: 70px;
    border: 15px solid var(--gray-200);
    border-bottom: 0;
    box-sizing: border-box;
}
.arc-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 70px;
    border-top-left-radius: 70px;
    border-top-right-radius: 70px;
    border: 15px solid var(--primary-500);
    border-bottom: 0;
    box-sizing: border-box;
    transform-origin: bottom center;
    transition: transform 1s ease-out;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.arc-value {
    position: relative;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: -10px;
}

.param-chart-container {
    height: 100px;
    width: 100%;
    position: relative;
}


/* ─── Offline Station Card Dim ────────────── */
.station-card[data-status="Offline"] {
    opacity: 0.5;
    filter: grayscale(0.4);
}

.station-card[data-status="Offline"]:hover {
    opacity: 0.8;
    filter: grayscale(0);
}

/* ─── Type Color Variables ────────────────── */
:root {
    --aws-color: #2563eb;
    --arg-color: #22c55e;
    --aaws-color: #f97316;
}


/* ─── Loading Skeleton ────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-card-hover) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }
.skeleton-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}


/* ─── Loading Skeleton ────────────────────── */
.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skeleton-line {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-card-hover) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ─── Print Styles ────────────────────────── */
@media print {
    .sidebar, .top-header, .mobile-menu-btn, .header-actions,
    .notif-wrapper, #themeToggle, .btn-sm, .filter-select,
    #chartParamSelect, #chartTimeSelect, .app-footer { display: none !important; }
    
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    
    body { background: #fff !important; color: #000 !important; font-size: 12px; }
    .card, .bg-card { background: #fff !important; }
    
    .print-header { display: block !important; text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid #000; }
    .print-header h1 { font-size: 16px; }
    .print-header p { font-size: 11px; color: #666; }
}

.print-header { display: none; }

/* --- Mobile View Enhancements --- */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; width: 100%; }
    .app-layout { overflow-x: hidden; width: 100%; }
    .main-content { min-width: 0; width: 100%; overflow-x: hidden; }

    .top-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        height: auto !important;
        padding: 12px 16px !important;
        gap: 12px;
    }
    .header-title h1 {
        font-size: 1.1rem !important;
        white-space: normal !important;
        line-height: 1.3 !important;
    }
    .header-title p {
        font-size: 0.75rem !important;
        white-space: normal !important;
    }

    .home-clock-container {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 16px !important;
        gap: 8px !important;
    }
    #homeLiveTime {
        font-size: 1.8rem !important;
    }

    .tech-grid {
        grid-template-columns: 1fr !important;
    }
    .arch-diagram {
        padding: 16px !important;
        font-size: 0.7rem !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
    }
    
    .card { padding: 12px !important; }
    .card-body { padding: 16px !important; }
    .card-header { padding: 12px 16px !important; }
    
    .stat-row { flex-direction: column !important; }
    .stat-box { width: 100% !important; margin-bottom: 8px !important; }
}

/* --- Sticky Header Enhancement --- */
.top-header {
    position: sticky !important;
    top: 0;
    z-index: 1050;
    background: var(--bg-main);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}
[data-theme="dark"] .top-header {
    background: rgba(11, 17, 33, 0.9);
}
