@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("../fonts/cairo-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-weight: 600; font-display: swap; src: url("../fonts/cairo-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url("../fonts/cairo-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("../fonts/cairo-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-weight: 600; font-display: swap; src: url("../fonts/cairo-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url("../fonts/cairo-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --primary: #8D2AFF;
  --primary-ink: #5C12B8;
  --primary-50: #F3ECFC;
  --ink: #171B3A;
  --ink-2: #5A6078;
  --line: #E4E2EC;
  --bg: #F3F2F6;
  --surface: #FCFCFD;
  --radius: 8px;
  --control: 6px;
  --side: 208px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 13.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
img { max-width: 100%; display: block; }

.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
.cal-side {
  background: var(--surface);
  border-inline-start: 1px solid var(--line);
  padding: 16px 14px 24px;
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(248px, 28vw);
  height: 100dvh;
  overflow: auto;
}
body[data-page="home"] .shell { grid-template-columns: var(--side) 1fr min(248px, 28vw); }
.cal-extra { margin-top: 14px; }
.cal-extra h2, .cal-extra h3 { font-size: 0.82rem; margin: 12px 0 6px; }
.cal-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: transparent;
  border-inline-start: 1px solid var(--line);
}
.cal-tiles .cal-tile:first-child { border-inline-start: 0; }
.cal-tile b { font-size: 1rem; font-variant-numeric: tabular-nums; line-height: 1; }
.cal-tile span { color: var(--ink-2); font-size: 0.68rem; }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-list li { border-top: 1px solid var(--line); }
.cal-list a, .cal-list span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  font-size: 0.75rem;
}
.cal-list b { font-weight: 600; }
.cal-list small { color: var(--ink-2); white-space: nowrap; }
.cal-empty { color: var(--ink-2); font-size: 0.75rem; padding: 4px 0 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.cal-head strong { font-size: 0.82rem; font-weight: 700; }
.cal-head button, .cal-presets button, .cal-day {
  border: 0;
  background: transparent;
  border-radius: var(--control);
  min-height: 26px;
  transition: background 180ms ease, color 180ms ease;
}
.cal-head button { width: 26px; color: var(--ink-2); }
.cal-head button:hover, .cal-presets button:hover, .cal-day:hover { background: var(--bg); }
.cal-presets { display: flex; gap: 2px; margin-bottom: 8px; }
.cal-presets button {
  flex: 1;
  font-size: 0.7rem;
  color: var(--ink-2);
  border: 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.cal-dow, .cal-empty { font-size: 0.66rem; color: var(--ink-2); min-height: 18px; }
.cal-day { font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.cal-day.is-on { background: var(--primary-50); color: var(--primary-ink); }
.cal-day.is-edge { background: var(--primary-ink); color: #fff; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--primary-ink); }
.side {
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand { display: flex; justify-content: center; padding: 4px 8px 10px; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side nav a, .side form button, .side .install-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--control);
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 100%;
  text-align: start;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}
.side nav a .ph, .side form button .ph, .side .install-btn .ph { color: var(--ink-2); font-size: 1.05rem; }
.side nav a[aria-current="page"] {
  background: var(--primary-50);
  color: var(--primary-ink);
}
@media (min-width: 768px) {
  .side nav a[aria-current="page"] { box-shadow: inset -2px 0 0 var(--primary-ink); }
}
.side nav a[aria-current="page"] .ph { color: var(--primary-ink); }
.side nav a:hover, .side form button:hover, .side .install-btn:hover { background: var(--bg); }
.side nav a[aria-current="page"]:hover { background: var(--primary-50); }
.side form { margin: 0; }
.side form button, .side .install-btn { color: var(--ink-2); }
.install { display: flex; flex-direction: column; gap: 2px; }
.install[hidden], .install-ios[hidden] { display: none; }
.install-ios { margin: 0; padding: 0 10px 6px; color: var(--ink-2); font-size: 0.72rem; line-height: 1.45; }
.ph { font-size: 1rem; }

.main { width: 100%; max-width: none; padding: 22px 28px 48px; }
body[data-page="home"] .main { max-width: none; padding: 18px 22px 32px; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin: 0 0 18px;
  padding: 0;
}
body[data-page="home"] .top { margin-bottom: 14px; }
.top-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.nav-toggle, .nav-backdrop { display: none; }
.nav-toggle {
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: var(--surface);
  color: var(--ink);
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}
.back-btn:hover { background: var(--bg); }
.back-btn .ph { font-size: 1rem; }
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(23, 27, 58, 0.36);
}
.top h1 { font-size: 1.28rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
.top-search { margin-inline-start: auto; }
.top-search .field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
}
.top-search input {
  width: min(240px, 42vw);
  min-height: 34px;
  margin: 0;
  background: var(--surface);
}

.home-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: #B42318;
  color: #fff;
  font-weight: 700;
}
.home-alert .ph { color: #fff; }
a.home-alert { color: #fff; text-decoration: none; }
.home-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.home-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease;
}
.home-actions a .ph { color: var(--primary-ink); }
.home-actions a:hover { background: var(--primary-50); border-color: transparent; }
.home-actions a:active { transform: scale(0.98); }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.user-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.user-stats .metric { min-height: 88px; }
.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  gap: 2px;
  min-height: 92px;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: background 180ms ease, border-color 180ms ease;
}
a.metric:hover { background: var(--primary-50); border-color: transparent; }
a.metric:active { transform: scale(0.98); }
.metric .ph { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 6px; }
.metric-label { color: var(--ink-2); font-size: 0.75rem; line-height: 1.3; }
.metric strong { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.05; }
.metric-grid .metric:first-child strong { font-size: 1.7rem; }
.metric small { color: var(--ink-2); font-size: 0.7rem; }
.home-bottom {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}
.home-bottom > .panel { min-width: 0; }
.review-panel { padding: 10px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.review-head h2 { margin: 0; font-size: 0.86rem; }
.review-head span { color: var(--ink-2); font-size: 0.72rem; }
.review-hero {
  position: relative;
  height: 112px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.review-hero img { width: 100%; height: 100%; object-fit: cover; }
.review-hero.is-empty { display: grid; place-items: center; color: var(--ink-2); font-weight: 700; }
.review-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(23, 27, 58, 0.16);
}
.review-nav.is-prev { inset-inline-start: 8px; }
.review-nav.is-next { inset-inline-end: 8px; }
.review-strip { display: flex; gap: 6px; margin-top: 8px; overflow: auto; }
.review-strip button {
  width: 46px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
  flex: 0 0 auto;
}
.review-strip img { width: 100%; height: 100%; object-fit: cover; }
.review-strip .is-on { border-color: var(--primary-ink); }
.review-body { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.review-body .name { font-weight: 700; font-size: 0.88rem; }
.review-facts { display: grid; grid-template-columns: 64px 1fr; margin: 0; font-size: 0.75rem; }
.review-facts dt, .review-facts dd { margin: 0; padding: 2px 0; border-top: 1px solid var(--line); }
.review-facts dt { color: var(--ink-2); }
.review-note { min-height: 42px; width: 100%; margin-top: 2px; }
.review-body label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); font-size: 0.75rem; }
.review-body .actions { margin-top: 0; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
}
.panel h2 { font-size: 0.92rem; margin-bottom: 8px; }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pay-head h2 { margin: 0; }
.pay-head a { font-weight: 700; }
.pay-head strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.pay-bars {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 118px;
  margin: 8px 0 6px;
}
.pay-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
}
.pay-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.pay-bar {
  width: min(28px, 80%);
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: #DDD6EA;
  transition: height 200ms ease, background 200ms ease;
}
.pay-col.is-on .pay-bar, .pay-col:hover .pay-bar { background: var(--primary-ink); }
.pay-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 0.68rem;
}
.pay-col.is-on .pay-name { color: var(--primary-ink); font-weight: 700; }
.pay-tip { display: flex; flex-direction: column; gap: 1px; min-height: 34px; }
.pay-tip b { font-size: 0.8rem; }
.pay-tip span { color: var(--ink-2); font-size: 0.75rem; }
.pay-people { list-style: none; margin: 4px 0 0; padding: 0; max-height: 72px; overflow: auto; }
.pay-people a { display: block; padding: 4px 0; border-top: 1px solid var(--line); font-size: 0.75rem; }
.cal-money {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  font-size: 0.75rem;
}
.cal-money b { font-weight: 700; }
.panel-count { color: var(--ink-2); margin-bottom: 4px; }
.ring {
  width: 108px;
  height: 108px;
  margin: 4px auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--primary-ink) var(--part, 0%), #E6E1F0 0);
  display: grid;
  place-items: center;
}
.ring b {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.legend span { color: var(--ink-2); font-size: 0.85rem; }
.legend b { font-variant-numeric: tabular-nums; }
.roster { list-style: none; margin: 8px 0 0; padding: 0; }
.roster li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.roster b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roster-empty { color: var(--ink-2); border-top: 0; }
.skel-home { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.skel-home span { height: 108px; margin: 0; }
.skel-home .bar, .skel-home .wide { grid-column: 1 / -1; }
.skel-home .bar { height: 30px; }
.skel-home .wide { height: 160px; }

.queue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.queue {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 112px;
}
.queue strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; }
.queue span { color: var(--ink-2); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.toolbar .tabs { margin: 0; }
.toolbar .filters { display: flex; align-items: center; gap: 8px; margin: 0; }
.toolbar .field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}
.toolbar input { width: min(280px, 70vw); }
.toolbar [data-count] { margin-inline-start: auto; color: var(--ink-2); }
.toolbar .company-filter { width: auto; min-width: 180px; max-width: 260px; }
.user-stats a.metric[aria-current="page"] { border-color: var(--primary-ink); background: var(--primary-50); }
.toolbar .btn { display: inline-flex; align-items: center; text-decoration: none; }
.hint { margin: 0 0 10px; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; min-height: 0; }
.choices { display: flex; gap: 18px; margin-top: 8; }
.stack.assign { margin-top: 18px; }
.stack.assign h2 { font-size: 0.95rem; }
table.data td.num { font-variant-numeric: tabular-nums; }
.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
.sheet.pad { padding: 14px 16px 18px; }
table.data { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.data th {
  text-align: start;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--ink-2);
  background: transparent;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.empty {
  text-align: center;
  color: var(--ink-2);
  padding: 28px 12px;
}
table.data tbody tr:hover td { background: #F7F5FB; }
table.data a.name { font-weight: 700; }
table.data th.ops, table.data td.ops { width: 112px; text-align: end; white-space: nowrap; }
.row-ops { display: inline-flex; justify-content: flex-end; gap: 4px; }
.op {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: var(--surface);
  color: var(--ink-2);
  transition: background 180ms ease, color 180ms ease;
}
.op:hover { background: var(--primary-50); color: var(--primary-ink); }
.op:active { transform: scale(0.98); }
#flash { margin: 0 0 10px; }

.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a {
  min-height: 36px;
  padding: 6px 12px;
  margin-bottom: -1px;
  border-radius: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  transition: color 180ms ease, border-color 180ms ease;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] {
  background: transparent;
  color: var(--primary-ink);
  border-bottom-color: var(--primary-ink);
}

.filters, .stack { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.stack { flex-direction: column; align-items: stretch; max-width: 520px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: var(--surface);
  padding: 6px 10px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--primary-ink);
  outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
  outline-offset: 1px;
}
textarea { min-height: 120px; resize: vertical; }
.filters input { width: min(320px, 100%); }

.btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary-ink); color: #fff; border-color: var(--primary-ink); }
.btn-primary:hover { background: #4E0FB0; color: #fff; }
.btn-danger { background: #fff; color: #b42318; border-color: #fda29b; }
.btn-danger:hover { background: #fef3f2; color: #912018; }
.pkg-price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}
.pkg-price-block b { font-weight: 700; }
.pkg-year { color: var(--ink-2); }
.pkg-year s { color: var(--ink-2); opacity: 0.75; }
.pkg-year-preview {
  margin: -4px 0 8px;
  color: var(--ink-2);
  font-size: 0.85rem;
}
.pkg-year-preview s { opacity: 0.75; }
.ads-field { display: flex; flex-direction: column; gap: 8px; }
.ads-field input[type="number"] { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.list { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}
.row strong { font-weight: 700; }
.muted { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: 140px 1fr; max-width: 720px; }
.facts dt, .facts dd { margin: 0; padding: 8px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.links a { color: var(--primary-ink); font-weight: 700; }

.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.shots img, .doc-frame {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.shots img { aspect-ratio: 4 / 3; object-fit: cover; }
.doc-frame { min-height: 420px; }
.doc-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.company-agents,
.company-leads,
.company-team-limit,
.company-docs { margin-top: 22px; }
.company-agents h3,
.company-leads h3,
.company-team-limit h3,
.doc-list h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.company-team-limit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 320px;
}
.company-team-limit-row input { flex: 1; min-width: 0; }
.company-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.company-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  background: var(--surface);
}
.company-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.company-card-head h3 { margin: 0; font-size: 1rem; }
.company-card-actions { display: flex; gap: 6px; }
.company-card .facts { max-width: none; grid-template-columns: 130px 1fr; }
.company-card .facts input { width: 100%; max-width: 260px; }
.company-card .facts .radio-group { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.company-card .facts .radio-group label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.company-card .facts .radio-group input { width: auto; margin: 0; }
.company-card .note { margin: 10px 0 0; }
.doc-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}
.doc-thumb {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.doc-thumb-shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--bg);
  color: var(--ink-2);
  text-decoration: none;
  overflow: hidden;
}
.doc-thumb-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.doc-thumb-shot.is-file {
  gap: 6px;
  font-weight: 700;
  font-size: 0.78rem;
}
.doc-thumb-shot.is-file .ph {
  font-size: 1.6rem;
  color: var(--ink);
}
.doc-thumb-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 10px;
}
.doc-thumb-meta .doc-type {
  font-size: 0.82rem;
  line-height: 1.3;
}
.doc-thumb-meta em {
  font-style: normal;
  color: var(--ink-2);
  font-size: 0.72rem;
}
.doc-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
  text-decoration: none;
}
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.load-more { display: flex; justify-content: center; margin-top: 16px; }
.load-more .btn[hidden] { display: none; }
.force-update-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.force-update-grid .stack { max-width: none; }
.force-update-app > h2 { margin-bottom: 4px; }
.force-update-platform {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.force-update-platform h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.force-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.paper-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.paper-shot {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.paper-shot img, .paper-frame { width: 100%; height: 100%; object-fit: cover; border: 0; }
.paper-frame { pointer-events: none; }
.paper-open { position: absolute; inset: 0; }
.paper-shot.is-empty, .paper-shot.is-file {
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: var(--ink-2);
  font-weight: 700;
}
.paper-shot b {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--control);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}
.paper-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.paper-meta a.name { font-weight: 700; }
.paper-meta em { font-style: normal; color: var(--ink-2); font-size: 0.75rem; }
.ad-card .ad-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.35;
  max-height: calc(1.35em * 2);
  word-break: break-word;
}
.ad-card .ad-price {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  color: var(--ink);
}
.paper-shot .ad-number {
  left: auto;
  right: 8px;
  min-width: auto;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}
.ad-desc-title {
  margin: 18px 0 8px;
  font-size: 1rem;
}
.ad-desc {
  margin: 0 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  color: var(--ink);
}
.paper-meta .row-ops { margin-top: 6px; }
.slide-preview {
  width: min(420px, 100%);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.slide-preview[hidden] { display: none; }

.state { padding: 28px 0; color: var(--ink-2); }
.note { color: var(--ink); background: var(--primary-50); border-radius: var(--radius); padding: 10px 12px; }
.form-error { color: #7A1D16; background: #FDECEC; border-radius: var(--radius); padding: 10px 12px; }
.notify {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
  gap: 12px;
  align-items: start;
}
.notify-copy textarea { min-height: 180px; }
.audience { display: flex; flex-direction: column; gap: 6px; }
.audience-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: var(--surface);
  text-align: start;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.audience-btn:hover { background: var(--bg); }
.audience-btn:active { transform: scale(0.98); }
.audience-btn.is-on {
  background: var(--primary-50);
  border-color: transparent;
  box-shadow: inset -2px 0 0 var(--primary-ink);
  color: var(--primary-ink);
  font-weight: 700;
}
.notify-field { margin-top: 12px; }
.notify-send {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.notify-send .btn-primary { min-width: 120px; }

.skel span {
  display: block;
  height: 18px;
  margin: 12px 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #EEEAF5, #F7F4FB, #EEEAF5);
  background-size: 200% 100%;
  animation: skel 1.1s ease-in-out infinite;
}
.skel-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.skel-cards span { height: 132px; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .skel span { animation: none; }
  *, *::before, *::after { transition: none; }
}
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.login-body { background: #12152c; font-size: 16px; }
.login-stage {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow: hidden;
}
.login-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, rgba(23, 27, 58, 0.78) 0%, rgba(92, 18, 184, 0.34) 46%, rgba(23, 27, 58, 0.62) 100%);
}
.login-panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
}
.login-card {
  width: 100%;
  background: rgba(252, 252, 253, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  box-shadow: 0 16px 40px rgba(23, 27, 58, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.login-card form { display: flex; flex-direction: column; gap: 8px; }
.login-card label { color: var(--ink); }
.login-card input { min-height: 44px; background: rgba(255, 255, 255, 0.88); }
.login-card .form-error { margin-bottom: 16px; }
.login-card .btn { margin-top: 10px; width: 100%; min-height: 44px; }
.login-card .install { margin-top: 14px; }
.login-card .install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--control);
  background: var(--surface);
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease;
}
.login-card .install-btn:hover { background: var(--bg); }
.login-card .install-ios { padding-inline: 2px; text-align: center; }
.offline-body { display: grid; place-items: center; padding: 32px 16px; }
.offline-card {
  width: min(360px, 100%);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
}
.offline-card img { width: 52px; height: 52px; margin: 0 auto 12px; }
.offline-card h1 { font-size: 1.2rem; margin-bottom: 8px; }
.offline-card p { color: var(--ink-2); }
.login-card .btn-primary:hover { background: #4E0FB0; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .home-bottom { grid-template-columns: 1fr 1fr; }
  .home-bottom .review-panel { grid-column: 1 / -1; }
  .skel-home, .user-stats, .metric-grid { grid-template-columns: 1fr 1fr; }
  .skel-home .bar, .skel-home .wide { grid-column: 1 / -1; }
  .notify { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body[data-page="home"] .shell { grid-template-columns: var(--side) 1fr; }
  body[data-page="home"] .cal-side {
    position: static;
    grid-column: 1 / -1;
    order: 3;
    width: auto;
    height: auto;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
  .login-card { padding: 24px 18px 18px; }
}

@media (max-width: 700px) {
  .home-bottom { grid-template-columns: 1fr; }
  .home-bottom .review-panel { grid-column: auto; }
}

@media (max-width: 767px) {
  .shell, body[data-page="home"] .shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-backdrop { display: block; }
  .side {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(280px, 86vw);
    height: 100dvh;
    border-bottom: 0;
    transform: translate3d(100%, 0, 0);
    transition: transform 200ms ease;
  }
  body.nav-open .side { transform: none; }
  .side nav { display: flex; flex-direction: column; }
  .main { order: 1; padding: 16px 14px 40px; min-width: 0; }
  .top { flex-wrap: wrap; gap: 10px; }
  .top-search, .top-search input { width: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tabs a { flex: none; }
  .sheet { overflow-x: auto; }
  table.data { table-layout: auto; min-width: 680px; }
  .skel-home, .user-stats, .metric-grid, .queue-grid, .skel-cards, .row, .shots { grid-template-columns: 1fr 1fr; }
  .skel-home .bar, .skel-home .wide { grid-column: 1 / -1; }
  .facts { grid-template-columns: 1fr; }
}

/* Glass theme (Elmasa layout language, Laqi colours) */
:root {
  --bg: #F6F5F9;
  --radius: 16px;
  --control: 10px;
  --side: 240px;
  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.7);
  --soft-line: rgba(23, 27, 58, 0.07);
  --glass-blur: 12px;
  --card-shadow: 0 8px 24px rgba(23, 27, 58, 0.05);
  --control-shadow: 0 6px 16px rgba(23, 27, 58, 0.06);
  --ring: 0 0 0 4px rgba(141, 42, 255, 0.16);
  --grad: linear-gradient(180deg, #9A40FF 0%, #7A1FE6 100%);
}
body {
  font-size: 14.5px;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(141, 42, 255, 0.09), transparent 55%),
    radial-gradient(900px 500px at 0% 0%, rgba(92, 18, 184, 0.06), transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

.side {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-inline-end: 1px solid var(--soft-line);
  box-shadow: -4px 0 24px rgba(23, 27, 58, 0.04);
  padding: 0 12px 12px;
  gap: 10px;
  overflow-y: auto;
}
.brand {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 -12px;
  padding: 18px 12px 14px;
  border-bottom: 1px solid var(--soft-line);
  text-align: center;
}
.brand img { width: 56px; height: 56px; border-radius: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.brand-text small { font-size: 0.74rem; color: var(--ink-2); }
.side nav { gap: 3px; padding-top: 4px; }
.side nav a, .side form button, .side .install-btn {
  min-height: 42px;
  padding: 0 14px;
  gap: 12px;
  border-radius: 12px;
}
.side nav a .ph, .side form button .ph, .side .install-btn .ph { font-size: 1.2rem; }
.side nav a:hover, .side form button:hover, .side .install-btn:hover {
  background: rgba(141, 42, 255, 0.08);
  color: var(--primary-ink);
}
.side nav a:hover .ph { color: var(--primary-ink); }
.side nav a[aria-current="page"],
.side nav a[aria-current="page"]:hover {
  background: rgba(141, 42, 255, 0.13);
  color: var(--primary-ink);
  font-weight: 700;
}
@media (min-width: 768px) {
  .side nav a[aria-current="page"] { box-shadow: none; }
}
.side-foot { border-top-color: var(--soft-line); padding-top: 10px; }

.main { padding-top: 0; }
body[data-page="home"] .main { padding-top: 0; }
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 65px;
  margin: 0 -28px 22px;
  padding: 10px 28px;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--soft-line);
}
body[data-page="home"] .top { margin: 0 -22px 18px; padding: 10px 22px; }
.top h1 { font-size: 1.35rem; color: var(--primary-ink); }
.top-tools { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; flex: none; }
.top-search + .top-tools { margin-inline-start: 0; }
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: rgba(141, 42, 255, 0.06);
  color: var(--ink);
  font-weight: 700;
}
.side-user .ph { font-size: 1.6rem; color: var(--primary-ink); }
.bell { position: relative; }
.bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  box-shadow: var(--control-shadow);
  color: var(--primary-ink);
}
.bell-btn .ph { font-size: 1.2rem; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: #fff; }
.bell-dot {
  position: absolute;
  top: 7px;
  inset-inline-end: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #D92D20;
  box-shadow: 0 0 0 2px #fff;
}
.bell-dot[hidden], .bell-panel[hidden] { display: none; }
.bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 50;
  width: min(380px, calc(100vw - 28px));
  max-height: min(480px, 70vh);
  overflow: auto;
  padding: 12px;
  border-radius: 16px;
  background: rgba(252, 252, 253, 0.97);
  border: 1px solid var(--soft-line);
  box-shadow: 0 18px 40px rgba(23, 27, 58, 0.16);
}
.bell-head { padding: 2px 4px 8px; border-bottom: 1px solid var(--soft-line); margin-bottom: 4px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item + .activity-item { border-top: 1px solid var(--soft-line); }
.activity-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-radius: 10px;
}
a.activity-link:hover { background: rgba(141, 42, 255, 0.05); }
.activity-link > .ph {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(141, 42, 255, 0.1);
  color: var(--primary-ink);
  font-size: 1.05rem;
}
.kind-phone_changed .activity-link > .ph { background: rgba(247, 144, 9, 0.14); color: #B54708; }
.kind-account_deleted .activity-link > .ph,
.kind-agent_removed .activity-link > .ph { background: rgba(217, 45, 32, 0.1); color: #B42318; }
.kind-package_near_expiry .activity-link {
  background: rgba(217, 45, 32, 0.06);
}
.kind-package_near_expiry .activity-link > .ph {
  background: rgba(217, 45, 32, 0.12);
  color: #B42318;
}
.kind-package_near_expiry .activity-body b { color: #B42318; }
.activity-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.activity-body b { font-size: 0.82rem; }
.activity-body span { font-size: 0.8rem; color: var(--ink); overflow-wrap: anywhere; }
.activity-body small { font-size: 0.7rem; color: var(--ink-2); }
.activity-empty { padding: 14px 4px; color: var(--ink-2); font-size: 0.8rem; }
.home-bottom > .activity-panel { grid-column: 1 / -1; }
.activity-panel .activity-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.activity-panel .activity-item + .activity-item { border-top: 0; }
.activity-panel .activity-item { border-top: 1px solid var(--soft-line); }
.owner-kind {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(23, 27, 58, 0.06);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 600;
}
.owner-kind.is-company { background: rgba(141, 42, 255, 0.1); color: var(--primary-ink); }
.toolbar .tabs + .tabs { margin-inline-start: 6px; }
.nav-toggle, .cal-toggle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  box-shadow: var(--control-shadow);
  color: var(--primary-ink);
}
.back-btn {
  min-height: 38px;
  border-radius: 12px;
  border-color: var(--glass-line);
  background: var(--glass-strong);
  box-shadow: var(--control-shadow);
  color: var(--primary-ink);
}
.back-btn:hover { background: #fff; }
.cal-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cal-toggle .ph { font-size: 1.2rem; }
.cal-toggle:hover { background: #fff; }
body.cal-collapsed .cal-toggle { background: var(--grad); border-color: transparent; color: #fff; }
body.cal-collapsed .cal-side { display: none; }
body.cal-collapsed[data-page="home"] .shell { grid-template-columns: var(--side) 1fr; }

.cal-side {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-inline-start-color: var(--soft-line);
  padding: 18px 16px 24px;
}
.cal-head strong { font-size: 0.92rem; }
.cal-head button { width: 30px; min-height: 30px; }
.cal-presets { gap: 4px; }
.cal-presets button {
  min-height: 30px;
  border-radius: 999px;
  background: rgba(141, 42, 255, 0.06);
  color: var(--primary-ink);
  font-weight: 600;
}
.cal-presets button:hover { background: rgba(141, 42, 255, 0.14); }
.cal-grid { gap: 2px; }
.cal-day { min-height: 30px; border-radius: 9px; }
.cal-day.is-edge { background: var(--grad); box-shadow: 0 4px 10px rgba(141, 42, 255, 0.28); }
.cal-tiles { border-color: var(--glass-line); border-radius: 14px; background: var(--glass); box-shadow: var(--control-shadow); }
.cal-tile { border-inline-start-color: var(--soft-line); padding: 10px 4px; }
.cal-tile b { font-size: 1.1rem; color: var(--primary-ink); }
.cal-list li { border-top-color: var(--soft-line); }

.panel, .metric, .sheet, .queue, .paper-card, .offline-card, .force-update-platform {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--card-shadow);
}
.panel { padding: 18px 18px 16px; }
.panel h2 { font-size: 1rem; }

.home-alert {
  border-radius: 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #C9372B 0%, #B42318 100%);
  box-shadow: 0 8px 18px rgba(180, 35, 24, 0.2);
}
.home-actions { gap: 8px; margin: 6px 0 14px; }
.home-actions a {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  box-shadow: var(--control-shadow);
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.home-actions a:hover {
  background: #fff;
  border-color: var(--glass-line);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(23, 27, 58, 0.08);
}

.metric-grid, .user-stats { gap: 14px; }
.metric {
  gap: 4px;
  min-height: 118px;
  padding: 16px 16px 14px;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
a.metric:hover {
  background: var(--glass-strong);
  border-color: var(--glass-line);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 27, 58, 0.08);
}
.metric .ph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(141, 42, 255, 0.1);
  color: var(--primary-ink);
  font-size: 1.25rem;
}
.metric-label { font-size: 0.8rem; font-weight: 600; }
.metric strong { font-size: 1.7rem; }
.metric-grid .metric:first-child strong { font-size: 1.9rem; }
.metric-grid .metric:first-child .ph { background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(141, 42, 255, 0.3); }
.home-bottom { gap: 14px; margin-top: 14px; }
.queue-grid { gap: 16px; }

.review-hero { border-radius: 12px; height: 128px; }
.review-strip button { border-radius: 10px; }
.pay-bar { width: min(32px, 80%); border-radius: 8px 8px 3px 3px; background: rgba(141, 42, 255, 0.16); }
.pay-col.is-on .pay-bar, .pay-col:hover .pay-bar { background: var(--grad); }
.ring b { background: #fff; }
.roster li, .legend li, .pay-people a, .review-facts dt, .review-facts dd, .facts dt, .facts dd, .row { border-color: var(--soft-line); }

table.data th {
  background: rgba(255, 255, 255, 0.55);
  padding: 12px 14px;
  border-bottom-color: var(--soft-line);
}
table.data td { padding: 12px 14px; border-bottom-color: var(--soft-line); }
table.data tbody tr:hover td { background: rgba(141, 42, 255, 0.05); }
.op {
  width: 32px;
  height: 32px;
  border-color: var(--glass-line);
  background: var(--glass-strong);
  box-shadow: 0 2px 6px rgba(23, 27, 58, 0.05);
}

.tabs { gap: 4px; border-bottom-color: var(--soft-line); }
.tabs a { min-height: 40px; padding: 8px 14px; }

input, select, textarea {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border-color: rgba(23, 27, 58, 0.1);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--control-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.check input { box-shadow: none; }
.top-search input { min-height: 38px; background: rgba(255, 255, 255, 0.85); }

.btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  border-color: rgba(23, 27, 58, 0.1);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--control-shadow);
}
.btn:hover { background: #fff; }
.btn-primary, .login-card .btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(141, 42, 255, 0.28);
}
.btn-primary:hover, .login-card .btn-primary:hover {
  background: var(--grad);
  color: #fff;
  filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(141, 42, 255, 0.34);
}
.btn-primary:focus-visible { box-shadow: 0 8px 18px rgba(141, 42, 255, 0.28), var(--ring); }
.btn-danger { background: #fff; }
.audience-btn {
  min-height: 44px;
  border-radius: 12px;
  border-color: var(--glass-line);
  background: var(--glass-strong);
  box-shadow: var(--control-shadow);
}
.audience-btn.is-on { background: rgba(141, 42, 255, 0.12); box-shadow: inset -3px 0 0 var(--primary-ink); }
.note, .form-error { border-radius: 12px; }

.login-card { border-radius: 22px; padding: 32px 26px 24px; }
.login-card input { min-height: 46px; }
.login-card .btn { min-height: 46px; }
.login-card .install-btn { border-radius: 12px; }

@media (max-width: 860px) {
  body[data-page="home"] .cal-side { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (max-width: 767px) {
  .main { padding-top: 0; }
  .top, body[data-page="home"] .top { margin: 0 -14px 16px; padding: 10px 14px; }
  .side { background: rgba(252, 252, 253, 0.96); }
  .top-tools { order: 1; }
  .top-search { order: 2; }
  .activity-panel .activity-list { grid-template-columns: 1fr; }
  .bell-panel { position: fixed; top: 64px; inset-inline: 14px; width: auto; }
  table.data td { overflow-wrap: break-word; }
  .metric-grid, .user-stats { gap: 10px; }
  .metric { min-height: 104px; padding: 14px 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  a.metric:hover, .home-actions a:hover { transform: none; }
}

@media screen and (min-width: 768px) {
  html { zoom: 0.9; }
  body, .shell, .login-stage { min-height: calc(100dvh / 0.9); }
  .side { height: calc(100dvh / 0.9); }
  .cal-side { height: auto; }
}
