/* ============================================================
   DESIGN TOKENS — سامانه‌ی ارزیابی و خودشناسی دانش‌آموز
   پالت: کاغذ گرم + سبز-آبی عمیق (اعتماد، آرامش، رشد) + طلایی کم‌رنگ
   برای نقاط قوت + قرمز فقط برای هشدارهای ایمنی واقعی.
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --bg: #F6F4EE;
    --surface: #FFFFFF;
    --surface-sunken: #EFEDE4;
    --ink: #22282A;
    --ink-muted: #5B6462;
    --ink-faint: #8B948F;
    --border: #E2DFD3;

    --accent: #2E6B68;
    --accent-strong: #1E4C4A;
    --accent-tint: #E4EEEC;

    --gold: #B8853A;
    --gold-tint: #F6ECDA;

    --alert: #AE3B30;
    --alert-tint: #F8E7E4;

    --radius: 10px;
    --font: 'Vazirmatn', 'Tahoma', sans-serif;

    --shadow-soft: 0 1px 2px rgba(34, 40, 42, 0.06), 0 4px 16px rgba(34, 40, 42, 0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    direction: rtl;
    font-size: 16px;
    line-height: 1.75;
}

h1, h2, h3, h4 {
    font-family: var(--font);
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 .5em;
    color: var(--ink);
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-muted); max-width: 62ch; }

a { color: var(--accent-strong); }

button, .btn {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    padding: 0.7em 1.4em;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--accent-strong); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}
button.secondary, .btn.secondary {
    background: transparent;
    color: var(--accent-strong);
    border: 1.5px solid var(--border);
}
button.secondary:hover { background: var(--accent-tint); }
button.danger { background: var(--alert); }
button.danger:hover { background: #8C2E25; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
    font-family: var(--font);
    font-size: 0.95rem;
    padding: 0.65em 0.9em;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    width: 100%;
}
label { display: block; font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 0.35em; }
.field { margin-bottom: 1.1em; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4em 1.6em;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 1.6em 1.2em;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}
.sidebar .brand {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1.2em;
    color: var(--accent-strong);
}
.sidebar a {
    display: block;
    padding: 0.6em 0.8em;
    border-radius: var(--radius);
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.92rem;
}
.sidebar a:hover, .sidebar a.active { background: var(--accent-tint); color: var(--accent-strong); }
.sidebar .logout { margin-top: auto; }

.main {
    flex: 1;
    padding: 2em 2.4em;
    max-width: 980px;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-box {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.2em 2em;
    box-shadow: var(--shadow-soft);
}
.auth-box h1 { font-size: 1.3rem; text-align: center; margin-bottom: 0.2em; }
.auth-box .subtitle { text-align: center; color: var(--ink-faint); font-size: 0.85rem; margin-bottom: 1.6em; }

.banner {
    border-radius: var(--radius);
    padding: 0.9em 1.2em;
    margin-bottom: 1.2em;
    font-size: 0.92rem;
}
.banner.info { background: var(--accent-tint); color: var(--accent-strong); }
.banner.warn { background: var(--gold-tint); color: #6B4A1D; }
.banner.error { background: var(--alert-tint); color: var(--alert); }

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    background: var(--surface-sunken);
    color: var(--ink-muted);
}
.badge.high { background: var(--gold-tint); color: #6B4A1D; }
.badge.critical { background: var(--alert-tint); color: var(--alert); }

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

.progress-bar {
    height: 8px;
    background: var(--surface-sunken);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar > div { height: 100%; background: var(--accent); }

.strength-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-sunken);
    overflow: hidden;
    margin-top: 0.3em;
}
.strength-bar > div { height: 100%; background: var(--gold); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: right; padding: 0.6em 0.5em; border-bottom: 1px solid var(--border); }
th { color: var(--ink-faint); font-weight: 600; font-size: 0.8rem; }

.empty-state { text-align: center; color: var(--ink-faint); padding: 2.5em 1em; }

@media (max-width: 720px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-left: none; border-bottom: 1px solid var(--border); }
    .sidebar .brand { display: none; }
    .main { padding: 1.4em; }
}
