/* =============================================================
   PRESENSI APP - OCEAN & ATMOSPHERE THEME
   ============================================================= */

/* --- CSS Variables / Theme --- */
:root {
    --deep-ocean: #0a1628;
    --dark-blue: #0f1f3d;
    --navy: #1a2a4a;
    --azure: #0077b6;
    --cyan: #00b4d8;
    --light-cyan: #90e0ef;
    --aqua: #caf0f8;
    --glass-bg: rgba(15, 31, 61, 0.6);
    --glass-border: rgba(0, 180, 216, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-primary: #e8f4f8;
    --text-secondary: #8ba4b8;
    --text-muted: #5a7a8f;
    --success: #00c896;
    --warning: #ffb703;
    --danger: #e63946;
    --info: #00b4d8;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

[data-theme="light"] {
    --deep-ocean: #eef6fc;
    --dark-blue: #d6e8f5;
    --navy: #b8d4e8;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 119, 182, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --text-primary: #0a1628;
    --text-secondary: #2a4a6a;
    --text-muted: #6a8aaa;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--deep-ocean);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--light-cyan); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--azure); }

/* --- App Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--deep-ocean) 0%, var(--dark-blue) 100%);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    backdrop-filter: blur(20px);
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--azure), var(--cyan));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
}

.logo-text { display: flex; flex-direction: column; }
.logo-title { font-weight: 700; font-size: 18px; color: var(--text-primary); }
.logo-subtitle { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.5px; }

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}
.sidebar-toggle:hover {
    background: var(--glass-bg);
    color: var(--cyan);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

.nav-item:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, var(--azure), var(--cyan));
    box-shadow: 0 4px 15px rgba(0, 119, 182, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--cyan);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--glass-border);
}

.sidebar.collapsed {
    width: 70px;
}
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-item i { width: auto; font-size: 18px; }

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

/* --- Topbar --- */
.topbar {
    height: var(--topbar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.breadcrumb-item { color: var(--text-secondary); }
.breadcrumb-item.active { color: var(--cyan); font-weight: 600; }
.breadcrumb-sep { color: var(--text-muted); font-size: 10px; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

.theme-toggle,
.notif-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.theme-toggle:hover, .notif-btn:hover {
    background: var(--navy);
    color: var(--cyan);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: var(--transition);
}
.user-profile:hover { background: var(--glass-bg); }

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--azure), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.user-info { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-secondary); }

/* --- Content --- */
.content-wrapper {
    padding: 24px 30px;
    min-height: calc(100vh - var(--topbar-height));
}

/* --- Cards --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}
.card:hover { border-color: rgba(0, 180, 216, 0.25); }

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h3 i { color: var(--cyan); }

.card-body { padding: 20px 24px; }

/* --- Alerts --- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}
.alert-success { background: rgba(0, 200, 150, 0.15); color: var(--success); border: 1px solid rgba(0, 200, 150, 0.2); }
.alert-danger { background: rgba(230, 57, 70, 0.15); color: var(--danger); border: 1px solid rgba(230, 57, 70, 0.2); }

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--azure), var(--cyan)); color: white; box-shadow: 0 4px 15px rgba(0, 119, 182, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 119, 182, 0.4); }
.btn-success { background: linear-gradient(135deg, #00a87a, var(--success)); color: white; }
.btn-success:hover { transform: translateY(-2px); }
.btn-danger { background: linear-gradient(135deg, #c1121f, var(--danger)); color: white; }
.btn-warning { background: linear-gradient(135deg, #e85d04, var(--warning)); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 180, 216, 0.1); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover { opacity: 0.9; }

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
    position: relative;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group label i { margin-right: 6px; color: var(--cyan); }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15); }
.form-control::placeholder { color: var(--text-muted); }
[data-theme="light"] .form-control { background: white; border-color: #ccc; }
.form-select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--dark-blue);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}
.form-select:focus { outline: none; border-color: var(--cyan); }
.form-select-sm { padding: 6px 10px; font-size: 12px; }
textarea.form-control { resize: vertical; min-height: 60px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
}
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}
.checkbox-container input { width: 18px; height: 18px; accent-color: var(--cyan); }

.toggle-password {
    position: absolute;
    right: 12px;
    bottom: 11px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* --- Table --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 180, 216, 0.05);
}
.table tbody tr:hover { background: rgba(0, 180, 216, 0.03); }
.table tbody tr:last-child td { border-bottom: none; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.bg-success { background: rgba(0, 200, 150, 0.15); color: var(--success); border: 1px solid rgba(0, 200, 150, 0.2); }
.bg-warning { background: rgba(255, 183, 3, 0.15); color: var(--warning); border: 1px solid rgba(255, 183, 3, 0.2); }
.bg-danger { background: rgba(230, 57, 70, 0.15); color: var(--danger); border: 1px solid rgba(230, 57, 70, 0.2); }
.bg-info { background: rgba(0, 180, 216, 0.15); color: var(--cyan); border: 1px solid rgba(0, 180, 216, 0.2); }
.bg-secondary { background: rgba(138, 164, 184, 0.15); color: var(--text-secondary); border: 1px solid rgba(138, 164, 184, 0.2); }
.bg-primary { background: rgba(0, 119, 182, 0.15); color: var(--azure); border: 1px solid rgba(0, 119, 182, 0.2); }
.bg-light { background: rgba(202, 240, 248, 0.15); color: var(--aqua); }
.bg-purple { background: rgba(130, 71, 229, 0.15); color: #8247e5; border: 1px solid rgba(130, 71, 229, 0.2); }
.bg-blue { background: rgba(0, 119, 182, 0.15); color: var(--azure); border: 1px solid rgba(0, 119, 182, 0.2); }
.bg-green { background: rgba(0, 200, 150, 0.15); color: var(--success); border: 1px solid rgba(0, 200, 150, 0.2); }
.bg-yellow { background: rgba(255, 183, 3, 0.15); color: var(--warning); border: 1px solid rgba(255, 183, 3, 0.2); }
.bg-red { background: rgba(230, 57, 70, 0.15); color: var(--danger); border: 1px solid rgba(230, 57, 70, 0.2); }

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--cyan); }
.stat-card.mini { flex-direction: column; text-align: center; padding: 16px; gap: 4px; }

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

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* --- Welcome Card --- */
.welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--dark-blue), var(--navy));
    position: relative;
    overflow: hidden;
}
.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.welcome-text h1 { font-size: 24px; font-weight: 700; }
.welcome-text p { color: var(--text-secondary); margin-top: 4px; }
.welcome-weather { display: flex; align-items: center; gap: 12px; }
.weather-icon { font-size: 32px; color: var(--cyan); }
.clock-display { font-size: 24px; font-weight: 700; letter-spacing: 2px; color: var(--cyan); }

/* --- Row 2 Col --- */
.row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* --- Mini Stats --- */
.mini-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}
.mini-stat {
    text-align: center;
}
.mini-value { font-size: 24px; font-weight: 700; display: block; }
.mini-label { font-size: 12px; color: var(--text-secondary); }

/* --- Chart --- */
.chart-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.donut-chart { width: 160px; height: 160px; }
.donut-segment { transition: stroke-dasharray 0.5s ease; }
.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
}
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot-blue { background: var(--cyan); }
.dot-yellow { background: var(--warning); }
.dot-red { background: var(--danger); }

/* --- Attendance Status --- */
.attendance-status {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    border-radius: 12px;
}
.attendance-status.on-time { background: rgba(0, 200, 150, 0.05); padding: 12px; }
.attendance-status.late { background: rgba(255, 183, 3, 0.05); }
.status-icon { font-size: 36px; }
.on-time .status-icon { color: var(--success); }
.late .status-icon { color: var(--warning); }
.status-detail { display: flex; flex-direction: column; gap: 8px; }
.status-badge-large {
    font-size: 14px; font-weight: 700; padding: 4px 16px; border-radius: 20px; display: inline-block;
}
.status-badge-large.hadir { background: rgba(0, 200, 150, 0.15); color: var(--success); border: 1px solid rgba(0, 200, 150, 0.2); }
.status-badge-large.terlambat { background: rgba(255, 183, 3, 0.15); color: var(--warning); border: 1px solid rgba(255, 183, 3, 0.2); }
.time-detail { display: flex; gap: 20px; font-size: 13px; color: var(--text-secondary); }

.no-attendance {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}
.no-attendance i { font-size: 40px; margin-bottom: 12px; color: var(--navy); }

/* --- Notifications Panel --- */
.notif-panel {
    position: fixed;
    right: -380px;
    top: 0;
    width: 360px;
    height: 100vh;
    background: var(--dark-blue);
    border-left: 1px solid var(--glass-border);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.notif-panel.open { right: 0; }
.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}
.notif-panel-header h3 { font-size: 16px; }
.notif-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.notif-loading { text-align: center; padding: 40px; color: var(--text-muted); }
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    display: none;
}
.notif-overlay.show { display: block; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: var(--transition);
    cursor: pointer;
}
.notif-item:hover { background: var(--glass-bg); }
.notif-item.unread { background: rgba(0, 180, 216, 0.05); border-left: 3px solid var(--cyan); }
.notif-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-icon.success { background: rgba(0, 200, 150, 0.15); color: var(--success); }
.notif-icon.warning { background: rgba(255, 183, 3, 0.15); color: var(--warning); }
.notif-icon.danger { background: rgba(230, 57, 70, 0.15); color: var(--danger); }
.notif-icon.info { background: rgba(0, 180, 216, 0.15); color: var(--cyan); }
.notif-content { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; display: block; }
.notif-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-muted); }

/* --- Clock Section --- */
.clock-section {
    text-align: center;
    padding: 40px;
    margin-bottom: 24px;
}
.clock-big {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--cyan);
    text-shadow: 0 0 30px rgba(0, 180, 216, 0.3);
    display: block;
}
.clock-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: block;
}
.clock-actions { margin-top: 24px; }
.pulse-btn {
    animation: pulseShadow 2s infinite;
}
@keyframes pulseShadow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(0, 180, 216, 0); }
}

.month-filter {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-cell { display: flex; gap: 6px; }

/* --- Filter Rows --- */
.filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* --- Settings --- */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--glass-border);
    gap: 16px;
}
.setting-item:last-child { border-bottom: none; }
.setting-label { display: flex; flex-direction: column; flex: 1; }
.setting-name { font-size: 14px; font-weight: 500; }
.setting-key { font-size: 11px; color: var(--text-muted); }
.setting-item .form-control,
.setting-item .form-select { max-width: 200px; }

/* --- Login Page --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--deep-ocean);
    position: relative;
    overflow: hidden;
}
.login-container {
    position: relative;
    z-index: 1;
}
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200'%3E%3Cpath fill='%230077b6' fill-opacity='0.1' d='M0,128L48,117.3C96,107,192,85,288,90.7C384,96,480,128,576,138.7C672,149,768,139,864,122.7C960,107,1056,85,1152,80C1248,75,1344,85,1392,90.7L1440,96L1440,200L1392,200C1344,200,1248,200,1152,200C1056,200,960,200,864,200C768,200,672,200,576,200C480,200,384,200,288,200C192,200,96,200,48,200L0,200Z'%3E%3C/path%3E%3C/svg%3E") repeat-x;
    background-size: 1440px 200px;
    animation: waveAnim 6s linear infinite;
}
.wave-1 { bottom: 0; opacity: 0.3; animation-duration: 6s; }
.wave-2 { bottom: -30px; opacity: 0.2; animation-duration: 8s; animation-delay: -2s; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200'%3E%3Cpath fill='%2300b4d8' fill-opacity='0.15' d='M0,160L30,144C60,128,120,96,180,96C240,96,300,128,360,138.7C420,149,480,139,540,128C600,117,660,107,720,106.7C780,107,840,117,900,138.7C960,160,1020,192,1080,197.3C1140,203,1200,181,1260,160C1320,139,1380,117,1410,106.7L1440,96L1440,200L1410,200C1380,200,1320,200,1260,200C1200,200,1140,200,1080,200C1020,200,960,200,900,200C840,200,780,200,720,200C660,200,600,200,540,200C480,200,420,200,360,200C300,200,240,200,180,200C120,200,60,200,30,200L0,200Z'%3E%3C/path%3E%3C/svg%3E"); }
.wave-3 { bottom: -60px; opacity: 0.1; animation-duration: 10s; animation-delay: -4s; }

@keyframes waveAnim {
    0% { background-position-x: 0; }
    100% { background-position-x: 1440px; }
}

.login-card {
    width: 420px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 180, 216, 0.1);
    position: relative;
    z-index: 2;
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--azure), var(--cyan));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0, 119, 182, 0.3);
}
.login-header h1 { font-size: 24px; font-weight: 700; }
.login-header p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.login-footer { text-align: center; margin-top: 20px; }

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.modal-content {
    width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    z-index: 1;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }
.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-close:hover { color: var(--text-primary); }

/* --- Profile --- */
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--azure), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--cyan);
    box-shadow: 0 0 30px rgba(0, 180, 216, 0.2);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-big { font-size: 36px; color: white; font-weight: 700; }
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--azure);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-photo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

/* --- Error Page --- */
.error-page {
    text-align: center;
    padding: 80px 30px;
}
.error-page h1 { font-size: 72px; font-weight: 800; color: var(--cyan); text-shadow: 0 0 40px rgba(0, 180, 216, 0.3); }
.error-page p { font-size: 18px; color: var(--text-secondary); margin: 12px 0 24px; }

/* --- Utilities --- */
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.text-center { text-align: center; }

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .content-wrapper { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .login-card { width: 92%; margin: 0 auto; padding: 24px; }
    .clock-big { font-size: 42px; }
    .welcome-card { flex-direction: column; text-align: center; gap: 16px; }
    .modal-content { width: 92%; padding: 20px; }
    .notif-panel { width: 100%; right: -100%; }
    .user-info { display: none; }
    .search-bar { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 22px; }
    .clock-big { font-size: 36px; }
    .card-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .header-actions { width: 100%; }
    .btn-lg { width: 100%; }
}
