/* ============================================================
   MAINTENANCE PRO STYLES
   ------------------------------------------------------------
   Loaded AFTER style.css, add-assets.css, and maintenance.css
   so it can extend and override cleanly.

   PURPOSE:
     The maintenance page previously reused generic card / button
     styling. This stylesheet gives it the same professional
     polish as the dashboard landing page (index.html), without
     touching any of the JavaScript logic.

   CONTAINS:
     1. Page hero strip (title + actions + KPI chips)
     2. Refined action buttons
     3. Polish for filter sidebar cards
     4. Maintenance table refinements (sticky header, hover,
        colored type badges)
     5. Statistics card upgrade (icon + accent, like the
        dashboard-pro cards)
     6. Modal consistency

   IMPORTANT:
     Every selector here is scoped under classes that already
     exist in maintenance.html — we never change IDs, never
     change data attributes, never touch onclick handlers.
   ============================================================ */

/* ============================================================
   1) PAGE HERO STRIP
   ------------------------------------------------------------
   Replaces the plain <h1> + <p> + row of 5 buttons with a
   compact professional header:
     • Left   : page title, subtitle, and action buttons
     • Right  : three small KPI chips (Total / Pending / Overdue)
   ============================================================ */
.maintenance-hero {
    position: relative;
    background: linear-gradient(135deg, #1e3a5f 0%, #152b47 60%, #2a4d7a 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.22);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Diagonal light streak — same subtle sheen as the dashboard hero */
.maintenance-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 55%;
    height: 200%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(240, 176, 93, 0.10) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(15deg);
    pointer-events: none;
}

.maintenance-hero-text {
    position: relative;
    z-index: 1;
    min-width: 260px;
    flex: 1;
}

.maintenance-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #f0b05d;
    margin-bottom: 6px;
}

.maintenance-hero-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.maintenance-hero-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ---- Action buttons row inside the hero ---- */
.maintenance-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

/* Primary CTA: amber gradient */
.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #f0b05d 0%, #e09d3e 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(240, 176, 93, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 176, 93, 0.5);
}

.hero-btn-primary:active {
    transform: translateY(0);
}

/* Secondary CTA: ghost buttons that read well on dark hero */
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* ---- KPI chips on the right side of the hero ---- */
.maintenance-hero-kpis {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.hero-kpi {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 96px;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.hero-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.hero-kpi-value.kpi-pending  { color: #f0b05d; }
.hero-kpi-value.kpi-overdue  { color: #ff8a75; }
.hero-kpi-value.kpi-complete { color: #86e29b; }

/* ============================================================
   2) FILTER SIDEBAR POLISH
   ------------------------------------------------------------
   The sidebar currently contains two cards: folder tree and
   filter form. We give both a subtle "mini-header" look so the
   user can tell the sections apart at a glance.
   ============================================================ */
.left-sidebar-wrapper .assets-folder-container,
.left-sidebar-wrapper .maintenance-filter-form {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef1f3;
    background: #ffffff;
    padding: 18px;
}

.left-sidebar-wrapper .assets-folder-container h3,
.left-sidebar-wrapper .maintenance-filter-form h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #244855;
    margin: 0 0 14px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f3;
}

/* Folder tree items get a slight tabular feel */
.folder-item {
    padding: 2px 0;
}

.folder-content {
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.folder-content:hover {
    background: #f2f6f8;
}

/* Filter labels — slightly more breathing room */
.maintenance-filter-form > div {
    margin-bottom: 18px !important;
}

.maintenance-filter-form label {
    color: #495057;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

/* ============================================================
   3) MAINTENANCE TABLE POLISH
   ------------------------------------------------------------
   The main content card currently uses a plain <table>. We add:
     • A cleaner header bar with a bottom border
     • Sticky table header that stays visible on scroll
     • Softer row hover
     • Type badges that stay pill-shaped but with slightly
       stronger contrast
   ============================================================ */
#maintenanceTableContainer {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef1f3;
    background: #ffffff;
    padding: 22px;
}

#maintenanceTableContainer h2,
#maintenanceTableTitle {
    font-size: 17px;
    font-weight: 700;
    color: #244855;
    margin: 0 0 18px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f3;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sticky header on the maintenance table */
#maintenanceTableContainer .data-table thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    color: #495057;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 14px;
    border-bottom: 2px solid #eef1f3;
    z-index: 2;
}

#maintenanceTableContainer .data-table tbody td {
    padding: 14px;
    font-size: 13px;
    color: #343a40;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

#maintenanceTableContainer .data-table tbody tr {
    transition: background 0.15s ease;
}

#maintenanceTableContainer .data-table tbody tr:hover {
    background: #f8fafb;
}

/* Reinforce type badges inside the table so they read crisp */
#maintenanceTableContainer .type-badge {
    font-size: 11px;
    padding: 4px 12px;
}

/* ============================================================
   4) STATISTICS CARDS UPGRADE
   ------------------------------------------------------------
   The bottom stats-grid currently reuses the basic .stat-card
   from style.css. We give these four cards the same visual
   language as the dashboard-pro stat cards: accent bar on
   left, softer shadow, larger value.
   ============================================================ */
.content-card .stats-grid .stat-card {
    position: relative;
    border-left: none;                  /* remove the old red bar */
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef1f3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.content-card .stats-grid .stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #244855;                /* default dark teal */
}

/* Color-code each stat card by its position */
.content-card .stats-grid .stat-card:nth-child(1)::before { background: #90AEAD; } /* Total Scheduled */
.content-card .stats-grid .stat-card:nth-child(2)::before { background: #f0b05d; } /* Pending */
.content-card .stats-grid .stat-card:nth-child(3)::before { background: #28a745; } /* Completed */
.content-card .stats-grid .stat-card:nth-child(4)::before { background: #E64833; } /* Overdue */

.content-card .stats-grid .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(36, 72, 85, 0.10);
}

.content-card .stats-grid .stat-card h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 10px;
}

.content-card .stats-grid .stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a3640;
    line-height: 1;
    margin-bottom: 6px;
}

.content-card .stats-grid .stat-card .stat-change {
    font-size: 12px;
    color: #6c757d;
}

/* Make the whole stats section card transparent so the inner
   stat cards look like their own tiles */
.content-card:has(> .stats-grid) {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}

.content-card:has(> .stats-grid) > h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #244855;
    margin: 0 0 14px 0;
    padding: 0 4px;
}

/* ============================================================
   5) MODAL CONSISTENCY
   ------------------------------------------------------------
   Existing modals use the base .modal-content rules from
   maintenance.css. We slightly tighten them here so headers
   sit flush and the close button reads as a real button.
   ============================================================ */
.modal-content h2 {
    color: #244855;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.1px;
}

.modal-content > div[style*="border-bottom"][style*="2px solid #dee2e6"] {
    /* Sharper modal header separator */
    border-bottom-color: #eef1f3 !important;
}

/* ============================================================
   6) RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 900px) {
    .maintenance-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 20px;
    }

    .maintenance-hero-kpis {
        width: 100%;
        justify-content: flex-start;
    }

    .hero-kpi {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
    }

    .hero-kpi-value {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .maintenance-hero-title {
        font-size: 20px;
    }

    .maintenance-hero-actions {
        width: 100%;
    }

    .hero-btn-primary,
    .hero-btn-secondary {
        flex: 1 1 calc(50% - 5px);
        justify-content: center;
        font-size: 12px;
        padding: 10px 12px;
    }

    .maintenance-hero-kpis {
        flex-wrap: wrap;
    }

    .hero-kpi {
        flex: 1 1 calc(50% - 6px);
    }
}