@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
--bg: #0c0e13;
--bg2: #13161e;
--bg3: #1a1e28;
--card: #1e2330;
--card2: #242938;
--border: #2e3447;
--accent: #4f8ef7;
--accent2: #7c5cfc;
--green: #22c55e;
--red: #ef4444;
--orange: #f97316;
--yellow: #eab308;
--text: #e8ecf4;
--text2: #8892aa;
--text3: #5a6480;
--shadow: 0 8px 32px rgba(0,0,0,0.4);
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'DM Sans',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; overflow-x:hidden; }

.slip-row { position: relative; }
.tooltip-card {
    visibility: hidden;
    opacity: 0;
    background: var(--bg1);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    max-width: 400px;
    position: absolute;
    bottom: 100%;
    left: 70%;
    transform: translateX(-70%);
    white-space: normal;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 999;
}
.slip-row:hover .tooltip-card {
    visibility: visible; opacity: 1;
}
/* ───── LOGIN ───── */
#loginPage {
display:flex; align-items:center; justify-content:center; min-height:100vh;
background: radial-gradient(ellipse at 20% 50%, #1a1e3a 0%, var(--bg) 60%),
            radial-gradient(ellipse at 80% 20%, #1a2840 0%, transparent 50%);
}
.login-box {
background:var(--card); border:1px solid var(--border); border-radius:20px;
padding:48px 44px; width:420px; box-shadow:var(--shadow);
}
.login-logo { display:flex; align-items:center; gap:12px; margin-bottom:32px; }
.login-logo-icon {
width:42px; height:42px; border-radius:12px;
background:linear-gradient(135deg, var(--accent), var(--accent2));
display:flex; align-items:center; justify-content:center; font-size:20px;
}
.login-logo h1 { font-size:22px; font-weight:700; letter-spacing:-0.5px; }
.login-logo span { color:var(--accent); }
.login-subtitle { color:var(--text2); font-size:13px; margin-bottom:28px; }
.wifi-badge {
display:flex; align-items:center; gap:8px; padding:10px 14px;
border-radius:10px; font-size:12px; font-weight:500; margin-bottom:20px;
border:1px solid;
}
.wifi-badge.connected { background:#0d2818; border-color:#166534; color:var(--green); }
.wifi-badge.disconnected { background:#2d1010; border-color:#7f1d1d; color:var(--red); }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:12px; font-weight:600; color:var(--text2); margin-bottom:6px; text-transform:uppercase; letter-spacing:0.5px; }
.form-group input, .form-group select, .form-group textarea {
width:100%; padding:12px 14px; background:var(--bg3); border:1px solid var(--border);
border-radius:10px; color:var(--text); font-family:inherit; font-size:14px;
transition:border-color 0.2s, box-shadow 0.2s; outline:none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
border-color:var(--accent); box-shadow:0 0 0 3px rgba(79,142,247,0.15);
}
.form-group select option { background:var(--bg3); }
.btn {
padding:12px 20px; border-radius:10px; font-family:inherit; font-size:14px;
font-weight:600; cursor:pointer; border:none; transition:all 0.2s; display:inline-flex;
align-items:center; gap:8px;
}
.btn-primary { background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; width:100%; justify-content:center; }
.btn-primary:hover { opacity:0.9; transform:translateY(-1px); box-shadow:0 8px 24px rgba(79,142,247,0.3); }
.btn-secondary { background:var(--card2); color:var(--text); border:1px solid var(--border); }
.btn-secondary:hover { background:var(--border); }
.btn-danger { background:#7f1d1d; color:var(--red); border:1px solid #ef444433; }
.btn-danger:hover { background:#991b1b; }
.btn-success { background:#14532d; color:var(--green); border:1px solid #22c55e33; }
.btn-success:hover { background:#166534; }
.btn-warn { background:#431407; color:var(--orange); border:1px solid #f9731633; }
.btn-warn:hover { background:#7c2d12; }
.btn-sm { padding:7px 14px; font-size:12px; border-radius:8px; }
.biometric-row { display:flex; gap:10px; margin-top:12px; }
.bio-btn {
flex:1; padding:12px; background:var(--bg3); border:1px solid var(--border);
border-radius:10px; color:var(--text2); cursor:pointer; font-size:13px;
display:flex; align-items:center; justify-content:center; gap:8px;
transition:all 0.2s; font-family:inherit;
}
.bio-btn:hover { border-color:var(--accent); color:var(--accent); background:rgba(79,142,247,0.08); }
.login-error { color:var(--red); font-size:13px; margin-top:12px; display:none; }
.divider { display:flex; align-items:center; gap:12px; margin:20px 0; color:var(--text3); font-size:12px; }
.divider::before,.divider::after { content:''; flex:1; height:1px; background:var(--border); }

/* ───── MAIN APP ───── */
#app { display:none; min-height:100vh; }
.app-layout { display:flex; min-height:100vh; }

/* SIDEBAR */
.sidebar {
width:240px; background:var(--bg2); border-right:1px solid var(--border);
display:flex; flex-direction:column; position:fixed; height:100vh; z-index:100;
overflow-y:auto;
}
.sidebar-logo {
padding:20px 20px 16px; display:flex; align-items:center; gap:10px;
border-bottom:1px solid var(--border);
}
.sidebar-logo-icon {
width:34px; height:34px; border-radius:9px;
background:linear-gradient(135deg,var(--accent),var(--accent2));
display:flex; align-items:center; justify-content:center; font-size:16px;
}
.sidebar-logo span { font-size:17px; font-weight:700; letter-spacing:-0.3px; }
.sidebar-logo span em { color:var(--accent); font-style:normal; }
.sidebar-user {
padding:16px 20px; border-bottom:1px solid var(--border);
display:flex; align-items:center; gap:12px;
}
.avatar {
width:38px; height:38px; border-radius:10px; display:flex; align-items:center;
justify-content:center; font-weight:700; font-size:14px; flex-shrink:0;
}
.sidebar-user-info { flex:1; min-width:0; }
.sidebar-user-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-role { font-size:11px; color:var(--text3); }
.online-dot { width:8px; height:8px; border-radius:50%; background:var(--green); flex-shrink:0; }
.nav-section { padding:12px 12px 4px; font-size:10px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:1px; }
.nav-item {
display:flex; align-items:center; gap:10px; padding:9px 12px; margin:2px 8px;
border-radius:8px; cursor:pointer; font-size:13px; color:var(--text2);
transition:all 0.15s; user-select:none;
}
.nav-item:hover { background:var(--card); color:var(--text); }
.nav-item.active { background:rgba(79,142,247,0.12); color:var(--accent); font-weight:600; }
.nav-item .nav-icon { width:18px; text-align:center; font-size:15px; }
.nav-badge {
margin-left:auto; padding:2px 7px; border-radius:20px; font-size:10px;
font-weight:700; background:var(--accent); color:#fff;
}
.nav-badge.red { background:var(--red); }
.sidebar-bottom { margin-top:auto; padding:16px; border-top:1px solid var(--border); }

/* MAIN CONTENT */
.main { margin-left:240px; flex:1; min-height:100vh; }
.topbar {
background:var(--bg2); border-bottom:1px solid var(--border);
padding:0 28px; height:60px; display:flex; align-items:center; justify-content:space-between;
position:sticky; top:0; z-index:50;
}
.topbar-left { display:flex; align-items:center; gap:16px; }
.topbar-title { font-size:16px; font-weight:700; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.topbar-clock { font-family:'DM Mono',monospace; font-size:13px; color:var(--text2); }
.notif-btn {
width:36px; height:36px; border-radius:9px; background:var(--card); border:1px solid var(--border);
display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative; font-size:16px;
}
.notif-dot { position:absolute; top:6px; right:6px; width:7px; height:7px; border-radius:50%; background:var(--red); }
.page-content { padding:24px 28px; }

/* CARDS */
.card {
background:var(--card); border:1px solid var(--border); border-radius:14px;
padding:20px; margin-bottom:16px;
}
.card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.card-title { font-size:14px; font-weight:700; }
.card-subtitle { font-size:12px; color:var(--text3); margin-top:2px; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.stat-card {
background:var(--card); border:1px solid var(--border); border-radius:14px; padding:18px;
}
.stat-label { font-size:11px; color:var(--text3); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.stat-value { font-size:26px; font-weight:700; margin:6px 0 4px; line-height:1; }
.stat-change { font-size:12px; color:var(--text3); }
.stat-change.up { color:var(--green); }
.stat-change.down { color:var(--red); }

/* ATTENDANCE TIMER */
.timer-card {
background:linear-gradient(135deg, #1a2240, #1e2a3a);
border:1px solid #2a3a5a; border-radius:18px; padding:28px; margin-bottom:20px;
text-align:center; position:relative; overflow:hidden;
}
.timer-card::before {
content:''; position:absolute; top:-60px; right:-60px;
width:180px; height:180px; border-radius:50%;
background:radial-gradient(circle, rgba(79,142,247,0.12) 0%, transparent 70%);
}
.timer-status { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1.5px; color:var(--text3); margin-bottom:10px; }
.timer-display { font-family:'DM Mono',monospace; font-size:52px; font-weight:500; letter-spacing:2px; line-height:1; margin-bottom:8px; }
.timer-display.working { color:var(--green); }
.timer-display.break { color:var(--orange); }
.timer-display.idle { color:var(--text3); }
.timer-date { font-size:13px; color:var(--text3); margin-bottom:20px; }
.timer-actions { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.timer-actions .btn { min-width:140px; justify-content:center; }
.break-btn-large {
padding:14px 28px; border-radius:12px; font-size:15px; font-weight:700;
background:linear-gradient(135deg, #431407, #7c2d12);
color:var(--orange); border:1px solid #f9731633; cursor:pointer;
font-family:inherit; display:flex; align-items:center; gap:10px;
transition:all 0.2s;
}
.break-btn-large:hover { opacity:0.9; transform:scale(1.02); }
.break-btn-large.active {
background:linear-gradient(135deg, #14532d, #166534);
color:var(--green); border-color:#22c55e33;
}
.checkin-btn {
padding:14px 28px; border-radius:12px; font-size:15px; font-weight:700;
background:linear-gradient(135deg,var(--accent),var(--accent2));
color:#fff; border:none; cursor:pointer; font-family:inherit;
display:flex; align-items:center; gap:10px; transition:all 0.2s;
}
.checkin-btn:hover { opacity:0.9; transform:scale(1.02); }
.checkin-btn.checkout {
background:linear-gradient(135deg,#7f1d1d,#991b1b);
color:var(--red); border:1px solid #ef444433;
}

/* TABLE */
table { width:100%; border-collapse:collapse; }
th { text-align:left; font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:0.5px; padding:10px 14px; border-bottom:1px solid var(--border); }
td { padding:12px 14px; font-size:13px; border-bottom:1px solid var(--border); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tr:hover td { background:rgba(255,255,255,0.02); }
.badge {
display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px;
font-size:11px; font-weight:600;
}
.badge-green { background:#0d2818; color:var(--green); border:1px solid #166534; }
.badge-red { background:#2d1010; color:var(--red); border:1px solid #7f1d1d; }
.badge-orange { background:#1c1008; color:var(--orange); border:1px solid #7c2d12; }
.badge-blue { background:#0d1e3a; color:var(--accent); border:1px solid #1e3a6a; }
.badge-purple { background:#1a1030; color:#a78bfa; border:1px solid #4c1d95; }
.badge-yellow { background:#1c1608; color:var(--yellow); border:1px solid #854d0e; }

/* TABS */
.tabs { display:flex; gap:4px; padding:4px; background:var(--bg3); border-radius:10px; margin-bottom:20px; flex-wrap:wrap; }
.tab-btn {
padding:8px 16px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer;
color:var(--text2); background:transparent; border:none; font-family:inherit;
transition:all 0.15s; white-space:nowrap;
}
.tab-btn.active { background:var(--card); color:var(--text); font-weight:600; }
.tab-btn:hover:not(.active) { color:var(--text); }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* PROFILE */
.profile-header {
background:linear-gradient(135deg, #1a1e28, #1e2a3a);
border:1px solid var(--border); border-radius:16px; padding:24px;
display:flex; align-items:center; gap:20px; margin-bottom:20px;
}
.profile-avatar {
width:80px; height:80px; border-radius:18px; display:flex; align-items:center;
justify-content:center; font-size:32px; font-weight:700; flex-shrink:0;
}
.profile-info h2 { font-size:20px; font-weight:700; }
.profile-info p { color:var(--text2); font-size:13px; margin-top:3px; }
.profile-badges { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.info-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.info-item label { font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:0.5px; display:block; margin-bottom:4px; }
.info-item p { font-size:14px; }

/* KPI */
.kpi-bar-wrap { margin-bottom:16px; }
.kpi-bar-header { display:flex; justify-content:space-between; margin-bottom:6px; font-size:13px; }
.kpi-bar-track { background:var(--bg3); border-radius:20px; height:8px; overflow:hidden; }
.kpi-bar-fill { height:100%; border-radius:20px; transition:width 1s ease; }
.kpi-score-big { font-size:56px; font-weight:700; line-height:1; }

/* LEAVE */
.leave-balance { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:20px; }
.leave-bal-card { background:var(--card2); border:1px solid var(--border); border-radius:12px; padding:16px; text-align:center; }
.leave-bal-num { font-size:28px; font-weight:700; }

/* SALARY SLIP */
.salary-slip {
background:var(--card); border:1px solid var(--border); border-radius:14px;
overflow:hidden; margin-bottom:16px;
}
.slip-header {
padding:20px 24px; background:linear-gradient(135deg,var(--accent),var(--accent2));
display:flex; justify-content:space-between; align-items:center;
}
.slip-body { padding:20px 24px; }
.slip-row { display:flex; justify-content:space-between; padding:8px 0; font-size:13px; border-bottom:1px solid var(--border); }
.slip-row:last-child { border-bottom:none; font-weight:700; font-size:15px; }

/* ADMIN */
.admin-header { background:linear-gradient(135deg,#2d1010,#1a0a0a); border:1px solid var(--red)33; border-radius:14px; padding:16px 20px; margin-bottom:20px; display:flex; align-items:center; gap:12px; }
.employee-table-row td { font-size:13px; }
.action-btns { display:flex; gap:6px; }
.modal-overlay {
position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:1000;
display:flex; align-items:center; justify-content:center; display:none;
}
.modal-overlay.open { display:flex; }
.modal {
background:var(--card); border:1px solid var(--border); border-radius:18px;
padding:28px; width:560px; max-height:90vh; overflow-y:auto; max-width:95vw;
}
.modal h2 { font-size:17px; font-weight:700; margin-bottom:20px; }
.modal-footer { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* AUDIT LOG */
.audit-item { display:flex; align-items:flex-start; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.audit-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.audit-text { font-size:13px; }
.audit-time { font-size:11px; color:var(--text3); margin-top:2px; font-family:'DM Mono',monospace; }

/* TOAST */
.toast {
position:fixed; bottom:24px; right:24px; background:var(--card);
border:1px solid var(--border); border-radius:12px; padding:14px 18px;
font-size:13px; z-index:9999; transform:translateY(20px); opacity:0;
transition:all 0.3s; max-width:320px; display:flex; align-items:center; gap:10px;
box-shadow:var(--shadow);
}
.toast.show { opacity:1; transform:translateY(0); }
.toast.success { border-left:3px solid var(--green); }
.toast.error { border-left:3px solid var(--red); }
.toast.info { border-left:3px solid var(--accent); }

/* MISC */
.empty-state { text-align:center; padding:40px 20px; color:var(--text3); }
.empty-state .empty-icon { font-size:40px; margin-bottom:12px; }
.search-bar { display:flex; gap:10px; margin-bottom:16px; }
.search-bar input { flex:1; }
input[type="checkbox"] { width:16px; height:16px; cursor:pointer; accent-color:var(--accent); }
.progress-ring-wrap { position:relative; display:inline-block; }
.scrollable { max-height:320px; overflow-y:auto; }
.scrollable::-webkit-scrollbar { width:4px; }
.scrollable::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

/* GRID UTILS */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.mb-4 { margin-bottom:16px; }
.mt-4 { margin-top:16px; }
.flex { display:flex; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.flex-center { display:flex; align-items:center; gap:8px; }
.text-muted { color:var(--text2); font-size:13px; }
.text-small { font-size:12px; color:var(--text3); }

/* ───── ANIMATIONS ───── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.animate-in { animation:fadeIn 0.3s ease forwards; }
.pulse { animation:pulse 2s infinite; }

/* ───── RESPONSIVE ───── */
@media (max-width: 768px) {
.sidebar { transform:translateX(-100%); }
.main { margin-left:0; }
.stats-grid { grid-template-columns:1fr 1fr; }
.grid-2,.grid-3 { grid-template-columns:1fr; }
}