/* ============================================================================
   Time & Attendance — shared visual language
   Brand tokens mirror the Command Center (navy #1e3a5f), tuned for 1080p
   landscape web use: full-width cards, calm surfaces, soft depth.
   ============================================================================ */

:root {
    --ta-navy: var(--cas-navy-700);
    --ta-navy-dark: var(--cas-navy-900);
    --ta-ink: var(--cas-ink);
    --ta-muted: var(--cas-muted);
    --ta-faint: var(--cas-faint);
    --ta-surface: var(--cas-surface);
    --ta-border: var(--cas-line);
    --ta-shadow: var(--cas-shadow-card);
    --ta-shadow-hover: 0 4px 12px rgba(15, 32, 39, .12);
    --ta-radius: 12px;

    /* Vertical chrome stacked above a T&A list table inside the main content
       area: app bar (64) + content-wrapper padding (32) + breadcrumb (~36) +
       page header (~92) + container margin + card padding/borders. Fixed-height
       tables subtract this (plus the filter bar / pager when present) so the
       PAGE never scrolls — only the table body does. Tune here in one place. */
    --ta-list-chrome: 250px;
    --ta-filterbar-h: 92px;
    --ta-pager-h: 60px;
}

/* ---- Page header ---------------------------------------------------------- */
.ta-pageheader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ta-pageheader-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ta-pageheader-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5364 100%);
    box-shadow: 0 6px 16px rgba(30, 58, 95, .28);
}

.ta-pageheader-icon .mud-icon-root { font-size: 1.6rem; }

.ta-pageheader-title {
    font-weight: 700;
    color: var(--ta-ink);
    line-height: 1.15;
    letter-spacing: -.01em;
}

.ta-pageheader-sub {
    color: var(--ta-muted);
    margin-top: 2px;
}

.ta-pageheader-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Cards / sections ----------------------------------------------------- */
.ta-card {
    background: var(--ta-surface);
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-radius);
    box-shadow: var(--ta-shadow);
}

.ta-card-pad { padding: 20px; }

.ta-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ta-section-title {
    font-weight: 600;
    color: var(--ta-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- KPI cards ------------------------------------------------------------ */
.ta-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    height: 100%;
    background: var(--ta-surface);
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-radius);
    box-shadow: var(--ta-shadow);
    transition: box-shadow .15s ease, transform .15s ease;
}

.ta-kpi--clickable { cursor: pointer; }
.ta-kpi--clickable:hover {
    box-shadow: var(--ta-shadow-hover);
    transform: translateY(-2px);
}

.ta-kpi-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.ta-kpi-icon .mud-icon-root { font-size: 1.45rem; }

.ta-kpi-icon--primary { background: rgba(30, 58, 95, .10); color: #1e3a5f; }
.ta-kpi-icon--success { background: rgba(46, 160, 67, .13); color: #2ea043; }
.ta-kpi-icon--warning { background: rgba(191, 135, 0, .15); color: #bf8700; }
.ta-kpi-icon--error   { background: rgba(207, 34, 46, .12); color: #cf222e; }
.ta-kpi-icon--info    { background: rgba(9, 105, 218, .12); color: #0969da; }
.ta-kpi-icon--neutral { background: rgba(87, 96, 106, .12); color: #57606a; }

.ta-kpi-body { display: flex; flex-direction: column; min-width: 0; }

.ta-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ta-ink);
}

.ta-kpi-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ta-muted);
    margin-top: 2px;
}

.ta-kpi-hint {
    font-size: .73rem;
    color: var(--ta-faint);
    margin-top: 1px;
}

/* ---- Filter bar ----------------------------------------------------------- */
.ta-filterbar {
    background: var(--ta-surface);
    border: 1px solid var(--ta-border);
    border-radius: var(--ta-radius);
    box-shadow: var(--ta-shadow);
    padding: 16px 18px;
    margin-bottom: 18px;
}

/* ---- Empty state ---------------------------------------------------------- */
.ta-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 16px;
    color: var(--ta-faint);
    text-align: center;
}

.ta-empty .mud-icon-root { font-size: 2.4rem; opacity: .5; }

/* ---- Tables: give T&A tables a crisp, dense, professional feel ----------- */
.ta-table .mud-table-root { --mud-palette-table-striped: rgba(30, 58, 95, .025); }
.ta-table thead .mud-table-cell {
    font-weight: 600;
    color: var(--ta-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .72rem;
    background: #f7f9fb;
}
.ta-table .mud-table-row:hover { background: rgba(30, 58, 95, .04) !important; }

/* tighten chips inside T&A tables */
.ta-table .mud-chip { font-weight: 600; }

/* ---- Leave calendar ------------------------------------------------------- */
.ta-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}
.ta-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .82rem;
    color: var(--ta-muted);
}
.ta-cal-swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex: 0 0 12px;
}

.ta-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* weekday header row sizes to content; the 6 week rows split the remaining
       height so the whole month fits the viewport without scrolling the page. */
    grid-template-rows: auto repeat(6, minmax(84px, 1fr));
    gap: 8px;
    height: calc(100vh - var(--ta-list-chrome) - 56px); /* 56 ≈ legend + card padding */
    min-height: 560px;
}
.ta-cal-weekhead {
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ta-faint);
    padding: 4px 0;
}
.ta-cal-cell {
    min-height: 0; /* grid rows (minmax) drive the height so the month fits */
    overflow: hidden;
    border: 1px solid var(--ta-border);
    border-radius: 12px;
    background: var(--ta-surface);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow .12s ease, border-color .12s ease;
}
.ta-cal-cell:hover { box-shadow: var(--ta-shadow); }
.ta-cal-cell.ta-cal-out { background: #f6f8fa; opacity: .6; }
.ta-cal-cell.ta-cal-weekend { background: #fbfcfe; }
.ta-cal-cell.ta-cal-has { cursor: default; }
.ta-cal-cell.ta-cal-today {
    border-color: var(--ta-navy);
    box-shadow: 0 0 0 1px var(--ta-navy) inset;
}

.ta-cal-daynum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ta-ink);
}
.ta-cal-out .ta-cal-daynum { color: var(--ta-faint); }
.ta-cal-count {
    font-size: .68rem;
    font-weight: 700;
    color: #fff;
    background: var(--ta-navy);
    border-radius: 999px;
    padding: 1px 7px;
}

.ta-cal-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: flex-start;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}
.ta-cal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .04);
}
.ta-cal-dot--pending {
    background: transparent !important;
    border: 2px solid currentColor;
}
.ta-cal-more {
    font-size: .68rem;
    font-weight: 700;
    color: var(--ta-muted);
    align-self: center;
}

/* tooltip person list */
.ta-cal-tip { max-width: 280px; }
.ta-cal-tip-head {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: .82rem;
}
.ta-cal-tip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    font-size: .8rem;
}
.ta-cal-tip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 9px;
}
.ta-cal-tip-name { font-weight: 600; }
.ta-cal-tip-code { color: rgba(255, 255, 255, .8); margin-left: auto; }
