/* ============================================================
   ADS styles - Core: command-center dashboard layout
   Split out of the former monolithic style.css WITHOUT code changes.
   Files are linked in numeric order (see Core/templates/_styles.html) so
   the cascade is identical to the old single file.
   ============================================================ */

/* ============================================================
   Command-center dashboard layout: calendar + mini stat cards on the
   left, Recent/Assigned Tickets panel on the right, Exceptions +
   HR Overview stacked full-width along the bottom.
   ============================================================ */
.dash-top-row {
    display: flex;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 14px;
    min-width: 0;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

/* Left column: calendar on top, small stat cards (Leave Bal / Attendance
   / Exceptions Summary) in a row underneath it. */
.dash-top-left {
    flex: 0 1 360px;
    min-width: 300px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dash-top-left .lcal-card { margin-bottom: 0; }

.dash-mini-row {
    display: flex;
    gap: 10px;
}
.dash-mini-row .lv-balance-card { flex: 1 1 0; min-width: 0; }

/* Right column: the ticket/activity table panel, fills remaining width */
.dash-top-right {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}
.dash-top-right .assigned-tickets-section { height: 100%; box-sizing: border-box; min-width: 0; max-width: 100%; }

/* Delivery Manager: Exceptions Summary card reparented into dash-top-right
   (see loadDashboardExceptions() in script.js) so it sits beside the
   calendar instead of stacked underneath it - dash-top-right is otherwise
   empty for this role since they have no assigned-tickets table. */
.dm-exc-summary-beside-calendar.ts-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Bottom row: Exceptions banner + HR Overview, always full width.
   Explicitly given its own (lower) stacking position so the Delivery
   Manager exceptions-summary hover popup - which lives earlier in the
   page and floats below its trigger via position:absolute - always
   paints above this row instead of being visually clipped by it. */
.dash-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.lv-balance-card {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 12px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 12px;
    overflow: hidden;
}
.lv-balance-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 7px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    flex-wrap: wrap;
    row-gap: 2px;
}
.lv-balance-header i {
    color: #16a34a;
    background: #ecfdf5;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    flex-shrink: 0;
}
.lv-balance-year { margin-left: auto; font-size: 9.5px; font-weight: 600; color: var(--gray-400); white-space: nowrap; }
.lv-balance-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2px;
    margin: 8px 0;
    min-width: 0;
}
.lv-balance-stat { flex: 1 1 0; min-width: 0; text-align: center; position: relative; padding: 0 2px; box-sizing: border-box; }
.lv-balance-stat + .lv-balance-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--gray-100, #f3f4f6);
}
.lv-balance-stat-value { font-size: 16px; font-weight: 800; color: var(--gray-900); line-height: 1; white-space: nowrap; }
.lv-balance-stat-label {
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--gray-400);
    margin-top: 4px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
}
.lv-balance-stat-highlight .lv-balance-stat-value { color: #16a34a; }
.lv-balance-bar-track {
    width: 100%;
    height: 5px;
    border-radius: 6px;
    background: var(--gray-100, #f3f4f6);
    overflow: hidden;
    margin-bottom: 6px;
}
.lv-balance-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 6px;
    transition: width 0.3s ease;
}
.lv-balance-footer {
    font-size: 9px;
    color: var(--gray-500, #6b7280);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .dash-top-row { flex-direction: column; }
    .dash-top-left { max-width: 100%; min-width: 0; }
}
@media (max-width: 640px) {
    .dash-mini-row { flex-direction: column; }
    .lv-balance-card { max-width: 100%; }
}

/* Exceptions card */
.lv-exceptions-card { margin-bottom: 16px; }
.lv-exceptions-card .ts-badge-status.auto-submitted { background:#fff7ed; color:#c2410c; }

/* "Action Required" style banner card used for the dashboard exceptions
   panel — soft red tint, accent bar, and a pill-style pending count to
   match the command-center reference layout. Purely visual; the same
   IDs/handlers underneath still drive the table, filters, and pagination. */
.dash-exceptions-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #b91c1c;
    margin-bottom: 0;
}
.dash-exceptions-banner .section-header {
    border-bottom: 1px solid #fecaca;
}
.dash-exceptions-banner .section-header h3 {
    color: #7f1d1d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dash-exceptions-banner .section-header h3 i {
    color: #b91c1c;
}
.dash-exceptions-badge {
    background: #7f1d1d !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 11px;
}
.dash-exceptions-review-btn {
    width: auto;
    height: auto;
    background: #7f1d1d;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.dash-exceptions-review-btn:hover { background: #991b1b; }
/* Everything inside (filters, table, pagination) keeps its normal white
   surface so the red tint reads as a header banner, not the whole panel. */
.dash-exceptions-banner .ticket-filters-row,
.dash-exceptions-banner .timesheet-table-wrap,
.dash-exceptions-banner #dash-exceptions-grouped {
    background: var(--white);
    border-radius: 8px;
}
.dash-exceptions-banner .timesheet-table-wrap { padding: 2px; }
.lv-exceptions-card .ts-badge-status.auto-leave { background:#eff6ff; color:#1d4ed8; }

