/* ==========================================================================
   AREA OPERATION (AO) REPORT - TUNAS TOYOTA KIARACONDONG
   Interactive Digital Whiteboard & Operations Cockpit Styling
   ========================================================================== */

:root {
    --ao-primary-red: #c8102e;
    --ao-dark-red: #9e0c22;
    --ao-navy-bg: #0b132b;
    --ao-card-bg: #ffffff;
    --ao-border: #e2e8f0;
    --ao-text-main: #0f172a;
    --ao-text-muted: #64748b;
    --ao-green: #10b981;
    --ao-yellow: #f59e0b;
    --ao-blue: #3b82f6;
    --ao-purple: #8b5cf6;
    --ao-orange: #f97316;
}

/* Whiteboard Container Shell */
.ao-board-container {
    background: #f8fafc;
    border-radius: 20px;
    border: 2px solid #cbd5e1;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 24px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

/* Board Header */
.ao-board-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 2px dashed #cbd5e1;
    margin-bottom: 22px;
    text-align: center;
}

.ao-header-center-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.ao-logo-top-center {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ao-logo-dark {
    height: 42px;
    max-width: 280px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
    transition: transform 0.2s ease;
}

.ao-logo-dark:hover {
    transform: scale(1.02);
}

.ao-brand-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ao-title-main {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 0.5px;
    margin: 0;
    text-transform: uppercase;
}

.ao-branch-tag {
    font-size: 13px;
    font-weight: 800;
    color: var(--ao-primary-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff1f2;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid #fecdd3;
}

.ao-actions-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ao-date-pill {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* 4-Quadrant Board Grid */
.ao-quadrant-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 22px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .ao-quadrant-grid {
        grid-template-columns: 1fr;
    }
}

/* Quadrant Card */
.ao-quad-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.03);
    position: relative;
}

.ao-quad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #f1f5f9;
}

.ao-quad-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Stock Matching Visual Section */
.ao-stock-bars-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ao-bar-box {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    position: relative;
}

.ao-bar-box-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ao-bar-box-val {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.ao-bar-progress {
    height: 18px;
    background: #e2e8f0;
    border-radius: 6px;
    display: flex;
    overflow: hidden;
    margin-bottom: 8px;
}

.ao-bar-free {
    background: #38bdf8;
    height: 100%;
    color: white;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ao-bar-match {
    background: #fbbf24;
    height: 100%;
    color: #78350f;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ao-bar-sub {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    display: flex;
    justify-content: space-between;
}

/* OS Order & Unmatch / Match Subgrid */
.ao-matching-subgrid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 12px;
    margin-bottom: 16px;
}

.ao-sub-panel {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 12px;
}

.ao-sub-title {
    font-size: 11px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ao-pill-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ao-pill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
}

.ao-pill-badge {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.badge-match-w1 { background: #fef08a; color: #854d0e; }
.badge-match-w2 { background: #fed7aa; color: #9a3412; }
.badge-match-w3 { background: #fecdd3; color: #9f1239; }
.badge-match-w4 { background: #e9d5ff; color: #6b21a8; }
.badge-firmed { background: #bbf7d0; color: #166534; }
.badge-unmatch { background: #fee2e2; color: #991b1b; }

/* Stepped Ladder Rhythm (5-Day Staircase) */
.ao-ladder-container {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    margin-top: 14px;
}

.ao-ladder-title {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.ao-ladder-steps {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 100px;
    padding: 0 4px;
}

.ao-step-bar {
    flex: 1;
    background: #cbd5e1;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px;
    color: white;
    font-size: 10px;
    font-weight: 800;
    transition: all 0.3s ease;
    position: relative;
}

.ao-step-bar.active-ladder-1 { background: #86efac; color: #14532d; height: 30%; }
.ao-step-bar.active-ladder-2 { background: #4ade80; color: #14532d; height: 45%; }
.ao-step-bar.active-ladder-3 { background: #22c55e; color: #ffffff; height: 60%; }
.ao-step-bar.active-ladder-4 { background: #16a34a; color: #ffffff; height: 75%; }
.ao-step-bar.active-ladder-5 { background: #15803d; color: #ffffff; height: 88%; }
.ao-step-bar.active-ladder-6 { background: #14532d; color: #ffffff; height: 100%; }

.ao-step-lbl {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    margin-top: 4px;
    text-align: center;
}

/* MDP Logistics Truck Row */
.ao-truck-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ao-truck-node {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    position: relative;
}

.ao-truck-icon {
    font-size: 16px;
    color: #16a34a;
    margin-bottom: 4px;
}

.ao-truck-val {
    font-size: 14px;
    font-weight: 900;
    color: #0f172a;
}

.ao-truck-accum {
    font-size: 9.5px;
    font-weight: 700;
    color: #15803d;
}

/* SPK Table Matrix */
.ao-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.ao-spk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: center;
}

.ao-spk-table th {
    background: #1e293b;
    color: white;
    font-weight: 800;
    padding: 8px 10px;
    white-space: nowrap;
    border: 1px solid #334155;
}

.ao-spk-table td {
    padding: 8px 10px;
    font-weight: 700;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.ao-spk-table tr:nth-child(even) td {
    background: #f8fafc;
}

.ao-spk-table td.cell-gap-pos {
    background: #dcfce7;
    color: #15803d;
    font-weight: 800;
}

.ao-spk-table td.cell-gap-neg {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 800;
}

/* Closing Estimation Hero Card */
.ao-closing-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.ao-closing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    align-items: center;
}

.ao-closing-stat {
    padding: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    text-align: center;
}

.ao-closing-stat.highlight-gold {
    background: linear-gradient(135deg, rgba(245,158,11,0.25) 0%, rgba(217,119,6,0.15) 100%);
    border: 1.5px solid #f59e0b;
}

.ao-closing-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ao-closing-val {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
}

.ao-closing-sub {
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    margin-top: 4px;
}

/* Master Vehicle Model Breakdown Table */
.ao-matrix-container {
    background: white;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}

.ao-matrix-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.ao-matrix-table-wrap {
    overflow-x: auto;
    max-height: 600px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.ao-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.ao-matrix-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0f172a;
    color: white;
    font-weight: 800;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #334155;
    white-space: nowrap;
}

.ao-matrix-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    font-weight: 700;
    color: #1e293b;
}

.ao-matrix-table td.col-model {
    text-align: left;
    font-weight: 800;
    color: #0f172a;
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 5;
    border-right: 2px solid #cbd5e1;
    min-width: 170px;
}

.ao-matrix-table tr:hover td {
    background: #f8fafc;
}

.ao-matrix-table tr:hover td.col-model {
    background: #f1f5f9;
}

.ao-matrix-table tr.row-grand-total td {
    background: #1e293b !important;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 900;
    border-top: 2px solid #f59e0b;
}

.ao-matrix-table tr.row-grand-total td.col-model {
    background: #1e293b !important;
    color: #fbbf24 !important;
}

/* Action Toolbar */
.ao-actions-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-ao {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-ao-wa {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-ao-wa:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.btn-ao-export {
    background: #f1f5f9;
    color: #334155;
    border: 1.5px solid #cbd5e1;
}

.btn-ao-export:hover {
    background: #e2e8f0;
}

/* Mobile Swipe Hint */
.ao-mobile-swipe-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #bae6fd;
    text-align: center;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS (Screens <= 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .ao-mobile-swipe-hint {
        display: flex;
    }

    .ao-board-container {
        padding: 14px 12px;
        border-radius: 14px;
        border-width: 1.5px;
        margin-bottom: 16px;
    }

    .ao-board-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 14px;
        margin-bottom: 16px;
    }

    .ao-brand-badge {
        width: 100%;
        gap: 10px;
    }

    .ao-brand-badge img {
        height: 26px !important;
    }

    .ao-title-main {
        font-size: 16px;
    }

    .ao-branch-tag {
        font-size: 11px;
    }

    .ao-actions-toolbar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ao-date-pill {
        width: 100%;
        justify-content: center;
        padding: 6px 12px;
        font-size: 11.5px;
        box-sizing: border-box;
    }

    .btn-ao {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        font-size: 11.5px;
        padding: 9px 8px;
        box-sizing: border-box;
    }

    /* Hero Closing Card */
    .ao-closing-hero {
        padding: 14px 12px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .ao-closing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ao-closing-stat {
        padding: 8px 6px;
        border-radius: 10px;
    }

    .ao-closing-stat.highlight-gold {
        grid-column: span 2;
        padding: 12px 8px;
    }

    .ao-closing-label {
        font-size: 10px;
    }

    .ao-closing-val {
        font-size: 20px;
    }

    .ao-closing-sub {
        font-size: 10px;
    }

    /* Quadrant Layout */
    .ao-quadrant-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 16px;
    }

    .ao-quad-card {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .ao-quad-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .ao-quad-title {
        font-size: 13.5px;
    }

    /* Stock Bars */
    .ao-stock-bars-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .ao-bar-box {
        padding: 8px 6px;
    }

    .ao-bar-box-val {
        font-size: 19px;
    }

    .ao-bar-sub {
        font-size: 9.5px;
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }

    /* Subgrid & Panels */
    .ao-matching-subgrid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .ao-sub-panel {
        padding: 10px;
    }

    .ao-pill-item {
        font-size: 11px;
        padding: 5px 8px;
    }

    .ao-ladder-container {
        padding: 10px 8px;
        border-radius: 12px;
    }

    .ao-ladder-steps {
        height: 75px;
        gap: 4px;
    }

    .ao-step-bar {
        font-size: 9px;
        padding: 2px 1px;
    }

    /* Truck Milestones */
    .ao-truck-flow {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .ao-truck-node {
        padding: 6px 4px;
    }

    .ao-truck-val {
        font-size: 12px;
    }

    .ao-truck-accum {
        font-size: 8.5px;
    }

    /* Table Matrix */
    .ao-matrix-container {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .ao-matrix-table-wrap {
        max-height: 480px;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }

    .ao-matrix-table th {
        padding: 8px 6px;
        font-size: 10.5px;
    }

    .ao-matrix-table td {
        padding: 7px 6px;
        font-size: 11px;
    }

    .ao-matrix-table td.col-model {
        min-width: 125px;
        font-size: 11px;
        padding: 7px 8px;
        box-shadow: 2px 0 6px rgba(0,0,0,0.06);
    }
}

@media (max-width: 400px) {
    .ao-truck-flow {
        grid-template-columns: repeat(2, 1fr);
    }
}



