/* ============================================
   ABSENSI MAN 3 KOTA PEKANBARU
   Color Theme: Green & Blue Elegant
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0d6e3e;
    --primary-dark: #094d2b;
    --primary-light: #16a361;
    --secondary: #1565c0;
    --secondary-dark: #0d47a1;
    --secondary-light: #42a5f5;
    --accent: #00897b;
    --gradient-1: linear-gradient(135deg, #0d6e3e 0%, #1565c0 100%);
    --gradient-2: linear-gradient(135deg, #16a361 0%, #42a5f5 100%);
    --gradient-3: linear-gradient(160deg, #094d2b 0%, #0d47a1 50%, #00897b 100%);
    --bg-primary: #f0f5f1;
    --bg-card: #ffffff;
    --bg-sidebar: #0a1628;
    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --text-light: #8e9aaf;
    --text-white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --gold: #f59e0b;
    --silver: #94a3b8;
    --bronze: #d97706;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    --info: #2563eb;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-3);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.02);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: var(--gradient-1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 20px rgba(13,110,62,0.3);
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13,110,62,0.1);
    background: white;
}

.form-control::placeholder {
    color: var(--text-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(13,110,62,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13,110,62,0.4);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #c2410c; transform: translateY(-1px); }
.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============ LAYOUT ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 270px;
    background: var(--bg-sidebar);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text h2 {
    font-size: 15px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.sidebar-brand .brand-text span {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.nav-item.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 12px rgba(13,110,62,0.3);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user .user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.sidebar-user .user-info span {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 0;
    min-height: 100vh;
}

.top-bar {
    background: white;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.top-bar .breadcrumb {
    font-size: 12px;
    color: var(--text-light);
}

.content-area {
    padding: 28px 32px;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

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

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

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* ============ STAT CARDS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30px, -30px);
}

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

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card .stat-icon.green { background: rgba(13,110,62,0.1); color: var(--primary); }
.stat-card .stat-icon.blue { background: rgba(21,101,192,0.1); color: var(--secondary); }
.stat-card .stat-icon.orange { background: rgba(234,88,12,0.1); color: var(--warning); }
.stat-card .stat-icon.red { background: rgba(220,38,38,0.1); color: var(--danger); }
.stat-card .stat-icon.teal { background: rgba(0,137,123,0.1); color: var(--accent); }

.stat-card .stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-info p {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* ============ TABLE ============ */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    background: var(--bg-primary);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
}

table tbody td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

table tbody tr:hover {
    background: rgba(13,110,62,0.02);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: rgba(22,163,74,0.1); color: var(--success); }
.badge-warning { background: rgba(234,88,12,0.1); color: var(--warning); }
.badge-danger { background: rgba(220,38,38,0.1); color: var(--danger); }
.badge-info { background: rgba(37,99,235,0.1); color: var(--info); }
.badge-secondary { background: rgba(100,116,139,0.1); color: var(--text-secondary); }

/* ============ ALERT ============ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(22,163,74,0.08); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.alert-danger { background: rgba(220,38,38,0.08); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }
.alert-warning { background: rgba(234,88,12,0.08); color: var(--warning); border: 1px solid rgba(234,88,12,0.2); }
.alert-info { background: rgba(37,99,235,0.08); color: var(--info); border: 1px solid rgba(37,99,235,0.2); }

/* ============ ATTENDANCE BOX ============ */
.attendance-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

.attendance-box .camera-container {
    width: 320px;
    height: 240px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 0 auto 24px;
    background: #1a2332;
    position: relative;
    border: 3px solid var(--primary);
}

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

.attendance-box .camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.attendance-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.btn-checkin {
    background: var(--gradient-1);
    color: white;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(13,110,62,0.35);
    transition: var(--transition);
}

.btn-checkin:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(13,110,62,0.45);
}

.btn-checkin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--secondary) 0%, #7c3aed 100%);
    color: white;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(21,101,192,0.35);
    transition: var(--transition);
}

.btn-checkout:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(21,101,192,0.45);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============ CALENDAR ============ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-header-cell {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.calendar-cell {
    padding: 8px;
    min-height: 70px;
    border-radius: 8px;
    border: 1px solid transparent;
    position: relative;
    font-size: 13px;
    transition: var(--transition);
}

.calendar-cell:hover {
    border-color: var(--border);
    background: rgba(13,110,62,0.02);
}

.calendar-cell .day-number {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.calendar-cell.today {
    background: rgba(13,110,62,0.05);
    border-color: var(--primary);
}

.calendar-cell.tepat-waktu .day-number { color: var(--success); }
.calendar-cell.terlambat .day-number { color: var(--warning); }
.calendar-cell.tidak-masuk .day-number { color: var(--danger); }
.calendar-cell.holiday { background: rgba(220,38,38,0.06); }
.calendar-cell.holiday .day-number { color: var(--danger); }
.calendar-cell.cuti { background: rgba(37,99,235,0.06); }
.calendar-cell.cuti .day-number { color: var(--info); }
.calendar-cell.libur { background: rgba(148,163,184,0.08); }
.calendar-cell.libur .day-number { color: var(--text-light); }
.calendar-cell.empty { background: transparent; }

.calendar-label {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
}

.calendar-label.tepat-waktu { background: rgba(22,163,74,0.15); color: var(--success); }
.calendar-label.terlambat { background: rgba(234,88,12,0.15); color: var(--warning); }
.calendar-label.tidak-masuk { background: rgba(220,38,38,0.15); color: var(--danger); }
.calendar-label.holiday { background: rgba(220,38,38,0.15); color: var(--danger); }
.calendar-label.cuti { background: rgba(37,99,235,0.15); color: var(--info); }
.calendar-label.libur { background: rgba(148,163,184,0.15); color: var(--text-light); }

/* ============ LEADERBOARD ============ */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: white;
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.02));
    border-color: rgba(245,158,11,0.3);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, rgba(148,163,184,0.08), rgba(148,163,184,0.02));
    border-color: rgba(148,163,184,0.3);
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, rgba(217,119,6,0.08), rgba(217,119,6,0.02));
    border-color: rgba(217,119,6,0.3);
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.rank-badge.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: white; box-shadow: 0 4px 12px rgba(245,158,11,0.4); }
.rank-badge.silver { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: white; box-shadow: 0 4px 12px rgba(148,163,184,0.4); }
.rank-badge.bronze { background: linear-gradient(135deg, #d97706, #f59e0b); color: white; box-shadow: 0 4px 12px rgba(217,119,6,0.4); }
.rank-badge.default { background: var(--bg-primary); color: var(--text-secondary); }

.leaderboard-info {
    flex: 1;
}

.leaderboard-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.leaderboard-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.leaderboard-stats {
    text-align: right;
}

.leaderboard-stats .count {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.leaderboard-stats .label {
    font-size: 11px;
    color: var(--text-light);
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
    box-shadow: var(--shadow-xl);
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(220,38,38,0.1);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

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

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.pagination a {
    color: var(--text-secondary);
    background: white;
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .active span {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.pagination .disabled span {
    color: var(--text-light);
    background: var(--bg-primary);
}

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-bar select,
.filter-bar input[type="date"],
.filter-bar input[type="text"],
.filter-bar input[type="month"] {
    padding: 9px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: var(--text-primary);
    transition: var(--transition);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13,110,62,0.1);
}

/* ============ PHOTO VIEW ============ */
.photo-trigger {
    color: var(--secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
    transition: var(--transition);
}

.photo-trigger:hover {
    color: var(--primary);
}

.photo-modal img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

/* ============ FAKE GPS INDICATOR ============ */
.fake-gps-alert {
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.browser-anomaly-alert {
    background: rgba(234,88,12,0.08);
    border: 1px solid rgba(234,88,12,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--warning);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ FORM ============ */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6a7e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ============ MOBILE TOGGLE ============ */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 150;
    width: 44px;
    height: 44px;
    background: var(--gradient-1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-area { padding: 16px; }
    .top-bar { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .calendar-grid { gap: 2px; }
    .calendar-cell { min-height: 50px; padding: 4px; font-size: 11px; }
    .login-card { margin: 16px; padding: 32px 24px; }
    .attendance-box { padding: 24px; }
    .attendance-box .camera-container { width: 100%; height: 200px; }
    .filter-bar { flex-direction: column; }
    .filter-bar select,
    .filter-bar input { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ============ FILTER PANEL ============ */
.filter-panel {
    background: linear-gradient(135deg, rgba(13,110,62,0.03) 0%, rgba(21,101,192,0.03) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group label i {
    margin-right: 4px;
    color: var(--primary);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.btn-export {
    background: linear-gradient(135deg, #0d6e3e 0%, #16a361 100%);
    color: white;
    margin-left: auto;
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(13,110,62,0.25);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13,110,62,0.35);
}

/* ============ STATS SUMMARY ============ */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.summary-item.total {
    background: linear-gradient(135deg, rgba(21,101,192,0.06), rgba(21,101,192,0.02));
    border-color: rgba(21,101,192,0.15);
}

.summary-item.success {
    background: linear-gradient(135deg, rgba(22,163,74,0.06), rgba(22,163,74,0.02));
    border-color: rgba(22,163,74,0.15);
}

.summary-item.warning {
    background: linear-gradient(135deg, rgba(234,88,12,0.06), rgba(234,88,12,0.02));
    border-color: rgba(234,88,12,0.15);
}

.summary-item.danger {
    background: linear-gradient(135deg, rgba(220,38,38,0.06), rgba(220,38,38,0.02));
    border-color: rgba(220,38,38,0.15);
}

.summary-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.summary-item.total .summary-icon {
    background: rgba(21,101,192,0.12);
    color: var(--secondary);
}

.summary-item.success .summary-icon {
    background: rgba(22,163,74,0.12);
    color: var(--success);
}

.summary-item.warning .summary-icon {
    background: rgba(234,88,12,0.12);
    color: var(--warning);
}

.summary-item.danger .summary-icon {
    background: rgba(220,38,38,0.12);
    color: var(--danger);
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

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

/* ============ PHOTO TRIGGER ============ */
.photo-trigger {
    color: var(--info);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
}

.photo-trigger:hover {
    color: var(--secondary-dark);
}

@media (max-width: 768px) {
    .filter-row { grid-template-columns: 1fr 1fr; }
    .filter-actions { flex-direction: column; align-items: stretch; }
    .btn-export { margin-left: 0; }
    .stats-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .filter-row { grid-template-columns: 1fr; }
    .stats-summary { grid-template-columns: 1fr; }
}

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-light); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.d-flex { display: flex; }
.gap-2 { gap: 16px; }
.gap-1 { gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.w-100 { width: 100%; }
