/* =====================================================================
   WriteMyAssessment · Staff Portal
   Brand-matched theme — Plus Jakarta Sans, blue #2563EB, navy sidebar.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e6e9f2;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eef4ff;
    --sidebar: #0a1028;
    --sidebar-2: #0d1633;
    --sidebar-text: #a9b4d0;
    --sidebar-muted: #6b779c;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --gold: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, .14);
    --radius: 14px;
}
* { box-sizing: border-box; }
html, body {
    margin: 0; min-height: 100%;
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg); color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
svg { display: block; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 258px; color: var(--sidebar-text);
    background: linear-gradient(185deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }
.brand-icon {
    width: 42px; height: 42px; border-radius: 12px; flex: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .45);
}
.brand-title { font-weight: 800; color: #fff; font-size: 15px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { color: var(--sidebar-muted); font-size: 11px; margin-top: 3px; font-weight: 600; letter-spacing: .02em; }
.nav { padding: 8px 12px; flex: 1; }
.nav-label { color: var(--sidebar-muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 14px 12px 6px; }
.nav a {
    display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px;
    color: var(--sidebar-text); font-size: 14px; font-weight: 600; margin-bottom: 3px;
    transition: background .15s, color .15s;
}
.nav a svg { opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.35); }
.nav a.active svg { opacity: 1; }
.user-box { border-top: 1px solid rgba(255,255,255,.08); padding: 16px; }
.avatar {
    width: 38px; height: 38px; border-radius: 999px; flex: none;
    background: rgba(59,130,246,.2); color: #bfdbfe;
    display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.user-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-name { color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { color: var(--sidebar-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.main { margin-left: 258px; min-height: 100vh; width: calc(100% - 258px); }
.topbar {
    height: 66px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: flex-end;
    gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.content { padding: 28px; max-width: 1280px; }

/* ---------- Typography ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
h1 { font-size: 30px; margin: 0; line-height: 1.12; letter-spacing: -.03em; font-weight: 800; }
h2 { font-size: 18px; margin: 0 0 12px; letter-spacing: -.02em; font-weight: 700; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: flex; gap: 14px; align-items: center; padding: 20px; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.stat-icon.green { background: #e7f8ee; color: var(--success); }
.stat-icon.amber { background: #fef3c7; color: var(--warning); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-icon.gold { background: #fef3c7; color: var(--gold); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- Motivation ---------- */
.welcome-banner {
    position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; margin-bottom: 22px;
    background: linear-gradient(120deg, #0a1028 0%, #162b72 48%, #246ae8 100%); color: #fff;
    box-shadow: var(--shadow-lg);
}
.welcome-banner::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); pointer-events: none;
}
.welcome-banner h1 { color: #fff; font-size: 26px; }
.welcome-hi { font-size: 13px; font-weight: 700; color: #bfdbfe; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.welcome-quote { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: #dbe4ff; font-size: 14px; font-weight: 500; max-width: 640px; }
.welcome-quote svg { flex: none; color: #93c5fd; }
.welcome-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.welcome-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.welcome-chip svg { color: #ffd479; }

.progress-wrap { margin-top: 8px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.progress-head .muted { font-weight: 500; }
.progress-track { height: 12px; border-radius: 999px; background: #e8edf7; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #3b82f6); transition: width .6s ease; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.achv { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.achv.locked { opacity: .55; filter: grayscale(.6); }
.achv-medal { width: 42px; height: 42px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 6px 14px rgba(245,158,11,.35); }
.achv.locked .achv-medal { background: #e2e8f0; color: #94a3b8; box-shadow: none; }
.achv-title { font-weight: 800; font-size: 13px; }
.achv-desc { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 13px 14px; border-bottom: 1px solid var(--border); background: #f8fafc; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #f1f4f9; vertical-align: middle; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafcff; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.muted { color: var(--muted); }
.right { text-align: right; }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 15px; border-radius: 11px; border: 1px solid transparent; background: #fff; color: var(--text); cursor: pointer; font-weight: 700; font-size: 13px; line-height: 1; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--border); background: #fff; color: var(--text); }
.btn-outline:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { color: #fff; background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-warning { color: #fff; background: var(--warning); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--sidebar-text); }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-small { min-height: 32px; padding: 7px 10px; font-size: 12px; border-radius: 9px; }
.btn-full { width: 100%; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #334155; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
    width: 100%; border: 1px solid #d7dded; border-radius: 11px; min-height: 42px; padding: 10px 12px; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
textarea { min-height: 96px; resize: vertical; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters .input, .filters select { width: auto; min-width: 150px; }
.search { min-width: 250px !important; flex: 1; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-indigo { background: #eef2ff; color: #4f46e5; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-amber { background: #fef3c7; color: #d97706; }
.badge-purple { background: #f3e8ff; color: #9333ea; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ---------- Alerts / flash ---------- */
.flash { margin-bottom: 16px; display: grid; gap: 8px; }
.alert { padding: 12px 15px; border-radius: 12px; font-weight: 600; font-size: 14px; border: 1px solid; display: flex; align-items: center; gap: 10px; }
.alert svg { flex: none; }
.alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero {
    position: relative; overflow: hidden; color: #fff; padding: 54px 50px;
    background: linear-gradient(150deg, #0a1028 0%, #162b72 50%, #246ae8 100%);
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 60%); }
.auth-hero .brand-title, .auth-hero .brand-sub { color: #fff; }
.auth-hero-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-hero h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 14px; color: #fff; }
.auth-hero p { color: #cdd8f5; font-size: 15px; max-width: 420px; line-height: 1.6; }
.auth-hero-body { position: relative; z-index: 1; }
.auth-points { display: grid; gap: 14px; margin-top: 26px; }
.auth-point { display: flex; align-items: center; gap: 13px; font-weight: 600; font-size: 14px; }
.auth-point .ap-ic { width: 38px; height: 38px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #93c5fd; }
.auth-hero-foot { color: #9fb0dc; font-size: 13px; position: relative; z-index: 1; }
.auth-panel { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff; display: grid; place-items: center; margin-bottom: 20px; box-shadow: 0 10px 22px rgba(37,99,235,.4); }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card .subtitle { margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: flex; align-items: center; gap: 7px; }
.field label svg { color: var(--muted); }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
.auth-alt a { color: var(--primary); font-weight: 700; }
.pw-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- Notifications ---------- */
.notification { position: relative; }
.notification-btn { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; display: grid; place-items: center; color: #334155; }
.notification-btn:hover { background: #f8fafc; }
.notif-count { position: absolute; top: -3px; right: -3px; background: #ef4444; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; display: grid; place-items: center; font-weight: 800; border: 2px solid #fff; }
.notif-panel { display: none; position: absolute; right: 0; top: 50px; width: 380px; max-width: calc(100vw - 30px); background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-head { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 800; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f1f4f9; display: flex; gap: 11px; align-items: flex-start; }
.notif-ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.notif-ic.overdue, .notif-ic.payment { background: #fee2e2; color: #dc2626; }
.notif-ic.deadline { background: #fef3c7; color: #d97706; }
.notif-ic.completed { background: #dcfce7; color: #16a34a; }
.notif-item strong { display: block; font-size: 13px; }
.notif-item span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Misc ---------- */
.mobile-menu { display: none; }
.work-entry { border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 16px; background: #fbfcff; }
.work-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 42px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg,#2563eb,#3b82f6); border-radius: 999px; }
.overdue { color: var(--danger); font-weight: 800; }

@media (max-width: 980px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }
    .mobile-menu { display: inline-flex; margin-right: auto; }
    .topbar { justify-content: space-between; padding: 0 16px; }
    .content { padding: 18px; }
    .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
    h1 { font-size: 26px; }
}
@media print {
    .sidebar, .topbar, .no-print, .page-head .actions { display: none !important; }
    .main { margin: 0; width: 100%; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 0; }
    body { background: #fff; }
}
