/**
 * Attenta Design System
 * Camada de padronizacao visual. Deve conter apenas tokens e componentes
 * reutilizaveis; estilos especificos de pagina devem migrar para ca quando
 * forem realmente comuns.
 */

:root {
    --ds-radius-xs: 4px;
    --ds-radius-sm: 6px;
    --ds-radius-md: 8px;
    --ds-radius-pill: 999px;

    --ds-space-1: 0.25rem;
    --ds-space-2: 0.5rem;
    --ds-space-3: 0.75rem;
    --ds-space-4: 1rem;
    --ds-space-5: 1.25rem;
    --ds-space-6: 1.5rem;

    --ds-focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary-color) 28%, transparent);
    --ds-surface-border: 1px solid var(--border-color);
    --ds-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.14);
    --ds-shadow-card-hover: 0 10px 24px rgba(0, 0, 0, 0.20);
    --ds-shadow-shell: 0 12px 36px rgba(0, 0, 0, 0.16);
    --ds-separator-subtle: rgba(148, 163, 184, 0.18);
    --ds-motion-fast: 140ms var(--ease-out);
    --ds-motion-normal: 200ms var(--ease-out);
}

html[data-theme="light"] {
    --bg-dark: #f6f8fb;
    --bg-darker: #eef2f6;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-hover: #f1f5f9;
    --border-color: #e5ebf2;
    --border-light: #d6dee8;
    --text-primary: #111827;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #64748b;
    --text-dimmed: #7c8aa0;
    --text-white: #ffffff;
    --primary-light: rgba(21, 101, 192, 0.09);
    --success-bg: #e8f8ef;
    --error-bg: #fef0f0;
    --warning-bg: #fff7df;
    --info-bg: #edf5ff;
    --purple-bg: #f2efff;
    --muted-bg: #eef2f6;
    --ds-surface-border: 1px solid rgba(15, 23, 42, 0.07);
    --ds-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
    --ds-shadow-card-hover: 0 10px 24px rgba(15, 23, 42, 0.09);
    --ds-shadow-shell: 0 16px 40px rgba(15, 23, 42, 0.08);
    --ds-separator-subtle: rgba(15, 23, 42, 0.052);
}

html,
body {
    letter-spacing: 0;
}

.app-header {
    backdrop-filter: saturate(1.2) blur(10px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.sidebar {
    scrollbar-gutter: stable;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0)),
        var(--bg-card);
}

.sidebar-nav {
    padding-bottom: var(--ds-space-4);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: var(--ds-radius-pill);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.42);
}

.sidebar .nav-section {
    padding: 0 var(--ds-space-3);
}

.sidebar .nav-section-title {
    padding-left: var(--ds-space-2);
    padding-right: var(--ds-space-2);
}

.sidebar .nav-item {
    position: relative;
    min-height: 42px;
    margin: 2px 0;
    padding: 0.625rem 0.75rem;
    border-left: 0;
    border-radius: var(--ds-radius-md);
    color: var(--text-secondary);
    gap: 0.7rem;
    transition:
        background-color var(--ds-motion-fast),
        color var(--ds-motion-fast),
        transform var(--ds-motion-fast),
        box-shadow var(--ds-motion-fast);
}

.sidebar .nav-item::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: var(--ds-radius-pill);
    background: var(--primary-color);
    transform: translateY(-50%);
    transition: height var(--ds-motion-fast);
}

.sidebar .nav-item:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    transform: translateX(1px);
}

.sidebar .nav-item.active {
    background: color-mix(in srgb, var(--primary-color) 13%, var(--bg-card));
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-color) 22%, transparent);
}

.sidebar .nav-item.active::before {
    height: 58%;
}

.sidebar .nav-item.active i {
    color: var(--primary-color);
}

[data-theme="light"] .sidebar {
    background: var(--bg-card);
}

[data-theme="light"] .sidebar .nav-item {
    color: var(--text-secondary);
}

[data-theme="light"] .sidebar .nav-item:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
}

[data-theme="light"] .sidebar .nav-item.active {
    background: color-mix(in srgb, var(--primary-color) 10%, #ffffff);
    color: var(--text-primary);
}

.pwa-install-section {
    flex: 0 0 auto;
    padding: 0 var(--ds-space-3) var(--ds-space-3) !important;
    margin-bottom: 0 !important;
}

.pwa-install-section .nav-item {
    min-height: 48px;
    border-radius: var(--ds-radius-md);
    width: 100%;
    border: 1px dashed color-mix(in srgb, var(--primary-color) 35%, var(--border-color)) !important;
    background: color-mix(in srgb, var(--primary-color) 8%, transparent) !important;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.sidebar-footer {
    flex: 0 0 auto;
    background: var(--bg-card);
}

.theme-toggle {
    right: 1rem !important;
    bottom: 1rem !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 240 !important;
    box-shadow: 0 8px 24px rgba(21, 101, 192, 0.32) !important;
}

.theme-toggle:hover {
    transform: translateY(-1px) !important;
}

.page-header {
    align-items: flex-start;
    margin-bottom: var(--ds-space-6);
}

.page-header-title h1 {
    letter-spacing: 0;
    line-height: 1.2;
}

.page-header-title p {
    max-width: 70ch;
}

.page-header-actions .btn {
    min-height: 40px;
}

.card,
.stat-card,
.quick-action,
.alert-card,
.filter-card,
.filters-card,
.table-container,
.modal-content {
    border-radius: var(--ds-radius-md) !important;
}

.card,
.stat-card,
.quick-action,
.table-container {
    border: var(--ds-surface-border);
    box-shadow: var(--ds-shadow-card);
}

.card {
    overflow: clip;
}

.card-header {
    min-height: 56px;
    gap: var(--ds-space-3);
}

.card-title {
    line-height: 1.3;
    letter-spacing: 0;
}

.card-title i {
    flex: 0 0 auto;
}

.btn {
    min-height: 40px;
    border-radius: var(--ds-radius-md) !important;
    letter-spacing: 0;
    white-space: nowrap;
}

.btn-sm {
    min-height: 32px;
}

.btn-lg {
    min-height: 48px;
}

.btn-icon,
.header-icon-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 40px;
    border-radius: var(--ds-radius-md) !important;
}

.btn:focus-visible,
.btn-icon:focus-visible,
.nav-item:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.dropdown-item:focus-visible,
.quick-action:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring) !important;
}

.btn:active,
.quick-action:active,
.nav-item:active {
    transform: translateY(1px);
}

.btn i,
.dropdown-item i,
.card-title i {
    line-height: 1;
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    transition: transform var(--ds-motion-normal), box-shadow var(--ds-motion-normal), border-color var(--ds-motion-normal);
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-card-hover);
    border-color: var(--border-light);
}

.stat-card-icon,
.dash-stat-icon,
.quick-action-icon,
.alert-card-icon {
    border-radius: var(--ds-radius-md) !important;
}

.stat-card-icon.danger,
.stat-card-icon.error {
    background: var(--error-bg);
    color: var(--error-color);
}

.stat-card-icon.secondary,
.stat-card-icon.purple,
.dash-stat-icon.secondary,
.quick-action-icon.secondary {
    background: var(--purple-bg);
    color: var(--purple-color);
}

.stat-card-accent-primary,
.dash-stat-accent-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.stat-card-accent-success,
.dash-stat-accent-success {
    border-left: 4px solid var(--success-color) !important;
}

.stat-card-accent-warning,
.dash-stat-accent-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.stat-card-accent-danger,
.dash-stat-accent-danger {
    border-left: 4px solid var(--error-color) !important;
}

.stat-card-accent-info,
.dash-stat-accent-info {
    border-left: 4px solid var(--info-color) !important;
}

.dash-stat-accent-secondary,
.stat-card-accent-purple {
    border-left: 4px solid var(--purple-color) !important;
}

.quick-action {
    border-color: var(--border-color) !important;
    transition: transform var(--ds-motion-normal), box-shadow var(--ds-motion-normal), border-color var(--ds-motion-normal), background var(--ds-motion-normal);
}

.quick-action:hover {
    border-color: color-mix(in srgb, var(--primary-color) 60%, var(--border-color)) !important;
}

.quick-action-icon {
    width: 52px;
    height: 52px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-3);
    border-radius: var(--ds-radius-md) !important;
    line-height: 1.45;
}

.alert > i:first-child {
    margin-top: 0.1rem;
    flex: 0 0 auto;
}

.alert-card {
    border: var(--ds-surface-border);
    box-shadow: var(--ds-shadow-card);
}

.alert-card.info {
    background: var(--info-bg);
    border-left: 4px solid var(--info-color);
}

.alert-card.warning {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning-color);
}

.alert-card.danger,
.alert-card.error {
    background: var(--error-bg);
    border-left: 4px solid var(--error-color);
}

.alert-card.success {
    background: var(--success-bg);
    border-left: 4px solid var(--success-color);
}

.table-container,
.table-responsive {
    border-radius: var(--ds-radius-md);
}

.table th {
    letter-spacing: 0.04em;
}

.table td,
.table th {
    vertical-align: middle;
}

.badge {
    min-height: 24px;
    border-radius: var(--ds-radius-pill);
    letter-spacing: 0;
}

.badge-lg {
    min-height: 36px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.empty-state {
    border-radius: var(--ds-radius-md);
}

.empty-state-icon {
    opacity: 0.72;
}

.empty-state-lg-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    opacity: 0.72;
}

.dropdown-menu {
    border-radius: var(--ds-radius-md);
    border: var(--ds-surface-border);
    box-shadow: var(--ds-shadow-card-hover);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: var(--ds-radius-md) !important;
}

.form-control,
.form-select {
    min-height: 40px;
}

.swal2-popup {
    border-radius: var(--ds-radius-md) !important;
}

@media (hover: hover) {
    .btn:hover:not(:disabled),
    .nav-item:hover,
    .quick-action:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 575.98px) {
    .page-header-actions {
        gap: var(--ds-space-2);
    }

    .page-header-actions .btn {
        justify-content: center;
        width: 100%;
    }

    .card-header {
        min-height: 52px;
        align-items: flex-start;
    }

    .btn {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .nav-item,
    .quick-action,
    .stat-card {
        transform: none !important;
    }
}

/* Dashboard shell components */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--ds-space-4);
    padding: var(--ds-space-5);
}

.stat-card-content {
    flex: 1;
    min-width: 0;
}

.stat-card-value {
    line-height: 1;
}

.stat-card-label {
    margin-top: var(--ds-space-1);
}

.alerts-section {
    display: grid;
    gap: var(--ds-space-3);
    margin-bottom: var(--ds-space-6);
}

.alert-card {
    display: flex;
    align-items: center;
    gap: var(--ds-space-4);
    padding: var(--ds-space-4) var(--ds-space-5);
}

.alert-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    font-size: 1.15rem;
}

.alert-card.info .alert-card-icon {
    background: color-mix(in srgb, var(--info-color) 18%, transparent);
    color: var(--info-color);
}

.alert-card.warning .alert-card-icon {
    background: color-mix(in srgb, var(--warning-color) 18%, transparent);
    color: var(--warning-color);
}

.alert-card.danger .alert-card-icon,
.alert-card.error .alert-card-icon {
    background: color-mix(in srgb, var(--error-color) 18%, transparent);
    color: var(--error-color);
}

.alert-card.success .alert-card-icon {
    background: color-mix(in srgb, var(--success-color) 18%, transparent);
    color: var(--success-color);
}

.alert-card-content {
    flex: 1;
    min-width: 0;
}

.alert-card-title {
    font-weight: 650;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.alert-card-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-3);
    min-height: 132px;
    padding: var(--ds-space-5);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
}

.quick-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    font-size: 1.4rem;
}

.quick-action-icon.primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

.quick-action-icon.success {
    background: var(--success-bg);
    color: var(--success-color);
}

.quick-action-icon.warning {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.quick-action-icon.info {
    background: var(--info-bg);
    color: var(--info-color);
}

.quick-action-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.weekly-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 152px;
    gap: var(--ds-space-2);
    padding: var(--ds-space-4) 0;
}

.weekly-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ds-space-2);
    min-width: 0;
}

.weekly-bar-fill {
    width: 100%;
    max-width: 42px;
    min-height: 8px;
    border-radius: var(--ds-radius-sm) var(--ds-radius-sm) 0 0;
    background: linear-gradient(to top, var(--primary-color), #60a5fa);
    transform-origin: bottom;
    animation: attentaBarGrow 420ms var(--ease-out) both;
}

@keyframes attentaBarGrow {
    from { transform: scaleY(0.18); opacity: 0.7; }
    to { transform: scaleY(1); opacity: 1; }
}

.weekly-bar-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
}

.weekly-bar-value {
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-primary);
}

.working-now-list {
    display: grid;
    gap: var(--ds-space-2);
    max-height: 300px;
    overflow-y: auto;
}

.working-now-item,
.pending-item {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-3);
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.working-now-item {
    border-color: color-mix(in srgb, var(--success-color) 18%, var(--border-color));
    background: color-mix(in srgb, var(--success-color) 7%, var(--bg-card));
}

.working-now-avatar,
.working-now-avatar-img,
.user-avatar,
.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-pill);
    flex: 0 0 40px;
}

.working-now-avatar,
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 650;
    font-size: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.working-now-avatar {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
}

.working-now-avatar-img,
.user-avatar-img {
    object-fit: cover;
}

.working-now-info,
.pending-info {
    flex: 1;
    min-width: 0;
}

.working-now-name,
.pending-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.working-now-position,
.pending-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.working-now-time {
    font-size: 0.75rem;
    color: var(--success-color);
    font-weight: 600;
    white-space: nowrap;
}

.monthly-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-4);
}

.monthly-stat {
    text-align: center;
    padding: var(--ds-space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
}

.monthly-stat-value {
    font-size: 1.5rem;
    line-height: 1.15;
    font-weight: 750;
    color: var(--text-primary);
}

.monthly-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: var(--ds-space-1);
}

.monthly-stat-value.success,
.summary-value.success {
    color: var(--success-color);
}

.monthly-stat-value.warning,
.summary-value.warning {
    color: var(--warning-color);
}

.monthly-stat-value.info,
.summary-value.info {
    color: var(--info-color);
}

.recent-clocks-table {
    width: 100%;
    color: var(--text-primary);
}

.recent-clocks-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 650;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.recent-clocks-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
}

.recent-clocks-table td small {
    color: var(--text-secondary);
}

.recent-clocks-table tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-width: 0;
}

.user-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clock-type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--ds-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.clock-type-badge.in {
    background: var(--success-bg);
    color: var(--success-color);
}

.clock-type-badge.out {
    background: var(--error-bg);
    color: var(--error-color);
}

.pending-list {
    display: grid;
    gap: var(--ds-space-2);
}

.pending-item {
    justify-content: space-between;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: var(--ds-space-4);
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.summary-label {
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 650;
    color: var(--text-primary);
    text-align: right;
}

.btn-inline-icon {
    min-height: auto;
    vertical-align: baseline;
}

/* Approval/request components */
.tabs {
    gap: var(--ds-space-2);
    margin-bottom: var(--ds-space-6);
    padding-bottom: 0;
}

.tab-btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: var(--ds-radius-md) var(--ds-radius-md) 0 0;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    padding: 0 0.45rem;
    border-radius: var(--ds-radius-pill);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.tab-btn.active .tab-badge {
    background: var(--primary-light);
    color: var(--primary-color);
}

.request-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    padding: var(--ds-space-4);
    margin-bottom: var(--ds-space-4);
    box-shadow: var(--ds-shadow-card);
    transition: transform var(--ds-motion-normal), border-color var(--ds-motion-normal), box-shadow var(--ds-motion-normal);
}

.request-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-light);
    box-shadow: var(--ds-shadow-card-hover);
}

.request-card.history-approved {
    border-left: 4px solid var(--success-color);
}

.request-card.history-rejected {
    border-left: 4px solid var(--error-color);
}

.request-card.history-cancelled {
    border-left: 4px solid var(--text-secondary);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-4);
}

.request-card .user-info {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    min-width: 0;
}

.request-card .user-avatar,
.request-card .user-avatar-img {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
}

.request-card .user-name {
    font-weight: 650;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.user-position,
.user-team {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.user-team {
    font-size: 0.75rem;
}

.request-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--ds-radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.request-badge {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.request-badge.vacation {
    background: var(--primary-light);
    color: var(--primary-color);
}

.request-badge.correction,
.request-badge.bank-hours {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.request-badge.justification {
    background: var(--purple-bg);
    color: var(--purple-color);
}

.status-badge.approved {
    background: var(--success-bg);
    color: var(--success-color);
}

.status-badge.rejected {
    background: var(--error-bg);
    color: var(--error-color);
}

.status-badge.cancelled {
    background: var(--muted-bg);
    color: var(--text-secondary);
}

.request-details {
    margin-bottom: var(--ds-space-4);
}

.detail-row {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    margin-bottom: var(--ds-space-2);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.detail-row i {
    font-size: 1rem;
    color: var(--primary-color);
}

.request-reason {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: var(--ds-space-3) 0;
    line-height: 1.55;
}

.request-date,
.request-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.request-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
    margin-top: var(--ds-space-2);
}

.reviewer-info {
    font-size: 0.8125rem;
    padding-top: var(--ds-space-2);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.reviewer-info.approved {
    color: var(--success-color);
}

.reviewer-info.rejected {
    color: var(--error-color);
}

.reviewer-info.cancelled {
    color: var(--text-secondary);
}

.correction-info {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    padding: var(--ds-space-3);
    margin-bottom: var(--ds-space-3);
}

.correction-info + .correction-info {
    margin-top: var(--ds-space-2);
}

.correction-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--ds-space-1);
}

.correction-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.correction-value-sm {
    font-size: 0.8125rem;
}

.correction-arrow {
    color: var(--primary-color);
    margin: 0 var(--ds-space-2);
}

.document-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    background: var(--primary-light);
    border: 1px solid color-mix(in srgb, var(--primary-color) 28%, transparent);
    border-radius: var(--ds-radius-md);
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: var(--ds-space-2);
}

.document-btn:hover {
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
    color: var(--primary-color);
}

.request-actions {
    display: flex;
    gap: var(--ds-space-2);
    padding-top: var(--ds-space-4);
    border-top: 1px solid var(--border-color);
}

.request-actions .btn {
    flex: 1;
}

body.loaded .request-card {
    animation: attentaSoftRise 180ms var(--ease-out) both;
}

/* Employee management components */
.filters-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    padding: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
    box-shadow: var(--ds-shadow-card);
}

.filters-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
}

.filters-row .search-box {
    flex: 1 1 280px;
    min-width: 220px;
}

.filter-select {
    flex: 0 1 180px;
    min-width: 150px;
    width: auto;
}

.filters-row > .btn {
    flex: 0 0 auto;
}

.view-toggle {
    display: inline-flex;
    gap: var(--ds-space-1);
    padding: var(--ds-space-1);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
}

.view-toggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border: 0;
    border-radius: var(--ds-radius-sm);
    background: transparent;
    color: var(--text-secondary);
    transition: background var(--ds-motion-fast), color var(--ds-motion-fast);
}

.view-toggle button:hover {
    color: var(--text-primary);
}

.view-toggle button.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--ds-shadow-card);
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--ds-space-4);
}

.employee-table-panel {
    display: none !important;
}

html.is-employee-table-view .employee-view-grid {
    display: none !important;
}

html.is-employee-table-view .employee-table-panel {
    display: block !important;
}

/* Global light-mode polish. This layer intentionally sits late in the cascade
   to normalize page-local card/header/table styles without editing every page. */
html[data-theme="light"] body {
    background:
        linear-gradient(180deg, #f9fbfd 0%, var(--bg-dark) 240px),
        var(--bg-dark) !important;
}

html[data-theme="light"] .main-content,
html[data-theme="light"] .content-wrapper {
    background: transparent !important;
}

html[data-theme="light"] .app-header {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: rgba(203, 213, 225, 0.72) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.96) !important;
    border-right-color: rgba(203, 213, 225, 0.75) !important;
    box-shadow: 1px 0 0 rgba(15, 23, 42, 0.03) !important;
}

html[data-theme="light"] .sidebar-header,
html[data-theme="light"] .sidebar-footer {
    background: transparent !important;
    border-color: rgba(203, 213, 225, 0.75) !important;
}

html[data-theme="light"] .sidebar .nav-section-title {
    color: #7c8aa0 !important;
}

html[data-theme="light"] .sidebar .nav-item {
    color: #465569 !important;
}

html[data-theme="light"] .sidebar .nav-item:hover {
    background: #f3f7fb !important;
    color: #111827 !important;
}

html[data-theme="light"] .sidebar .nav-item.active {
    background: linear-gradient(90deg, rgba(21, 101, 192, 0.12), rgba(21, 101, 192, 0.05)) !important;
    color: #0f172a !important;
    box-shadow: inset 0 0 0 1px rgba(21, 101, 192, 0.14) !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .profile-avatar-card,
html[data-theme="light"] .password-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .quick-action,
html[data-theme="light"] .quick-action-btn,
html[data-theme="light"] .request-card,
html[data-theme="light"] .filters-card,
html[data-theme="light"] .filter-card,
html[data-theme="light"] .table-container,
html[data-theme="light"] .table-responsive-card,
html[data-theme="light"] .data-card,
html[data-theme="light"] .location-card,
html[data-theme="light"] .team-card,
html[data-theme="light"] .bank-hour-card,
html[data-theme="light"] .dash-stat-card,
html[data-theme="light"] .clock-card,
html[data-theme="light"] .recurring-card,
html[data-theme="light"] .schedule-tabs,
html[data-theme="light"] .selection-list,
html[data-theme="light"] .status-timeline,
html[data-theme="light"] .notification-card,
html[data-theme="light"] .notification-settings-card,
html[data-theme="light"] .support-card,
html[data-theme="light"] .lead-card,
html[data-theme="light"] .invoice-card,
html[data-theme="light"] .company-card,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .superadmin-card,
html[data-theme="light"] .plan-card,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .detail-section,
html[data-theme="light"] .form-section,
html[data-theme="light"] .monthly-progress-card,
html[data-theme="light"] .balance-card,
html[data-theme="light"] .info-card {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    box-shadow: var(--ds-shadow-card) !important;
}

html[data-theme="light"] .card:hover,
html[data-theme="light"] .profile-card:hover,
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .quick-action:hover,
html[data-theme="light"] .quick-action-btn:hover,
html[data-theme="light"] .request-card:hover,
html[data-theme="light"] .employee-card:hover,
html[data-theme="light"] .location-card:hover,
html[data-theme="light"] .team-card:hover,
html[data-theme="light"] .bank-hour-card:hover,
html[data-theme="light"] .dash-stat-card:hover,
html[data-theme="light"] .recurring-card:hover,
html[data-theme="light"] .notification-card:hover,
html[data-theme="light"] .lead-card:hover,
html[data-theme="light"] .invoice-card:hover,
html[data-theme="light"] .company-card:hover,
html[data-theme="light"] .admin-card:hover,
html[data-theme="light"] .superadmin-card:hover,
html[data-theme="light"] .plan-card:hover {
    box-shadow: var(--ds-shadow-card-hover) !important;
}

html[data-theme="light"] .card-header,
html[data-theme="light"] .profile-card-header,
html[data-theme="light"] .password-card-header,
html[data-theme="light"] .data-card-header,
html[data-theme="light"] .form-section-header,
html[data-theme="light"] .detail-section-header,
html[data-theme="light"] .settings-card-header,
html[data-theme="light"] .notification-header,
html[data-theme="light"] .support-card-header,
html[data-theme="light"] .lead-card-header,
html[data-theme="light"] .invoice-card-header,
html[data-theme="light"] .company-card-header,
html[data-theme="light"] .admin-card-header,
html[data-theme="light"] .superadmin-card-header,
html[data-theme="light"] .plan-card-header {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    border-bottom: 0 !important;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.045) !important;
}

html[data-theme="light"] .card-footer,
html[data-theme="light"] .request-actions,
html[data-theme="light"] .employee-card-body,
html[data-theme="light"] .employee-card-footer,
html[data-theme="light"] .info-row,
html[data-theme="light"] .summary-row,
html[data-theme="light"] .detail-row,
html[data-theme="light"] .profile-info-item,
html[data-theme="light"] .selection-item,
html[data-theme="light"] .timeline,
html[data-theme="light"] .timeline-item,
html[data-theme="light"] .records-timeline,
html[data-theme="light"] .history-item,
html[data-theme="light"] .notification-item,
html[data-theme="light"] .schedule-info,
html[data-theme="light"] .schedule-item,
html[data-theme="light"] .settings-row,
html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer,
html[data-theme="light"] .border-top,
html[data-theme="light"] .border-bottom {
    border-color: var(--ds-separator-subtle) !important;
}

html[data-theme="light"] .info-row:last-child,
html[data-theme="light"] .summary-row:last-child,
html[data-theme="light"] .detail-row:last-child,
html[data-theme="light"] .timeline-item:last-child,
html[data-theme="light"] .selection-item:last-child,
html[data-theme="light"] .notification-item:last-child {
    border-bottom-color: transparent !important;
}

html[data-theme="light"] .bg-primary-light,
html[data-theme="light"] .bg-info-light,
html[data-theme="light"] .bg-success-light,
html[data-theme="light"] .bg-warning-light,
html[data-theme="light"] .bg-danger-light,
html[data-theme="light"] .bg-secondary-light {
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-theme="light"] .badge,
html[data-theme="light"] [class$="-badge"],
html[data-theme="light"] [class*="-badge "] {
    border-color: transparent !important;
}

html[data-theme="light"] .day-badge,
html[data-theme="light"] .schedule-badge,
html[data-theme="light"] .distance-badge,
html[data-theme="light"] .photo-requirement-badge,
html[data-theme="light"] .pending-clocks-badge,
html[data-theme="light"] .balance-badge,
html[data-theme="light"] .schedule-type-badge,
html[data-theme="light"] .entry-badge,
html[data-theme="light"] .period-badge,
html[data-theme="light"] .existing-badge,
html[data-theme="light"] .total-hours-badge,
html[data-theme="light"] .clock-status-badge {
    box-shadow: none !important;
}

html[data-theme="light"] .table,
html[data-theme="light"] .employee-table,
html[data-theme="light"] .recent-clocks-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    color: var(--text-primary) !important;
}

html[data-theme="light"] .table thead th,
html[data-theme="light"] .employee-table th,
html[data-theme="light"] .recent-clocks-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .table td,
html[data-theme="light"] .employee-table td,
html[data-theme="light"] .recent-clocks-table td,
html[data-theme="light"] .week-table th,
html[data-theme="light"] .week-table td {
    border-color: var(--ds-separator-subtle) !important;
}

html[data-theme="light"] .table tbody tr,
html[data-theme="light"] .employee-table tr,
html[data-theme="light"] .recent-clocks-table tr {
    transition: background-color var(--ds-motion-fast);
}

html[data-theme="light"] .table tbody tr:hover,
html[data-theme="light"] .employee-table tr:hover,
html[data-theme="light"] .recent-clocks-table tr:hover {
    background: #f8fafc !important;
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] .input-group-text {
    border-color: #d6dee8 !important;
    box-shadow: none !important;
}

html[data-theme="light"] .form-control:hover,
html[data-theme="light"] .form-select:hover {
    border-color: #c3cfdd !important;
}

html[data-theme="light"] .btn-primary {
    box-shadow: 0 1px 2px rgba(21, 101, 192, 0.18);
}

html[data-theme="light"] .btn-outline-primary {
    background: rgba(255, 255, 255, 0.72) !important;
}

html[data-theme="light"] .btn-outline-primary:hover {
    background: var(--primary-color) !important;
}

html[data-theme="light"] .btn-outline-secondary,
html[data-theme="light"] .btn-light {
    background: #ffffff !important;
}

html[data-theme="light"] .alert {
    box-shadow: var(--ds-shadow-card);
}

html[data-theme="light"] .list-group-item {
    border-color: var(--ds-separator-subtle) !important;
}

html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .swal2-popup {
    box-shadow: var(--ds-shadow-shell) !important;
}

html[data-theme="light"] .theme-toggle {
    background: #ffffff !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--ds-shadow-shell) !important;
}

html[data-theme="light"] .theme-toggle i {
    color: var(--primary-color) !important;
}

/* Theme toggle state: show the action the button will perform. */
.theme-toggle .bi-moon-fill {
    display: none !important;
}

.theme-toggle .bi-sun-fill {
    display: inline-flex !important;
    color: #ffffff !important;
}

html[data-theme="light"] .theme-toggle {
    background: #ffffff !important;
    color: var(--primary-color) !important;
    border: 1px solid rgba(21, 101, 192, 0.16) !important;
    box-shadow: 0 10px 26px rgba(21, 101, 192, 0.18) !important;
}

html[data-theme="light"] .theme-toggle .bi-sun-fill {
    display: none !important;
}

html[data-theme="light"] .theme-toggle .bi-moon-fill {
    display: inline-flex !important;
    color: var(--primary-color) !important;
}

body.loaded .content-wrapper > * {
    animation: attentaPageItemIn 220ms var(--ease-out) both;
}

body.loaded .content-wrapper .profile-card,
body.loaded .content-wrapper .profile-avatar-card,
body.loaded .content-wrapper .password-card,
body.loaded .content-wrapper .filters-card,
body.loaded .content-wrapper .filter-card,
body.loaded .content-wrapper .table-container,
body.loaded .content-wrapper .table-responsive-card,
body.loaded .content-wrapper .data-card,
body.loaded .content-wrapper .settings-card,
body.loaded .content-wrapper .detail-section,
body.loaded .content-wrapper .form-section,
body.loaded .content-wrapper .monthly-progress-card,
body.loaded .content-wrapper .balance-card,
body.loaded .content-wrapper .info-card,
body.loaded .content-wrapper .dash-stat-card,
body.loaded .content-wrapper .clock-card,
body.loaded .content-wrapper .recurring-card,
body.loaded .content-wrapper .schedule-tabs,
body.loaded .content-wrapper .status-timeline,
body.loaded .content-wrapper .notification-card,
body.loaded .content-wrapper .notification-settings-card,
body.loaded .content-wrapper .support-card,
body.loaded .content-wrapper .lead-card,
body.loaded .content-wrapper .invoice-card,
body.loaded .content-wrapper .company-card,
body.loaded .content-wrapper .admin-card,
body.loaded .content-wrapper .superadmin-card,
body.loaded .content-wrapper .plan-card {
    animation: attentaCardIn 220ms var(--ease-out) both;
}

@keyframes attentaCardIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.loaded .content-wrapper > *:nth-child(2) { animation-delay: 25ms; }
body.loaded .content-wrapper > *:nth-child(3) { animation-delay: 50ms; }
body.loaded .content-wrapper > *:nth-child(4) { animation-delay: 75ms; }
body.loaded .content-wrapper > *:nth-child(n+5) { animation-delay: 90ms; }

@keyframes attentaPageItemIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.employee-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    padding: var(--ds-space-5);
    box-shadow: var(--ds-shadow-card);
    transition: transform var(--ds-motion-normal), border-color var(--ds-motion-normal), box-shadow var(--ds-motion-normal);
}

.employee-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-light);
    box-shadow: var(--ds-shadow-card-hover);
}

.employee-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-4);
}

.employee-avatar,
.employee-table .avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--ds-radius-pill);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    font-weight: 700;
}

.employee-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    font-size: 1.15rem;
}

.employee-avatar img,
.employee-table .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-info {
    flex: 1;
    min-width: 0;
}

.employee-name {
    color: var(--text-primary);
    font-weight: 650;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-position {
    margin-top: var(--ds-space-1);
    margin-bottom: var(--ds-space-2);
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.employee-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.25rem 0.625rem;
    border-radius: var(--ds-radius-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-status.active {
    background: var(--success-bg);
    color: var(--success-color);
}

.badge-status.inactive {
    background: var(--error-bg);
    color: var(--error-color);
}

.employee-card-body {
    padding-top: var(--ds-space-4);
    margin-bottom: var(--ds-space-4);
    border-top: 1px solid var(--border-color);
}

.employee-detail {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    min-width: 0;
    margin-bottom: var(--ds-space-2);
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.employee-detail i {
    width: 16px;
    flex: 0 0 16px;
    color: var(--text-muted);
}

.employee-detail span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-card-footer,
.btn-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ds-space-2);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--ds-motion-fast), border-color var(--ds-motion-fast), color var(--ds-motion-fast), transform var(--ds-motion-fast);
}

.btn-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-action.view:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

.btn-action.edit:hover {
    border-color: var(--warning-color);
    color: var(--warning-color);
    background: var(--warning-bg);
}

.btn-action.danger:hover {
    border-color: var(--error-color);
    color: var(--error-color);
    background: var(--error-bg);
}

.empty-state-full {
    grid-column: 1 / -1;
}

.employee-grid .empty-state,
.employee-table-panel .empty-state {
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    color: var(--text-secondary);
    text-align: center;
    box-shadow: var(--ds-shadow-card);
}

.employee-grid .empty-state i,
.employee-table-panel .empty-state i {
    display: block;
    margin-bottom: var(--ds-space-4);
    color: var(--text-secondary);
    font-size: 3rem;
    opacity: 0.72;
}

.employee-grid .empty-state h3,
.employee-table-panel .empty-state h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
}

.employee-table {
    width: 100%;
    color: var(--text-primary);
}

.employee-table th {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 650;
    text-align: left;
    text-transform: uppercase;
}

.employee-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.employee-table tr:hover {
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.employee-table .avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    font-size: 0.875rem;
}

.user-info .name {
    color: var(--text-primary);
    font-weight: 600;
}

.user-info .email {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.swal-password-panel {
    margin-top: var(--ds-space-4);
    padding: var(--ds-space-4);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    background: var(--bg-darker);
}

.swal-password-label {
    margin-bottom: var(--ds-space-1);
    color: var(--text-secondary);
}

.swal-password-value {
    margin-bottom: 0;
    color: var(--success-color);
    font-size: 1.5rem;
    font-weight: 750;
}

body.loaded .stats-grid > .stat-card,
body.loaded .quick-actions > .quick-action,
body.loaded .alerts-section > .alert-card,
body.loaded .employee-card,
body.loaded .locations-grid > .location-card,
body.loaded .teams-grid > .team-card,
body.loaded .bank-hours-grid > .bank-hour-card {
    animation: attentaSoftRise 180ms var(--ease-out) both;
}

@keyframes attentaSoftRise {
    from { transform: translateY(4px); }
    to { transform: translateY(0); }
}

/* Shared admin collection components */
.locations-grid,
.teams-grid,
.bank-hours-grid {
    display: grid;
    gap: var(--ds-space-4);
}

.locations-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.teams-grid,
.bank-hours-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.location-card,
.team-card,
.bank-hour-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-card);
    transition:
        transform var(--ds-motion-normal),
        border-color var(--ds-motion-normal),
        box-shadow var(--ds-motion-normal),
        background var(--ds-motion-normal);
}

.location-card:hover,
.team-card:hover,
.bank-hour-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-light);
    box-shadow: var(--ds-shadow-card-hover);
}

.tab-buttons {
    display: flex;
    gap: var(--ds-space-2);
    padding: var(--ds-space-1);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    background: var(--bg-secondary);
}

.tab-buttons .tab-btn {
    flex: 1;
    min-height: 40px;
    border: 0;
    border-radius: var(--ds-radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    transition:
        background var(--ds-motion-fast),
        color var(--ds-motion-fast),
        box-shadow var(--ds-motion-fast),
        transform var(--ds-motion-fast);
}

.tab-buttons .tab-btn:hover:not(.active) {
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    color: var(--text-primary);
}

.tab-buttons .tab-btn.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--ds-shadow-card);
}

.filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
    padding: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
    border: 1px solid var(--border-color);
    border-radius: var(--ds-radius-md);
    background: var(--bg-card);
    box-shadow: var(--ds-shadow-card);
}

.day-btn,
.type-btn {
    border-radius: var(--ds-radius-md);
    transition:
        background var(--ds-motion-fast),
        border-color var(--ds-motion-fast),
        color var(--ds-motion-fast),
        transform var(--ds-motion-fast);
}

.day-btn:hover,
.type-btn:hover {
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    body.loaded .content-wrapper > *,
    body.loaded .content-wrapper .profile-card,
    body.loaded .content-wrapper .profile-avatar-card,
    body.loaded .content-wrapper .password-card,
    body.loaded .content-wrapper .filters-card,
    body.loaded .content-wrapper .filter-card,
    body.loaded .content-wrapper .table-container,
    body.loaded .content-wrapper .table-responsive-card,
    body.loaded .content-wrapper .data-card,
    body.loaded .content-wrapper .settings-card,
    body.loaded .content-wrapper .detail-section,
    body.loaded .content-wrapper .form-section,
    body.loaded .content-wrapper .monthly-progress-card,
    body.loaded .content-wrapper .balance-card,
    body.loaded .content-wrapper .info-card,
    body.loaded .content-wrapper .dash-stat-card,
    body.loaded .content-wrapper .clock-card,
    body.loaded .content-wrapper .recurring-card,
    body.loaded .content-wrapper .schedule-tabs,
    body.loaded .content-wrapper .status-timeline,
    body.loaded .content-wrapper .notification-card,
    body.loaded .content-wrapper .notification-settings-card,
    body.loaded .content-wrapper .support-card,
    body.loaded .content-wrapper .lead-card,
    body.loaded .content-wrapper .invoice-card,
    body.loaded .content-wrapper .company-card,
    body.loaded .content-wrapper .admin-card,
    body.loaded .content-wrapper .superadmin-card,
    body.loaded .content-wrapper .plan-card,
    body.loaded .stats-grid > .stat-card,
    body.loaded .quick-actions > .quick-action,
    body.loaded .alerts-section > .alert-card,
    body.loaded .employee-card,
    body.loaded .locations-grid > .location-card,
    body.loaded .teams-grid > .team-card,
    body.loaded .bank-hours-grid > .bank-hour-card,
    .location-card,
    .team-card,
    .bank-hour-card,
    .day-btn,
    .type-btn {
        animation: none !important;
        transform: none !important;
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .stats-grid,
    .quick-actions,
    .monthly-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-grid,
    .quick-actions {
        gap: var(--ds-space-3);
    }

    .stat-card {
        padding: var(--ds-space-4);
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .quick-action {
        min-height: 116px;
        padding: var(--ds-space-4);
    }

    .quick-action-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        font-size: 1.25rem;
    }

    .alert-card {
        flex-wrap: wrap;
    }

    .alert-card .btn {
        width: 100%;
    }

    .recent-clocks-table {
        font-size: 0.875rem;
    }

    .recent-clocks-table th,
    .recent-clocks-table td {
        padding: 0.625rem;
    }

    .weekly-chart {
        height: 124px;
    }

    .weekly-bar-fill {
        max-width: 30px;
    }

    .weekly-bar-label {
        font-size: 0.5625rem;
    }

    .employee-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters-row {
        align-items: stretch;
    }

    .filters-row .btn,
    .filters-row .filter-select {
        flex: 1 1 160px;
    }
}

@media (max-width: 575.98px) {
    .stats-grid,
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .monthly-summary-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--ds-space-3);
        min-height: 104px;
    }

    .stat-card-label {
        overflow-wrap: normal;
        word-break: normal;
    }

    .quick-action {
        min-height: 112px;
    }

    .recent-clocks-table th:nth-child(5),
    .recent-clocks-table td:nth-child(5) {
        display: none;
    }

    .working-now-item {
        flex-wrap: wrap;
    }

    .working-now-time {
        width: 100%;
        text-align: right;
    }

    .pending-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .pending-item .btn {
        width: 100%;
    }

    .tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--ds-space-2);
        overflow: visible;
        border-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }

    .tab-btn {
        flex: 0 0 auto;
        justify-content: center;
        min-height: 40px;
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
        border: 1px solid var(--border-color);
        border-radius: var(--ds-radius-md);
        background: var(--bg-card);
    }

    .tab-btn.active {
        border-color: color-mix(in srgb, var(--primary-color) 58%, var(--border-color));
        background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-card));
    }

    .tab-btn.active::after {
        display: none;
    }

    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--ds-space-3);
    }

    .request-actions {
        flex-direction: column;
    }

    .request-actions .btn {
        width: 100%;
    }

    .request-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-card {
        padding: var(--ds-space-3);
    }

    .filters-row {
        flex-direction: column;
        gap: var(--ds-space-2);
    }

    .filters-row .search-box,
    .filters-row .filter-select,
    .filters-row .btn {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
    }

    .view-toggle {
        width: 100%;
    }

    .view-toggle button {
        flex: 1;
    }

    .employee-grid {
        grid-template-columns: 1fr;
        gap: var(--ds-space-3);
    }

    .employee-card {
        padding: var(--ds-space-4);
    }

    .employee-avatar {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        font-size: 1rem;
    }

    .employee-table th:nth-child(3),
    .employee-table td:nth-child(3),
    .employee-table th:nth-child(4),
    .employee-table td:nth-child(4) {
        display: none;
    }

    .employee-table th,
    .employee-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }

    .employee-table .avatar {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 0.75rem;
    }

    .user-info .email {
        display: none;
    }
}

@media (max-width: 420px) {
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .tab-btn i {
        display: none;
    }

    .employee-card-header {
        gap: var(--ds-space-3);
    }

    .employee-avatar {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .employee-name {
        font-size: 0.9375rem;
    }

    .employee-position,
    .employee-detail {
        font-size: 0.75rem;
    }

    .employee-card-footer,
    .btn-action-group {
        gap: var(--ds-space-1);
    }

    .btn-action {
        width: 34px;
        height: 34px;
        min-height: 34px;
    }
}

/* Final light-mode card normalization.
   This must stay at the end because many role pages define local stat/card
   rules after the shared header. It removes the grey inset boxes that appeared
   around stat values/labels while preserving the card shell itself. */
html[data-theme="light"] .card,
html[data-theme="light"] .card.bg-dark,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .dash-stat-card,
html[data-theme="light"] .stat-card-mini,
html[data-theme="light"] .quick-action,
html[data-theme="light"] .quick-action-btn,
html[data-theme="light"] .request-card,
html[data-theme="light"] .employee-card,
html[data-theme="light"] .location-card,
html[data-theme="light"] .team-card,
html[data-theme="light"] .bank-hour-card,
html[data-theme="light"] .recurring-card,
html[data-theme="light"] .notification-card,
html[data-theme="light"] .notification-settings-card,
html[data-theme="light"] .support-card,
html[data-theme="light"] .lead-card,
html[data-theme="light"] .invoice-card,
html[data-theme="light"] .company-card,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .superadmin-card,
html[data-theme="light"] .plan-card,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .password-card,
html[data-theme="light"] .detail-section,
html[data-theme="light"] .form-section,
html[data-theme="light"] .info-card,
html[data-theme="light"] .balance-card,
html[data-theme="light"] .monthly-progress-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.045) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035), 0 10px 24px rgba(15, 23, 42, 0.035) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .bg-dark,
html[data-theme="light"] .border-secondary,
html[data-theme="light"] .card.bg-dark.border-secondary,
html[data-theme="light"] .card.bg-dark.border-primary {
    background-color: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.06) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .card-header,
html[data-theme="light"] .profile-card-header,
html[data-theme="light"] .password-card-header,
html[data-theme="light"] .data-card-header,
html[data-theme="light"] .form-section-header,
html[data-theme="light"] .detail-section-header,
html[data-theme="light"] .settings-card-header,
html[data-theme="light"] .notification-header,
html[data-theme="light"] .support-card-header,
html[data-theme="light"] .lead-card-header,
html[data-theme="light"] .invoice-card-header,
html[data-theme="light"] .company-card-header,
html[data-theme="light"] .admin-card-header,
html[data-theme="light"] .superadmin-card-header,
html[data-theme="light"] .plan-card-header {
    background: #ffffff !important;
    border-bottom-color: rgba(15, 23, 42, 0.04) !important;
    box-shadow: none !important;
}

html[data-theme="light"] .stat-card-content,
html[data-theme="light"] .dash-stat-content,
html[data-theme="light"] .stat-mini-content,
html[data-theme="light"] .dashboard-stat-content,
html[data-theme="light"] .metric-content,
html[data-theme="light"] .quick-action-content,
html[data-theme="light"] .stat-card-value,
html[data-theme="light"] .stat-card-label,
html[data-theme="light"] .stat-card-sub,
html[data-theme="light"] .dash-stat-value,
html[data-theme="light"] .dash-stat-label,
html[data-theme="light"] .dash-stat-sub,
html[data-theme="light"] .stat-card-mini-value,
html[data-theme="light"] .stat-card-mini-label,
html[data-theme="light"] .stat-mini-value,
html[data-theme="light"] .stat-mini-label,
html[data-theme="light"] .dashboard-stat-value,
html[data-theme="light"] .dashboard-stat-label,
html[data-theme="light"] .metric-value,
html[data-theme="light"] .metric-label,
html[data-theme="light"] .quick-action-label,
html[data-theme="light"] .card-title,
html[data-theme="light"] .card-title *,
html[data-theme="light"] .card-body > h1,
html[data-theme="light"] .card-body > h2,
html[data-theme="light"] .card-body > h3,
html[data-theme="light"] .card-body > h4,
html[data-theme="light"] .card-body > h5,
html[data-theme="light"] .card-body > h6 {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    outline: 0 !important;
}

html[data-theme="light"] .stat-card-content,
html[data-theme="light"] .dash-stat-content,
html[data-theme="light"] .stat-mini-content,
html[data-theme="light"] .dashboard-stat-content,
html[data-theme="light"] .metric-content,
html[data-theme="light"] .quick-action-content {
    border-radius: 0 !important;
    padding: 0 !important;
}

html[data-theme="light"] .stat-card-content::before,
html[data-theme="light"] .stat-card-content::after,
html[data-theme="light"] .dash-stat-content::before,
html[data-theme="light"] .dash-stat-content::after,
html[data-theme="light"] .stat-card-value::before,
html[data-theme="light"] .stat-card-value::after,
html[data-theme="light"] .stat-card-label::before,
html[data-theme="light"] .stat-card-label::after,
html[data-theme="light"] .dash-stat-value::before,
html[data-theme="light"] .dash-stat-value::after,
html[data-theme="light"] .dash-stat-label::before,
html[data-theme="light"] .dash-stat-label::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

html[data-theme="light"] .stat-card-value,
html[data-theme="light"] .dash-stat-value,
html[data-theme="light"] .stat-card-mini-value,
html[data-theme="light"] .stat-mini-value,
html[data-theme="light"] .dashboard-stat-value,
html[data-theme="light"] .metric-value {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .stat-card-label,
html[data-theme="light"] .stat-card-sub,
html[data-theme="light"] .dash-stat-label,
html[data-theme="light"] .dash-stat-sub,
html[data-theme="light"] .stat-card-mini-label,
html[data-theme="light"] .stat-mini-label,
html[data-theme="light"] .dashboard-stat-label,
html[data-theme="light"] .metric-label {
    color: var(--text-secondary) !important;
}
