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

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

:root {
    --bg: #050910;
    --sidebar: #080e17;
    --card: #0d141f;
    --card2: #111b29;
    --blue: #1687ff;
    --blue-dark: #0065d5;
    --text: #f4f7fb;
    --muted: #8795a8;
    --border: rgba(255,255,255,.08);
    --green: #22c982;
    --red: #ff5365;
    --orange: #ffae42;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Vazirmatn", sans-serif;
    background:
        radial-gradient(circle at 80% 0%, rgba(0,120,255,.16), transparent 30%),
        radial-gradient(circle at 0% 100%, rgba(0,100,255,.08), transparent 30%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

button, input, select { font-family: inherit; }
button { border: 0; cursor: pointer; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #1d3048; border-radius: 10px; }

/* SIDEBAR */
.sidebar {
    position: fixed; right: 0; top: 0; width: 270px; height: 100vh;
    background: rgba(7,12,20,.97); border-left: 1px solid var(--border);
    padding: 18px 14px; overflow-y: auto; z-index: 1000; backdrop-filter: blur(20px);
}
.logo { display: flex; align-items: center; gap: 12px; padding: 7px 8px 25px; }
.logo-icon {
    width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #168cff, #00489b); box-shadow: 0 10px 35px rgba(0,120,255,.25);
    font-size: 21px; font-weight: 800;
}
.logo-text strong { display: block; font-size: 15px; }
.logo-text span { display: block; color: #657387; font-size: 9px; margin-top: 3px; }
.menu-title { color: #536174; font-size: 9px; margin: 4px 12px 8px; }
.menu { display: flex; flex-direction: column; gap: 3px; }
.menu-item {
    width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 12px; background: transparent; color: #93a0b1; font-size: 11px; text-align: right; transition: .2s;
    text-decoration: none;
}
.menu-item:hover { color: white; background: rgba(255,255,255,.035); }
.menu-item.active {
    color: white;
    background: linear-gradient(90deg, rgba(20,135,255,.22), rgba(20,135,255,.03));
    border: 1px solid rgba(20,135,255,.12);
}
.menu-icon { width: 23px; text-align: center; font-size: 16px; }
.bottom-menu { border-top: 1px solid rgba(255,255,255,.06); margin-top: 14px; padding-top: 14px; }
.version { text-align: center; color: #4d5b6e; font-size: 9px; margin-top: 18px; }

/* MAIN */
.main { width: calc(100% - 270px); margin-right: 270px; padding: 25px 30px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.welcome h1 { font-size: 23px; margin-bottom: 5px; }
.welcome p { color: var(--muted); font-size: 11px; }
.profile { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 43px; height: 43px; border-radius: 13px;
    background: linear-gradient(135deg, #168cff, #004184);
    display: flex; align-items: center; justify-content: center; font-weight: 800; overflow: hidden;
}

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.stat-card .value { font-size: 22px; font-weight: 800; }
.stat-card .label { color: var(--muted); font-size: 10px; margin-top: 4px; }

/* ATTENDANCE CARD */
.attendance {
    position: relative; overflow: hidden;
    background: linear-gradient(115deg, rgba(12,126,255,.24), rgba(10,16,26,.96) 68%), var(--card);
    border: 1px solid rgba(30,140,255,.18); border-radius: 22px; padding: 25px; margin-bottom: 18px;
}
.attendance-content { position: relative; z-index: 2; }
.attendance-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.attendance-head h2 { font-size: 16px; }
.status {
    display: flex; align-items: center; gap: 6px; color: var(--green);
    background: rgba(34,201,130,.08); border: 1px solid rgba(34,201,130,.14);
    padding: 6px 10px; border-radius: 20px; font-size: 9px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.clock { font-size: 42px; font-weight: 800; letter-spacing: 1px; }
.date { color: #8b98a9; font-size: 10px; margin-top: 2px; }

/* SWIPE SLIDER */
.attendance-control { width: 100%; max-width: 510px; margin-top: 24px; }
.slider-track {
    position: relative; width: 100%; height: 64px; background: #070e18;
    border: 1px solid rgba(255,255,255,.1); border-radius: 17px; overflow: hidden;
}
.slider-handle {
    position: absolute; top: 5px; right: 5px; width: 54px; height: 54px; border-radius: 13px;
    background: linear-gradient(135deg, #168cff, #0065d5); display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px; z-index: 5; cursor: grab; box-shadow: 0 8px 25px rgba(0,120,255,.32);
    transition: right .25s ease, background .2s ease;
}
.slider-handle:active { cursor: grabbing; }
.slider-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #7e8b9c; font-size: 11px; font-weight: 600; pointer-events: none; z-index: 2;
}
.slider-fill { position: absolute; top: 5px; right: 5px; height: 54px; width: 54px; border-radius: 13px; background: rgba(20,135,255,.15); }

/* TOAST */
.toast {
    position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #101925; border: 1px solid var(--border); color: white; padding: 12px 20px;
    border-radius: 12px; font-size: 11px; opacity: 0; pointer-events: none; transition: .3s; z-index: 3000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* AUTH PAGE */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 30px;
    width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px;
}
.auth-card h1 { font-size: 18px; margin-bottom: 10px; text-align: center; }
.auth-card label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.auth-card input {
    background: #0b1220; border: 1px solid var(--border); border-radius: 10px; padding: 12px;
    color: var(--text); font-size: 13px;
}
.auth-card button {
    margin-top: 14px; padding: 13px; border-radius: 10px; background: linear-gradient(135deg, #168cff, #0065d5);
    color: white; font-size: 13px; font-weight: 700;
}
.auth-error {
    background: rgba(255,83,101,.1); border: 1px solid rgba(255,83,101,.25); color: var(--red);
    padding: 10px; border-radius: 10px; font-size: 11px; text-align: center;
}

/* SIMPLE TABLE (manager / super admin) */
table.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 16px; overflow: hidden; }
table.data-table th, table.data-table td { padding: 12px 14px; font-size: 11px; text-align: right; border-bottom: 1px solid var(--border); }
table.data-table th { color: var(--muted); font-weight: 600; background: rgba(255,255,255,.02); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 9px; display: inline-block; }
.badge.pending { background: rgba(255,174,66,.1); color: var(--orange); }
.badge.approved { background: rgba(34,201,130,.1); color: var(--green); }
.badge.rejected { background: rgba(255,83,101,.1); color: var(--red); }
.btn { padding: 8px 14px; border-radius: 8px; font-size: 10px; font-weight: 600; }
.btn.approve { background: rgba(34,201,130,.15); color: var(--green); }
.btn.reject { background: rgba(255,83,101,.15); color: var(--red); }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main { width: 100%; margin-right: 0; padding: 16px; }
}
