/* ==========================================================
   HR Tizimi — Liquid Glass Design System
   ========================================================== */

:root {
    /* Fon */
    --void: #0a0d16;
    --void-2: #0d1120;

    /* Shisha */
    --glass-bg: rgba(255, 255, 255, 0.055);
    --glass-bg-strong: rgba(255, 255, 255, 0.09);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-highlight: rgba(255, 255, 255, 0.5);

    /* Matn */
    --text: #EDEFF5;
    --text-dim: #A7AFC2;
    --text-faint: #6B7488;

    /* Accent gradienti */
    --accent-1: #6E8CFF;
    --accent-2: #B18CFF;
    --accent: linear-gradient(135deg, var(--accent-1), var(--accent-2));

    --success: #34D399;
    --warning: #FBBF24;
    --danger: #FB7185;
    --teal: #22D3AE;

    --radius: 18px;
    --radius-sm: 12px;

    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--void);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Aurora background (imzo element) ---------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at top, var(--void-2), var(--void) 65%);
}
.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.38;
    animation: drift 26s ease-in-out infinite alternate;
}
.aurora-blob.b1 {
    width: 520px; height: 520px;
    top: -120px; left: -80px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
}
.aurora-blob.b2 {
    width: 480px; height: 480px;
    bottom: -160px; right: -100px;
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
    animation-delay: -9s;
}
.aurora-blob.b3 {
    width: 380px; height: 380px;
    top: 40%; left: 55%;
    background: radial-gradient(circle, var(--teal), transparent 70%);
    animation-delay: -17s;
    opacity: 0.22;
}
@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
    .aurora-blob { animation: none; }
}

/* ---------- Shisha (glass) baza ---------- */
.glass,
.panel, .card, table, .alert, .login-box, .sidebar {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    backdrop-filter: blur(28px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    position: relative;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* nozik yorug'lik chizig'i - shishaning yuqori qirrasi */
.glass::before,
.panel::before, .card::before, .alert::before, .login-box::before {
    content: "";
    position: absolute;
    top: 0; left: 14px; right: 14px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    opacity: 0.5;
}

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 22px 0;
    flex-shrink: 0;
    margin: 16px 0 16px 16px;
    height: calc(100vh - 32px);
    position: sticky;
    top: 16px;
    border-radius: 22px;
}

.logo, .login-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    padding: 0 22px 22px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.logo-mark {
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logo-rest { color: var(--text); }

.sidebar nav { display: flex; flex-direction: column; flex: 1; gap: 2px; padding: 4px 12px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
    text-decoration: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(110, 140, 255, 0.22), rgba(177, 140, 255, 0.14));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar-footer { padding: 14px 20px 4px; border-top: 1px solid var(--glass-border); margin-top: 8px; }
.user-box { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.user-name { font-weight: 600; color: var(--text); font-size: 13.5px; }
.user-role { font-size: 12px; color: var(--text-faint); text-transform: capitalize; }
.logout-link {
    display: flex; align-items: center; gap: 10px;
    color: var(--danger);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.logout-link:hover { background: rgba(251, 113, 133, 0.1); }

.content { flex: 1; padding: 32px 40px; max-width: 1240px; position: relative; z-index: 1; }

h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 26px;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 22px;
    color: var(--text);
}
h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-top: 0;
    color: var(--text);
    letter-spacing: -0.01em;
}

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0; }

/* ---------- Stat kartalar ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.card { padding: 22px; overflow: hidden; }
.card-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.card-icon svg { width: 20px; height: 20px; }
.icon-blue   { background: rgba(110, 140, 255, 0.16); color: #93A9FF; }
.icon-violet { background: rgba(177, 140, 255, 0.16); color: #C6ACFF; }
.icon-amber  { background: rgba(251, 191, 36, 0.16); color: #FBBF24; }
.icon-teal   { background: rgba(34, 211, 174, 0.16); color: #22D3AE; }

.card-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.card-label { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.panel { padding: 22px; margin-bottom: 18px; }

/* ---------- Jadval ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table th, table td { padding: 12px 16px; text-align: left; font-size: 13.5px; }
table th {
    color: var(--text-faint);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}
table td { border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-dim); }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(255, 255, 255, 0.025); color: var(--text); }

.actions a, .actions .link-btn { margin-right: 12px; color: var(--accent-1); text-decoration: none; font-size: 13px; font-weight: 500; }
.actions a:hover { color: #93A9FF; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

.link-btn { background: none; border: none; cursor: pointer; padding: 0; font: inherit; }

/* ---------- Nishonlar (badges) ---------- */
.badge {
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.02em;
}
.badge-active, .badge-approved, .badge-present, .badge-paid, .badge-calculated {
    background: rgba(52, 211, 153, 0.14); color: #4EEBAF; border-color: rgba(52, 211, 153, 0.25);
}
.badge-pending, .badge-probation, .badge-late, .badge-draft {
    background: rgba(251, 191, 36, 0.14); color: #FBBF24; border-color: rgba(251, 191, 36, 0.25);
}
.badge-rejected, .badge-terminated, .badge-absent {
    background: rgba(251, 113, 133, 0.14); color: #FF8FA3; border-color: rgba(251, 113, 133, 0.25);
}
.badge-on_leave, .badge-day_off {
    background: rgba(110, 140, 255, 0.14); color: #93A9FF; border-color: rgba(110, 140, 255, 0.25);
}

/* ---------- Tugmalar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--glass-border);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--font-body);
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 18px rgba(110, 140, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(110, 140, 255, 0.45); filter: brightness(1.05); }

/* ---------- Formalar ---------- */
.form { max-width: 620px; }
.form label { display: block; margin: 14px 0 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.form input, .form select, select, input[type=text], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=password], input[type=file] {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    font-family: var(--font-body);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form input:focus, .form select:focus, select:focus, input:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(110, 140, 255, 0.18);
}
.form input::placeholder { color: var(--text-faint); }
.form select option { background: #14182A; color: var(--text); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: start; margin-bottom: 10px; }
.align-end { display: flex; align-items: flex-end; }

.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.mini-input { width: 96px !important; padding: 6px 10px !important; font-family: var(--font-mono); }

.search-form { display: flex; gap: 10px; margin-bottom: 18px; max-width: 420px; }

/* ---------- Xabarnomalar ---------- */
.alert { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; }
.alert-success { color: #4EEBAF; }
.alert-error { color: #FF8FA3; }

.summary-line { margin: 16px 0; color: var(--text-dim); font-size: 14px; }
.summary-line strong { font-family: var(--font-mono); color: var(--text); }

/* ---------- Profil / kabinet ---------- */
.employee-photo {
    width: 90px; height: 90px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin-bottom: 12px;
    border: 2px solid var(--glass-border);
}
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head .employee-photo { margin-bottom: 0; width: 72px; height: 72px; }
.profile-head h2 { margin: 0 0 4px; font-size: 19px; }
.muted { color: var(--text-faint); font-size: 13px; margin: 2px 0; }

/* Pul/kod qiymatlari uchun mono shrift */
td:has(> .money), .money { font-family: var(--font-mono); }

/* ---------- Login sahifasi ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    padding: 42px 38px;
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}
.login-logo { justify-content: center; padding: 0 0 6px; font-size: 26px; }
.subtitle { text-align: center; color: var(--text-dim); margin: 0 0 24px; font-size: 13.5px; }
.login-box label { display: block; margin: 16px 0 6px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.login-box input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
}
.login-box input:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(110, 140, 255, 0.18); }
.login-box button {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(110, 140, 255, 0.35);
    transition: filter 0.15s ease, transform 0.1s ease;
}
.login-box button:hover { filter: brightness(1.08); }
.login-box button:active { transform: scale(0.98); }
.hint { text-align: center; font-size: 11.5px; color: var(--text-faint); margin-top: 20px; font-family: var(--font-mono); }

/* ---------- Statistika sahifasi uchun canvas konteyner ---------- */
canvas { max-width: 100%; }

/* ---------- Skroll paneli (scrollbar) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid-2, .cards { grid-template-columns: 1fr; }
    .app { flex-direction: column; }
    .sidebar {
        width: auto;
        margin: 12px;
        height: auto;
        position: relative;
        top: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px;
    }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .nav-item span { display: none; }
    .sidebar-footer { display: flex; align-items: center; border-top: none; margin: 0; padding: 0 0 0 8px; }
    .content { padding: 20px; }
}

/* Kirish uchun ko'rinadigan fokus (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 2px;
}
