/* ZelvanooTech design system — Crystal Glass. One stylesheet; themes are CSS-variable sets (data-theme on <html>).
   Logical properties are used everywhere so RTL (Arabic) mirrors correctly without a second file. */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Naskh Arabic", "Helvetica Neue", Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

/* ---------- Themes ---------- */
:root, [data-theme="crystal-blue"] {
  color-scheme: dark;
  --bg-0: #050b1f; --bg-1: #0a1a3f; --bg-2: #0b2a63;
  --surface: rgba(255,255,255,.07); --surface-2: rgba(255,255,255,.11); --surface-solid: #0d1f4a;
  --border: rgba(147,197,253,.22); --border-strong: rgba(147,197,253,.4);
  --text: #eaf2ff; --muted: #a9bddf; --faint: #7f95bf;
  --primary: #3b82f6; --primary-2: #1d4ed8; --on-primary: #fff; --accent: #22d3ee;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --info: #7dd3fc;
  --shadow: 0 18px 50px rgba(2,8,30,.55); --glow: 0 0 0 1px rgba(96,165,250,.25), 0 10px 40px rgba(59,130,246,.25);
  --orb-1: rgba(59,130,246,.35); --orb-2: rgba(34,211,238,.22);
  --input-bg: rgba(5,11,31,.55); --hl: rgba(255,255,255,.18);
}
[data-theme="royal-violet"] {
  color-scheme: dark;
  --bg-0: #0c0620; --bg-1: #1a0d42; --bg-2: #2c1170;
  --surface: rgba(255,255,255,.07); --surface-2: rgba(255,255,255,.12); --surface-solid: #1c0f46;
  --border: rgba(196,181,253,.24); --border-strong: rgba(196,181,253,.45);
  --text: #f3edff; --muted: #c4b5e8; --faint: #9c8cc7;
  --primary: #8b5cf6; --primary-2: #6d28d9; --on-primary: #fff; --accent: #e879f9;
  --ok: #4ade80; --warn: #fbbf24; --bad: #fb7185; --info: #c4b5fd;
  --shadow: 0 18px 50px rgba(10,3,30,.6); --glow: 0 0 0 1px rgba(167,139,250,.28), 0 10px 40px rgba(139,92,246,.28);
  --orb-1: rgba(139,92,246,.38); --orb-2: rgba(232,121,249,.2);
  --input-bg: rgba(12,6,32,.55);
}
[data-theme="crystal-light"] {
  color-scheme: light;
  --bg-0: #e9f1ff; --bg-1: #f6faff; --bg-2: #dbe9ff;
  --surface: rgba(255,255,255,.72); --surface-2: rgba(255,255,255,.9); --surface-solid: #ffffff;
  --border: rgba(37,99,235,.18); --border-strong: rgba(37,99,235,.38);
  --text: #0b1b3a; --muted: #43587f; --faint: #6b7fa6;
  --primary: #2563eb; --primary-2: #1e40af; --on-primary: #fff; --accent: #0891b2;
  --ok: #047857; --warn: #b45309; --bad: #b91c1c; --info: #0369a1;
  --shadow: 0 16px 40px rgba(30,64,175,.14); --glow: 0 0 0 1px rgba(37,99,235,.2), 0 10px 30px rgba(37,99,235,.16);
  --orb-1: rgba(59,130,246,.22); --orb-2: rgba(34,211,238,.2);
  --input-bg: rgba(255,255,255,.95); --hl: rgba(255,255,255,.9);
}
[data-theme="emerald-glass"] {
  color-scheme: dark;
  --bg-0: #03120d; --bg-1: #06251b; --bg-2: #0a3a2a;
  --surface: rgba(255,255,255,.07); --surface-2: rgba(255,255,255,.11); --surface-solid: #0a2d21;
  --border: rgba(110,231,183,.22); --border-strong: rgba(110,231,183,.42);
  --text: #e9fff6; --muted: #a3d4c0; --faint: #78a592;
  --primary: #10b981; --primary-2: #047857; --on-primary: #03120d; --accent: #5eead4;
  --ok: #86efac; --warn: #fcd34d; --bad: #fca5a5; --info: #7dd3fc;
  --shadow: 0 18px 50px rgba(0,12,8,.6); --glow: 0 0 0 1px rgba(52,211,153,.28), 0 10px 40px rgba(16,185,129,.25);
  --orb-1: rgba(16,185,129,.32); --orb-2: rgba(94,234,212,.2);
  --input-bg: rgba(3,18,13,.55);
}
[data-theme="midnight-dark"] {
  color-scheme: dark;
  --bg-0: #000000; --bg-1: #08080e; --bg-2: #12121c;
  --surface: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.1); --surface-solid: #101018;
  --border: rgba(255,255,255,.14); --border-strong: rgba(255,255,255,.3);
  --text: #f4f4f8; --muted: #b0b0c4; --faint: #85859c;
  --primary: #6366f1; --primary-2: #4338ca; --on-primary: #fff; --accent: #a5b4fc;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --info: #93c5fd;
  --shadow: 0 18px 50px rgba(0,0,0,.7); --glow: 0 0 0 1px rgba(129,140,248,.25), 0 10px 40px rgba(99,102,241,.22);
  --orb-1: rgba(99,102,241,.28); --orb-2: rgba(165,180,252,.12);
  --input-bg: rgba(0,0,0,.5);
}
[data-contrast="high"] { --border: var(--border-strong); --muted: var(--text); --faint: var(--text); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background: radial-gradient(1200px 700px at 12% -10%, var(--bg-2), transparent 60%), linear-gradient(160deg, var(--bg-1), var(--bg-0) 70%);
  background-attachment: fixed;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; unicode-bidi: plaintext; }
.sr-only, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 100; background: var(--surface-solid); padding: .6em 1em; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.hide-sm { display: inline; }
.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ic-lg { width: 1.6em; height: 1.6em; } .ic-xl { width: 3rem; height: 3rem; }

/* ---------- Background orbs (cheap, GPU friendly) ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-orbs::before, .bg-orbs::after { content: ""; position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .9; }
.bg-orbs::before { background: var(--orb-1); inset-block-start: -18vmax; inset-inline-start: -10vmax; animation: float 22s var(--ease) infinite alternate; }
.bg-orbs::after { background: var(--orb-2); inset-block-end: -20vmax; inset-inline-end: -12vmax; animation: float 28s var(--ease) infinite alternate-reverse; }
@keyframes float { to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } }

/* ---------- Glass surfaces ---------- */
.glass {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hl);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--surface-solid); } }
.card { padding: 1.25rem; } .card h2 { margin-bottom: .75rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }

/* ---------- Buttons (3D) ---------- */
.btn {
  --b: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 600; color: var(--text); padding: .65em 1.15em; border-radius: 12px; min-height: 42px;
  background: linear-gradient(180deg, var(--b), var(--surface)); border: 1px solid var(--border);
  box-shadow: 0 3px 0 rgba(0,0,0,.25), inset 0 1px 0 var(--hl); transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .15s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25), inset 0 1px 0 var(--hl); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-3d { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 82%, white), var(--primary) 45%, var(--primary-2)); color: var(--on-primary); border-color: color-mix(in srgb, var(--primary) 60%, white); box-shadow: 0 4px 0 color-mix(in srgb, var(--primary-2) 70%, black), 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-3d:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--primary-2) 70%, black), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-danger { background: linear-gradient(180deg, #ef6b6b, #dc2626 50%, #b91c1c); color: #fff; border-color: #f87171; box-shadow: 0 4px 0 #7f1d1d, inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: .35em .8em; min-height: 34px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; text-decoration: none; position: relative; }
.icon-btn:hover { background: var(--surface); border-color: var(--border); }
.icon-btn.wa { color: #25d366; } .icon-btn.disabled { opacity: .35; cursor: not-allowed; }
.linklike { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: start; width: 100%; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.field label { font-weight: 600; font-size: .9rem; }
.req { color: var(--bad); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; padding: .65em .85em; width: 100%; min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
select option { background: var(--surface-solid); color: var(--text); }
::placeholder { color: var(--faint); }
input[type="checkbox"] { width: 1.15em; height: 1.15em; min-height: 0; accent-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: .6em; font-weight: 500 !important; cursor: pointer; }
.hint { color: var(--muted); } .error { color: var(--bad); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.filters .field label { font-size: .8rem; color: var(--muted); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem 1rem; margin: 0 0 1rem; }
legend { padding: 0 .5rem; font-weight: 650; }

/* ---------- Alerts & badges ---------- */
.alert { padding: .8em 1.1em; border-radius: 12px; border: 1px solid; margin-bottom: 1rem; background: var(--surface); }
.alert-success { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.alert-error { border-color: color-mix(in srgb, var(--bad) 70%, transparent); }
.alert-warning { border-color: color-mix(in srgb, var(--warn) 65%, transparent); }
.alert-info { border-color: color-mix(in srgb, var(--info) 55%, transparent); }
.badge { display: inline-block; padding: .15em .7em; border-radius: 999px; font-size: .78rem; font-weight: 650; border: 1px solid; white-space: nowrap; background: var(--surface); }
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.badge-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.badge-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.badge-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { padding: .7em .9em; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
table.data tbody tr:hover { background: var(--surface); }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); }
table.data td.r, table.data th.r { text-align: end; }
a.sort { color: inherit; text-decoration: none; } a.sort:hover { color: var(--accent); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ic { width: 2.5rem; height: 2.5rem; opacity: .6; margin-bottom: .5rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.pager ul { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.pager a, .pager .dis { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 .5em; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.pager a:hover { background: var(--surface-2); } .pager a.cur { background: var(--primary); color: var(--on-primary); border-color: transparent; } .pager .dis { opacity: .45; }
.pager-info { color: var(--muted); font-size: .88rem; margin: 0; }

/* ---------- Layout: admin shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; gap: 1rem; padding: 1rem; transition: grid-template-columns .25s var(--ease); }
.shell.collapsed { grid-template-columns: 76px 1fr; }
.sidebar { position: sticky; top: 1rem; align-self: start; height: calc(100vh - 2rem); display: flex; flex-direction: column; padding: 1rem .75rem; overflow-y: auto; overflow-x: hidden; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; padding: .25rem .6rem 1rem; }
.brand .ic { color: var(--accent); }
.sidebar nav { flex: 1; } .sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: flex; align-items: center; gap: .75rem; padding: .6em .8em; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 550; transition: background .15s, color .15s, transform .15s; }
.sidebar li a:hover { background: var(--surface); color: var(--text); }
.sidebar li a.active { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 40%, transparent), color-mix(in srgb, var(--primary) 18%, transparent)); color: var(--text); box-shadow: var(--glow); }
.sidebar .sep { height: 1px; background: var(--border); margin: .6rem .5rem; }
.side-site { margin-top: .75rem; justify-content: flex-start; }
.shell.collapsed .sidebar span, .shell.collapsed .brand-name { display: none; }
.shell.collapsed .sidebar li a, .shell.collapsed .brand { justify-content: center; padding-inline: 0; }
.main-col { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; min-height: var(--topbar-h); position: sticky; top: 1rem; z-index: 20; }
.quick-search { flex: 1; max-width: 420px; position: relative; display: flex; align-items: center; }
.quick-search .ic { position: absolute; inset-inline-start: .8em; color: var(--muted); pointer-events: none; }
.quick-search input { padding-inline-start: 2.4em; border-radius: 999px; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; }
.theme-form select { width: auto; min-height: 34px; padding: .25em .6em; border-radius: 10px; font-size: .88rem; }
.notif .dot { position: absolute; inset-block-start: -4px; inset-inline-end: -4px; background: var(--bad); color: #fff; font-size: .65rem; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center; font-weight: 700; padding: 0 4px; }
.menu { position: relative; }
.menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 190px; list-style: none; margin: 0; padding: .4rem; z-index: 30; }
.menu-list a, .menu-list .linklike { display: block; padding: .5em .8em; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu-list a:hover, .menu-list .linklike:hover { background: var(--surface-2); }
.menu-head { padding: .4em .8em; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.content { min-width: 0; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.crumbs { color: var(--muted); font-size: .85rem; margin-bottom: .25rem; } .crumbs a { color: var(--muted); }

/* ---------- Dashboard widgets ---------- */
.grid { display: grid; gap: 1rem; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.stat { padding: 1.1rem 1.2rem; position: relative; overflow: hidden; transition: transform .2s var(--ease); }
.stat:hover { transform: translateY(-3px); }
.stat::after { content: ""; position: absolute; inset-inline-end: -30px; inset-block-start: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.7rem; font-weight: 750; margin: .2rem 0; line-height: 1.15; }
.stat .value.sm { font-size: 1.15rem; }
.stat .sub { color: var(--muted); font-size: .83rem; }
.chart { min-height: 220px; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.legend i { display: inline-block; width: .8em; height: .8em; border-radius: 3px; margin-inline-end: .35em; vertical-align: -.05em; }
.list { list-style: none; margin: 0; padding: 0; } .list li { padding: .6em 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; } .list li:last-child { border: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: .45rem 1rem; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6em 1em; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs a.active, .tabs a:hover { color: var(--text); border-color: var(--accent); }
.contact { display: inline-flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.total-box { display: grid; gap: .3rem; margin-inline-start: auto; max-width: 340px; }
.total-box div { display: flex; justify-content: space-between; gap: 2rem; } .total-box .grand { font-size: 1.2rem; font-weight: 750; border-top: 1px solid var(--border-strong); padding-top: .4rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.perm-group { padding: .8rem 1rem; }
.progress { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; } .progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }

/* ---------- Dialog ---------- */
dialog { color: var(--text); padding: 1.5rem; max-width: min(92vw, 440px); border: 1px solid var(--border-strong); }
dialog::backdrop { background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* ---------- Bare pages (login, errors) ---------- */
.bare-main { min-height: 100vh; display: grid; place-content: center; padding: 1.5rem; gap: 1rem; }
.bare-card { width: min(94vw, 440px); padding: 2rem 1.75rem; }
.bare-card h1 { text-align: center; } .brand-mark { text-align: center; color: var(--accent); margin: 0 0 .5rem; filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--accent) 50%, transparent)); }
.display { font-size: 4rem; margin: 0; background: linear-gradient(135deg, var(--accent), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .bg-orbs, .sidebar, .topbar, .no-print, .filters, .pager, .actions, .skip, dialog, .btn, .icon-btn, .tabs { display: none !important; }
  .shell { display: block; padding: 0; } .glass { background: #fff !important; box-shadow: none !important; border: 1px solid #ccc !important; backdrop-filter: none; }
  .card { break-inside: avoid; } table.data { min-width: 0; } table.data thead th { position: static; background: #eee; color: #000; }
  .muted, .faint, .hint { color: #444 !important; } a { color: #000; text-decoration: none; }
  .badge { border-color: #888; color: #000 !important; background: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; padding: .6rem; }
  .sidebar { position: fixed; inset-block: .6rem; inset-inline-start: .6rem; width: min(84vw, 300px); height: auto; z-index: 60; transform: translateX(calc(-110% * var(--dir, 1))); transition: transform .25s var(--ease); }
  [dir="rtl"] .sidebar { transform: translateX(110%); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.collapsed .sidebar span, .shell.collapsed .brand-name { display: inline; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
  .topbar { top: .6rem; } .hide-sm { display: none; } .quick-search { max-width: none; }
}
@media (max-width: 560px) {
  .kv { grid-template-columns: 1fr; } .quick-search { display: none; } .page-head .actions { width: 100%; } .theme-form { display: none; }
  .card { padding: 1rem; } .stat .value { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce), (update: slow) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; }

/* ---------- Row actions, misc admin widgets ---------- */
.row-actions { display: inline-flex; gap: .15rem; align-items: center; justify-content: flex-end; }
.icon-btn.icon-danger { color: var(--bad); }
.icon-btn.icon-danger:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.perm-matrix { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1rem; }
.perm-matrix fieldset, .lang-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; margin: 0 0 1rem; }
.perm-matrix legend, .lang-block legend { padding: 0 .4rem; font-weight: 650; }
.check { display: flex; gap: .5rem; align-items: center; cursor: pointer; margin: .25rem 0; }
.theme-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.theme-card { display: grid; gap: .5rem; padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-1); color: var(--text); }
.theme-card input { position: absolute; opacity: 0; }
.theme-card:has(input:checked) { outline: 2px solid var(--accent); }
.theme-swatch { height: 52px; border-radius: 10px; background: linear-gradient(135deg, var(--bg-2), var(--primary) 60%, var(--accent)); }
details.restore { display: inline-block; text-align: start; } details.restore summary { list-style: none; cursor: pointer; }
.items-table input { width: 100%; }
.print-doc { background: #fff; color: #111; }
.print-page { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.print-doc .data th, .print-doc .data td { border-bottom: 1px solid #ccc; color: #111; }
