/* ══════════════════════════════════════════════════════════
   Harlienz Design Qatar — ERP design system
   Monochrome: black → white, with one light-pink accent.
   Type: Public Sans
   ══════════════════════════════════════════════════════════ */

:root {
  /* mono ramp */
  --black:      #0C0C0D;
  --ink:        #141416;
  --ink-2:      #4C4C52;
  --ink-3:      #86868D;
  --ink-4:      #AFAFB5;

  --line:       #ECEBED;
  --line-2:     #DEDCE0;
  --line-3:     #C9C7CC;

  --bg:         #FAFAFB;
  --surface:    #FFFFFF;
  --surface-2:  #F7F7F8;
  --surface-3:  #F1F1F3;

  /* the single accent */
  --pink:       #F2C3D4;
  --pink-mid:   #E7A3BC;
  --pink-soft:  #FCEFF4;
  --pink-line:  #F4D9E3;
  --pink-ink:   #A65C7B;

  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 2px rgba(12,12,13,.04), 0 6px 18px rgba(12,12,13,.05);
  --shadow-lg:  0 20px 52px rgba(12,12,13,.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.24; letter-spacing: -.012em; }
p { margin: 0; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; z-index: 200; background: var(--black); color: #fff; padding: 10px 16px; }
.skip:focus { left: 0; top: 0; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; border-radius: 4px; }

/* ── Shell ──────────────────────────────────────────────── */
body { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top app bar ────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 70;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 54px; flex: 0 0 54px;
  background: var(--black); color: #E9E9EB;
}
.ab-burger {
  display: none; place-items: center; width: 34px; height: 34px;
  background: none; border: 0; border-radius: 8px; color: inherit; cursor: pointer;
}
.ab-burger:hover { background: rgba(255,255,255,.1); }

.ab-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: 0 0 auto; padding-right: 6px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--pink); color: var(--black);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.logo-text { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; line-height: 1.12; }
.logo-text em {
  font-style: normal; font-size: 8.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--pink);
}

/* menus */
.ab-nav { display: flex; align-items: center; gap: 1px; min-width: 0; flex: 1; }
.menu { position: relative; }
.menu-top {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 11px; background: none; border: 0; border-radius: 8px;
  color: rgba(233,233,235,.8); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.menu-top:hover { background: rgba(255,255,255,.1); color: #fff; }
.menu-top[aria-expanded="true"] { background: #fff; color: var(--black); font-weight: 600; }
.menu-top.is-active { color: #fff; font-weight: 600; box-shadow: inset 0 -2px 0 var(--pink); }
.menu-top .mt-caret { width: 10px; height: 10px; opacity: .6; }
.menu-top .mt-key {
  font-size: 9.5px; font-weight: 700; padding: 1px 4px; border-radius: 4px;
  background: rgba(255,255,255,.14); color: rgba(255,255,255,.75);
}
.menu-top[aria-expanded="true"] .mt-key { background: var(--surface-3); color: var(--ink-3); }

.menu-pop {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 80;
  min-width: 268px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 11px; box-shadow: var(--shadow-lg);
  animation: pop-in .11s ease-out;
}
@keyframes pop-in { from { transform: translateY(-4px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; background: none; border: 0; border-radius: 8px;
  color: var(--ink); font-size: 13px; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item[aria-current="page"] { background: var(--black); color: #fff; font-weight: 600; }
.menu-item .mi-ico { flex: 0 0 16px; opacity: .65; }
.menu-item[aria-current="page"] .mi-ico { opacity: 1; }
.menu-item .mi-tag {
  margin-left: auto; font-size: 9.5px; font-weight: 700;
  background: var(--pink); color: var(--black); padding: 1px 6px; border-radius: 999px;
}

/* right cluster */
.ab-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ab-search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(233,233,235,.72); font-size: 12.5px;
}
.ab-search:hover { background: rgba(255,255,255,.14); color: #fff; }
.ab-search span { min-width: 54px; text-align: left; }
.ab-branch {
  padding: 6px 10px; font-size: 12.5px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: rgba(233,233,235,.85);
}
.ab-branch option { color: var(--ink); }
.ab-icon {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px;
  background: none; border: 0; border-radius: 8px; color: inherit; cursor: pointer; font-size: 20px;
}
.ab-icon:hover { background: rgba(255,255,255,.1); }
.dot-badge {
  position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--pink); color: var(--black); font-size: 9.5px; font-weight: 700;
  line-height: 15px; border-radius: 999px; text-align: center;
}
.ab-user { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.14); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--pink);
  color: var(--black); display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: 12px; font-weight: 600; }
.user-meta span { font-size: 10.5px; color: rgba(233,233,235,.55); }

/* drawer/help close buttons sit on light surfaces */
.drawer-head .ab-icon, .help .ab-icon, .ms-head .ab-icon { color: var(--ink-2); }
.drawer-head .ab-icon:hover, .help .ab-icon:hover, .ms-head .ab-icon:hover { background: var(--surface-3); color: var(--black); }

/* ── Mobile menu sheet ──────────────────────────────────── */
.menu-sheet { position: fixed; inset: 0; z-index: 85; }
.ms-scrim { position: absolute; inset: 0; background: rgba(12,12,13,.45); }
.ms-panel {
  position: absolute; left: 0; right: 0; top: 0; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 0 0 16px 16px; box-shadow: var(--shadow-lg);
  animation: pop-in .14s ease-out;
}
.ms-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ms-head input {
  flex: 1; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface-2);
}
.ms-body { overflow-y: auto; padding: 12px 14px 18px; }
.ms-group { margin-bottom: 14px; }
.ms-group h3 {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-bottom: 6px;
}
.ms-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ms-item {
  display: flex; align-items: center; gap: 9px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  font-size: 12.5px; text-align: left; cursor: pointer; color: var(--ink);
}
.ms-item:hover { border-color: var(--line-3); }
.ms-item[aria-current="page"] { background: var(--black); border-color: var(--black); color: #fff; font-weight: 600; }
.ms-item svg { flex: 0 0 15px; opacity: .7; }
.ms-empty { padding: 20px 4px; color: var(--ink-3); font-size: 13px; }

/* ── View ───────────────────────────────────────────────── */
.view { flex: 1; padding: 22px 22px 40px; max-width: 1560px; width: 100%; margin: 0 auto; }
.appfoot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3);
}

.page-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; }
.page-head .ph-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; max-width: 74ch; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--line-3); background: var(--surface-2); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.btn-primary { background: var(--black); border-color: var(--black); color: #fff; }
.btn-primary:hover { background: #26262A; border-color: #26262A; }
.btn-accent { background: var(--pink); border-color: var(--pink); color: var(--black); }
.btn-accent:hover { background: var(--pink-mid); border-color: var(--pink-mid); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-3); color: var(--black); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; flex: 0 0 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 18px; font-size: 14.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ── Cards & layout ─────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 14px; }
.card-head .ch-sub { font-size: 11.8px; color: var(--ink-3); margin-top: 1px; }
.card-head .ch-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 17px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 15px; }
.grid > *, .stack > *, .pos > *, .main { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }
.stack { display: grid; gap: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── KPI ────────────────────────────────────────────────── */
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start;
}
.kpi-ico {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px;
  display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2);
}
.kpi.k-pink .kpi-ico { background: var(--pink-soft); color: var(--pink-ink); }
.kpi.k-dark .kpi-ico { background: var(--black); color: #fff; }
.kpi-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.kpi-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); }
.delta { font-weight: 700; display: inline-flex; align-items: center; gap: 2px; font-size: 11px; }
.delta.up { color: var(--black); }
.delta.down { color: var(--pink-ink); }
.delta.flat { color: var(--ink-3); }

/* ── Badges & chips ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent;
}
.badge.ok    { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.badge.warn  { background: var(--pink-soft); color: var(--pink-ink); border-color: var(--pink-line); }
.badge.risk  { background: var(--black); color: #fff; }
.badge.info  { background: var(--surface-3); color: var(--ink-2); }
.badge.mute  { background: transparent; color: var(--ink-3); border-color: var(--line); }
.badge.pink  { background: var(--pink); color: var(--black); }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge.no-dot::before, .badge.risk::before { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: var(--line-3); }
.chip[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: #fff; font-weight: 600; }

.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.src i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.src-boutique i   { background: var(--black); }
.src-website i    { background: var(--ink-3); }
.src-exhibition i { background: var(--pink); }
.src-event i      { background: var(--pink-mid); }
.src-b2b i        { background: var(--line-3); }

/* ── Toolbar ────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 15px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .spacer { margin-left: auto; }
.field {
  display: flex; align-items: center; gap: 7px; padding: 6px 11px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px;
}
.field:focus-within { border-color: var(--ink-3); }
.field input, .field select { border: 0; background: none; font-size: 13px; min-width: 120px; outline: none; }
.field svg { color: var(--ink-3); flex: 0 0 15px; }
.field.grow { flex: 1 1 210px; }
.field.grow input { width: 100%; min-width: 0; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { font-weight: 600; }
table.data .muted { color: var(--ink-3); font-size: 12.5px; }
table.data .code { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cell-sub { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.cell-art { display: flex; align-items: center; gap: 10px; }
.row-link { cursor: pointer; }

.table-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 15px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3);
}
.table-foot .spacer { margin-left: auto; }
.empty { padding: 32px 18px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 3px; }

/* ── Meters ─────────────────────────────────────────────── */
.meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 66px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--black); }
.meter.ok > span   { background: var(--ink-2); }
.meter.warn > span { background: var(--pink-mid); }
.meter.risk > span { background: var(--black); }
.meter.pink > span { background: var(--pink); }
.meter-row { display: flex; align-items: center; gap: 9px; }
.meter-row .mv { font-size: 12px; color: var(--ink-3); min-width: 32px; text-align: right; }

/* ── Charts ─────────────────────────────────────────────── */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: inherit; font-size: 10.5px; fill: var(--ink-3); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); padding-top: 10px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* ── Lists & tiles ──────────────────────────────────────── */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 11px; padding: 11px 17px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.li-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
}
.li-main { min-width: 0; flex: 1; }
.li-main strong { display: block; font-size: 13px; font-weight: 600; }
.li-main span { font-size: 12px; color: var(--ink-3); }
.li-end { text-align: right; white-space: nowrap; font-size: 13px; }

.tiles { display: grid; gap: 9px; }
.tile {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; width: 100%;
}
.tile:hover { border-color: var(--line-3); background: var(--surface-2); }
.tile-ico { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); }
.tile strong { display: block; font-size: 12.8px; }
.tile span { font-size: 11.5px; color: var(--ink-3); }
.tile .tile-go { margin-left: auto; color: var(--ink-4); }

/* ── Timeline & flow ────────────────────────────────────── */
.timeline { position: relative; padding-left: 21px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line-2); }
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--line-3);
}
.tl-item.done::before { background: var(--black); border-color: var(--black); }
.tl-item.active::before { background: var(--pink); border-color: var(--pink-mid); }
.tl-item strong { font-size: 13px; display: block; }
.tl-item span { font-size: 12px; color: var(--ink-3); }

.flow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.flow-step { flex: 1 0 138px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.flow-step .fs-n { font-size: 10px; font-weight: 700; color: var(--ink-4); letter-spacing: .12em; }
.flow-step strong { display: block; font-size: 12.8px; margin: 2px 0 4px; }
.flow-step .fs-count { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.flow-step .fs-meta { font-size: 11.5px; color: var(--ink-3); }
.flow-step.is-hot { background: var(--pink-soft); border-color: var(--pink-line); }
.flow-step.is-block { background: var(--black); border-color: var(--black); color: #fff; }
.flow-step.is-block .fs-n, .flow-step.is-block .fs-meta { color: rgba(255,255,255,.62); }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 0 6px; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.tab {
  padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent;
  font-size: 13px; color: var(--ink-3); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--black); border-bottom-color: var(--black); font-weight: 600; }
.tab-panel[hidden] { display: none; }

/* ── Forms ──────────────────────────────────────────────── */
.form-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label.lbl { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.lbl input, label.lbl select, label.lbl textarea {
  padding: 9px 11px; font-size: 13px; font-weight: 400;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); width: 100%;
}
label.lbl input:focus, label.lbl select:focus, label.lbl textarea:focus { outline: none; border-color: var(--black); }
label.lbl input[aria-invalid="true"], label.lbl select[aria-invalid="true"], label.lbl textarea[aria-invalid="true"] {
  border-color: var(--pink-mid); background: var(--pink-soft);
}
label.lbl textarea { resize: vertical; }
.req { color: var(--pink-ink); }
.hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.form-error { font-size: 12px; color: var(--pink-ink); font-weight: 600; }

/* ── POS ────────────────────────────────────────────────── */
.pos { display: grid; grid-template-columns: 1fr 352px; gap: 15px; align-items: start; }

.pos-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 11px 14px; border-bottom: 1px solid var(--line); }
/* Block, not flex: a flex column with overflow:hidden lets its automatic
   minimum size collapse to 0, so the grid row sized itself smaller than the
   content and clipped the price and location lines. */
.pos-tile {
  display: block; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0; overflow: hidden; cursor: pointer; text-align: left;
  transition: border-color .12s, box-shadow .12s;
}
.pos-tile:hover { border-color: var(--black); box-shadow: var(--shadow); }
.pos-tile:active { background: var(--surface-2); }
.pos-tile.is-out { opacity: .45; cursor: not-allowed; }
.pos-tile-body { display: block; padding: 8px 10px 10px; }
.pos-tile strong { display: block; font-size: 12.4px; line-height: 1.3; }
.pos-tile .pt-sku { font-size: 10.5px; color: var(--ink-3); }
.pos-tile .pt-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 5px; gap: 6px; }
.pos-tile .pt-price { font-size: 13.5px; font-weight: 700; }
.pos-tile .pt-stock { font-size: 10.5px; color: var(--ink-3); }
.pos-tile .pt-stock.low { color: var(--pink-ink); font-weight: 700; }

.cart { position: sticky; top: 74px; }
.cart-lines { max-height: 286px; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.cart-line strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.cart-line .cl-sku { display: block; font-size: 10.5px; color: var(--ink-3); }
.cart-line .cl-amt { font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; }
.cart-line .cl-rm { background: none; border: 0; color: var(--ink-4); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cart-line .cl-rm:hover { color: var(--black); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.qty button { width: 24px; height: 23px; border: 0; background: var(--surface-2); cursor: pointer; color: var(--ink-2); font-size: 14px; line-height: 1; }
.qty button:hover { background: var(--black); color: #fff; }
.qty span { min-width: 28px; text-align: center; font-size: 12.5px; font-weight: 700; }

.totals { padding: 13px 15px; border-top: 1px solid var(--line); background: var(--surface-2); }
.tot-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; color: var(--ink-2); }
.tot-row.grand { margin-top: 7px; padding-top: 9px; border-top: 1px solid var(--line-2); font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.pay-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 0 15px 12px; }
.pay-btn {
  padding: 9px 4px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 11.5px; font-weight: 600; cursor: pointer; display: grid; gap: 3px; justify-items: center; color: var(--ink-2);
}
.pay-btn svg { width: 15px; height: 15px; }
.pay-btn:hover { border-color: var(--line-3); }
.pay-btn[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: #fff; }

/* ── Drawer ─────────────────────────────────────────────── */
.drawer-host { position: fixed; inset: 0; z-index: 90; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(12,12,13,.4); }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide-in .16s ease-out;
}
.drawer.wide { width: min(880px, 100%); }
@keyframes slide-in { from { transform: translateX(22px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 15px; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 17px; display: grid; gap: 14px; align-content: start; }

.kv { display: grid; grid-template-columns: 148px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-size: 12px; }
.kv dd { margin: 0; font-weight: 500; }

/* ── Notes ──────────────────────────────────────────────── */
.note {
  display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 12.5px; background: var(--pink-soft); border: 1px solid var(--pink-line); color: var(--pink-ink);
}
.note.info { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.note.risk { background: var(--black); border-color: var(--black); color: #fff; }
.note svg { flex: 0 0 16px; margin-top: 1px; }
.note strong { font-weight: 700; }
.section-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }

/* ── Toast ──────────────────────────────────────────────── */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; justify-items: end; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 15px;
  background: var(--black); color: #fff; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); max-width: 380px; animation: toast-in .16s ease-out;
}
.toast svg { flex: 0 0 16px; color: var(--pink); }
.toast strong { font-weight: 600; }
.toast span { color: rgba(255,255,255,.7); font-size: 12px; display: block; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Product art ────────────────────────────────────────── */
.art { display: block; }
.art .a-fill { fill: var(--pink-soft); }
.art .a-fill-2 { fill: var(--surface-3); }
.art .a-line { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.art .a-thin { fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; }
.art-sm {
  display: inline-grid; place-items: center;
  width: 36px; height: 44px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  flex: 0 0 36px; padding: 3px; vertical-align: middle;
}
.art-sm svg { height: 36px; width: auto; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1240px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pos { grid-template-columns: 1fr 320px; }
}
@media (max-width: 1040px) {
  .g-2-1, .g-1-2, .g-3-2, .g-3 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; }
  .cart { position: static; }
}
@media (max-width: 1420px) { .ab-search span { display: none; } }
@media (max-width: 1320px) { .ab-branch { display: none; } }
@media (max-width: 1240px) {
  .menu-top { padding: 7px 8px; font-size: 12.5px; }
  .menu-top .mt-key, .menu-top .mt-caret { display: none; }
  .ab-search kbd { display: none; }
  .user-meta { display: none; }
}
@media (max-width: 1080px) {
  .ab-nav { display: none; }
  .ab-burger { display: grid; }
}
@media (max-width: 880px) {
  .view { padding: 16px 13px 32px; }
  .appbar { padding: 0 10px; gap: 8px; }
  .user-meta { display: none; }
  .ab-search kbd { display: none; }
  .g-4, .g-5, .g-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-actions { width: 100%; margin-left: 0; }
  .kv { grid-template-columns: 116px 1fr; }
}


/* ══ Keyboard chips ═══════════════════════════════════════ */
kbd {
  display: inline-block; min-width: 18px; padding: 1px 5px;
  font-family: inherit; font-size: 10.5px; font-weight: 600; line-height: 16px;
  text-align: center; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; white-space: nowrap;
}
.appbar kbd, .appfoot kbd { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: rgba(233,233,235,.8); }
.appfoot kbd { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
.btn kbd { margin-left: 2px; }

/* ══ Command palette ══════════════════════════════════════ */
.palette-host { position: fixed; inset: 0; z-index: 110; }
.palette-scrim { position: absolute; inset: 0; background: rgba(12,12,13,.42); }
.palette {
  position: absolute; left: 50%; top: 11vh; transform: translateX(-50%);
  width: min(640px, calc(100vw - 28px)); max-height: 72vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop-in .12s ease-out;
}
.pal-input { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.pal-input svg { color: var(--ink-3); flex: 0 0 17px; }
.pal-input input { flex: 1; border: 0; outline: none; font-size: 15px; background: none; }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-group { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 9px 10px 4px; }
.pal-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; background: none; border: 0; border-radius: 8px;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.pal-item .pi-ico { flex: 0 0 16px; color: var(--ink-3); }
.pal-item .pi-sub { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.pal-item[aria-selected="true"] { background: var(--black); color: #fff; }
.pal-item[aria-selected="true"] .pi-ico, .pal-item[aria-selected="true"] .pi-sub { color: var(--pink); }
.pal-empty { padding: 26px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }
.pal-foot { display: flex; gap: 14px; padding: 9px 15px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--ink-3); }

/* ══ Shortcut help ════════════════════════════════════════ */
.help-host { position: fixed; inset: 0; z-index: 110; }
.help {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(760px, calc(100vw - 28px)); max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.help-body { overflow-y: auto; padding: 16px; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); align-content: start; }
.keys { display: grid; gap: 1px; }
.keys-row { display: flex; align-items: center; gap: 12px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 12.8px; }
.keys-row:last-child { border-bottom: 0; }
.keys-row .kr-keys { margin-left: auto; display: flex; gap: 3px; flex: 0 0 auto; }

/* ══ POS — fits the viewport, never scrolls the page ══════ */
/* The page is a fixed-height app screen: only the catalogue grid
   and the cart lines scroll, so staff never lose sight of the total. */
.pos-page { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
/* Let flex measure the leftover height rather than guessing at the
   chrome, so the till screen fits exactly with no page scroll. */
body.has-pos .view { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
body.has-pos { overflow: hidden; }
.pos-extras { flex: 0 0 auto; }
.pos-extras .page-head { margin-bottom: 10px; }

body.pos-full .appbar, body.pos-full .appfoot,
body.pos-full .pos-extras { display: none; }
body.pos-full .view { padding: 0; max-width: none; }
body.pos-full .pos-page { height: 100vh; gap: 0; }
body.pos-full { overflow: hidden; }
body.has-pos { overflow: hidden; }

.posbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  padding: 8px 12px; background: var(--black); color: #E9E9EB;
  border-radius: var(--radius); flex: 0 0 auto; overflow-x: auto;
}
body.pos-full .posbar { border-radius: 0; }
.posbar .pb-till { display: flex; flex-direction: column; line-height: 1.15; padding-right: 10px; border-right: 1px solid rgba(255,255,255,.16); white-space: nowrap; }
.posbar .pb-till strong { font-size: 13px; }
.posbar .pb-till span { font-size: 10.5px; color: rgba(233,233,235,.6); }
.posbar .pb-field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 150px;
  padding: 7px 11px; border-radius: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
}
.posbar .pb-field input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: #fff; font-size: 13.5px; }
.posbar .pb-field input::placeholder { color: rgba(233,233,235,.5); }
.posbar .pb-stat { font-size: 12px; color: rgba(233,233,235,.7); white-space: nowrap; }
.posbar .pb-stat strong { color: #fff; font-size: 14px; }
.posbar .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: rgba(233,233,235,.8); white-space: nowrap; }
.posbar .chip:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.posbar .chip[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: var(--black); }
.posbar kbd { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: rgba(233,233,235,.8); }

.pos-main {
  display: grid; grid-template-columns: 1fr 348px; gap: 12px;
  flex: 1; min-height: 0; align-items: stretch;
}
body.pos-full .pos-main { gap: 0; }

.pos-cat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
body.pos-full .pos-cat { border-radius: 0; border-left: 0; border-bottom: 0; }
.pos-cat .card-body { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 0; }
.pos-bar { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 9px 12px; border-bottom: 1px solid var(--line); }
/* grid-auto-rows: max-content — a <button> grid item resolves its automatic
   minimum size to 0, so auto rows sized smaller than the tile content and
   clipped the price and stock lines. */
.pos-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: max-content; align-content: start; align-items: start;
  gap: 9px; padding: 11px;
}
body.pos-full .pos-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }

.cart { display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: static; }
body.pos-full .cart { border-radius: 0; border-right: 0; border-bottom: 0; }
.cart .card-body { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 0; }
.cart-lines { flex: 1; min-height: 60px; overflow-y: auto; }
.totals, .pay-grid, .cart-foot, .cart-hint { flex: 0 0 auto; }

.pos-art { height: 84px; background: var(--surface-2); display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.pos-art svg { height: 72px; width: auto; }
body.pos-full .pos-art { height: 100px; }
body.pos-full .pos-art svg { height: 86px; }

.pos-tile { position: relative; }
.pos-tile .pt-key {
  position: absolute; top: 5px; left: 5px; z-index: 1;
  min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px;
  background: var(--black); color: #fff; border-radius: 5px;
  font-size: 9.5px; font-weight: 700; text-align: center;
}
.pos-tile:hover .pt-key { background: var(--pink); color: var(--black); }
.pos-tile .pt-vcode { font-size: 10px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.pos-tile .pt-info {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  display: grid; place-items: center; width: 21px; height: 21px;
  border-radius: 6px; background: var(--surface); border: 1px solid var(--line-2);
  color: var(--ink-3); cursor: pointer;
}
.pos-tile .pt-info:hover { background: var(--black); border-color: var(--black); color: #fff; }
.pos-tile .pt-avail { font-size: 10.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.pos-tile .pt-avail.low { color: var(--pink-ink); }
.pos-tile .pt-avail.out { color: var(--ink-3); }
.pos-tile .pt-locs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px;
  padding-top: 5px; border-top: 1px solid var(--line);
  font-size: 9.5px; color: var(--ink-3); letter-spacing: .01em;
}
.pos-tile .pt-locs .pt-res { color: var(--pink-ink); font-weight: 700; }
.cart-line .cl-stock { display: block; font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.cart-line .cl-stock.low { color: var(--pink-ink); font-weight: 600; }
.cart-line .cl-stock.none { color: var(--pink-ink); font-weight: 700; }

.cart-hint { padding: 8px 15px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1040px) {
  .pos-main { grid-template-columns: 1fr; }
  body.pos-full .pos-main { display: flex; flex-direction: column; }
  .help-body { grid-template-columns: 1fr; }
}


/* ══ Stat lists (replaced the charts) ═════════════════════ */
.stat-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.stat-head strong { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.stat-head span { font-size: 11.5px; color: var(--ink-3); }
.stat-list { display: grid; gap: 2px; }
.stat-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.8px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .sr-rank { flex: 0 0 18px; font-size: 11px; font-weight: 700; color: var(--ink-4); }
.stat-row .sr-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row .sr-bar { flex: 0 0 72px; height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.stat-row .sr-bar > span { display: block; height: 100%; background: var(--black); border-radius: 999px; }
.stat-row .sr-val { flex: 0 0 auto; font-weight: 600; text-align: right; white-space: nowrap; }
.stat-row .sr-pct { flex: 0 0 46px; text-align: right; color: var(--ink-3); font-size: 11.5px; }
table.data tfoot td { padding: 10px 14px; border-top: 1px solid var(--line-2); background: var(--surface-2); font-size: 12.8px; }

/* ══ Theme picker ═════════════════════════════════════════ */
.theme-grid { display: grid; gap: 8px; }
.theme-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; width: 100%; color: var(--ink);
}
.theme-card:hover { border-color: var(--line-3); }
.theme-card[aria-pressed="true"] { border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.tc-swatch { display: flex; flex: 0 0 auto; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-2); }
.tc-swatch i { width: 18px; height: 30px; display: block; }
.tc-body { flex: 1; min-width: 0; }
.tc-body strong { display: block; font-size: 13px; }
.tc-body span { font-size: 11.5px; color: var(--ink-3); }
.tc-check { opacity: 0; color: var(--black); flex: 0 0 auto; }
.theme-card[aria-pressed="true"] .tc-check { opacity: 1; }

/* ══ Density ══════════════════════════════════════════════ */
:root[data-density="compact"] table.data td { padding: 5px 11px; }
:root[data-density="compact"] table.data th { padding: 7px 11px; }
:root[data-density="compact"] .card-body { padding: 13px; }
:root[data-density="compact"] .kpi { padding: 11px 12px; }
:root[data-density="compact"] .kpi-value { font-size: 19px; }
:root[data-density="compact"] .list-item { padding: 8px 14px; }

/* ══ Filter bar (reports and stock) ═══════════════════════ */
.filterbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.filterbar .fb-label { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.filterbar select, .filterbar input {
  padding: 6px 10px; font-size: 12.5px; border: 1px solid var(--line-2);
  border-radius: 7px; background: var(--surface); color: var(--ink);
}
.filterbar .fb-count { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ══ Inline stock editor ══════════════════════════════════ */
.stock-edit { display: flex; align-items: center; gap: 4px; }
.stock-edit input {
  width: 58px; padding: 4px 6px; font-size: 12.5px; text-align: right;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface);
}
.stock-edit input:focus { outline: none; border-color: var(--black); }
.vcode {
  font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-3); padding: 2px 7px; border-radius: 5px; display: inline-block;
}

@media print {
  .appbar, .appfoot, .page-actions, .toolbar, .toast-host, .posbar, .login-screen { display: none !important; }
  .view { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ══ Unauthenticated Full-Screen Login Page ═══════════════ */
body.is-unauthenticated {
  overflow: hidden;
  background: radial-gradient(circle at 50% 10%, #FFF2F6 0%, #F5F5F7 60%, #ECECED 100%);
}
body.is-unauthenticated .appbar,
body.is-unauthenticated .appfoot,
body.is-unauthenticated #view,
body.is-unauthenticated .menu-sheet,
body.is-unauthenticated .palette-host,
body.is-unauthenticated .help-host,
body.is-unauthenticated .drawer-host {
  display: none !important;
}

[hidden],
.login-screen[hidden],
#login-screen[hidden],
.login-screen.is-hidden {
  display: none !important;
}

.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
  background: radial-gradient(circle at 50% 10%, #FFF2F6 0%, #F8F8FA 55%, #F0EFF2 100%);
}

.login-card {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border: 1px solid rgba(12, 12, 13, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(12, 12, 13, 0.09), 0 4px 16px rgba(12, 12, 13, 0.04);
  padding: 36px 32px 30px;
  margin: auto;
  animation: login-fade-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes login-fade-up {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 20px;
}
.login-logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--pink); color: var(--black);
  display: grid; place-items: center;
  font-weight: 700; font-size: 20px;
  box-shadow: 0 4px 12px rgba(242, 195, 212, 0.5);
}
.login-brand-text h2 {
  font-size: 19px; font-weight: 700; line-height: 1.15;
  color: var(--black); letter-spacing: -0.01em;
}
.login-brand-text span {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--pink-ink);
}

.login-header {
  text-align: center; margin-bottom: 22px;
}
.login-header h3 {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 4px;
}
.login-header p {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.45;
}

/* Quick Role Switcher */
.quick-role-box {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.quick-role-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.quick-role-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px;
}
.role-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 7px 9px;
  cursor: pointer; text-align: left;
  transition: all 0.15s ease;
}
.role-chip:hover {
  border-color: var(--black);
  background: #FFFBFD;
  box-shadow: 0 2px 8px rgba(12, 12, 13, 0.05);
  transform: translateY(-1px);
}
.role-chip .role-icon { font-size: 15px; flex-shrink: 0; }
.role-chip .role-info strong {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.2;
}
.role-chip .role-info span {
  display: block; font-size: 10px; color: var(--ink-3); line-height: 1.2;
}

.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line-2);
}
.login-divider span {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-4); font-weight: 500;
}

/* Form inputs */
.login-form .form-group {
  margin-bottom: 14px;
}
.login-form label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink); margin-bottom: 5px;
}
.login-form .input-wrap {
  position: relative; display: flex; align-items: center;
}
.login-form input {
  width: 100%; height: 42px;
  padding: 0 13px; font-size: 13.5px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 9px; color: var(--ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.login-form input:focus {
  outline: none; background: var(--surface);
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(12, 12, 13, 0.08);
}
.toggle-pw {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--ink-3); cursor: pointer;
  padding: 4px; display: grid; place-items: center; border-radius: 4px;
}
.toggle-pw:hover { color: var(--ink); }

.login-error {
  padding: 10px 14px; margin-bottom: 14px;
  background: #FFF1F0; border: 1px solid #FFCCC7;
  border-radius: 8px; color: #CF1322;
  font-size: 12.5px; font-weight: 500; line-height: 1.4;
  animation: pop-in 0.15s ease-out;
}

.btn-login-submit {
  width: 100%; height: 44px; margin-top: 6px;
  background: var(--black); color: #FFFFFF;
  border: 0; border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(12, 12, 13, 0.18);
}
.btn-login-submit:hover {
  background: #252528;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(12, 12, 13, 0.24);
}
.btn-login-submit:active {
  transform: translateY(0);
}

.login-footer-security {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 22px; font-size: 11px; color: var(--ink-3);
  text-align: center;
}
.login-footer-security svg { color: var(--pink-ink); flex-shrink: 0; }
