@font-face {
    font-family: 'Vazir';
    src: url('./fonts/Vazir-Regular.ttf');
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', Tahoma, sans-serif;
    text-align: right;
}

:root {
    --ink: #1b2a41;
    --ink-soft: #4a5a72;
    --paper: #f2f5f9;
    --surface: #ffffff;
    --line: #d5dce6;
    --teal: #0d7c86;
    --teal-dark: #095f67;
    --gold: #e0a52c;
    --danger: #b3261e;
    --danger-bg: #fbeaea;
    --ok: #17703f;
    --ok-bg: #e6f4ec;
}
.time-cell {
    unicode-bidi: isolate;
    text-align: right;
    white-space: nowrap;
}

html, body { height: 100%; }

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Vazirmatn, "IRANSans", Tahoma, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--ink);
    background: var(--paper);
}

a { color: var(--teal-dark); }

main {
    flex: 1;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.footer {
    padding: 18px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

/* ---------- hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
    padding-top: 24px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: 2.1rem;
    line-height: 1.5;
}

.hero p { margin: 0 0 24px; color: var(--ink-soft); }

.hero-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 5px solid var(--teal);
    padding: 24px;
}

.hero-panel h2 { margin: 0 0 12px; font-size: 1.1rem; }

.role-list { list-style: none; margin: 0; padding: 0; }

.role-list li {
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.role-list li:first-child { border-top: 0; }

.role-list strong { display: block; }
.role-list span { color: var(--ink-soft); font-size: 0.9rem; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
    
    display: inline-block;
    padding: 10px 22px;
    border: 2px solid var(--teal);
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    
    text-decoration: none;
    cursor: pointer;
 
  
    text-align: center;
}

.flex{


      display: flex;
    align-items: center;
}

.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.ghost { background: transparent; color: var(--teal-dark); }
.btn.ghost:hover { background: #e3f1f2; }
.btn.full { width: 100%; margin-top: 8px; }

.btn:focus-visible,
.link-btn:focus-visible,
input:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ---------- cards & forms ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 32px;
}

.card.auth { max-width: 520px; margin: 0 auto; }

.card h1 { margin: 0 0 8px; font-size: 1.5rem; }

.lead { color: var(--ink-soft); margin: 0 0 20px; }

.field { margin-bottom: 16px; flex: 1; }

.field label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.95rem; }

.field small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 0.82rem; }

.field input {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #9aa8bb;
    border-radius: 4px;
}

.field input:focus { border-color: var(--teal); }

.row { display: flex; gap: 16px; }

.password-wrap { position: relative; }

.password-wrap input { padding-inline-end: 64px; }

.link-btn {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 8px;
    border: 0;
    background: none;
    color: var(--teal-dark);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ---------- role selector ---------- */
.roles {
    margin: 16px 0 20px;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.roles legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }

.role-option { display: block; }

.role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-option span {
    display: block;
    padding: 10px 6px;
    border: 1px solid #9aa8bb;
    border-radius: 4px;
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.5;
    cursor: pointer;
}

.role-option input:checked + span {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.role-option input:focus-visible + span {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ---------- messages ---------- */
.flashes { max-width: 520px; margin: 0 auto 16px; }

.flash {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-inline-start: 5px solid;
}

.flash.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.flash.success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }

.hint { margin: 20px 0 0; text-align: center; color: var(--ink-soft); font-size: 0.92rem; }
.hint.small { margin-top: 6px; font-size: 0.82rem; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; gap: 24px; }
    .hero h1 { font-size: 1.6rem; }
    .row { flex-direction: column; gap: 0; }
    .roles { grid-template-columns: 1fr; }
    .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- single site header (brand + menus + actions) ---------- */
.skip-link {
    position: absolute;
    inset-inline-start: 8px;
    top: -60px;
    z-index: 100;
    padding: 8px 14px;
    background: var(--gold);
    color: var(--ink);
    font-weight: 600;
}

.skip-link:focus { top: 8px; }

.site-header {
    position: relative;
    z-index: 30;
    background: var(--ink);
    border-bottom: 4px solid var(--gold);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand {
    padding: 14px 0;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-bar {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu { position: relative; }

.menu-btn {
    padding: 18px 12px 15px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: #dbe4f0;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.menu-link {
    display: block;
    padding: 18px 12px 15px;
    border-bottom: 3px solid transparent;
    color: #dbe4f0;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.menu-btn:hover,
.menu-link:hover,
.menu.open .menu-btn { color: #fff; border-bottom-color: var(--gold); }

.menu-btn:focus-visible,
.menu-link:focus-visible,
.nav-btn:focus-visible,
.nav-toggle:focus-visible,
.nav-actions a:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.caret { font-size: 0.7rem; }

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    z-index: 40;
    min-width: 270px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--teal);
    box-shadow: 0 8px 20px rgba(27, 42, 65, 0.18);
}

.menu.open .submenu { display: block; }

.submenu a {
    display: block;
    padding: 9px 18px;
    color: var(--ink);
    font-size: 0.93rem;
    text-decoration: none;
}

.submenu a:hover,
.submenu a:focus-visible { background: #e3f1f2; color: var(--teal-dark); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-inline-start: auto;
}

.nav-actions a,
.nav-btn {
    border: 0;
    background: none;
    color: #dbe4f0;
    font: inherit;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.nav-actions a:hover,
.nav-btn:hover { color: #fff; text-decoration: underline; }

.inline-form { display: inline; margin: 0; }

.nav-toggle {
    display: none;
    margin-inline-start: auto;
    padding: 8px 14px;
    border: 1px solid #5d6f8a;
    border-radius: 4px;
    background: none;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.crumb { margin: 0 0 4px; color: var(--teal-dark); font-size: 0.9rem; font-weight: 600; }

/* ---------- index sections ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 56px;
}

.features article {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--teal);
}

.features h2 { margin: 0 0 8px; font-size: 1.05rem; }
.features p { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .header-inner { flex-wrap: wrap; gap: 0 12px; padding: 0 16px; }
    .brand { flex: 1; }
    .nav-toggle { margin: 10px 0; }

    .site-nav { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; }
    .js .site-nav { display: none; }
    .js .site-nav.open { display: flex; padding-bottom: 8px; }

    .menu-bar { flex-direction: column; }
    .menu-btn {
        width: 100%;
        text-align: start;
        padding: 13px 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .menu-link {
        padding: 13px 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .menu-btn:hover,
    .menu-link:hover,
    .menu.open .menu-btn { border-bottom-color: rgba(255, 255, 255, 0.12); }

    .submenu {
        position: static;
        min-width: 0;
        border: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.07);
    }
    .submenu a { color: #dbe4f0; padding-inline: 16px; }
    .submenu a:hover,
    .submenu a:focus-visible { background: rgba(255, 255, 255, 0.12); color: #fff; }

    .nav-actions { margin: 0; padding: 12px 4px 4px; }
    .features { grid-template-columns: 1fr; margin-top: 32px; }
}

/* اگر جاوااسکریپت اجرا نشد، در دسکتاپ زیرمنوها با هاور و فوکوس هم باز شوند */
@media (min-width: 901px) {
    .menu:hover .submenu,
    .menu:focus-within .submenu { display: block; }
    .menu:hover .menu-btn { color: #fff; border-bottom-color: var(--gold); }
}

/* ---------- admin pages: forms, tables, pager ---------- */
.card.wide { max-width: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #9aa8bb;
    border-radius: 4px;
}

.field select:focus,
.field textarea:focus { border-color: var(--teal); outline: 3px solid var(--gold); outline-offset: 2px; }

.field textarea { resize: vertical; }

.req { color: var(--danger); }

.group {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.group legend {
    width: 100%;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--line);
    font-weight: 700;
    color: var(--ink);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 16px;
}

.span-2 { grid-column: span 2; }

.btn.small { padding: 5px 14px; font-size: 0.88rem; }

.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: var(--line);
    color: var(--ink-soft);
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.toolbar input {
    flex: 1;
    padding: 9px 12px;
    font: inherit;
    border: 1px solid #9aa8bb;
    border-radius: 4px;
    background: #fff;
}

.toolbar input:focus { border-color: var(--teal); outline: 3px solid var(--gold); outline-offset: 2px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }

.table { width: 100%; border-collapse: collapse; background: var(--surface); }

.table th,
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }

.table thead th { background: #e9eef5; font-size: 0.9rem; }

.table tbody tr:hover { background: #f6f9fc; }

.table td[dir="ltr"] { text-align: right; }

.table .empty { padding: 28px; text-align: center; color: var(--ink-soft); }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.pager-info { color: var(--ink-soft); font-size: 0.92rem; }

.group-view { margin-bottom: 22px; }

.group-view h2 {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--line);
    font-size: 1.05rem;
}

.info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }

.info-row { padding: 8px 0; border-bottom: 1px solid var(--line); }

.info dt { color: var(--ink-soft); font-size: 0.85rem; }

.info dd { font-weight: 600; word-break: break-word; }

@media (max-width: 900px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .form-grid,
    .info { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .toolbar { flex-wrap: wrap; }
    .toolbar input { flex-basis: 100%; }
}

.check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--ink-soft);
    cursor: pointer;
}

.field .check-inline input { width: auto; padding: 0; }

.field input[type="file"] { padding: 8px; }

.photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 26px;
}

.photo-card { padding: 14px; background: var(--surface); border: 1px solid var(--line); }

.photo-card h2 { margin-bottom: 10px; font-size: 1rem; }

.photo-card img {
    display: block;
    width: 100%;
    max-height: 320px;
    margin-bottom: 12px;
    object-fit: contain;
    background: #eef2f7;
}

.photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    margin-bottom: 12px;
    background: #eef2f7;
    color: var(--ink-soft);
}

@media (max-width: 600px) {
    .photos { grid-template-columns: 1fr; }
}

/* ---------- delete ---------- */
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }

.btn.danger:hover { background: var(--danger-bg); }

.btn.danger.solid { background: var(--danger); color: #fff; }

.btn.danger.solid:hover { background: #8f1f19; border-color: #8f1f19; }

.delete-list { margin: 8px 0 22px; padding-inline-start: 22px; line-height: 2; }

.card .flash { margin-bottom: 18px; }

/* ---------- notes ---------- */
.span-3 { grid-column: 1 / -1; }

.table td.note-text {
    min-width: 280px;
    white-space: pre-wrap;
    word-break: break-word;
}

.card > .actions { margin-top: 22px; }

/* با ۷ منو در یک ردیف، روی صفحه‌های متوسط فشرده‌تر شود */
@media (min-width: 901px) and (max-width: 1180px) {
    .header-inner { gap: 10px; padding: 0 12px; }
    .menu-btn,
    .menu-link { padding-inline: 8px; font-size: 0.88rem; }
    .brand { font-size: 1.15rem; }
    .nav-actions { gap: 12px; }
}

/* ---------- lockers & equipment ---------- */
.row-actions { display: flex; gap: 8px; }

.note-box {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: #fdf6e3;
    border-inline-start: 4px solid var(--gold);
    line-height: 1.9;
}

.table a { color: var(--teal-dark); }

.table a.btn.ghost { color: var(--teal-dark); }

.table a.btn.danger { color: var(--danger); }

/* ---------- loans ---------- */
.text-danger { color: var(--danger); }

.table tbody tr.overdue-row,
.table tbody tr.overdue-row:hover { background: #fbeaea; }

.overdue-row td { color: #7a1a15; border-bottom-color: #efc7c4; }

.overdue-row td:first-child { box-shadow: inset -4px 0 0 var(--danger); }

.badge-overdue {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    background: var(--danger);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* جدول‌های پرستون: متن سلول‌ها بشکند تا نیازی به اسکرول افقی نباشد */
.table.wrap th,
.table.wrap td { padding: 10px 10px; white-space: normal; }

.table.wrap .badge-overdue { white-space: normal; text-align: center; line-height: 1.6; }

/* ---------- availability ---------- */
.badge-ok,
.badge-loaned {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-ok { background: var(--ok-bg); color: var(--ok); }

.badge-loaned { background: #fdf1d6; color: #7a5200; }

.badge-loaned.is-overdue { background: var(--danger-bg); color: var(--danger); }

.loan-detail { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 0.8rem; }

.toolbar .export-link { margin-inline-start: auto; white-space: nowrap; }

.badge-off {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    background: #e8ecf1;
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- partial payments (تسویه) ---------- */
.pay-form { display: flex; gap: 8px; align-items: center; margin: 0; }

.pay-form input {
    width: 150px;
    padding: 6px 10px;
    font: inherit;
    border: 1px solid #9aa8bb;
    border-radius: 4px;
    background: #fff;
}

.pay-form input:focus { border-color: var(--teal); outline: 3px solid var(--gold); outline-offset: 2px; }

@media (max-width: 600px) {
    .pay-form { flex-wrap: wrap; }
    .pay-form input { width: 100%; }
}

.booking-list { margin: 6px 0 0; padding-inline-start: 20px; line-height: 2; }

/* ---------- finance ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}

.stat {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--teal);
}

.stat.total { border-top-color: var(--gold); }

.stat span { display: block; color: var(--ink-soft); font-size: 0.88rem; }

.stat strong { display: block; margin-top: 4px; font-size: 1.35rem; }

.meter {
    width: 110px;
    height: 10px;
    border: 0;
    border-radius: 5px;
    background: #e4e9f0;
    vertical-align: middle;
    appearance: none;
    -webkit-appearance: none;
}

.meter::-webkit-progress-bar { background: #e4e9f0; border-radius: 5px; }
.meter::-webkit-progress-value { background: var(--teal); border-radius: 5px; }
.meter::-moz-progress-bar { background: var(--teal); border-radius: 5px; }

.section-title { margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); font-size: 1.1rem; }

/* ---------- کادر پهن‌تر برای جدول‌های پرستون (مثل «لیست دوره‌ها») روی PC ----------
   کادر از عرض main بیرون می‌زند و وسط‌چین می‌ماند؛ روی صفحه‌ی کوچک‌تر از ۱۲۰۰px هیچ تغییری نمی‌کند.
   بیشتر سلول‌ها در یک خط می‌مانند و فقط ستون‌های پرمتن (class="col-wrap") می‌شکنند. */
@media (min-width: 1200px) {
    .card.xwide {
        --xwide: min(1480px, calc(100vw - 60px));
        margin-inline: calc((100% - var(--xwide)) / 2);
        padding: 28px 24px;
    }

    .card.xwide .table.wrap th,
    .card.xwide .table.wrap td { padding: 12px 10px; white-space: nowrap; }

    /* تیتر ستون‌ها می‌توانند دو خطی شوند تا ستون‌ها باریک بمانند */
    .card.xwide .table.wrap th { white-space: normal; line-height: 1.5; }

    .card.xwide .table.wrap td.col-wrap { white-space: normal; min-width: 170px; }

    .card.xwide .table.wrap td .loan-detail {
        display: block;
        white-space: normal;
        max-width: 230px;
        margin-top: 6px;
    }

    .card.xwide .table.wrap .btn { white-space: nowrap; }
}

/* PC با صفحه‌ی کوچک‌تر (۱۲۰۰ تا ۱۳۵۹): جا کم است، پس متن سلول‌ها مثل قبل بشکند */
@media (min-width: 1200px) and (max-width: 1359px) {
    .card.xwide .table.wrap td,
    .card.xwide .table.wrap .btn { white-space: normal; }
    .card.xwide .table.wrap td.col-wrap { min-width: 130px; }
}

/* ---------- صفحه‌ی اعمال کاربران: پاک کردن مخزن ---------- */
.purge-box {
    margin: 0 0 22px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-right: 4px solid var(--danger);
    border-radius: 10px;
    background: var(--surface);
}
.purge-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.purge-head span { color: var(--ink-soft); font-size: 0.9rem; }

.purge-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
    padding: 5px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}
.chip:hover { border-color: var(--danger); }
.chip.active { background: var(--danger); border-color: var(--danger); color: #fff; }

.purge-range {
    --fill: 0%;
    display: block;
    width: 100%;
    height: 8px;
    margin: 6px 0 12px;
    border-radius: 999px;
    background: linear-gradient(to left, var(--danger) var(--fill), var(--line) var(--fill));
    accent-color: var(--danger);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.purge-range:disabled { opacity: 0.45; cursor: not-allowed; }
.purge-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.purge-range::-moz-range-thumb {
    width: 18px; height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.purge-readout { margin: 0 0 12px; color: var(--ink-soft); }
.purge-readout output { font-weight: 700; color: var(--ink); }

/* پنجره‌ی خیلی باریکِ دسکتاپ (۹۰۱ تا ۱۰۲۰): منوی ادمین کل ۹ مورد دارد، پس کمی فشرده‌تر */
@media (min-width: 901px) and (max-width: 1020px) {
    .menu-btn,
    .menu-link { padding-inline: 4px; font-size: 0.82rem; }
    .nav-actions { gap: 8px; }
}

/* جمله‌ی هر عمل در صفحه‌ی اعمال کاربران */
.table.wrap td.col-text { white-space: normal; line-height: 1.9; min-width: 280px; }
@media (min-width: 1200px) {
    .card.xwide .table.wrap td.col-text { min-width: 340px; }
}

/* کادر مبلغ با عبارت «تومان» جلوی عدد (فرم پرداخت حقوق دبیر) */
.money-field {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}
.money-field:focus-within { border-color: var(--teal); outline: 3px solid var(--gold); outline-offset: 2px; }
.money-field input {
    width: 130px;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 8px 10px;
    font: inherit;
    text-align: left;
    background: transparent;
}
.money-field input:focus { outline: 0; }
.money-unit {
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-inline-start: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 0.88rem;
    white-space: nowrap;
}
@media (max-width: 900px) {
    .pay-form .money-field { flex: 1 1 100%; }
    .pay-form .money-field input { width: 100%; }
}

/* ---------- جستجوی لحظه‌ای دانش‌آموز (ثبت دانش‌آموز در دوره) ---------- */
.combo { position: relative; }
.combo input[type="search"] { width: 100%; }
.combo-list {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 4px);
    z-index: 30;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(27, 42, 65, 0.18);
}
.combo-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.combo-item span { color: var(--ink-soft); font-size: 0.88rem; }
.combo-item:hover,
.combo-item.active { background: var(--paper); outline: 2px solid var(--teal); outline-offset: -2px; }
.combo-empty { padding: 10px 12px; color: var(--ink-soft); }
.combo-selected {
    margin: 8px 0 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--ok-bg);
    color: var(--ok);
    font-weight: 700;
}
.combo-selected.error { background: var(--danger-bg); color: var(--danger); }

/* مبلغ بدهی که لینک است (طلب‌های آموزشگاه ← بدهی هر دوره) */
.debt-link {
    display: inline-block;
    font-weight: 700;
    color: var(--danger);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}
.debt-link:hover { background: var(--danger-bg); border-radius: 4px; }

/* ---------- جدول حضور و غیاب جلسه‌ها (صفحه‌ی جزئیات دوره) ----------
   با دانش‌آموز زیاد، جدول داخل کادرش اسکرول افقی می‌شود؛ اسم‌ها در چند خط می‌شکنند
   و ستون برچسب سمت راست هنگام اسکرول ثابت می‌ماند. */
.attendance-table th,
.attendance-table td { text-align: center; min-width: 96px; white-space: normal; line-height: 1.6; }
.attendance-table th:first-child { position: sticky; right: 0; z-index: 1; min-width: 110px; box-shadow: -1px 0 0 var(--line); }
.attendance-table thead th:first-child { background: #e9eef5; }
.attendance-table tbody th:first-child { background: var(--surface); }

/* ---------- صفحه‌ی اول: ورود ساده برای همه‌ی کاربران ---------- */
.entry,
.entry * { text-align: center; }

.entry {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 0 24px;
}

.entry h1 { margin: 0 0 12px; font-size: 2.1rem; line-height: 1.5; }

.entry-lead { margin: 0 0 32px; color: var(--ink-soft); font-size: 1.05rem; }

.entry-roles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.entry-role {
    display: block;
    padding: 26px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--teal);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.entry-role:hover,
.entry-role:focus-visible { border-top-color: var(--gold); color: var(--teal-dark); }

.entry-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 700px) {
    .entry { padding-top: 32px; }
    .entry h1 { font-size: 1.6rem; }
    .entry-roles { grid-template-columns: 1fr; }
}

/* ---------- طلب‌های آموزشگاه: دانش‌آموزی که امروز کلاس دارد (سبز) ---------- */
.table tr.row-today td { background: var(--ok-bg); }
.table tr.row-today td:first-child { box-shadow: inset -4px 0 0 var(--ok); }
.live-note { color: var(--ok); font-weight: 600; }
.legend-green { display: inline-block; width: 12px; height: 12px; background: var(--ok-bg); border: 1px solid var(--ok); vertical-align: middle; }
