/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --c-primary: #6366f1;
    --c-primary-light: #818cf8;
    --c-primary-dark: #4f46e5;
    --c-primary-50: #eef2ff;
    --c-success: #10b981;
    --c-success-50: #ecfdf5;
    --c-success-100: #d1fae5;
    --c-danger: #ef4444;
    --c-danger-50: #fef2f2;
    --c-danger-100: #fee2e2;
    --c-warning: #f59e0b;
    --c-warning-50: #fffbeb;
    --c-warning-100: #fef3c7;
    --c-info: #06b6d4;
    --c-info-50: #ecfeff;

    --c-bg: #f1f5f9;
    --c-surface: #ffffff;
    --c-surface-alt: #f8fafc;
    --c-border: #e2e8f0;
    --c-border-light: #f1f5f9;
    --c-text: #0f172a;
    --c-text-secondary: #475569;
    --c-text-muted: #94a3b8;

    --c-sidebar: #0f172a;
    --c-sidebar-hover: rgba(255, 255, 255, 0.08);
    --c-sidebar-active: rgba(99, 102, 241, 0.25);
    --c-sidebar-text: #94a3b8;

    --radius-xs: 0.25rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.35);
    --shadow-success: 0 4px 14px rgba(16, 185, 129, 0.35);
    --shadow-danger: 0 4px 14px rgba(239, 68, 68, 0.35);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul { list-style: none; }

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: scaleIn 0.4s ease;
}

.login-card {
    background: var(--c-surface);
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2.5rem;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: var(--shadow-primary);
}

.login-logo svg {
    width: 28px;
    height: 28px;
    color: white;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--c-text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--c-text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: var(--c-text-muted);
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--c-text);
    background: var(--c-surface-alt);
    transition: var(--transition);
}

.form-group input::placeholder { color: var(--c-text-muted); }

.form-group input:focus {
    outline: none;
    border-color: var(--c-primary);
    background: var(--c-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.login-hint {
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: var(--c-primary-50);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--c-primary-dark);
    text-align: center;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover { background: var(--c-primary-dark); }

.btn-success {
    background: var(--c-success);
    color: #fff;
    box-shadow: var(--shadow-success);
}

.btn-success:hover { background: #059669; }

.btn-danger {
    background: var(--c-danger);
    color: #fff;
    box-shadow: var(--shadow-danger);
}

.btn-danger:hover { background: #dc2626; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--c-border);
    color: var(--c-text-secondary);
}

.btn-outline:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-50);
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-secondary);
}

.btn-ghost:hover { background: var(--c-surface-alt); color: var(--c-text); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

/* ===== Alerts ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.alert-error { background: var(--c-danger-50); color: #991b2b; border: 1px solid var(--c-danger-100); }
.alert-success { background: var(--c-success-50); color: #166534; border: 1px solid var(--c-success-100); }
.alert-info { background: var(--c-info-50); color: #083344; border: 1px solid #b6e0fe; }

#loginError:empty { display: none; }

.page-alerts {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

.page-alerts .alert {
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

/* ===== App Shell ===== */
#app {
    min-height: 100vh;
}

.app-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--c-text-secondary);
    font-size: 1.25rem;
    transition: var(--transition);
}

.menu-toggle:hover { background: var(--c-surface-alt); }

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.app-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.app-brand-icon svg { width: 20px; height: 20px; color: #fff; }

.app-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.user-chip:hover { background: var(--c-surface-alt); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary-light) 0%, var(--c-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-text);
}

.app-body {
    display: flex;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--c-sidebar);
    color: var(--c-sidebar-text);
    padding: 1.25rem 0.75rem;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-section-label {
    padding: 0.75rem 0.875rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(148, 163, 184, 0.5);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--c-sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 0.125rem;
}

.nav-link svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

.nav-link:hover {
    background: var(--c-sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background: var(--c-sidebar-active);
    color: #fff;
    font-weight: 600;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-width: 0;
}

.page-header {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--c-text-muted);
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

/* ===== Clock Hero ===== */
.clock-hero {
    background: linear-gradient(135deg, var(--c-sidebar) 0%, #1e293b 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.clock-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(99,102,241,0.2) 0%, transparent 60%);
    pointer-events: none;
}

.clock-hero .clock-date {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.clock-hero .clock-time {
    font-size: 3rem;
    font-weight: 200;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.clock-hero .clock-status-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

/* ===== Cards ===== */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-xs);
    animation: fadeIn 0.3s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.01em;
}

/* ===== Clock In/Out Buttons ===== */
.clock-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.clock-btn {
    min-width: 180px;
    height: 56px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ===== Time Info Row ===== */
.time-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
}

.time-info-item {
    text-align: center;
    padding: 1rem;
    background: var(--c-surface-alt);
    border-radius: var(--radius-md);
}

.time-info-label {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    margin-bottom: 0.25rem;
}

.time-info-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
}

/* ===== Stat Cards Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    animation: fadeIn 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.stat-icon svg { width: 24px; height: 24px; }

.stat-icon-blue { background: var(--c-primary-50); color: var(--c-primary); }
.stat-icon-green { background: var(--c-success-50); color: var(--c-success); }
.stat-icon-amber { background: var(--c-warning-50); color: var(--c-warning); }
.stat-icon-red { background: var(--c-danger-50); color: var(--c-danger); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--c-text-muted);
    margin-top: 0.125rem;
}

/* ===== Table Wrapper ===== */
.table-wrap {
    overflow-x: auto;
    margin: -0.5rem;
    padding: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--c-surface-alt);
    color: var(--c-text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.table thead th:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.table thead th:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--c-border-light);
    color: var(--c-text);
}

.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--c-surface-alt); }
.table tbody tr:last-child td { border-bottom: none; }

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--c-text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-present { background: var(--c-success-50); color: #047857; }
.badge-late { background: var(--c-warning-50); color: #92400e; }
.badge-absent { background: var(--c-danger-50); color: #991b2b; }
.badge-halfday { background: var(--c-info-50); color: #083344; }
.badge-success { background: var(--c-success-50); color: #047857; }
.badge-info { background: var(--c-info-50); color: #083344; }

/* ===== Loading ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--c-text-muted);
    gap: 0.75rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-text { font-size: 0.875rem; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--c-text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--c-text-muted);
    transition: var(--transition);
}

.modal-close:hover { background: var(--c-surface-alt); color: var(--c-text); }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-alt);
}

/* ===== Camera Modal ===== */
.camera-modal { max-width: 440px; }

.camera-container {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
}

.camera-placeholder p { font-size: 0.875rem; }

.camera-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--c-surface-alt);
    border-radius: var(--radius-md);
}

.camera-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--c-text-secondary);
}

.camera-info-item svg { color: var(--c-primary); flex-shrink: 0; }

/* ===== Attendance Photos ===== */
.attendance-photo {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    border: 2px solid var(--c-border);
    cursor: pointer;
    transition: var(--transition);
}

.attendance-photo:hover { border-color: var(--c-primary); transform: scale(1.02); }

.geo-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: var(--c-text-muted);
}

.row-photo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--c-border);
    cursor: pointer;
    transition: var(--transition);
}

.row-photo:hover { border-color: var(--c-primary); transform: scale(1.1); }

.row-photo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--c-surface-alt);
    border: 1px solid var(--c-border);
}

/* ===== Report Filters ===== */
.report-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.filter-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--c-surface-alt);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--c-border);
}

.filter-tab {
    padding: 0.4375rem 1rem;
    border: none;
    background: transparent;
    color: var(--c-text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--c-text);
    background: var(--c-surface);
}

.filter-tab.active {
    background: var(--c-primary);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-date-range .form-input {
    width: auto;
    min-width: 130px;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
}

.export-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.report-period-label {
    font-size: 0.8125rem;
    color: var(--c-text-muted);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--c-border-light);
}

/* ===== Leave UI ===== */
.leave-form {
    padding: 0.5rem 0;
}

.leave-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leave-card {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-border);
    background: var(--c-surface);
    transition: var(--transition);
}

.leave-card:hover { box-shadow: var(--shadow-xs); }

.leave-card.leave-pending { border-left-color: var(--c-warning); }
.leave-card.leave-approved { border-left-color: var(--c-success); }
.leave-card.leave-rejected { border-left-color: var(--c-danger); }

.leave-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.leave-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.leave-type-cuti { background: var(--c-primary-50); color: var(--c-primary-dark); }
.leave-type-sakit { background: var(--c-danger-50); color: var(--c-danger); }
.leave-type-izin { background: var(--c-warning-50); color: var(--c-warning); }

.leave-date-range {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 0.375rem;
}

.leave-reason {
    font-size: 0.8125rem;
    color: var(--c-text-secondary);
    line-height: 1.5;
    margin-bottom: 0.375rem;
}

.leave-admin-note {
    font-size: 0.75rem;
    color: var(--c-text-secondary);
    background: var(--c-surface-alt);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.leave-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.6875rem;
    color: var(--c-text-muted);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.leave-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.leave-cancel-btn {
    margin-top: 0.5rem;
}

.leave-filter {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.leave-review-info {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.leave-review-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.leave-review-row span {
    color: var(--c-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

/* ===== Table Actions ===== */
.table-actions {
    display: flex;
    gap: 0.375rem;
}

/* ===== Edit Modal Forms ===== */
.modal-edit-large {
    max-width: 560px;
    width: 90%;
}

.edit-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--c-surface-alt);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group:only-child {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-50);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--c-border-light);
}

.edit-photo-preview {
    width: 100%;
    max-width: 140px;
    height: auto;
    border-radius: var(--radius-md);
    border: 2px solid var(--c-border);
    margin-top: 0.25rem;
}

/* ===== Maps ===== */
.map-container {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    border: 2px solid var(--c-border);
    overflow: hidden;
    z-index: 0;
}

.map-container.map-lg { height: 280px; }
.map-container.map-sm { height: 150px; }

.map-container .leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.map-container .leaflet-popup-content {
    margin: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.map-marker-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--c-text);
    margin-bottom: 0.125rem;
}

.map-marker-coord {
    font-size: 0.6875rem;
    color: var(--c-text-muted);
}

.map-modal-container {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    border: 2px solid var(--c-border);
    overflow: hidden;
    z-index: 0;
}

.map-section-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-text-secondary);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    height: 150px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--c-border);
    background: var(--c-surface-alt);
    color: var(--c-text-muted);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    text-align: center;
    padding: 1rem;
}

.modal-map-large .map-modal-container { height: 240px; }

/* ===== Departments ===== */
.dept-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.dept-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--c-surface-alt);
    border-radius: var(--radius-md);
    gap: 0.625rem;
}

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

.dept-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--c-text);
}

.dept-desc {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    margin-top: 0.125rem;
}

.dept-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.dept-filter-wrap {
    display: flex;
    align-items: center;
}

.dept-banner-select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.dept-banner-select option {
    background: var(--c-surface);
    color: var(--c-text);
}

.badge-sm {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
}

/* ===== Admin Dashboard ===== */
.dashboard-rate-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    border-radius: var(--radius-xl);
    color: #fff;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.rate-banner-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.rate-banner-label {
    font-size: 0.8125rem;
    opacity: 0.85;
}

.rate-banner-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rate-banner-right .badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.dashboard-stats-grid .stat-card {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

.dashboard-stats-grid .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

.dashboard-stats-grid .stat-icon svg {
    width: 20px;
    height: 20px;
}

.dashboard-stats-grid .stat-value {
    font-size: 1.5rem;
}

.dashboard-stats-grid .stat-label {
    font-size: 0.6875rem;
}

.stat-clickable {
    cursor: pointer;
    transition: var(--transition);
}

.stat-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.dashboard-chart-card .chart-container-wrapper {
    height: 280px;
    padding: 0.5rem;
}

.chart-period-tabs {
    display: flex;
    gap: 0.25rem;
}

.chart-tab {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.chart-tab.active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

.activity-timeline {
    max-height: 350px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--c-border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-photo, .activity-photo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.activity-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-primary-50);
    color: var(--c-primary);
    font-size: 0.6875rem;
    font-weight: 700;
}

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

.activity-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.activity-detail {
    display: flex;
    gap: 0.75rem;
    font-size: 0.6875rem;
    color: var(--c-text-muted);
    margin-top: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.activity-loc {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.attention-list {
    max-height: 350px;
    overflow-y: auto;
}

.attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
    border-left: 3px solid var(--c-border);
}

.attention-warning { border-left-color: var(--c-warning); background: var(--c-warning-50); }
.attention-info { border-left-color: var(--c-info); background: var(--c-info-50); }

.attention-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.attention-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--c-primary-50);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    flex-shrink: 0;
}

.attention-name {
    font-size: 0.8125rem;
    font-weight: 600;
}

.attention-msg {
    font-size: 0.6875rem;
    color: var(--c-text-secondary);
}

.work-hours-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.wh-stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--c-surface-alt);
    border-radius: var(--radius-md);
}

.wh-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-primary);
}

.wh-label {
    font-size: 0.625rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.125rem;
}

.wh-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-text-secondary);
    margin-top: 0.75rem;
    margin-bottom: 0.375rem;
}

.wh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.wh-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.6875rem;
    font-weight: 600;
}

.wh-chip-green { background: var(--c-success-50); color: var(--c-success); }
.wh-chip-amber { background: var(--c-warning-50); color: var(--c-warning); }
.wh-chip-red { background: var(--c-danger-50); color: var(--c-danger); }

.pending-list {
    max-height: 350px;
    overflow-y: auto;
}

.pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--c-border-light);
}

.pending-item:last-child { border-bottom: none; }

.pending-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.pending-name {
    font-size: 0.8125rem;
    font-weight: 600;
}

.pending-date {
    font-size: 0.6875rem;
    color: var(--c-text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .report-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filter-tabs {
        justify-content: center;
    }

    .filter-tab {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    .custom-date-range {
        flex-wrap: wrap;
        justify-content: center;
    }

    .custom-date-range .form-input {
        flex: 1;
        min-width: 100px;
    }

    .export-actions {
        margin-left: 0;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 64px;
        left: -280px;
        width: 260px;
        height: calc(100vh - 64px);
        z-index: 15;
        transition: left 0.3s ease;
    }

    .sidebar.open { left: 0; box-shadow: var(--shadow-xl); }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 14;
    }

    .sidebar-overlay.active { display: block; }

    .main-content { padding: 1rem; }

    .clock-hero .clock-time { font-size: 2.25rem; }

    .time-info { grid-template-columns: 1fr; }

    .clock-actions { flex-direction: column; }
    .clock-btn { width: 100%; }

    .page-alerts {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .user-name { display: none; }

    .dashboard-row { grid-template-columns: 1fr; }
    .dashboard-stats-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .rate-banner-value { font-size: 1.5rem; }
    .work-hours-summary { grid-template-columns: repeat(3, 1fr); }
    .rate-banner-right { width: 100%; }
    .rate-banner-right .badge { font-size: 0.625rem; }
    .dept-banner-select { width: 100%; margin-top: 0.5rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 1.75rem; }
    .clock-hero { padding: 1.5rem; }
    .clock-hero .clock-time { font-size: 1.75rem; }
    .form-row { grid-template-columns: 1fr; }
    .modal-edit-large { width: 95%; max-height: 90vh; overflow-y: auto; }
    .table-actions { flex-direction: column; }
}
