@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Industrial fleet-ops palette */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;

    /* Power amber — the "energized" accent */
    --power: #f59e0b;
    --power-dark: #b45309;
    --power-light: #fbbf24;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Steel / industrial neutrals */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Sidebar dark theme */
    --sidebar-bg: #0b1424;
    --sidebar-bg-elev: #111d33;
    --sidebar-border: #1f2a44;
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #64748b;
    --sidebar-text-strong: #f1f5f9;

    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --card-shadow-hover: 0 12px 24px -8px rgba(15, 23, 42, 0.12), 0 6px 8px -6px rgba(15, 23, 42, 0.08);

    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-power:   linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-steel:   linear-gradient(135deg, #0b1424 0%, #1e293b 100%);
    --gradient-bg: linear-gradient(to bottom right, #f8fafc, #e2e8f0);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--neutral-50);
    color: var(--neutral-900);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar — dark fleet-ops style */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    color: var(--sidebar-text);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.08) 0%, transparent 50%);
}

.sidebar-logo {
    margin-bottom: 28px;
    padding: 16px;
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.sidebar-logo .logo-full {
    width: 100%;
    max-width: 170px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: brightness(1.05);
}

/* Section label above the nav items */
.sidebar ul::before {
    content: 'FLEET OPERATIONS';
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--sidebar-text-muted);
    letter-spacing: 0.18em;
    padding: 0 8px 12px;
}

/* Live status footer at bottom of sidebar */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    color: var(--sidebar-text-strong);
    font-size: 0.75rem;
    line-height: 1.5;
}

.sidebar-footer .footer-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--power-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
}

.sidebar-footer .footer-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--power);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
    animation: powerPulse 2s ease-out infinite;
}

@keyframes powerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.sidebar h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 48px;
    letter-spacing: -0.025em;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar li {
    padding: 11px 14px;
    border-radius: 8px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.18s ease;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.sidebar .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.sidebar li:hover {
    background-color: var(--sidebar-bg-elev);
    color: var(--sidebar-text-strong);
}

.sidebar li:hover .nav-icon {
    opacity: 1;
}

.sidebar li.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.08));
    color: white;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.sidebar li.active::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--power);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.sidebar li.active .nav-icon {
    opacity: 1;
    color: var(--power-light);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px 48px;
    background-image:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 0% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 35%);
    min-height: 100vh;
}

.view-section {
    animation: fadeIn 0.4s ease-out;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    padding-left: 16px;
}

.page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--gradient-power);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.page-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--power-dark);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

header h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--neutral-900);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

/* Button base */
button {
    font-family: 'Inter', sans-serif;
}

/* Input Fields Styling */
input[type="text"],
input[type="search"],
select {
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* File Upload */
.upload-group {
    background: white;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--neutral-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 16px;
    align-items: center;
}

.upload-group small {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neutral-700);
    margin-bottom: 4px;
    display: block;
}

input[type="file"] {
    font-size: 0.85rem;
    color: var(--neutral-700);
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--neutral-200);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s ease,
                border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12), 0 6px 8px -6px rgba(15, 23, 42, 0.08);
    border-color: var(--neutral-300);
}

.card.active {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.card p {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1;
    position: relative;
    z-index: 1;
    letter-spacing: -0.025em;
    font-feature-settings: 'tnum';
}

/* Card Variants with subtle gradients */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 0 0 0 100%;
    pointer-events: none;
}

.card.blue {
    border-bottom: 4px solid var(--primary);
}

.card.blue p {
    color: var(--primary);
}

.card.blue.active {
    box-shadow: 0 0 0 3px var(--primary-light), var(--card-shadow-hover);
}

.card.blue::before {
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    opacity: 1;
}

.card.green {
    border-bottom: 4px solid var(--success);
}

.card.green p {
    color: var(--success);
}

.card.green.active {
    box-shadow: 0 0 0 3px #86efac, var(--card-shadow-hover);
}

.card.green::before {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    opacity: 1;
}

.card.orange {
    border-bottom: 4px solid var(--warning);
}

.card.orange p {
    color: var(--warning);
}

.card.orange.active {
    box-shadow: 0 0 0 3px #fdba74, var(--card-shadow-hover);
}

.card.orange::before {
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    opacity: 1;
}

.card.red {
    border-bottom: 4px solid var(--danger);
}

.card.red p {
    color: var(--danger);
}

.card.red.active {
    box-shadow: 0 0 0 3px #fca5a5, var(--card-shadow-hover);
}

.card.red::before {
    background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
    opacity: 1;
}


/* Tables */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 28px;
    border: 1px solid var(--neutral-200);
    position: relative;
}

.table-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--neutral-200);
    background: white;
    position: sticky;
    top: 0;
    z-index: 20;
}

.table-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--neutral-800);
    letter-spacing: -0.01em;
}

table {
    width: 100%;
    border-collapse: separate;
    /* Changed for border-radius on rows if needed */
    border-spacing: 0;
}

th {
    background-color: var(--neutral-50);
    text-align: left;
    padding: 14px 28px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--neutral-700);
    font-weight: 700;
    border-bottom: 1px solid var(--neutral-200);
}

/* Ensure charts container doesn't block sticky */
.charts-container {
    overflow: visible !important;
}

/* Ensure table containers support sticky headers */
.table-container {
    overflow: visible;
    position: relative;
}

td {
    padding: 16px 28px;
    border-bottom: 1px solid var(--neutral-100);
    font-size: 0.88rem;
    color: var(--neutral-700);
    transition: background 0.15s;
    font-variant-numeric: tabular-nums;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--neutral-50);
    color: var(--neutral-900);
}

/* Status Badges */
/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.status-rented {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Live equipment pulse on RENTED status (running gensets) */
.status-rented::before {
    background: #15803d;
    animation: livePulse 1.6s ease-out infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.55); }
    70%  { box-shadow: 0 0 0 6px rgba(21, 128, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

.status-maintenance {
    background-color: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.status-maintenance::before {
    background: #c2410c;
}

.status-available {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.status-available::before {
    background: #1d4ed8;
}

/* Selection Interaction */
tr.selected td {
    background-color: #eff6ff !important;
}

tr.selected td:first-child {
    box-shadow: inset 4px 0 0 var(--primary);
}

/* History Section Animation */
#historyContainer {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   RESPONSIVE DESIGN & ALIGNMENT FIXES
   ========================================= */

/* Responsive Table - Hide columns on small screens */
/* Mobile: Show only Serial No and Status */
@media (max-width: 640px) {
    .mobile-hide {
        display: none !important;
    }
}

/* Tablet: Show Serial, Customer, Model, Status, Service Due, Util */
@media (min-width: 641px) and (max-width: 1024px) {
    .tablet-hide {
        display: none !important;
    }
}

/* Ensure tables don't break layout */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll iOS */
}

/* Mobile Breakpoint (<768px) */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* Sidebar becomes Topbar */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px 20px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid var(--neutral-200);
        border-right: none;
        gap: 16px;
    }

    .sidebar-logo {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .sidebar-logo .logo-full {
        max-width: 140px;
        margin: 0 auto;
    }

    .sidebar h2 {
        display: none;
        /* Hide Title on Mobile to save space */
    }

    .sidebar ul {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sidebar li {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Main Content Adjustments */
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    /* Header Adjustments */
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    header>div {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* OneDrive controls container */
    header>div>div {
        width: 100%;
    }

    /* Buttons full width on mobile */
    button {
        width: 100%;
        justify-content: center;
    }

    /* OneDrive controls mobile fix */
    header>div>div[style*="background: #f8fafc"] {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;
    }

    #oneDriveStatus {
        text-align: center;
        width: 100%;
    }

    /* Asset History Header */
    #view-asset-history header div {
        flex-direction: column;
        width: 100%;
        align-items: stretch !important;
    }

    #assetSearchInput {
        width: 100% !important;
    }

    /* Stats Grid Compact */
    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
        gap: 16px;
    }

    .card {
        padding: 24px;
    }

    .card p {
        font-size: 2.5rem;
    }

    /* Global Toolbar Mobile */
    .global-toolbar {
        justify-content: center !important;
        margin-bottom: 16px !important;
    }

    .global-toolbar>div {
        width: 100%;
        justify-content: space-between;
        flex-direction: column;
        text-align: center;
    }

    /* Search inputs full width */
    input[type="text"],
    input[type="search"],
    select {
        width: 100% !important;
        max-width: 100%;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    /* Upload group mobile */
    .upload-group {
        flex-direction: column;
        padding: 16px;
    }

    /* Table headers smaller */
    .table-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch !important;
    }

    .table-header h2 {
        text-align: center;
    }
}

/* Asset History Specific Alignment */
#view-asset-history header {
    flex-wrap: wrap;
    /* Ensure search bar wraps if needed */
}

/* Ensure Charts are responsive */
.charts-container {
    grid-template-columns: 1fr !important;
    /* Stack charts on small screens */
}

@media (min-width: 1024px) {
    .charts-container {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* =========================================
   DASHBOARD OVERVIEW STYLES
   ========================================= */

/* Dashboard metrics grid */
.dashboard-metrics {
    margin-bottom: 40px;
}

.dashboard-metrics .card small {
    display: block;
    margin-top: 8px;
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--neutral-700);
    opacity: 0.85;
}

/* Industrial metric card with icon badge */
.metric-card {
    cursor: default;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-card .metric-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: currentColor;
    z-index: 1;
}

.metric-card .metric-icon svg {
    width: 22px;
    height: 22px;
}

.metric-card.green  .metric-icon { color: var(--success); background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.18); }
.metric-card.blue   .metric-icon { color: var(--primary); background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.18); }
.metric-card.orange .metric-icon { color: var(--power);   background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.18); }
.metric-card.red    .metric-icon { color: var(--danger);  background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.18); }

.metric-card h3 {
    padding-right: 56px;
}

/* Dashboard charts grid - 2x2 on desktop, stack on mobile */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 1024px) {
    .dashboard-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Chart cards */
.chart-card {
    padding: 24px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    cursor: default;
}

.chart-card:hover {
    transform: none;
}

.chart-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: -0.005em;
}

.chart-card canvas {
    flex: 1;
    max-height: 280px;
}

/* Wide chart card spans both columns of a 2-col grid. Sized to fit rotated
   x-labels + top legend without empty space. */
.chart-card-wide {
    grid-column: 1 / -1;
    min-height: 380px;
    margin-bottom: 0;
    padding-bottom: 16px;
}

.chart-card-wide canvas {
    max-height: 320px;
}

/* Charts container shouldn't add extra trailing whitespace — the next
   section follows immediately. */
.charts-container { margin-bottom: 4px; }

/* Mobile optimizations for dashboard */
@media (max-width: 768px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chart-card {
        min-height: 300px;
        padding: 20px;
    }

    .chart-card canvas {
        max-height: 220px;
    }

    .dashboard-metrics .card {
        padding: 20px;
    }

    .dashboard-metrics .card p {
        font-size: 2.2rem;
    }

    .dashboard-metrics .card small {
        font-size: 0.8rem;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1023px) {
    .dashboard-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-card {
        min-height: 320px;
    }
}

/* Purple card style for additional metrics */
.card.purple {
    border-bottom: 4px solid #8b5cf6;
}

.card.purple p {
    color: #8b5cf6;
}

.card.purple.active {
    box-shadow: 0 0 0 3px #c4b5fd, var(--card-shadow-hover);
}

.card.purple::before {
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    opacity: 1;
}

/* Ensure all dashboard elements are responsive */
#dashAlerts>div {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Dashboard summary table responsive */
@media (max-width: 640px) {

    #dashSummaryTable td,
    #dashSummaryTable th {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}

/* =========================================
   LOGIN SCREEN
   ========================================= */
.login-screen {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at top right, rgba(245, 158, 11, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse at bottom left,  rgba(37, 99, 235, 0.22) 0%, transparent 50%),
        linear-gradient(135deg, #0b1424 0%, #1e293b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    overflow: hidden;
}

/* Subtle grid pattern — fleet-ops feel */
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.login-card {
    background: white;
    padding: 52px 56px;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    text-align: center;
    max-width: 460px;
    width: 100%;
    animation: loginSlideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

/* Top amber accent stripe — "powered by Watan Altaqa" */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-power);
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    margin-bottom: 24px;
}

.login-logo img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.login-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--neutral-800);
    margin-bottom: 6px;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.login-tagline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--power-dark);
    background: rgba(245, 158, 11, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 22px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.login-tagline::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--power);
    animation: powerPulse 2s ease-out infinite;
}

.login-description {
    color: var(--neutral-700);
    margin-bottom: 28px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.btn-login-primary,
.btn-login-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.btn-login-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-login-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-login-secondary {
    background: white;
    color: var(--neutral-700);
    border: 1.5px solid var(--neutral-200);
}

.btn-login-secondary:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
}

.login-note {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #94a3b8;
}

@media (max-width: 540px) {
    .login-card { padding: 36px 28px; }
    .login-title { font-size: 1.5rem; }
    .login-subtitle { font-size: 1rem; }
}

/* =========================================
   BUTTON SYSTEM
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
    line-height: 1;
    letter-spacing: 0.01em;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-indigo {
    background: #6366f1;
    color: white;
}

.btn-indigo:hover {
    background: #4f46e5;
}

.btn-ghost {
    background: transparent;
    color: var(--neutral-700);
    border: 1px solid var(--neutral-300);
}

.btn-ghost:hover {
    background: var(--neutral-50);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.28);
}

.btn-whatsapp:hover {
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

/* =========================================
   HEADER ACTIONS / ONEDRIVE CONTROLS
   ========================================= */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.onedrive-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--neutral-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
}

.onedrive-status {
    font-size: 0.85rem;
    color: var(--neutral-700);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.onedrive-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neutral-300);
}

.onedrive-status.connected {
    color: var(--success);
    font-weight: 600;
}

.onedrive-status.connected::before {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* Inline upload pair on the Executive Dashboard header */
.manual-upload-inline {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--neutral-200);
}

.upload-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neutral-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upload-inline-label input[type="file"] {
    font-size: 0.8rem;
    text-transform: none;
    font-weight: 400;
}

.upload-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* =========================================
   GLOBAL TOOLBAR (date filter)
   ========================================= */
.global-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.toolbar-group {
    background: white;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--neutral-200);
}

.toolbar-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neutral-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toolbar-select {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid var(--neutral-300);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--neutral-700);
    outline: none;
    background: white;
}

/* =========================================
   ALERTS / EMPTY STATES
   ========================================= */
.alert {
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.empty-state {
    text-align: center;
    padding: 24px;
    color: var(--neutral-700);
    font-size: 0.9rem;
}

/* Rental-date confidence dot — quick at-a-glance data quality indicator */
.conf-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    cursor: help;
    border: 1.5px solid white;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

.conf-dot.conf-high   { background: var(--success); }
.conf-dot.conf-medium { background: var(--power); }
.conf-dot.conf-low    { background: var(--neutral-300); }

/* =========================================
   ASSET SUMMARY CARD (Asset History view)
   Quick snapshot of the searched genset above the rental + service tables.
   ========================================= */
.asset-summary {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 22px 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.asset-summary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-power);
}

.asset-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px 28px;
}

.asset-summary-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asset-summary-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neutral-700);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.asset-summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--neutral-900);
    letter-spacing: -0.01em;
}

/* Make the model especially prominent — it's the primary identifier */
.asset-summary-value.asset-summary-model {
    font-size: 1.15rem;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
    padding: 4px 10px;
    border-radius: 8px;
    align-self: flex-start;
}

/* Idle indicator — for AVAILABLE / MAINTENANCE rows in Fleet Inventory.
   Color severity: green ≤14d, amber 15-45d, red >45d. */
.idle-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: help;
    border: 1px solid transparent;
}

.idle-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.idle-pill.idle-ok   { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.idle-pill.idle-warn { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.idle-pill.idle-bad  { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

.idle-sub {
    display: block;
    color: var(--neutral-700);
    font-size: 0.72rem;
    margin-top: 2px;
    font-style: italic;
}

/* =========================================
   TABLE HEADER FLEX VARIANT
   ========================================= */
.table-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.search-input {
    padding: 10px 14px;
    border: 1px solid var(--neutral-300);
    border-radius: 8px;
    width: 280px;
    max-width: 100%;
    font-size: 0.9rem;
}

/* =========================================
   ANALYTICS CHARTS GRID
   ========================================= */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 8px;
}

.charts-container .chart-card {
    height: 380px;
}

@media (max-width: 1024px) {
    .charts-container {
        grid-template-columns: 1fr !important;
    }
}

/* Keep monthly tables nicely spaced */
.charts-container .table-container {
    margin-bottom: 0;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.app-toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 14px 22px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.25s ease-out;
    pointer-events: none;
}

.app-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.app-toast-success { background: var(--success); }
.app-toast-error   { background: var(--danger); }
.app-toast-info    { background: var(--primary); }

/* =========================================
   TODAY'S BRIEF — top-of-dashboard priority panel
   ========================================= */
.todays-brief {
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.todays-brief::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-power);
}

.brief-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.brief-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--power-dark);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.brief-date {
    font-size: 0.85rem;
    color: var(--neutral-700);
    font-weight: 500;
}

.brief-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.brief-tile {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    padding: 16px 18px;
    border-left-width: 4px;
}

.brief-tile.brief-critical { border-left-color: var(--danger); background: #fff5f5; }
.brief-tile.brief-warning  { border-left-color: var(--power);  background: #fffbeb; }
.brief-tile.brief-info     { border-left-color: var(--primary); background: #eff6ff; }

.brief-tile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.brief-icon { font-size: 1.25rem; }

.brief-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--neutral-800);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.brief-count {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--neutral-900);
    background: white;
    padding: 2px 12px;
    border-radius: 999px;
    border: 1px solid var(--neutral-200);
    min-width: 32px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Fixed-height row so the auto-scroll math (window = 3 × row-height) lines up
   exactly across all tiles, regardless of varying customer-name lengths. */
.brief-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 0 2px;
    border-bottom: 1px dashed var(--neutral-200);
    font-size: 0.82rem;
    height: 34px;
    box-sizing: border-box;
}

.brief-item strong { color: var(--neutral-800); font-weight: 700; font-size: 0.82rem; }
.brief-item span   { color: var(--neutral-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief-item em     { color: var(--neutral-700); font-style: normal; font-weight: 600; font-size: 0.74rem; white-space: nowrap; }

/* Window that shows exactly 3 rows — auto-scroll runs inside this */
.brief-tile-body-window {
    height: calc(34px * 3);
    overflow: hidden;
    position: relative;
    /* fade the edges so items appearing/disappearing look graceful */
    mask-image: linear-gradient(to bottom, transparent 0, black 12%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 12%, black 88%, transparent 100%);
}

/* The rotating track — content is duplicated, so translateY(-50%) loops cleanly */
.brief-rotate-track {
    animation: briefRotate var(--rotate-duration, 20s) linear infinite;
    will-change: transform;
}

/* Pause when the user hovers anywhere over the tile — gives time to read */
.brief-tile:hover .brief-rotate-track,
.brief-tile-body-window:hover .brief-rotate-track {
    animation-play-state: paused;
}

@keyframes briefRotate {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.brief-empty {
    color: var(--neutral-700);
    font-size: 0.85rem;
    text-align: center;
    padding: 12px 0;
    font-weight: 500;
}

/* =========================================
   ALERTS PANEL (Executive Dashboard)
   ========================================= */
.alerts-panel {
    padding: 24px;
}

.alerts-grid {
    display: grid;
    gap: 12px;
}

.alerts-empty {
    text-align: center;
    color: var(--neutral-700);
    padding: 8px 0;
}

.alert-row {
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.18s ease;
}

.alert-row:hover {
    transform: translateX(2px);
}

.alert-row .alert-icon {
    font-size: 1.5rem;
}

.alert-row .alert-message {
    font-weight: 600;
    color: var(--neutral-800);
}

.alert-row-critical { background: #fee2e2; border-left-color: var(--danger); }
.alert-row-warning  { background: #ffedd5; border-left-color: var(--warning); }
.alert-row-info     { background: #dbeafe; border-left-color: var(--primary); }
.alert-row-success  { background: #dcfce7; border-left-color: var(--success); }

.summary-metric {
    font-weight: 600;
}

.summary-value {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 700;
}

/* =========================================
   COMPREHENSIVE RESPONSIVE LAYER
   Tablet (≤1024 px), phone (≤640 px), tiny phone (≤400 px)
   ========================================= */

/* TABLET — keep sidebar but trim padding */
@media (max-width: 1024px) {
    .main-content { padding: 28px 28px; }
    header h1 { font-size: 1.6rem; }
    .stats-grid { gap: 16px; }
    .card { padding: 22px; }
    .card p { font-size: 2.2rem; }
    .metric-card .metric-icon { width: 38px; height: 38px; }
    .metric-card .metric-icon svg { width: 18px; height: 18px; }
}

/* PHONE — sidebar collapses to a top bar */
@media (max-width: 768px) {
    /* Header layout — stack page title above actions, all controls full-width */
    header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-actions > * { width: 100%; }
    .header-actions .btn { width: 100%; justify-content: center; }

    .onedrive-controls,
    .manual-upload-inline {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .onedrive-controls .btn,
    .manual-upload-inline .btn {
        width: 100%;
        justify-content: center;
    }

    .onedrive-status {
        justify-content: center;
        text-align: center;
    }

    .table-header-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input { width: 100%; }
    .toolbar-group { width: 100%; justify-content: space-between; }

    /* Sidebar footer: hide on mobile (sidebar becomes a top strip) */
    .sidebar-footer { display: none; }
    .sidebar ul::before { display: none; }
    .sidebar { padding: 12px 16px; }
    .sidebar-logo {
        margin-bottom: 0; padding: 8px 12px;
        border-bottom: none;
        background: transparent;
    }
    .sidebar-logo .logo-full { max-width: 110px; }
    .sidebar ul {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        scrollbar-width: none;
    }
    .sidebar ul::-webkit-scrollbar { display: none; }
    .sidebar li {
        padding: 8px 12px;
        font-size: 0.82rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .sidebar li.active::before { display: none; }
    .sidebar .nav-icon { width: 16px; height: 16px; }

    /* Today's Brief: stack tiles */
    .brief-grid { grid-template-columns: 1fr; }

    /* Page title accent slimmer */
    .page-title { padding-left: 12px; }
    header h1 { font-size: 1.35rem; }
    .page-eyebrow { font-size: 0.65rem; }

    /* Brief items: keep single-line layout (the 34px row is fixed for the
       ticker math). Customer name truncates to fit. */
    .brief-item {
        grid-template-columns: auto 1fr auto;
        gap: 6px;
    }
    .brief-item strong { font-size: 0.78rem; }
    .brief-item span   { font-size: 0.74rem; }
    .brief-item em     { font-size: 0.7rem; }

    /* Asset summary stacks on phone */
    .asset-summary { padding: 18px 18px; }
    .asset-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px 18px;
    }
    .asset-summary-value { font-size: 0.95rem; }
    .asset-summary-value.asset-summary-model { font-size: 1rem; }

    /* Chart cards — taller aspect on phone so chart isn't squashed */
    .chart-card { min-height: 320px; }
    .chart-card-wide { min-height: 360px; }
    .chart-card canvas,
    .chart-card-wide canvas { max-height: 260px; }

    /* Page padding tightened */
    .main-content { padding: 20px 14px; }
    .stats-grid { margin-bottom: 24px; }
}

/* TINY PHONES (≤480 px) — most modern phones in portrait */
@media (max-width: 480px) {
    .main-content { padding: 16px 12px; }
    .card { padding: 18px; }
    .card p { font-size: 1.9rem; }
    .metric-card h3 { font-size: 0.8rem; padding-right: 48px; }
    .metric-card .metric-icon { width: 34px; height: 34px; top: 16px; right: 16px; }
    .metric-card .metric-icon svg { width: 16px; height: 16px; }

    .todays-brief { padding: 18px 16px; }
    .brief-tile { padding: 14px; }

    .table-header { padding: 14px 18px; }
    th, td { padding: 12px 16px; font-size: 0.82rem; }

    .login-card { padding: 28px 22px; }
    .login-title { font-size: 1.35rem; }
    .login-subtitle { font-size: 0.85rem; }

    /* Asset summary 1-column on tiny phones */
    .asset-summary-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Brief tile dates and headers compress further */
    .brief-header { font-size: 0.7rem; }
    .brief-date { font-size: 0.78rem; }
    .brief-tile-head { gap: 8px; }
    .brief-title { font-size: 0.72rem; }
    .brief-count { font-size: 1rem; padding: 1px 8px; }

    /* Chart cards take less vertical space on tiny phones */
    .chart-card { min-height: 280px; }
    .chart-card canvas { max-height: 220px; }

    /* On phones, show DATE + STATUS only — pile detail into the row */
    .ultra-mobile-hide { display: none; }
}