/* MindLab admin — same ink palette as the site, RTL, Persian UI. Dark only. */
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/vazirmatn-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/vazirmatn-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/vazirmatn-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/vazirmatn-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/vazirmatn-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/vazirmatn-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink-0: #0b0f13; --ink-1: #10161b; --ink-2: #172027; --ink-3: #1e2931;
  --line: #222d35; --line-2: #2f3c46;
  --text: #e4ebee; --muted: #8d9ba4; --faint: #5b6973;
  --mint: #a9f0d1; --mint-dim: #6fb89a;
  --bad: #ff8f8f; --warn: #efc777;
  --a-lead: var(--mint); --a-neuro: #b9a4ff; --a-bio: #76e0cf; --a-fin: #efc777; --a-phys: #86b6ff;
  --f-ui: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 8px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body.adm { margin: 0; background: var(--ink-0); color: var(--text); font: 400 15px/1.7 var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 4px; }
h1, h2 { margin: 0; font-weight: 500; line-height: 1.3; }
p { margin: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mark { width: 28px; height: 28px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mark .mk-l, .mark .mk-r { stroke: var(--mint); stroke-width: 2.2; }
.mark .mk-n { stroke: var(--mint); stroke-width: 1.2; opacity: .55; }
.mark .mk-d circle { fill: var(--mint); }

.adm-wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .adm-wrap { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); } }

/* top bar */
.adm-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ink-0) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.adm-top-in { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.adm-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.adm-brand small { font-weight: 400; color: var(--muted); font-size: 13px; margin-inline-start: 4px; }
.adm-nav { display: flex; gap: 4px; }
.adm-nav a { padding: 6px 14px; border-radius: 99px; color: var(--muted); font-size: 14px; transition: background .2s, color .2s; }
.adm-nav a:hover { color: var(--text); background: var(--ink-2); }
.adm-nav a[aria-current="page"] { background: var(--text); color: var(--ink-0); }
.adm-user { display: flex; gap: 4px; margin-inline-start: auto; }
.adm-user form { margin: 0; }
.ghost { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; transition: color .2s, background .2s; }
.ghost:hover { color: var(--text); background: var(--ink-2); }
@media (max-width: 720px) {
  .adm-top-in { gap: 8px; padding-block: 8px; }
  .adm-brand small, .ghost span { display: none; }
  .adm-nav { order: 3; width: 100%; justify-content: space-between; }
  .adm-nav a { flex: 1; text-align: center; }
}

.adm-main { padding-block: 32px 96px; display: grid; gap: 24px; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.head-row h1 { font-size: 28px; font-weight: 700; letter-spacing: 0; }
.head-row h1 small { font: 500 15px/1 var(--f-ui); color: var(--faint); margin-inline-start: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn-pri, .btn-sec, .btn-file { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 99px; border: 0; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .2s, border-color .2s, transform .15s; }
.btn-pri { background: var(--mint); color: var(--ink-0); }
.btn-pri:hover { background: #c6f7e2; }
.btn-pri:active { transform: translateY(1px); }
.btn-pri:disabled { opacity: .6; cursor: progress; }
.btn-sec, .btn-file { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-sec:hover, .btn-file:hover { box-shadow: inset 0 0 0 1px var(--muted); }

.flash { padding: 12px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--mint) 12%, var(--ink-1)); color: var(--mint); border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent); }
.err { padding: 12px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--bad) 10%, var(--ink-1)); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }

/* login */
.login { width: 100%; max-width: 380px; margin: 8vh auto 0; display: grid; gap: 20px; }
.login.wide { max-width: 640px; }
.login-mark .mark { width: 56px; height: 56px; }
.login h1 { font-size: 24px; }
.login-form { display: grid; gap: 16px; }
.login-form .btn-pri { width: 100%; margin-top: 4px; }
.login pre { direction: ltr; text-align: left; overflow-x: auto; padding: 16px; border-radius: var(--r); background: var(--ink-1); border: 1px solid var(--line); font: 13px/1.7 var(--f-mono); color: var(--mint); }
.login code { font-family: var(--f-mono); color: var(--mint); }

/* dashboard */
.kpis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpis li { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 104px; padding: 18px 20px; border-radius: 16px; background: var(--ink-1); border: 1px solid var(--line); }
.kpis b { font: 700 34px/1.15 var(--f-ui); letter-spacing: 0; font-variant-numeric: normal; }
.kpis li > div { display: grid; gap: 2px; min-width: 0; }
.kpis span { font-size: 15px; font-weight: 600; }
.kpis small { color: var(--muted); font-size: 13px; line-height: 1.55; }
.kpis li.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.kpis li.warn b { color: var(--warn); }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr; } .kpis li { min-height: 0; } }
.panel { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--ink-1); display: grid; gap: 16px; }
.panel h2 { font-size: 16px; font-weight: 700; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rows a { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.rows a:hover b { color: var(--mint); }
.rows .date { font-size: 13px; color: var(--mint-dim); }
@media (max-width: 640px) { .rows a { grid-template-columns: 1fr; gap: 2px; } }
.faces { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.faces a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 12px; background: var(--ink-0); border: 1px solid var(--line); font-size: 14px; font-weight: 500; transition: border-color .2s, background .2s; }
.faces a:hover { border-color: var(--warn); background: var(--ink-2); }
.faces img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }

/* tables */
.search { height: 42px; width: 220px; max-width: 100%; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--ink-1); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; min-width: 760px; }
.tbl th { text-align: start; font: 500 12px/1 var(--f-ui); color: var(--faint); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--ink-1); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--ink-1); }
.t-ph { width: 56px; }
.t-ph img { width: 40px; height: 50px; border-radius: 5px; object-fit: cover; }
.t-ph.poster img { width: 40px; height: 60px; object-position: top; }
.t-name { display: block; font-weight: 500; }
.t-name:hover { color: var(--mint); }
.t-sub { display: block; font-size: 13px; color: var(--muted); }
.t-tags { max-width: 260px; }
.t-tags span { display: inline-block; margin: 2px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-2); font: 12px/1.6 var(--f-mono); color: var(--muted); }
.t-links { white-space: nowrap; }
.lk { display: inline-grid; place-items: center; width: 26px; height: 26px; }
.lk.on { color: var(--mint); }
.lk.off { color: var(--line-2); }
.t-date b { display: block; font-weight: 500; font-size: 14px; }
.t-date span { font: 12px var(--f-mono); color: var(--faint); }
.t-act { white-space: nowrap; text-align: end; }
.t-act a { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); }
.t-act a:hover { background: var(--ink-3); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--a, var(--mint)); }
.a-lead { --a: var(--a-lead); } .a-neuro { --a: var(--a-neuro); } .a-bio { --a: var(--a-bio); } .a-fin { --a: var(--a-fin); } .a-phys { --a: var(--a-phys); }
.st { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.st.on, .st.next { background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); }
.st.off { background: var(--ink-3); color: var(--muted); }
.st.past { color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-2); }

/* forms */
.form { display: grid; gap: 20px; }
fieldset { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
legend { padding: 0 8px; font-weight: 500; color: var(--mint-dim); font-size: 14px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
@media (max-width: 720px) { .fgrid { grid-template-columns: 1fr; } fieldset { padding: 16px; } }
.fld { display: grid; gap: 6px; min-width: 0; align-content: start; }
.fld.wide { grid-column: 1 / -1; }
.fld > label, .lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.fld > label em { color: var(--mint); font-style: normal; }
.fld > label .ic { width: 16px; height: 16px; }
.fld input:not([type="checkbox"]):not([type="file"]), .fld select, .fld textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--ink-1);
  transition: border-color .2s, background .2s;
}
.fld textarea { resize: vertical; line-height: 1.7; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--mint-dim); background: var(--ink-2); }
.fld input:invalid:not(:placeholder-shown) { border-color: color-mix(in srgb, var(--bad) 60%, var(--line-2)); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--faint); }
.hint { font-size: 12.5px; color: var(--faint); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--mint); }
.check.small { font-size: 13px; color: var(--muted); }

.tagbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; min-height: 44px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--ink-1); }
.tagbox:focus-within { border-color: var(--mint-dim); }
.tag-list { list-style: none; margin: 0; padding: 0; display: contents; }
.tag-list li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 99px; background: var(--ink-3); font: 13px/1.5 var(--f-mono); }
[dir="rtl"] .tag-list li { padding: 3px 10px 3px 4px; }
.tag-list button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.tag-list button:hover { background: var(--line-2); color: var(--text); }
.tagbox input[type="text"] { flex: 1; min-width: 160px; border: 0 !important; background: none !important; min-height: 32px !important; padding: 4px 6px !important; }

.imgbox { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.img-prev { width: 120px; border-radius: 6px; overflow: hidden; background: var(--ink-1); border: 1px dashed var(--line-2); display: grid; place-items: center; flex: none; }
.img-prev.pt { aspect-ratio: 4/5; }
.img-prev.sq { aspect-ratio: 1; width: 96px; border-radius: 50%; }
.img-prev.free { min-height: 150px; }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-prev.free img { height: auto; }
.img-prev .ph { font-size: 12px; color: var(--faint); padding: 8px; text-align: center; }
.img-ctl { display: grid; gap: 10px; justify-items: start; flex: 1; min-width: 200px; }
.img-msg { font-size: 13px; color: var(--muted); }
.img-msg.ok { color: var(--mint); }
.img-msg.bad { color: var(--bad); }

.form-foot { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--ink-0) 70%, transparent); }
.danger { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.danger button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: none; color: var(--bad); cursor: pointer; font-size: 13.5px; }
.danger button:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }
