/* ============================================================
   ASSETS PRO STYLES
   ------------------------------------------------------------
   Loaded AFTER style.css, add-assets.css, and modal-assets.css
   so it can extend and override cleanly.

   PURPOSE:
     The assets page previously reused generic card / button
     styling. This stylesheet gives it the same professional
     polish as the dashboard, maintenance, and work orders pages.

   CONTAINS:
     1. Page hero strip (title + actions + live KPI chips)
     2. Folder sidebar polish
     3. Assets table refinements (sticky header, hover, mono codes)
     4. Statistics card upgrade (accent bars, larger values)

   IMPORTANT:
     Every selector here is scoped under classes that already
     exist in assets.html — we never change IDs, we never touch
     onclick handlers, and we never modify the assets JS logic.
   ============================================================ */

/* ============================================================
   1) PAGE HERO STRIP
   ------------------------------------------------------------
   Replaces the plain <h1> + <p> + row of buttons with a
   dashboard-style header:
     • Left  : eyebrow, title, subtitle, action buttons
     • Right : three KPI chips (Total / Active / Categories)
   ============================================================ */
.assets-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;
}

/* Same diagonal sheen as the other hero strips */
.assets-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;
}

.assets-hero-text {
    position: relative;
    z-index: 1;
    min-width: 260px;
    flex: 1;
}

.assets-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #f0b05d;
    margin-bottom: 6px;
}

.assets-hero-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.assets-hero-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ---- Action buttons row inside the hero ---- */
.assets-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

/* Primary CTA: amber gradient */
.assets-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;
}

.assets-hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 176, 93, 0.5);
}

.assets-hero-btn-primary:active {
    transform: translateY(0);
}

/* Ghost secondary buttons */
.assets-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);
}

.assets-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 ---- */
.assets-hero-kpis {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.assets-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: 92px;
    text-align: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.assets-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.assets-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.assets-kpi-value.kpi-active    { color: #86e29b; }  /* green */
.assets-kpi-value.kpi-category  { color: #f0b05d; }  /* amber */

/* ============================================================
   2) FOLDER SIDEBAR POLISH
   ------------------------------------------------------------
   Subtle refinement of the assets-folder-container: rounded
   card, uppercase header, cleaner internal divider.
   ============================================================ */
.assets-folder-container {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef1f3;
    background: #ffffff;
    padding: 18px;
    min-width: 300px;
    max-width: 350px;
}

.assets-folder-container h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #244855;
    margin: 0 0 14px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f3;
}

/* Folder item hover gets a cleaner feel — matching maintenance sidebar */
.assets-folder-container .folder-content {
    padding: 7px 9px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.assets-folder-container .folder-content:hover {
    background: #f2f6f8 !important;
}

/* Selected folder — dark teal highlight instead of bright blue */
.assets-folder-container .folder-selected .folder-content {
    background: #244855 !important;
}

.assets-folder-container .folder-selected .folder-name {
    color: #ffffff !important;
    font-weight: 600;
}

.assets-folder-container .folder-selected .folder-icon {
    color: #ffffff !important;
}

/* ============================================================
   3) ASSETS TABLE POLISH
   ------------------------------------------------------------
   Sticky header, softer row hover, monospaced asset codes.
   ============================================================ */
.assets-table-container .content-card {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef1f3;
    background: #ffffff;
    padding: 22px;
}

.assets-table-container .content-card h2 {
    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 assets table */
.assets-table-container .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;
    text-align: left;
}

.assets-table-container .data-table tbody td {
    padding: 14px;
    font-size: 13px;
    color: #343a40;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.assets-table-container .data-table tbody tr {
    transition: background 0.15s ease;
}

.assets-table-container .data-table tbody tr:hover {
    background: #f8fafb;
}

/* Asset code — reads as a technical identifier */
.assets-table-container .data-table tbody td:first-child {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    color: #244855;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Actions cell centered */
.assets-table-container .data-table td:last-child {
    text-align: center;
}

/* Status badges — using the same look as work orders */
.assets-table-container .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.assets-table-container .status-badge.status-active {
    background: rgba(40, 167, 69, 0.15);
    color: #166534;
}

.assets-table-container .status-badge.status-inactive {
    background: rgba(230, 72, 51, 0.12);
    color: #874F41;
}

.assets-table-container .status-badge.status-maintenance {
    background: rgba(240, 176, 93, 0.20);
    color: #874F41;
}

/* ============================================================
   4) STATISTICS CARDS UPGRADE
   ------------------------------------------------------------
   The bottom stats-grid gets the same accent-bar treatment
   used on the dashboard, maintenance, and work orders pages.
   ============================================================ */
.assets-stats-card {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    margin-bottom: 24px;
}

.assets-stats-card > h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #244855;
    margin: 0 0 14px 0;
    padding: 0 4px;
}

.assets-stats-card .stats-grid .stat-card {
    position: relative;
    border-left: none;                  /* remove 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;
    background: #ffffff;
}

.assets-stats-card .stats-grid .stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #244855;
}

/* Color-code the four cards */
.assets-stats-card .stats-grid .stat-card:nth-child(1)::before { background: #90AEAD; } /* Total */
.assets-stats-card .stats-grid .stat-card:nth-child(2)::before { background: #28a745; } /* Active % */
.assets-stats-card .stats-grid .stat-card:nth-child(3)::before { background: #f0b05d; } /* Categories */
.assets-stats-card .stats-grid .stat-card:nth-child(4)::before { background: #E64833; } /* Avg age */

.assets-stats-card .stats-grid .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(36, 72, 85, 0.10);
}

.assets-stats-card .stats-grid .stat-card h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 10px;
}

.assets-stats-card .stats-grid .stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a3640;
    line-height: 1;
    margin-bottom: 6px;
}

.assets-stats-card .stats-grid .stat-card .stat-change {
    font-size: 12px;
    color: #6c757d;
}

/* ============================================================
   5) RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .assets-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 20px;
    }

    .assets-hero-kpis {
        width: 100%;
    }

    .assets-kpi {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
    }

    .assets-kpi-value {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .assets-hero-title {
        font-size: 20px;
    }

    .assets-hero-actions {
        width: 100%;
    }

    .assets-hero-btn-primary,
    .assets-hero-btn-secondary {
        flex: 1 1 calc(50% - 5px);
        justify-content: center;
        font-size: 12px;
        padding: 10px 12px;
    }

    .assets-hero-kpis {
        flex-wrap: wrap;
    }

    .assets-kpi {
        flex: 1 1 calc(50% - 6px);
    }
}