/* ===========================================================
   Employee Tracker — design tokens
   Palette: deep navy ink + teal accent + amber for deadlines
   Type: Sora (headings, structural) / Inter (body, data)
=========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ink: #12182b;
    --ink-soft: #303a55;
    --paper: #f5f6fa;
    --surface: #ffffff;
    --line: #e3e6ef;
    --teal: #0f9d8c;
    --teal-dark: #0b7d70;
    --teal-tint: #e3f5f2;
    --amber: #ef9d3a;
    --amber-tint: #fdf1e0;
    --red: #d64545;
    --red-tint: #fbe9e9;
    --shadow: 0 1px 2px rgba(18, 24, 43, 0.04), 0 8px 24px rgba(18, 24, 43, 0.06);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand { font-family: 'Sora', sans-serif; }

a { color: inherit; }

button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------- Auth screen ---------------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(15, 157, 140, 0.14), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(239, 157, 58, 0.12), transparent 40%),
        var(--ink);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.auth-mark {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    display: flex; align-items: center; justify-content: center;
    color: white; font-family: 'Sora', sans-serif; font-weight: 800;
    margin-bottom: 20px;
}

.auth-card h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.02em; }
.auth-card p.sub { margin: 0 0 28px; color: var(--ink-soft); font-size: 14px; }

.tabbar {
    display: flex; gap: 4px;
    background: var(--paper);
    padding: 4px; border-radius: 10px;
    margin-bottom: 24px;
}
.tabbar button {
    flex: 1; border: none; background: transparent;
    padding: 8px 0; border-radius: 8px; cursor: pointer;
    font-weight: 600; color: var(--ink-soft);
    transition: background .15s, color .15s;
}
.tabbar button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 13px;
    border: 1.5px solid var(--line); border-radius: 9px;
    background: var(--paper);
    outline: none; transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--teal); background: var(--surface);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: 9px; padding: 11px 18px;
    font-weight: 700; cursor: pointer; transition: transform .1s, opacity .15s, box-shadow .15s;
    font-family: 'Inter', sans-serif;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: white; width: 100%; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-danger { background: var(--red-tint); color: var(--red); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.error-box, .info-box {
    font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px;
}
.error-box { background: var(--red-tint); color: var(--red); }
.info-box { background: var(--teal-tint); color: var(--teal-dark); }
.hidden { display: none !important; }

/* ---------------- App shell ---------------- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--ink); color: #cfd4e6;
    padding: 24px 18px; display: flex; flex-direction: column;
}
.brand { color: white; font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(15,157,140,.25); }

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 4px;
    cursor: pointer; font-weight: 600; font-size: 14px;
    color: #b7bdd6; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: var(--teal); color: white; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--teal-tint); color: var(--teal-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
    flex-shrink: 0;
}
.user-chip .meta { line-height: 1.3; overflow: hidden; }
.user-chip .meta .name { color: white; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-chip .meta .role { font-size: 12px; color: #9aa0bd; text-transform: capitalize; }

.main { padding: 32px 40px; max-width: 1180px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 24px; margin: 0; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }

.view { display: none; }
.view.active { display: block; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat-card .num { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; }
.stat-card .label { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin: 0 0 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .app-shell { grid-template-columns: 1fr; } .sidebar { display: none; } }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.badge-pending { background: var(--amber-tint); color: #a5680f; }
.badge-in_progress { background: var(--teal-tint); color: var(--teal-dark); }
.badge-completed { background: #e6f4e6; color: #2f7a2f; }

.progress-bar { height: 8px; border-radius: 100px; background: var(--line); overflow: hidden; width: 100%; }
.progress-bar .fill { height: 100%; background: var(--teal); border-radius: 100px; transition: width .3s; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty-state .big { font-size: 32px; margin-bottom: 8px; }

.list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(18,24,43,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
    background: var(--surface); border-radius: 16px; padding: 28px; width: 100%; max-width: 440px;
    max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--ink); color: white; padding: 12px 16px; border-radius: 9px;
    font-size: 13.5px; box-shadow: var(--shadow); max-width: 320px;
    animation: slide-in .2s ease-out;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--teal-dark); }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.text-muted { color: var(--ink-soft); font-size: 13px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
