/* ============================================================
   ATTENDANCE PAGE STYLES
   Page-specific CSS for the attendance section.
   Use tokens from tokens.css and classes from components.css.
   ============================================================ */

    /* ── Loading ── */
    .at-loading {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #6b7280;
        font-size: 0.9rem;
        padding: 2rem 0;
    }

    .at-spinner {
        width: 22px;
        height: 22px;
        border: 2.5px solid #e5e7eb;
        border-top-color: #6366f1;
        border-radius: 50%;
        animation: at-spin 0.7s linear infinite;
        flex-shrink: 0;
    }

    @keyframes at-spin {
        to { transform: rotate(360deg); }
    }

    .at-error-banner {
        background: #fee2e2;
        color: #991b1b;
        border-radius: 10px;
        padding: 0.85rem 1.1rem;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* ── Live connection indicator ── */
    .at-live-dot {
        display: inline-block;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        margin-left: 0.5rem;
        vertical-align: middle;
        flex-shrink: 0;
    }

    .at-live-dot--connected {
        background: #16a34a;
        animation: at-pulse 2s ease-in-out infinite;
    }

    .at-live-dot--reconnecting {
        background: #d97706;
        animation: at-pulse 1s ease-in-out infinite;
    }

    .at-live-dot--disconnected {
        background: #9ca3af;
    }

    /* ── Stats row extras ── */
    .dash-stat-icon-purple {
        background: #ede9fe;
        color: #7c3aed;
    }

    .dash-stat-sub {
        font-size: 0.72rem;
        color: #9ca3af;
        font-weight: 500;
        margin-top: -0.1rem;
        margin-bottom: 0.1rem;
    }

    /* ── Filter bar ── */
    .at-filterbar {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 1.25rem;
    }

    .at-filterbar-top {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .at-filterbar-date {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: #fff;
        border: 1.5px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.42rem 0.75rem;
        color: #9ca3af;
        transition: border-color 0.15s ease;
    }

    .at-filterbar-date:focus-within {
        border-color: #6366f1;
    }

    .at-filterbar-date input[type="date"] {
        border: none;
        outline: none;
        font-size: 0.875rem;
        color: #111827;
        font-family: inherit;
        background: transparent;
        cursor: pointer;
    }

    .at-filterbar-search {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: #fff;
        border: 1.5px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.42rem 0.75rem;
        color: #9ca3af;
        transition: border-color 0.15s ease;
    }

    .at-filterbar-search:focus-within {
        border-color: #6366f1;
    }

    .at-filterbar-search input {
        border: none;
        outline: none;
        font-size: 0.875rem;
        color: #111827;
        font-family: inherit;
        background: transparent;
        flex: 1;
        width: 100%;
    }

    .at-filterbar-search input::placeholder {
        color: #9ca3af;
    }

    /* Chips row */
    .at-filterbar-chips {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: #f9fafb;
        border: 1.5px solid #f3f4f6;
        border-radius: 12px;
        padding: 0.45rem 0.75rem;
        flex-wrap: wrap;
    }

    .at-chip-group {
        display: flex;
        gap: 0.25rem;
    }

    .at-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.28rem 0.65rem;
        border-radius: 7px;
        font-size: 0.8rem;
        font-weight: 500;
        font-family: inherit;
        border: 1.5px solid transparent;
        background: transparent;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.12s ease;
        white-space: nowrap;
        line-height: 1.4;
    }

    .at-chip:hover {
        background: #fff;
        color: #374151;
        border-color: #e5e7eb;
    }

    .at-chip--on {
        background: #fff;
        border-color: #c7d2fe;
        color: #4338ca;
        font-weight: 600;
        box-shadow: 0 1px 2px rgba(99, 102, 241, 0.12);
    }

    .at-chip--green  { border-color: #bbf7d0 !important; color: #166534 !important; background: #f0fdf4 !important; }
    .at-chip--purple { border-color: #ddd6fe !important; color: #4338ca !important; background: #f5f3ff !important; }
    .at-chip--amber  { border-color: #fde68a !important; color: #92400e !important; background: #fffbeb !important; }
    .at-chip--grace  { border-color: #fef08a !important; color: #854d0e !important; background: #fefce8 !important; }
    .at-chip--red    { border-color: #fecaca !important; color: #991b1b !important; background: #fff1f2 !important; }

    .at-chip-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .at-chip-dot--green  { background: #16a34a; }
    .at-chip-dot--purple { background: #6366f1; }
    .at-chip-dot--amber  { background: #d97706; }

    .at-filter-sep {
        width: 1px;
        height: 20px;
        background: #e5e7eb;
        flex-shrink: 0;
        margin: 0 0.15rem;
    }

    /* Select wrappers in filter chips row */
    .at-select-wrap {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        background: #fff;
        border: 1.5px solid #e5e7eb;
        border-radius: 7px;
        padding: 0.22rem 0.55rem;
        color: #9ca3af;
        transition: border-color 0.12s ease;
    }

    .at-select-wrap:focus-within {
        border-color: #6366f1;
    }

    .at-select-wrap select {
        border: none;
        outline: none;
        font-size: 0.8rem;
        font-weight: 500;
        color: #374151;
        background: transparent;
        font-family: inherit;
        cursor: pointer;
        padding: 0;
    }

    /* ── Table status pills ── */
    .at-status-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.78rem;
        font-weight: 600;
        padding: 0.25rem 0.65rem;
        border-radius: 999px;
        white-space: nowrap;
    }

    .at-status-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .at-status-checkedin .at-status-dot  { background: #16a34a; }
    .at-status-checkedin                  { background: #dcfce7; color: #166534; }

    .at-status-checkedout .at-status-dot  { background: #6366f1; }
    .at-status-checkedout                  { background: #ede9fe; color: #4338ca; }

    .at-status-autoclosed .at-status-dot  { background: #d97706; }
    .at-status-autoclosed                  { background: #fef3c7; color: #92400e; }

    .at-status-onbreak .at-status-dot     { background: #7c3aed; animation: at-pulse 1.4s ease-in-out infinite; }
    .at-status-onbreak                     { background: #ede9fe; color: #5b21b6; }

    /* ── Active break indicator (in Break column) ── */
    .at-break-active {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.78rem;
        color: #7c3aed;
        font-weight: 600;
        white-space: nowrap;
    }

    .at-break-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #7c3aed;
        flex-shrink: 0;
        animation: at-pulse 1.4s ease-in-out infinite;
    }

    @keyframes at-pulse {
        0%, 100% { opacity: 1; }
        50%       { opacity: 0.3; }
    }

    /* ── Flags ── */
    .at-flags {
        display: flex;
        gap: 0.3rem;
    }

    .at-flag {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 0.3rem;
        border-radius: 4px;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .at-flag--grace    { background: #fef9c3; color: #a16207; }
    .at-flag--late     { background: #fef3c7; color: #92400e; }
    .at-flag--verylate { background: #fee2e2; color: #991b1b; }
    .at-flag--early    { background: #fee2e2; color: #991b1b; }

    /* ── Expandable row ── */
    .at-row--expanded td {
        background: #fafafa;
    }

    .at-break-detail-row td {
        background: #f9fafb;
        border-bottom: 1px solid #f3f4f6;
    }

    .at-break-list {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
    }

    .at-break-list__label {
        font-size: 0.78rem;
        color: #9ca3af;
        font-weight: 600;
    }

    .at-break-chip {
        display: inline-block;
        background: #f3f4f6;
        border-radius: 6px;
        padding: 0.2rem 0.6rem;
        font-size: 0.78rem;
        color: #374151;
    }

    /* ── Live update flash animation ── */
    @keyframes at-flash {
        0%   { background-color: #ede9fe; }
        100% { background-color: transparent; }
    }

    .at-row--flash td {
        animation: at-flash 1.5s ease-out forwards;
    }

    /* ── Empty state ── */
    .at-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 3rem 1rem;
        color: #9ca3af;
        font-size: 0.9rem;
    }

    /* ── Pagination ── */
    .at-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 1rem;
        border-top: 1px solid #f3f4f6;
    }

    .at-page-btn {
        padding: 0.45rem 1rem;
        border: 1.5px solid #e5e7eb;
        border-radius: 8px;
        background: #fff;
        color: #374151;
        font-size: 0.85rem;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: background 0.15s ease;
    }

    .at-page-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .at-page-btn:not(:disabled):hover {
        background: #f3f4f6;
    }

    .at-page-info {
        font-size: 0.85rem;
        color: #6b7280;
    }

    /* ── Clickable rows ── */
    .table-row {
        cursor: pointer;
    }

    .table-row:hover td {
        background: #fafafa;
    }

    /* ── Missing employees section (#44) ── */
    .at-missing-section {
        background: #fff;
        border: 1.5px solid #fde68a;
        border-radius: 12px;
        margin-bottom: 1.25rem;
        overflow: hidden;
    }

    .at-missing-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        cursor: pointer;
        background: #fffbeb;
        user-select: none;
    }

    .at-missing-header:hover {
        background: #fef3c7;
    }

    .at-missing-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.88rem;
        font-weight: 600;
        color: #92400e;
    }

    .at-missing-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #f59e0b;
        color: #fff;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        padding: 0 0.35rem;
    }

    .at-missing-chevron {
        font-size: 0.72rem;
        color: #92400e;
    }

    .at-missing-list {
        padding: 0.5rem 0;
    }

    .at-missing-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.45rem 1rem;
        border-bottom: 1px solid #fef3c7;
    }

    .at-missing-row:last-child {
        border-bottom: none;
    }

    .at-missing-time {
        font-size: 0.78rem;
        color: #6b7280;
        white-space: nowrap;
        margin-left: 1rem;
    }

    /* ── Flag legend strip (inline in filter bar) ── */
    .at-flag-legend-strip {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        margin-left: auto;
        padding-left: 0.75rem;
        border-left: 1px solid #e5e7eb;
        flex-shrink: 0;
    }

    .at-flag-legend-label {
        font-size: 0.73rem;
        color: #9ca3af;
        font-weight: 600;
        letter-spacing: 0.02em;
        white-space: nowrap;
    }

    .at-flag-legend-item {
        display: inline-flex;
        align-items: center;
        gap: 0.28rem;
        font-size: 0.73rem;
        color: #6b7280;
        white-space: nowrap;
        cursor: default;
    }

/* ============================================================
   NEW ATTENDANCE DASHBOARD - att-* components
   ============================================================ */

/* ── Page header ── */
.att-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.att-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.att-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.att-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.att-live-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--color-neutral-subtle);
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
}

.att-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.att-live-dot--connected {
    background: var(--color-success);
    animation: at-pulse 2s ease-in-out infinite;
}

.att-live-dot--reconnecting {
    background: var(--color-warning);
    animation: at-pulse 1s ease-in-out infinite;
}

.att-live-dot--disconnected {
    background: var(--color-text-secondary);
}

/* ── Date navigator ── */
.att-date-nav {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.att-date-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.att-date-btn:hover:not(:disabled) {
    background: var(--color-neutral-subtle);
    color: var(--color-text-primary);
}

.att-date-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.att-date-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    padding: 0 var(--space-3);
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
}

/* ── Stat cards row ── */
.att-stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.att-stat-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    user-select: none;
}

.att-stat-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.att-stat-card--expanded {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.att-stat-top {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.att-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.att-stat-icon--green  { background: var(--color-success-subtle);  color: var(--color-success-hover); }
.att-stat-icon--red    { background: var(--color-error-subtle);    color: var(--color-error-hover); }
.att-stat-icon--amber  { background: var(--color-warning-subtle);  color: var(--color-warning-hover); }
.att-stat-icon--blue   { background: var(--color-accent-subtle);   color: var(--color-accent); }
.att-stat-icon--purple { background: #ede9fe;                      color: #7c3aed; }
.att-stat-icon--neutral { background: var(--color-neutral-subtle); color: var(--color-text-secondary); }

.att-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.att-stat-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-top: 1px;
}

.att-stat-detail {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

/* ── Two-column body ── */
.att-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    align-items: start;
}

.att-col-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}

.att-col-side {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}

/* ── Who's in card ── */
.att-who-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.att-who-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.att-who-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
    flex: 1;
}

.att-who-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.att-who-list {
    max-height: 340px;
    overflow-y: auto;
}

.att-who-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
}

.att-who-row:last-child {
    border-bottom: none;
}

.att-who-row:hover {
    background: var(--color-neutral-subtle);
}

.att-who-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
}

.att-who-avatar--sm {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

.att-who-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.att-who-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-who-dept {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-who-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.att-who-time {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.att-who-empty {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Skeleton rows */
.att-skel {
    background: linear-gradient(90deg, var(--color-neutral-subtle) 25%, var(--color-border) 50%, var(--color-neutral-subtle) 75%);
    background-size: 200% 100%;
    animation: att-shimmer 1.4s infinite;
    border-radius: var(--legacy-radius-sm);
}

.att-who-skel {
    height: 40px;
    margin: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
}

@keyframes att-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Status chips (in Who's in rows) */
.att-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.att-status-chip--in    { background: var(--color-success-subtle);  color: var(--color-success-hover); }
.att-status-chip--break { background: #ede9fe;                       color: #7c3aed; }

/* ── Collapsibles ── */
.att-collapsible {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.att-collapsible--warning {
    border-color: var(--color-warning-border);
}

.att-collapsible--error {
    border-color: #fecaca;
}

.att-collapsible-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 600;
    user-select: none;
    transition: background var(--transition-fast);
}

.att-collapsible--warning .att-collapsible-header {
    background: var(--color-warning-subtle);
    color: var(--color-warning-text);
}

.att-collapsible--warning .att-collapsible-header:hover {
    background: #fef3c7;
}

.att-collapsible--error .att-collapsible-header {
    background: var(--color-error-subtle);
    color: #991b1b;
}

.att-collapsible--error .att-collapsible-header:hover {
    background: #fee2e2;
}

.att-collapsible-chevron {
    margin-left: auto;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.att-collapsible-chevron--open {
    transform: rotate(180deg);
}

.att-collapsible-body {
    max-height: 280px;
    overflow-y: auto;
}

/* ── Side card ── */
.att-side-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.att-side-filter {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.att-side-label {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.att-side-select-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-background);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-secondary);
    transition: border-color var(--transition-fast);
}

.att-side-select-wrap:focus-within {
    border-color: var(--color-accent);
}

.att-side-select-wrap select {
    border: none;
    outline: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
}

.att-side-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-1) 0;
}

.att-side-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.att-side-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
}

.att-side-break-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.att-side-break-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .att-stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .att-body {
        grid-template-columns: 1fr;
    }

    .att-col-side {
        order: -1;
    }
}

@media (max-width: 640px) {
    .att-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .att-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   MY ATTENDANCE PAGE - ma-* components
   ============================================================ */

/* ── Page header ── */
.ma-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
}

.ma-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ma-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

/* ── Month nav pill ── */
.ma-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.ma-month-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    padding: 0 var(--space-3);
    white-space: nowrap;
    min-width: 96px;
    text-align: center;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
}

.ma-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.ma-nav-btn:hover:not(:disabled) {
    background: var(--color-neutral-subtle);
    color: var(--color-text-primary);
}

.ma-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Monthly stat cards (4 across, no all-time sub-text) ── */
.ma-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.ma-stat-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.ma-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ma-stat-icon--green   { background: var(--color-success-subtle); color: var(--color-success-hover); }
.ma-stat-icon--amber   { background: var(--color-warning-subtle); color: var(--color-warning-hover); }
.ma-stat-icon--accent  { background: var(--color-accent-subtle);  color: var(--color-accent); }
.ma-stat-icon--neutral { background: var(--color-neutral-subtle); color: var(--color-text-secondary); }

.ma-stat-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.ma-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.ma-stat-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* ── Calendar + day-detail row ── */
.ma-cal-row {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    align-items: start;
}

/* ── Mini calendar ── */
.ma-cal-wrapper {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.ma-cal-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: var(--space-2);
}

.ma-cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: var(--space-1) 0;
}

.ma-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ma-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--legacy-radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    color: var(--color-text-primary);
    background: transparent;
    padding: 0;
    line-height: 1;
}

.ma-cal-cell--empty {
    cursor: default;
    pointer-events: none;
}

.ma-cal-cell--future {
    color: var(--color-text-secondary);
    cursor: default;
    pointer-events: none;
}

.ma-cal-cell--weekend {
    color: var(--color-text-secondary);
}

.ma-cal-cell--present {
    background: var(--color-success-subtle);
    color: var(--color-success-hover);
    font-weight: 600;
}

.ma-cal-cell--late {
    background: var(--color-warning-subtle);
    color: var(--color-warning-text);
    font-weight: 600;
}

.ma-cal-cell--absent {
    background: var(--color-error-subtle);
    color: var(--color-error-hover);
    font-weight: 600;
}

.ma-cal-cell--today {
    border-color: var(--color-accent);
    font-weight: 700;
}

.ma-cal-cell--selected {
    background: var(--color-accent) !important;
    color: #fff !important;
    border-color: var(--color-accent) !important;
    font-weight: 700;
}

.ma-cal-cell:not(.ma-cal-cell--empty):not(.ma-cal-cell--future):not(.ma-cal-cell--selected):hover {
    background: var(--color-neutral-subtle);
    color: var(--color-text-primary);
}

/* ── Calendar legend ── */
.ma-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding-top: var(--space-3);
    flex-wrap: wrap;
}

.ma-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.ma-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ma-legend-dot--present { background: var(--color-success-hover); }
.ma-legend-dot--late    { background: var(--color-warning-text); }
.ma-legend-dot--absent  { background: var(--color-error-hover); }
.ma-legend-dot--weekend { background: #D1D5DB; }

/* ── Selected day detail panel ── */
.ma-day-detail {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 232px;
}

.ma-day-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    height: 100%;
    min-height: 160px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-align: center;
}

.ma-day-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.ma-day-date-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ma-day-date-weekday {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text-primary);
}

.ma-day-date-full {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.ma-day-times {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
}

.ma-day-time-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ma-day-time-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ma-day-time-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.ma-day-time-sep {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    padding-bottom: 2px;
}

.ma-day-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

.ma-day-stat {
    background: var(--color-background);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ma-day-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ma-day-stat-value {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
}

.ma-day-flag-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.ma-day-late-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.ma-day-late-badge--grace    { background: var(--color-warning-subtle); color: var(--color-warning-text); }
.ma-day-late-badge--late     { background: var(--color-warning-subtle); color: var(--color-warning-text); }
.ma-day-late-badge--verylate { background: var(--color-error-subtle);   color: var(--color-error-hover); }
.ma-day-late-badge--early    { background: var(--color-error-subtle);   color: var(--color-error-hover); }

.ma-day-absent-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 160px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-align: center;
}

.ma-day-absent-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.ma-day-state-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* ── Shared record detail helpers (used inside day panel) ── */
.ma-record-breaks {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.ma-detail-label {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.ma-break-item {
    display: inline-block;
    background: var(--color-neutral-subtle);
    border-radius: var(--legacy-radius-sm);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    color: var(--color-text-primary);
}

.ma-record-detail-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;
}

.ma-adjusted-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--color-neutral-subtle);
    color: var(--color-text-secondary);
}

/* ── Status chips ── */
.ma-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.ma-status-chip--checkedin        { background: var(--color-success-subtle);  color: var(--color-success-hover); }
.ma-status-chip--checkedout       { background: var(--color-accent-subtle);   color: var(--color-accent); }
.ma-status-chip--autoclosed       { background: var(--color-warning-subtle);  color: var(--color-warning-text); }
.ma-status-chip--manuallyadjusted { background: var(--color-neutral-subtle);  color: var(--color-text-secondary); }

/* ── Records table card (full width) ── */
.ma-table-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
}

.ma-records-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.ma-records-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
    flex: 1;
}

.ma-records-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.ma-table-wrap {
    overflow-x: auto;
}

.ma-att-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.ma-att-table thead tr {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
}

.ma-att-table th {
    padding: var(--space-2) var(--space-4);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.ma-att-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.ma-att-table tbody tr:last-child {
    border-bottom: none;
}

.ma-att-table tbody tr:hover {
    background: var(--color-neutral-subtle);
}

.ma-att-table td {
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-primary);
    vertical-align: middle;
}

.ma-att-row--selected {
    background: var(--color-accent-subtle) !important;
}

.ma-tbl-day-name {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ma-tbl-day-date {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.ma-tbl-flags {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ── Empty state ── */
.ma-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* ── Disputes card (full width) ── */
.ma-disputes-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ma-disputes-card--full {
    margin-bottom: var(--space-5);
}

.ma-disputes-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.ma-disputes-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
    flex: 1;
}

.ma-disputes-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.ma-disputes-badge--amber { background: var(--color-warning-subtle); color: var(--color-warning-text); }

.ma-dispute-list {
    display: flex;
    flex-direction: column;
}

.ma-dispute-list--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ma-dispute-card {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.ma-dispute-list--grid .ma-dispute-card {
    border-right: 1px solid var(--color-border);
}

.ma-dispute-card:last-child {
    border-bottom: none;
}

.ma-dispute-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.ma-dispute-date {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-primary);
}

.ma-dispute-reason {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.ma-dispute-awaiting {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    font-style: italic;
}

.ma-dispute-reviewer-note {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.ma-disputes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.ma-disputes-empty svg {
    color: var(--color-success);
    opacity: 0.8;
}

.ma-disputes-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.ma-disputes-ghost-btn {
    width: 100%;
    justify-content: center;
}

/* ── All-time stats (collapsible) ── */
.ma-alltime-section {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
}

.ma-alltime-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
    transition: background var(--transition-fast);
}

.ma-alltime-toggle:hover {
    background: var(--color-neutral-subtle);
}

.ma-alltime-chevron {
    transition: transform var(--transition-fast);
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.ma-alltime-chevron--open {
    transform: rotate(180deg);
}

.ma-alltime-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--color-border);
}

.ma-alltime-stat {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--color-border);
}

.ma-alltime-stat:last-child {
    border-right: none;
}

.ma-alltime-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.ma-alltime-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .ma-cal-row {
        grid-template-columns: 290px 1fr;
    }
}

@media (max-width: 900px) {
    .ma-cal-row {
        grid-template-columns: 1fr;
    }

    .ma-alltime-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ma-alltime-stat:nth-child(2) {
        border-right: none;
    }

    .ma-alltime-stat:nth-child(1),
    .ma-alltime-stat:nth-child(2) {
        border-bottom: 1px solid var(--color-border);
    }
}

@media (max-width: 640px) {
    .ma-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .ma-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ma-alltime-grid {
        grid-template-columns: 1fr;
    }

    .ma-alltime-stat {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .ma-alltime-stat:last-child {
        border-bottom: none;
    }

    .ma-dispute-list--grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ATTENDANCE HISTORY PAGE - /attendance/history
   All at-* and ah-* and mc-* styles live here.
   ============================================================ */

/* ── Loading / Error ── */
.at-loading {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    padding: var(--space-10) 0;
    justify-content: center;
}

.at-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: at-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes at-spin {
    to { transform: rotate(360deg); }
}

.at-error-banner {
    background: var(--color-error-subtle);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-4);
}

/* ── Header actions: export buttons ── */
.ah-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.ah-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: #374151;
    font-size: var(--font-size-xs);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.ah-export-btn:not(:disabled):hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-surface);
}

.ah-export-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Filter bar - white card ── */
.at-filterbar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.at-filterbar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ah-range-sep {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

/* "Clear filters" - link style */
.ah-clear-btn {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: var(--font-size-base);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 0 4px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.5;
    text-decoration: none;
}

.ah-clear-btn:hover {
    text-decoration: underline;
}

/* Date picker input wrapper */
.at-filterbar-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 7px 12px;
    color: var(--color-text-secondary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.at-filterbar-date:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.at-filterbar-date input[type="date"] {
    border: none;
    outline: none;
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    font-family: inherit;
    background: transparent;
    cursor: pointer;
}

/* Search input */
.at-filterbar-search {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 7px 12px;
    color: var(--color-text-secondary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.at-filterbar-search:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.at-filterbar-search input {
    border: none;
    outline: none;
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    font-family: inherit;
    background: transparent;
    flex: 1;
    width: 100%;
}

.at-filterbar-search input::placeholder {
    color: var(--color-text-secondary);
}

/* Chips / secondary filter row */
.at-filterbar-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    flex-wrap: wrap;
}

.at-chip-group {
    display: flex;
    gap: 4px;
}

.at-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    font-family: inherit;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.at-chip:hover {
    background: var(--color-surface);
    color: #374151;
    border-color: var(--color-border);
}

.at-chip--on {
    background: var(--color-surface);
    border-color: #C7D2FE;
    color: #4338CA;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.at-chip--green  { border-color: #BBF7D0 !important; color: #166534 !important; background: var(--color-success-subtle) !important; }
.at-chip--purple { border-color: #DDD6FE !important; color: #4338CA !important; background: var(--color-accent-subtle) !important; }
.at-chip--amber  { border-color: var(--color-warning-border) !important; color: var(--color-warning-text) !important; background: var(--color-warning-subtle) !important; }
.at-chip--grace  { border-color: #FEF08A !important; color: #854D0E !important; background: #FEFCE8 !important; }
.at-chip--red    { border-color: #FECACA !important; color: #991B1B !important; background: var(--color-error-subtle) !important; }

.at-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.at-chip-dot--green  { background: var(--color-success); }
.at-chip-dot--purple { background: var(--color-accent); }
.at-chip-dot--amber  { background: var(--color-warning); }

.at-filter-sep {
    width: 1px;
    height: 18px;
    background: var(--color-border);
    flex-shrink: 0;
    margin: 0 2px;
}

/* Location / department dropdown wrappers */
.at-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--color-text-secondary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.at-select-wrap:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.at-select-wrap select {
    border: none;
    outline: none;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: #374151;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

/* ── Flag legend strip ── */
.at-flag-legend-strip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding-left: 10px;
    border-left: 1px solid var(--color-border);
    flex-shrink: 0;
}

.at-flag-legend-label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.at-flag-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    cursor: default;
}

/* ── Table - scoped via the .at-filterbar sibling present only on history page ── */
.at-filterbar ~ .dash-card .data-table {
    width: 100%;
}

.at-filterbar ~ .dash-card .data-table thead tr {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}

.at-filterbar ~ .dash-card .data-table th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.at-filterbar ~ .dash-card .data-table td {
    padding: 11px 14px;
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
}

.at-filterbar ~ .dash-card .data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Clickable rows */
.table-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.table-row:hover td {
    background: var(--color-background);
}

.at-row--expanded td {
    background: var(--color-background);
}

/* Employee cell */
.table-assignee {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-assignee-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent) 0%, #8B5CF6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.table-task-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.table-task-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-task-desc {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-date {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
}

/* ── Status pills ── */
.at-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.at-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* CheckedIn - green */
.at-status-checkedin                { background: var(--color-success-subtle); color: var(--color-success); }
.at-status-checkedin .at-status-dot { background: var(--color-success); }

/* CheckedOut - neutral grey */
.at-status-checkedout                { background: var(--color-neutral-subtle); color: #374151; }
.at-status-checkedout .at-status-dot { background: var(--color-text-secondary); }

/* AutoClosed - red */
.at-status-autoclosed                { background: var(--color-error-subtle); color: var(--color-error); }
.at-status-autoclosed .at-status-dot { background: var(--color-error); }

/* ManuallyAdjusted - indigo */
.at-status-manuallyadjusted                { background: var(--color-accent-subtle); color: var(--color-accent); }
.at-status-manuallyadjusted .at-status-dot { background: var(--color-accent); }

/* OnBreak - purple */
.at-status-onbreak                { background: #EDE9FE; color: #5B21B6; }
.at-status-onbreak .at-status-dot { background: #7C3AED; animation: at-pulse 1.4s ease-in-out infinite; }

@keyframes at-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Active break indicator (pulsing dot) ── */
.at-break-active {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #7C3AED;
    font-weight: 600;
    white-space: nowrap;
}

.at-break-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7C3AED;
    flex-shrink: 0;
    animation: at-pulse 1.4s ease-in-out infinite;
}

/* ── Flag badges ── */
.at-flags {
    display: flex;
    gap: 4px;
}

.at-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: var(--legacy-radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
}

.at-flag--grace    { background: var(--color-warning-subtle); color: var(--color-warning-text); }
.at-flag--late     { background: var(--color-warning-subtle); color: var(--color-warning-text); }
.at-flag--verylate { background: var(--color-error-subtle);   color: var(--color-error); }
.at-flag--early    { background: var(--color-error-subtle);   color: var(--color-error); }

/* Late inline pill (class available for future inline usage) */
.at-late-pill {
    display: inline-flex;
    align-items: center;
    background: var(--color-warning-subtle);
    color: var(--color-warning);
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* WFH inline pill */
.at-wfh-pill {
    display: inline-flex;
    align-items: center;
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* ── Expandable break detail row ── */
.at-break-detail-row td {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
}

.at-break-list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding: 10px var(--space-4);
}

.at-break-list__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: 600;
}

.at-break-chip {
    display: inline-block;
    background: var(--color-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    color: #374151;
}

/* ── Empty state ── */
.at-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: 80px var(--space-4);
    text-align: center;
}

.at-empty svg {
    width: 48px;
    height: 48px;
    color: #D1D5DB;
    stroke: #D1D5DB;
    flex-shrink: 0;
}

.at-empty p {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin: 0;
    font-weight: 500;
}

/* ── Pagination ── */
.at-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.at-page-btn {
    padding: 7px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: #374151;
    font-size: var(--font-size-base);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.at-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.at-page-btn:not(:disabled):hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.at-page-info {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

/* ── Correct / edit row button ── */
.ah-correct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    padding: 0;
}

.ah-correct-btn:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    border-color: #C7D2FE;
}

/* ── Manual Correction Modal ── */
.mc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 400;
}

.mc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 401;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.04);
    width: 480px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--color-border);
}

.mc-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.mc-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.mc-close-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-background);
}

.mc-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.mc-row {
    display: flex;
    gap: var(--space-3);
}

.mc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.mc-field label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: #374151;
}

.mc-optional {
    font-weight: 400;
    color: var(--color-text-secondary);
}

.mc-input,
.mc-select,
.mc-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    font-family: inherit;
    background: var(--color-surface);
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.mc-input:focus,
.mc-select:focus,
.mc-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.mc-textarea {
    resize: vertical;
}

.mc-error {
    padding: 10px 14px;
    background: var(--color-error-subtle);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
}

.mc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--color-border);
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {

    /* Export buttons stack full width */
    .ah-actions {
        flex-direction: column;
        width: 100%;
    }

    .ah-export-btn {
        width: 100%;
        justify-content: center;
    }

    /* Filter bar inputs stack vertically */
    .at-filterbar-top {
        flex-direction: column;
        align-items: stretch;
    }

    .at-filterbar-date,
    .at-filterbar-search {
        width: 100%;
    }

    .at-filterbar-date input[type="date"] {
        width: 100%;
    }

    .ah-range-sep {
        text-align: center;
    }

    /* Flag legend wraps to new line */
    .at-flag-legend-strip {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 6px;
        border-top: 1px solid var(--color-border);
        width: 100%;
        flex-wrap: wrap;
    }

    /* Table: keep Employee (1), Date (3), Status (8), Actions (10)
       Hide: Location (2), Check-In (4), Check-Out (5), Worked (6), Break (7), Flags (9) */
    .at-filterbar ~ .dash-card .data-table thead th:nth-child(2),
    .at-filterbar ~ .dash-card .data-table thead th:nth-child(4),
    .at-filterbar ~ .dash-card .data-table thead th:nth-child(5),
    .at-filterbar ~ .dash-card .data-table thead th:nth-child(6),
    .at-filterbar ~ .dash-card .data-table thead th:nth-child(7),
    .at-filterbar ~ .dash-card .data-table thead th:nth-child(9) {
        display: none;
    }

    .at-filterbar ~ .dash-card .data-table tbody td:nth-child(2),
    .at-filterbar ~ .dash-card .data-table tbody td:nth-child(4),
    .at-filterbar ~ .dash-card .data-table tbody td:nth-child(5),
    .at-filterbar ~ .dash-card .data-table tbody td:nth-child(6),
    .at-filterbar ~ .dash-card .data-table tbody td:nth-child(7),
    .at-filterbar ~ .dash-card .data-table tbody td:nth-child(9) {
        display: none;
    }

    /* Tighter cell padding on mobile */
    .at-filterbar ~ .dash-card .data-table th,
    .at-filterbar ~ .dash-card .data-table td {
        padding: 10px 10px;
    }

    /* Modal becomes bottom sheet on mobile */
    .mc-modal {
        width: 100%;
        max-width: 100%;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .at-filterbar-chips {
        gap: 4px;
    }

    .at-chip {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    /* Flag legend hidden on very small screens - not enough room */
    .at-flag-legend-strip {
        display: none;
    }
}

/* ============================================================
   DISPUTES PAGE
   /attendance/disputes - all dp-* class definitions and overrides
   Design-only changes; no HTML or logic modified.
   ============================================================ */

/* ── Count badge ── */
.dp-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: var(--space-2);
    vertical-align: middle;
}

/* ── Filter tabs (pill toggle style) ── */
.dp-filter-tabs-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.dp-filter-tabs-wrap .filter-tab {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.dp-filter-tabs-wrap .filter-tab:hover {
    background: var(--color-neutral-subtle);
    color: var(--color-text-primary);
}

.dp-filter-tabs-wrap .filter-tab.active {
    background: var(--color-accent-subtle);
    border-color: var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
}

/* ── Table overrides (scoped to disputes table) ── */
.dp-overflow-wrap {
    overflow-x: auto;
}

.dp-overflow-wrap .data-table thead th {
    background: var(--color-neutral-subtle);
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 16px;
    border-bottom: 1.5px solid var(--color-border);
    white-space: nowrap;
}

.dp-overflow-wrap .data-table tbody td {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.dp-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dp-row:hover {
    background: var(--color-neutral-subtle);
}

/* ── Employee code chip ── */
.dp-code {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 6px;
    background: var(--color-neutral-subtle);
    color: var(--color-text-secondary);
    border-radius: var(--legacy-radius-sm);
    font-size: 0.72rem;
    font-weight: 500;
}

/* ── Status chips ── */
.dp-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.dp-status-pending {
    background: var(--color-warning-subtle);
    color: var(--color-warning-text);
}

.dp-status-approved {
    background: var(--color-success-subtle);
    color: var(--color-success-hover);
}

.dp-status-rejected {
    background: var(--color-error-subtle);
    color: var(--color-error-hover);
}

.dp-status-approvedwithmodification {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

/* ── Action buttons ── */
.dp-review-btn,
.dp-view-btn {
    padding: 5px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.dp-review-btn {
    background: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.dp-review-btn:hover {
    background: var(--color-accent-subtle);
}

.dp-view-btn {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.dp-view-btn:hover {
    background: var(--color-neutral-subtle);
    color: var(--color-text-primary);
}

/* ── Empty state ── */
.at-empty-state .dp-empty-icon {
    color: var(--color-success);
    opacity: 0.5;
}

/* ── Modal panel - widens default 420px centered modal to 540px ── */
.dp-review-panel {
    width: 540px;
}

/* ── Employee summary row inside modal ── */
.dp-emp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--color-neutral-subtle);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 4px;
}

.dp-emp-name {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.95rem;
}

/* ── Detail rows inside modal body ── */
.dp-detail-rows {
    padding: 0 20px;
}

.dp-reason-text {
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ── Review form ── */
.dp-review-form {
    margin-top: var(--space-4);
    padding: 0 20px var(--space-5);
}

.dp-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

/* ── Resolution tabs (card-like stacked options) ── */
.dp-resolution-tabs.detail-tabs {
    flex-direction: column;
    border-bottom: none;
    margin: 0 0 var(--space-4);
    gap: var(--space-2);
}

.dp-resolution-tabs.detail-tabs .detail-tab {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 0;
    border-bottom-width: 1.5px;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
    text-align: left;
    white-space: nowrap;
}

.dp-resolution-tabs.detail-tabs .detail-tab:hover {
    background: var(--color-neutral-subtle);
    color: var(--color-text-primary);
    border-color: var(--color-text-secondary);
}

.dp-resolution-tabs.detail-tabs .detail-tab.active {
    border-color: var(--color-accent);
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-weight: 600;
}

/* ── Time row ── */
.dp-time-row {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.dp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.dp-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ── Inputs ── */
.dp-time-input,
.dp-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--color-surface);
    color: var(--color-text-primary);
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dp-time-input:focus,
.dp-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.dp-textarea {
    resize: vertical;
}

/* ── Notes field wrapper ── */
.dp-notes-field {
    margin-top: var(--space-3);
}

.dp-required-mark {
    color: var(--color-error);
}

/* ── Inline error ── */
.dp-error {
    margin-top: var(--space-3);
    padding: 8px 12px;
    background: var(--color-error-subtle);
    color: var(--color-error-hover);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

/* ── Actions footer ── */
.dp-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* ── Reject submit button ── */
.dp-btn-reject {
    background: var(--color-error);
    color: #fff;
    border: 1.5px solid var(--color-error);
    padding: 7px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.dp-btn-reject:hover:not(:disabled) {
    background: var(--color-error-hover);
    border-color: var(--color-error-hover);
}

.dp-btn-reject:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Misc helpers (kept from old disputes.css) ── */
.dp-card-body-flush {
    padding: 0;
}

.dp-panel-code {
    margin-left: 6px;
}

.dp-notes-field {
    margin-top: var(--space-3);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    /* Hide: Claimed In (col 3), Claimed Out (col 4), Submitted (col 6) */
    .dp-overflow-wrap .data-table thead th:nth-child(3),
    .dp-overflow-wrap .data-table thead th:nth-child(4),
    .dp-overflow-wrap .data-table thead th:nth-child(6),
    .dp-overflow-wrap .data-table tbody td:nth-child(3),
    .dp-overflow-wrap .data-table tbody td:nth-child(4),
    .dp-overflow-wrap .data-table tbody td:nth-child(6) {
        display: none;
    }

    .dp-filter-tabs-wrap {
        gap: var(--space-1);
    }

    .dp-filter-tabs-wrap .filter-tab {
        font-size: 0.78rem;
        padding: 4px 12px;
    }

    /* Modal becomes bottom sheet on mobile */
    .dp-review-panel {
        width: 100% !important;
        max-width: 100% !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 92vh;
    }
}

/* ============================================================
   DISPUTES MODAL - dr-* layout classes
   Structured 5-section modal body layout.
   ============================================================ */

/* ── Section 1: Employee header ── */
.dr-employee-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.dr-employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6366F1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.dr-employee-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dr-employee-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

/* ── Section 2: Details grid ── */
.dr-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #E5E7EB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.dr-detail-cell {
    background: #FFFFFF;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dr-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dr-detail-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
    line-height: 1.4;
}

/* ── Section spacing ── */
.dr-section {
    margin-bottom: 16px;
}

.dr-section-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

/* ── Section 3: Reason box ── */
.dr-reason-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    color: #111827;
    line-height: 1.6;
    max-height: 100px;
    overflow-y: auto;
    word-break: break-word;
}

.dr-reason-box--accent {
    border-left: 3px solid #6366F1;
    background: #EEF2FF;
}

/* ── Section 4: Review info box ── */
.dr-review-info {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

/* Grid inside review-info: no outer margin (box provides padding) */
.dr-review-info .dr-details-grid {
    margin-bottom: 0;
}

/* Last section inside review-info needs no bottom margin */
.dr-review-info .dr-section:last-child {
    margin-bottom: 0;
}

/* Section within review-info needs a top gap from the grid */
.dr-review-info .dr-section {
    margin-top: 12px;
}

/* ── Section 5: Decision form ── */
/* dp-review-form inside dr-section - reset its own spacing */
.dr-section .dp-review-form {
    margin-top: var(--space-2);
    padding: 0;
}

/* ── Mobile: single-column grid ── */
@media (max-width: 640px) {
    .dr-details-grid {
        grid-template-columns: 1fr;
    }

    .dp-time-row {
        flex-direction: column;
        gap: 12px;
    }

    .dp-time-row .dp-field {
        width: 100%;
    }
}

/* ── Synapse camera button (run 29) ── */
.ma-scan-btn {
    margin-left: auto;
    margin-right: 0.75rem;
    padding: 0.5rem 0.9rem;
    border: none;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.ma-scan-btn:hover {
    background: #1f2937;
}
