/* =========================================================
   Grafday admin panel — "console" theme
   Dark surfaces, lime accent, mono eyebrow labels.
   ========================================================= */
:root {
    --bg: #0b0d0c;
    --bg-2: #101210;
    --surface: #141714;
    --surface-2: #191c19;
    --surface-3: #1f231f;
    --border: #232723;
    --border-2: #2e332e;
    --text: #e9ece6;
    --text-2: #b3b9b1;
    --muted: #7b827a;
    --accent: #d5f27e;
    --accent-2: #c3e463;
    --accent-ink: #151b05;
    --accent-soft: rgba(213, 242, 126, .07);
    --accent-line: rgba(213, 242, 126, .32);
    --red: #e99c9c;
    --red-soft: rgba(233, 156, 156, .09);
    --red-line: rgba(233, 156, 156, .3);
    --orange: #e9b27f;
    --orange-soft: rgba(233, 178, 127, .09);
    --yellow: #e4d283;
    --yellow-soft: rgba(228, 210, 131, .09);
    --blue: #98aedb;
    --blue-soft: rgba(152, 174, 219, .09);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar: 264px;
    --font: 'Vazirmatn', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.admin-body,
body.admin-login-page {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .9em; color: var(--text-2); }

svg.i {
    width: 16px; height: 16px; flex: none;
    stroke: currentColor; fill: none; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
svg.i.sm { width: 13px; height: 13px; }
.mono { font-family: var(--mono); letter-spacing: .06em; }
.ltr { direction: ltr; unicode-bidi: plaintext; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* =========================================================
   Shell: sidebar + main
   ========================================================= */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sb {
    position: sticky; top: 0; height: 100vh;
    background: var(--bg-2); border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 22px 16px 16px; overflow-y: auto; z-index: 60;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.sb-brand .bolt { color: var(--accent); width: 20px; height: 20px; }
.sb-brand .dot { color: var(--accent); }
.sb-brand img { max-height: 40px; max-width: 160px; width: auto; }
.sb { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.sb::-webkit-scrollbar { width: 6px; }
.sb::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
.sb-close { display: none; margin-inline-start: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }

.sb-ws { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); margin-bottom: 26px; }
.sb-ws .ico { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); flex: none; }
.sb-ws b { display: block; font-size: 12.5px; font-weight: 600; }
.sb-ws small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.sb-ws .lock { margin-inline-start: auto; color: var(--muted); width: 14px; height: 14px; }

.sb-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; color: var(--muted); padding: 0 10px 10px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; border: 1px solid transparent; transition: .15s; }
.sb-nav a:hover { background: var(--surface); color: var(--text); }
.sb-nav a.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.sb-nav a.active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-inline-start: auto; }
.sb-nav .count { margin-inline-start: auto; font-size: 11px; background: var(--red-soft); color: var(--red); border-radius: 20px; padding: 0 7px; line-height: 1.6; }
.sb-nav a.active .count { display: none; }

.sb-spark { margin-top: auto; padding: 22px 10px 14px; }
.sb-spark p { margin: 0 0 10px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }
.sb-spark p b { font-weight: 500; color: var(--text-2); }
.sb-spark .bars { display: flex; align-items: flex-end; gap: 4px; height: 40px; }
.sb-spark .bars span { flex: 1; background: #3a4136; border-radius: 1px; min-height: 2px; }
.sb-spark .bars span.hi { background: var(--accent); opacity: .75; }

.sb-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; transition: .15s; }
.sb-card:hover { border-color: var(--accent-line); }
.sb-card .ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); flex: none; }
.sb-card b { display: block; font-size: 12.5px; }
.sb-card small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.sb-card small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sb-card .arr { margin-inline-start: auto; color: var(--muted); }

.sb-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; margin-top: 8px; border-top: 1px solid var(--border); }
.sb-user > div { min-width: 0; }
.sb-user b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.sb-user a { margin-inline-start: auto; color: var(--muted); padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.sb-user a:hover { color: var(--red); background: var(--red-soft); }

.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; text-transform: uppercase; }
.avatar.sm { width: 28px; height: 28px; }

.sb-backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(11, 13, 12, .85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.crumb { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumb a:hover { color: var(--text); }
.crumb b { color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.crumb svg { width: 12px; height: 12px; flex: none; }
.top-r { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; flex: none; }
.top-r .sep { width: 1px; height: 16px; background: var(--border-2); }
.top-r .ver { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.top-r .pill { display: flex; align-items: center; gap: 6px; }
.top-r .pill:hover { color: var(--accent); }
.burger { display: none; background: none; border: 1px solid var(--border-2); border-radius: 7px; padding: 6px; color: var(--text-2); cursor: pointer; }
.content { padding: 34px 40px 64px; width: 100%; max-width: 1800px; }

/* =========================================================
   Page header
   ========================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--muted); margin: 0 0 6px; text-transform: uppercase; }
.title { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
.title .dot { color: var(--accent); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.back:hover { color: var(--accent); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
    font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #3d443c; background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-soft { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.btn-soft:hover { background: rgba(213, 242, 126, .12); border-color: var(--accent); }
.btn-danger { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: rgba(233, 156, 156, .15); border-color: var(--red); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn-icon { width: 30px; height: 30px; padding: 0; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   Cards
   ========================================================= */
.card { background: linear-gradient(180deg, var(--surface) 0%, #121512 100%); border: 1px solid var(--border); border-radius: var(--radius); position: relative; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.card-head.flat { border-bottom: 0; padding-bottom: 4px; }
.card-head > div { min-width: 0; }
.card-head .ico { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.card-head .ico.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.card-head h3 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.card-head .tag { margin-inline-start: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); padding-top: 4px; white-space: nowrap; }
.card-head .act { margin-inline-start: auto; flex: none; }
.card-body { padding: 24px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.card-foot .note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.card-foot .btns { display: flex; gap: 8px; margin-inline-start: auto; }
.card-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .16em; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.grid-main > aside { position: sticky; top: 76px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.grid-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.narrow { max-width: 1000px; }

.section-title { display: flex; align-items: center; gap: 12px; margin: 34px 0 6px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 20px; font-weight: 800; }
.section-title .r { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.section-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }

/* =========================================================
   Chips & badges
   ========================================================= */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--border-2); color: var(--text-2); background: var(--surface-2); text-transform: uppercase; white-space: nowrap; }
.chip.fa { font-family: var(--font); letter-spacing: 0; font-size: 12px; text-transform: none; }
.chip.accent { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 20px; border: 1px solid; white-space: nowrap; line-height: 1.7; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.draft { color: var(--yellow); border-color: rgba(228, 210, 131, .3); background: var(--yellow-soft); }
.badge.off { color: var(--muted); border-color: var(--border-2); background: var(--surface-2); }
.badge.new { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.badge.info { color: var(--blue); border-color: rgba(152, 174, 219, .3); background: var(--blue-soft); }
.badge.warn { color: var(--orange); border-color: rgba(233, 178, 127, .3); background: var(--orange-soft); }
a.badge:hover { filter: brightness(1.15); }

/* =========================================================
   Stats
   ========================================================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 24px 20px; display: flex; flex-direction: column; gap: 10px; transition: .15s; --c: var(--accent); min-height: 170px; }
a.stat:hover { border-color: var(--border-2); background: var(--surface-2); }
.stat .lbl { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.stat .lbl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.stat .lbl svg { margin-inline-start: auto; color: var(--muted); }
.stat .row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stat .num { font-size: 52px; font-weight: 300; line-height: 1.2; color: var(--c); }
.stat.plain .num { color: var(--text); }
.stat .sub { font-size: 13.5px; color: var(--muted); }
.stat .foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: auto; gap: 8px; }
.stat .foot i { display: block; width: 64px; height: 1px; background: var(--border-2); }
.stat .foot .hot { color: var(--c); }

/* =========================================================
   Lists (dashboard activity)
   ========================================================= */
.rows { display: flex; flex-direction: column; }
.rows .r { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); font-size: 14.5px; min-width: 0; }
.rows .r:last-child { border-bottom: 0; }
.rows a.r:hover { background: rgba(255, 255, 255, .015); }
.rows .r > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .r .t { font-weight: 500; }
.rows .r .s { color: var(--muted); font-size: 13px; }
.rows .r .d { margin-inline-start: auto; color: var(--muted); font-size: 13px; white-space: nowrap; flex: none; }
.rows .r.unread .t { color: var(--accent); }
.rows .r.unread::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.empty-inline { padding: 22px 20px; color: var(--muted); font-size: 13px; text-align: center; }

/* =========================================================
   Toolbar / filters
   ========================================================= */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar form { display: contents; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; top: 50%; transform: translateY(-50%); right: 11px; color: var(--muted); pointer-events: none; }
.admin-body .search input { padding-right: 34px; height: 36px; }
.admin-body .toolbar select { height: 36px; width: auto; min-width: 180px; max-width: 280px; padding-top: 0; padding-bottom: 0; }
.toolbar .r { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }

/* =========================================================
   Tables
   ========================================================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 13px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255, 255, 255, .012); }
.tbl td { padding: 16px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(213, 242, 126, .025); }
.tbl .c { text-align: center; }
.tbl .m { color: var(--muted); font-size: 12.5px; }
.tbl .n { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.tbl .nowrap { white-space: nowrap; }
.tbl .strong { font-weight: 600; }
.tbl a.strong:hover, .tbl a.link:hover { color: var(--accent); }
.tbl a.link { color: var(--accent); }
.tbl .ltr { direction: ltr; text-align: right; unicode-bidi: plaintext; }
.tbl .sub-line { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.tbl tr.unread td:first-child { box-shadow: inset -2px 0 0 var(--accent); }
.tbl tr.unread .strong { color: var(--accent); }
.tbl .sticky-act { position: sticky; left: 0; background: var(--surface); box-shadow: 8px 0 14px -10px rgba(0, 0, 0, .7); }
.row-act { display: flex; gap: 4px; justify-content: center; }
.row-act a, .row-act button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); border: 1px solid transparent; background: none; cursor: pointer; padding: 0; }
.row-act a:hover, .row-act button:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.row-act .del:hover { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.yes { color: var(--accent); }
.no { color: var(--border-2); }
.cell-flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb { width: 44px; height: 30px; border-radius: 5px; background: linear-gradient(135deg, #2b3327, #1a1f18); border: 1px solid var(--border-2); flex: none; object-fit: cover; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; padding: 3px 10px; border-radius: 6px; border: 1px solid rgba(152, 174, 219, .3); background: var(--blue-soft); color: var(--blue); font-size: 11.5px; }
.file-chip:hover { border-color: var(--blue); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { opacity: .75; direction: ltr; flex: none; }
.files-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pager .pp { display: flex; gap: 6px; }

/* =========================================================
   Empty state
   ========================================================= */
.empty { text-align: center; padding: 56px 24px; }
.empty .ei { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.empty .ei svg { width: 24px; height: 24px; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 13px; max-width: 460px; margin: 0 auto 18px; }

/* =========================================================
   Alerts (Django messages)
   ========================================================= */
.alert { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); font-size: 13px; margin-bottom: 20px; }
.alert-error, .alert.err { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.alert-warning { border-color: rgba(233, 178, 127, .3); background: var(--orange-soft); color: var(--orange); }
.alert-info { border-color: rgba(152, 174, 219, .3); background: var(--blue-soft); color: var(--blue); }
.alert ul { margin: 0; padding: 0; list-style: none; }

/* =========================================================
   Forms
   ========================================================= */
.field { margin-bottom: 20px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .lbl-row { display: flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.lbl-row { justify-content: space-between; }
.lbl-row span, .field > label .opt { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.req { color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.hint code { color: var(--text-2); }
.field-error { font-size: 12px; color: var(--red); margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.card-body > .form-grid:last-child > .field:last-child,
.card-body > .form-grid:last-child > .field:nth-last-child(2):not(.full):has(+ .field:not(.full)) { margin-bottom: 0; }

.admin-body :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]), select, textarea),
.admin-login-page :where(input:not([type=checkbox]):not([type=hidden])) {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    min-height: 40px;
}
.admin-body input::placeholder, .admin-body textarea::placeholder, .admin-login-page input::placeholder { color: #5c635b; }
.admin-body input:focus, .admin-body select:focus, .admin-body textarea:focus, .admin-login-page input:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px rgba(213, 242, 126, .07);
}
.admin-body input:disabled, .admin-body select:disabled, .admin-body textarea:disabled { opacity: .7; cursor: not-allowed; }
.admin-body :where(textarea) { min-height: 110px; resize: vertical; line-height: 1.8; }
.admin-body :where(select) {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b827a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px;
}
.admin-body select option { background: var(--surface-2); color: var(--text); }
.admin-body input.admin-input--ltr, .admin-body input[type=url], .admin-body input[type=email], .admin-body .ltr-in { direction: ltr; text-align: left; }
.admin-body input[type=number] { direction: ltr; text-align: right; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; right: 12px; color: var(--muted); pointer-events: none; z-index: 1; }
.admin-body .input-wrap input { padding-right: 38px; }
.admin-body .input-wrap.has-kbd input { padding-left: 74px; }
.input-wrap .kbd { position: absolute; left: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 7px; pointer-events: none; }
.admin-body .input-wrap .admin-datepicker { direction: ltr; text-align: right; cursor: pointer; letter-spacing: .03em; font-variant-numeric: tabular-nums; }

/* Choice cards (radio/checkbox) */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; display: block; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; transition: .15s; background: var(--bg); }
.choice:hover { border-color: #3d443c; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ci { color: var(--text-2); margin-bottom: 10px; display: block; }
.choice b { display: block; font-size: 13.5px; padding-inline-end: 22px; }
.choice small { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; }
.choice .radio { position: absolute; top: 14px; left: 14px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-2); transition: .15s; }
.choice:has(input:checked) { border-color: var(--accent-line); background: linear-gradient(135deg, rgba(213, 242, 126, .09), rgba(213, 242, 126, .02)); }
.choice:has(input:checked) .ci { color: var(--accent); }
.choice:has(input:checked) .radio { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 8px var(--accent); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(213, 242, 126, .15); }
.choice .rec { position: absolute; top: -8px; right: 12px; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; background: var(--accent); color: var(--accent-ink); padding: 0 6px; border-radius: 3px; font-weight: 600; line-height: 1.7; }

/* Toggle rows with switch */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle > span:first-child { min-width: 0; }
.toggle b { display: block; font-size: 13px; font-weight: 600; }
.toggle small { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; }
.toggle input[type=checkbox], input[type=checkbox].switch {
    appearance: none; -webkit-appearance: none; flex: none; margin: 0;
    position: relative; width: 36px; height: 20px; border-radius: 20px;
    background: var(--surface-3); border: 1px solid var(--border-2); cursor: pointer; transition: .2s;
}
.toggle input[type=checkbox]::before, input[type=checkbox].switch::before {
    content: ""; position: absolute; width: 14px; height: 14px; top: 2px; right: 2px;
    background: var(--muted); border-radius: 50%; transition: .2s;
}
.toggle input[type=checkbox]:checked, input[type=checkbox].switch:checked { background: var(--accent-soft); border-color: var(--accent-line); }
.toggle input[type=checkbox]:checked::before, input[type=checkbox].switch:checked::before { right: 18px; background: var(--accent); }
.toggle input[type=checkbox]:focus-visible { box-shadow: 0 0 0 3px rgba(213, 242, 126, .15); }

/* Check grid (permissions, groups, tags) */
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; background: var(--bg); transition: .15s; }
.check:hover { border-color: #3d443c; }
.check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none; border: 1.5px solid var(--border-2); border-radius: 4px; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; transition: .15s; }
.check input::after { content: ""; width: 8px; height: 4px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { box-shadow: 0 0 0 3px rgba(213, 242, 126, .15); }
.check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-opt { cursor: pointer; }
.tag-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tag-opt span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 12px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border-2); color: var(--text-2); transition: .15s; }
.tag-opt span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tag-color, var(--muted)); }
.tag-opt:hover span { border-color: #3d443c; }
.tag-opt input:checked + span { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.tag-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(213, 242, 126, .15); }

/* Upload dropzone (JS hooks: .admin-upload, __input, __preview, __filename, .has-file, .is-dragover) */
.admin-upload { position: relative; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); padding: 18px; display: flex; align-items: center; gap: 14px; background: var(--bg); cursor: pointer; transition: .15s; min-height: 84px; }
.admin-upload:hover, .admin-upload.is-dragover { border-color: var(--accent-line); background: var(--accent-soft); }
.admin-upload.has-file { border-style: solid; }
.admin-upload__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.admin-upload__icon { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--accent); background: var(--surface); flex: none; }
.admin-upload__text { min-width: 0; flex: 1; }
.admin-upload__title { display: block; font-size: 13px; font-weight: 600; }
.admin-upload__hint { display: block; font-size: 12px; color: var(--muted); }
.admin-upload__filename { display: block; font-size: 12px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-upload__filename:empty { display: none; }
.admin-upload__preview { display: none; flex: none; }
.admin-upload.has-file .admin-upload__preview { display: block; }
.admin-upload__preview img { display: block; width: 104px; height: 64px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border-2); }
.admin-upload--tall .admin-upload__preview img { width: 52px; height: 72px; }
.admin-upload--avatar .admin-upload__preview img { width: 60px; height: 60px; border-radius: 50%; }
.admin-upload--logo .admin-upload__preview img { width: 110px; height: 56px; object-fit: contain; background: rgba(255, 255, 255, .04); padding: 6px; }
.admin-upload--cover { flex-direction: column; align-items: stretch; text-align: center; }
.admin-upload--cover .admin-upload__icon { margin: 0 auto; }
.admin-upload--cover .admin-upload__preview img { width: 100%; height: 150px; }
.admin-upload--big { flex-direction: column; text-align: center; padding: 34px 18px; }

/* =========================================================
   Side status panel ("engine")
   ========================================================= */
.engine { padding: 18px 20px; }
.engine .ring { width: 118px; height: 118px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(213, 242, 126, .08) 0%, transparent 70%); position: relative; }
.engine .ring::before, .engine .ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--border-2); }
.engine .ring::after { inset: 16px; border-color: #2a3027; }
.engine .core { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #2a3320, #1a2013); border: 1px solid var(--accent-line); color: var(--accent); z-index: 1; font-size: 20px; font-weight: 700; overflow: hidden; }
.engine .core.round { border-radius: 50%; }
.engine .core svg { width: 24px; height: 24px; }
.engine .core img { width: 100%; height: 100%; object-fit: cover; }
.engine h4 { margin: 0; text-align: center; font-size: 14px; }
.engine > p { margin: 2px 0 16px; text-align: center; font-size: 12px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 500; display: flex; align-items: center; gap: 6px; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.kv b.on::before, .kv b.offd::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.kv b.on::before { background: var(--accent); }
.kv b.offd::before { background: var(--muted); }
.kv.block { display: block; }
.kv.block span { display: block; margin-bottom: 4px; }
.kv.block div { color: var(--text-2); line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }

/* =========================================================
   Related items (speakers, videos, gallery, sponsors)
   ========================================================= */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 16px 20px 20px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); min-width: 0; }
.item .ph { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #2c3528, #1a1f18); border: 1px solid var(--border-2); flex: none; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.item .ph img { width: 100%; height: 100%; object-fit: cover; }
.item .ph.sq { border-radius: 7px; }
.item .ph.wide { width: 60px; border-radius: 6px; }
.item .ph.logo img { object-fit: contain; padding: 4px; }
.item > div { min-width: 0; flex: 1; }
.item b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .row-act { flex: none; }
.items-empty { padding: 22px 20px; color: var(--muted); font-size: 13px; text-align: center; }

/* =========================================================
   Form builder
   ========================================================= */
.field-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 8px; transition: .15s; }
.field-row:last-child { margin-bottom: 0; }
.field-row:hover { border-color: var(--border-2); }
.field-row .grip { color: #4a5149; }
.field-row .no { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 22px; flex: none; }
.field-row > div { min-width: 0; flex: 1; }
.field-row b { font-size: 13px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-row small { font-size: 11.5px; color: var(--muted); }
.type-tag { font-size: 11px; color: var(--blue); background: var(--blue-soft); border: 1px solid rgba(152, 174, 219, .25); padding: 0 8px; border-radius: 4px; white-space: nowrap; }
.field-row .req-tag { font-size: 11px; color: var(--accent); white-space: nowrap; }

.preview { padding: 22px 20px; }
.preview h3 { font-size: 18px; margin-bottom: 6px; }
.preview .pv-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.preview .pv-desc { font-size: 12.5px; color: var(--blue); background: var(--blue-soft); border: 1px dashed rgba(152, 174, 219, .3); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; white-space: pre-line; }
.preview .pv-file { border: 1px dashed var(--border-2); border-radius: var(--radius-sm); padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.preview .pv-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.preview .pv-opt input { accent-color: var(--accent); }

/* =========================================================
   Message detail
   ========================================================= */
.msg-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.msg-meta div { padding: 14px 20px; border-right: 1px solid var(--border); min-width: 0; }
.msg-meta div:first-child { border-right: 0; }
.msg-meta span { display: block; font-size: 11.5px; color: var(--muted); }
.msg-meta b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.msg-meta a:hover { color: var(--accent); }
.msg-subject { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-subject span { font-size: 11.5px; color: var(--muted); }
.msg-subject b { font-size: 15px; }
.msg-body { padding: 22px 20px; font-size: 14px; line-height: 2.1; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }

/* =========================================================
   Modals & drawer
   ========================================================= */
.modal { position: fixed; inset: 0; background: rgba(5, 6, 5, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal.active { display: flex; }
.modal-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.modal-box.wide { max-width: 600px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-box .mb { padding: 24px 22px 18px; text-align: center; }
.modal-box .mi { width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.modal-box .mi svg { width: 22px; height: 22px; }
.modal-box h3 { margin: 0 0 6px; font-size: 16px; }
.modal-box .mb p { margin: 0; font-size: 13px; color: var(--muted); }
.modal-box .mf { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 22px 20px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; }
.modal-scroll { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 480px; max-width: 100%; background: var(--surface); border-right: 1px solid var(--border-2); z-index: 1001; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
.drawer.active { transform: none; }
.drawer .dh { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer .dh h3 { margin: 0; font-size: 15px; }
.drawer .dh p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer .dh .btn { margin-inline-start: auto; flex: none; }
.drawer .db { padding: 6px 20px 20px; overflow: auto; flex: 1; }
.drawer .db .kv:first-child { border-top: 0; }
.drawer .loading { text-align: center; color: var(--muted); padding: 50px 0; }
.drawer .files { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.drawer .files a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--bg); font-size: 12.5px; }
.drawer .files a:hover { border-color: var(--accent-line); }
.drawer .files a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .files a small { color: var(--muted); flex: none; }

/* =========================================================
   Login
   ========================================================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { position: relative; border-right: 1px solid var(--border); background: radial-gradient(ellipse at 40% 45%, rgba(213, 242, 126, .07), transparent 60%), var(--bg-2); padding: 40px; display: flex; flex-direction: column; overflow: hidden; }
.login-art .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(circle at 45% 45%, #000 0%, transparent 65%); mask-image: radial-gradient(circle at 45% 45%, #000 0%, transparent 65%); opacity: .6; }
.login-art > * { position: relative; }
.login-art .top-line { display: flex; justify-content: space-between; align-items: center; }
.login-art .engine { margin: auto 0 0; padding: 0; }
.login-art .engine .ring { margin: 0 0 30px; }
.login-art h2 { font-size: 38px; font-weight: 800; line-height: 1.4; margin: 0 0 10px; letter-spacing: -.02em; }
.login-art h2 span { color: var(--accent); }
.login-art .big p:last-child { color: var(--muted); max-width: 380px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form .box { width: 100%; max-width: 380px; }
.login-form .sb-brand { padding: 0 0 30px; }
.login-form h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.login-form h1 span { color: var(--accent); }
.login-form .sub { color: var(--muted); margin: 0 0 28px; font-size: 13px; }
.login-form .btn { width: 100%; height: 44px; font-size: 14px; margin-top: 4px; }
.login-form .foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--muted); }
.login-form .foot a:hover { color: var(--accent); }
.admin-login-page .input-wrap input { padding-right: 38px; }

/* =========================================================
   Jalali datepicker
   ========================================================= */
jdp-container {
    background: var(--surface) !important;
    border: 1px solid var(--border-2) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .55) !important;
    font-family: var(--font) !important;
    color: var(--text) !important;
    overflow: hidden;
}
jdp-container .jdp-months, jdp-container .jdp-years { color: var(--text) !important; fill: var(--text) !important; }
jdp-container .jdp-month, jdp-container .jdp-month input, jdp-container .jdp-month select,
jdp-container .jdp-time, jdp-container .jdp-time input, jdp-container .jdp-time select,
jdp-container .jdp-year, jdp-container .jdp-year input, jdp-container .jdp-year select {
    background: transparent !important; color: var(--text) !important; -webkit-text-fill-color: var(--text) !important; opacity: 1 !important;
    min-height: 0 !important; border: 0 !important; box-shadow: none !important; padding: 0 4px !important; width: auto !important;
}
jdp-container .jdp-year input, jdp-container .jdp-year select { min-width: 4.5ch; text-align: center; }
jdp-container .jdp-days { min-height: 210px; }
jdp-container .jdp-day, jdp-container .jdp-day-name { color: var(--text) !important; -webkit-text-fill-color: var(--text) !important; opacity: 1; }
jdp-container .jdp-day.not-in-month { opacity: .35 !important; }
jdp-container .jdp-day.disabled-day { opacity: .2 !important; }
jdp-container .jdp-icon-minus, jdp-container .jdp-icon-plus { border-color: var(--border-2) !important; background: var(--surface-2); color: var(--accent); }
jdp-container .jdp-icon-minus svg, jdp-container .jdp-icon-plus svg { stroke: var(--accent); fill: var(--accent); }
jdp-container .jdp-day-name { background-color: var(--accent-soft) !important; color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important; }
jdp-container .jdp-day.today { border-color: var(--accent-line) !important; }
jdp-container .jdp-day.selected { background-color: var(--accent) !important; color: var(--accent-ink) !important; -webkit-text-fill-color: var(--accent-ink) !important; }
jdp-container .jdp-day.holly-day, jdp-container .jdp-day.last-week, jdp-container .jdp-day-name.last-week { color: var(--red) !important; -webkit-text-fill-color: var(--red) !important; }
jdp-container .jdp-day:not(.disabled-day):hover { background: var(--accent-soft) !important; }
jdp-container .jdp-btn-close, jdp-container .jdp-btn-empty, jdp-container .jdp-btn-today { background: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 600; border-radius: 8px !important; }
jdp-container .jdp-time-container .jdp-time select { background: var(--surface-2) !important; }
jdp-container .jdp-time-container .jdp-time:after { color: var(--accent); }
@media only screen and (max-width: 481px) { jdp-overlay { background-color: rgba(0, 0, 0, .55) !important; } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
    .top-r .ver, .top-r .sep { display: none; }
    .grid-main, .grid-builder { grid-template-columns: minmax(0, 1fr); }
    .grid-main > aside { position: static; }
}
@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sb { position: fixed; top: 0; bottom: 0; right: 0; width: 280px; transform: translateX(100%); transition: transform .25s ease; }
    body.nav-open .sb { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
    body.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55; }
    .sb-close { display: grid; }
    .burger { display: grid; place-items: center; }
    .top { padding: 0 16px; }
    .top-r .ver, .top-r .sep, .top-r .pill { display: none; }
    .content { padding: 22px 16px 60px; }
    .stat { min-height: 0; }
    .stat .num { font-size: 40px; }
    .grid-2, .form-grid, .checks { grid-template-columns: minmax(0, 1fr); }
    .card-body > .form-grid:last-child > .field:nth-last-child(2):not(.full) { margin-bottom: 20px; }
    .choices, .choices.two { grid-template-columns: minmax(0, 1fr); }
    .msg-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .msg-meta div:nth-child(3) { border-right: 0; }
    .msg-meta div:nth-child(n+3) { border-top: 1px solid var(--border); }
    .login { grid-template-columns: 1fr; }
    .login-art { display: none; }
    .title { font-size: 23px; }
    .search { max-width: none; min-width: 100%; }
    .admin-body .toolbar select { max-width: none; flex: 1; }
    .page-head .actions { width: 100%; }
}
@media (max-width: 520px) {
    .stats { grid-template-columns: minmax(0, 1fr); }
    .card-head .tag { display: none; }
    .card-foot .btns { width: 100%; }
    .card-foot .btns .btn { flex: 1; }
}

/* English mono labels keep left-to-right word order inside the RTL layout */
.card-head .tag, .card-label, .chip:not(.fa), .top-r .ver, .input-wrap .kbd { direction: ltr; unicode-bidi: isolate; }
.eyebrow { direction: ltr; unicode-bidi: isolate; text-align: right; }
