/* ASHOUR STUDIO WORKSPACE — RTL, monochrome, restrained glass surfaces. */
:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --ink: #0b0b0b;
  --ink-2: #2b2b2b;
  --muted: #6f6f6c;
  --faint: #9a9a96;
  --line: #e4e4e0;
  --line-strong: #d0d0cb;
  --soft: #efefec;
  --ok: #0f6b46;
  --ok-bg: #e9f4ee;
  --warn: #8a5a00;
  --warn-bg: #fbf3df;
  --danger: #a3261b;
  --danger-bg: #fbeceb;
  --info: #1d4a7a;
  --info-bg: #e9f0f8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 8px 24px -12px rgba(11, 11, 11, .10);
  --sidebar: 264px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--ink);
  background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .6rem; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a.link:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; letter-spacing: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16); }
.brand strong { display: block; font-size: .98rem; letter-spacing: .06em; font-weight: 600; }
.brand span { display: block; font-size: .72rem; color: rgba(255, 255, 255, .55); letter-spacing: .22em; }
.nav-label { font-size: .7rem; color: rgba(255, 255, 255, .42); padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: rgba(255, 255, 255, .74);
  font-size: .93rem; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: #fff; color: var(--ink); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-inline-start: auto; font-size: .72rem; background: rgba(255, 255, 255, .16); padding: 1px 8px; border-radius: 20px; }
.nav a.active .count { background: var(--ink); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: .72rem; color: rgba(255, 255, 255, .38); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: rgba(244, 244, 242, .78); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(11, 11, 11, .06);
}
.search { flex: 1; max-width: 460px; position: relative; }
.search input {
  width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .8);
  padding: 0 40px 0 14px; font: inherit; font-size: .9rem;
}
.search svg { position: absolute; inset-inline-start: 13px; top: 11px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .8); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); background: #fff; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 20px;
  background: var(--ink); color: #fff; font-size: .68rem; display: grid; place-items: center; border: 2px solid var(--bg);
}
.menu-toggle { display: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px 4px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .8); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .who { line-height: 1.25; }
.user-menu .who b { display: block; font-size: .86rem; font-weight: 600; }
.user-menu .who small { color: var(--muted); font-size: .72rem; }
.dropdown {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; border-radius: 13px; z-index: 40;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.dropdown a, .dropdown button { display: block; width: 100%; text-align: start; padding: 8px 11px; border-radius: 8px; font: inherit; font-size: .9rem; background: none; border: 0; cursor: pointer; color: var(--ink); }
.dropdown a:hover, .dropdown button:hover { background: var(--soft); }
.content { padding: 26px 28px 60px; width: 100%; max-width: 1380px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: 3px; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #262626; }
.btn-danger { color: var(--danger); border-color: #e7c4c0; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--soft); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: .82rem; border-radius: 9px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------- Cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1rem; }
.card-body { padding: 18px 20px; }
.glass { background: rgba(255, 255, 255, .66); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: block; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi .label { font-size: .8rem; color: var(--muted); }
.kpi .value { font-size: 1.9rem; font-weight: 600; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.alert .value { color: var(--danger); }
.kpi.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi.dark .label { color: rgba(255, 255, 255, .6); }

dl.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; margin: 0; font-size: .92rem; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; font-weight: 500; font-size: .78rem; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .title { font-weight: 500; }
.table .title:hover { text-decoration: underline; text-underline-offset: 3px; }
.table td.num, .table th.num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 20px; font-size: .76rem; font-weight: 500; background: var(--soft); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.ok::before { background: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.warn::before { background: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); } .badge.danger::before { background: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); } .badge.info::before { background: var(--info); }
.badge.dark { background: var(--ink); color: #fff; } .badge.dark::before { background: #fff; }
.badge.plain::before { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: .8rem; background: var(--surface); }

/* ---------- Tabs / filters ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 15px; font-size: .92rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs .count { font-size: .72rem; background: var(--soft); border-radius: 20px; padding: 0 7px; margin-inline-start: 5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 3px; }
.seg a { padding: 5px 13px; border-radius: 8px; font-size: .86rem; color: var(--muted); }
.seg a.active { background: var(--ink); color: #fff; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters .field.grow { max-width: none; flex: 2 1 220px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-size: .82rem; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.field .error { font-size: .8rem; color: var(--danger); margin-top: 5px; }
.req::after { content: " *"; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  font: inherit; font-size: .92rem; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 11, 11, .08); }
input[type=file] { width: 100%; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-2); font: inherit; font-size: .88rem; }
input[dir=ltr], .input-ltr { direction: ltr; text-align: left; }
select[multiple] { min-height: 132px; padding: 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; max-height: 190px; overflow: auto; background: var(--surface); }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.pw { position: relative; }
.pw input { padding-inline-end: 62px; }
.pw button { position: absolute; inset-inline-end: 6px; top: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 0; background: var(--soft); font: inherit; font-size: .76rem; cursor: pointer; }
.form-foot { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
details.disclosure > summary { cursor: pointer; list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: 14px; }
.inset { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

/* ---------- Alerts / empty ---------- */
.alert { padding: 11px 15px; border-radius: 11px; font-size: .9rem; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; align-items: flex-start; }
.alert.success { border-color: #cfe5d8; background: var(--ok-bg); color: var(--ok); }
.alert.error { border-color: #efcfcb; background: var(--danger-bg); color: var(--danger); }
.alert.warning { border-color: #ecdcae; background: var(--warn-bg); color: var(--warn); }
.alert ul { margin: 0; padding-inline-start: 18px; }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--line-strong); margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; }

/* ---------- Progress ---------- */
.progress { height: 7px; background: var(--soft); border-radius: 20px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 20px; }
.progress.time > span { background: var(--faint); }
.dev-pos { color: var(--ok); } .dev-neg { color: var(--danger); }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: .85rem; }
.bar-row .num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Avatars / people ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: .74rem; font-weight: 600; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.35rem; }
.avatar.sm { width: 24px; height: 24px; font-size: .62rem; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.avatars { display: inline-flex; }
.avatars .avatar { margin-inline-start: -7px; border: 2px solid var(--surface); }
.avatars .avatar:first-child { margin-inline-start: 0; }

/* ---------- Lists / timeline ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.list > li:last-child { border-bottom: 0; }
.list .grow { min-width: 0; flex: 1; }
.list .grow a.t { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .grow a.t:hover { text-decoration: underline; text-underline-offset: 3px; }
.timeline { list-style: none; margin: 0; padding: 0 20px; }
.timeline li { position: relative; padding: 12px 18px 12px 0; border-inline-start: 1px solid var(--line); margin-inline-start: 5px; padding-inline-start: 18px; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -4.5px; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.timeline time { color: var(--faint); font-size: .76rem; display: block; }
.comment { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: 0; }
.comment .body { min-width: 0; flex: 1; }
.comment .who { font-size: .86rem; font-weight: 600; }
.comment .who time { font-weight: 400; color: var(--faint); font-size: .76rem; margin-inline-start: 6px; }

/* ---------- Files ---------- */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.file .ext { width: 42px; height: 42px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: .66rem; font-weight: 600; text-transform: uppercase; flex: none; overflow: hidden; letter-spacing: .04em; }
.file .ext img { width: 100%; height: 100%; object-fit: cover; }
.file .info { min-width: 0; flex: 1; }
.file .name { font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; unicode-bidi: plaintext; }
.file .sub { font-size: .76rem; color: var(--muted); }
.preview-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.preview-img { max-height: 70vh; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: var(--soft); border-radius: var(--radius); padding: 10px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-size: .86rem; font-weight: 600; }
.kcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px; margin-bottom: 8px; }
.kcard:hover { border-color: var(--ink); }
.kcard .t { font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.kcard .m { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); }
.kcard.late { border-inline-start: 3px solid var(--danger); }

/* ---------- Checklist / stages ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .done { color: var(--faint); text-decoration: line-through; }
.tick { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.tick.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tick svg { width: 13px; height: 13px; }
.stage { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; margin-bottom: 10px; }
.stage.current { border-color: var(--ink); }
.stage .num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: .8rem; font-weight: 600; flex: none; }
.stage.approved .num { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur, .pagination span.off { min-width: 34px; height: 34px; padding: 0 9px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.pagination span.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination span.off { color: var(--faint); background: transparent; }
.pagination a:hover { border-color: var(--ink); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: auto -20% -35% auto; width: 80%; aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, .09); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255, 255, 255, .025), 0 0 0 170px rgba(255, 255, 255, .02); }
.auth-side h1 { font-size: 2.1rem; font-weight: 600; line-height: 1.45; max-width: 13em; position: relative; z-index: 1; }
.auth-side p { color: rgba(255, 255, 255, .6); max-width: 30em; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: linear-gradient(160deg, #fafaf9, #ececea); }
.auth-card { width: 100%; max-width: 420px; padding: 34px 32px; border-radius: 20px; }
.auth-card h2 { font-size: 1.35rem; margin-bottom: 4px; }
.auth-card .field { margin-top: 16px; }
.auth-card .btn { width: 100%; height: 44px; margin-top: 20px; }

/* ---------- Errors ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font-size: 4.5rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }

/* ---------- Responsive ---------- */
.backdrop { display: none; }
@media (max-width: 1100px) {
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 300px); z-index: 60; transform: translateX(105%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 11, 11, .45); z-index: 50; }
  .menu-toggle { display: grid; }
  .topbar { padding: 10px 14px; }
  .content { padding: 18px 14px 60px; }
  .user-menu .who { display: none; }
  .user-menu summary { padding: 3px; border-radius: 50%; }
  .g2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  h1 { font-size: 1.3rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 1.5rem; }
  .filters .field { max-width: none; flex: 1 1 100%; }
  .btn { height: 44px; }
  .btn-sm { height: 36px; }
  .list > li, .card-head, .card-body { padding-inline: 14px; }
  .table th, .table td { padding: 10px 12px; }
  /* Tables become readable cards on phones */
  .table.cards thead { display: none; }
  .table.cards tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.cards td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: start; }
  .table.cards td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: .78rem; flex: none; }
  .table.cards td.primary { display: block; padding-bottom: 6px; }
  .table.cards tbody tr:hover td { background: none; }
}
@media print {
  .sidebar, .topbar, .actions, .filters, .pagination, .no-print { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #bbb; }
  body { background: #fff; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
