/*
 * Sakina — admin panel styles (no build step)
 * Fonts: Plus Jakarta Sans and Amiri Quran, SIL Open Font License 1.1 (assets/fonts/*-OFL.txt)
 */

@font-face {
  font-family: 'Jakarta';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Jakarta';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-Medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Jakarta';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Jakarta';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Jakarta';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-ExtraBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Amiri Quran';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/AmiriQuran-Regular.ttf') format('truetype');
}

:root {
  --bg: #f3f4fa;
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --surface-3: #eef0f8;
  --line: #e7e9f3;
  --line-2: #d8dbea;
  --text: #161a3a;
  --text-2: #4a4f74;
  --muted: #8a8fb2;
  --accent: #5b6cf0;
  --accent-2: #4352d8;
  --accent-soft: #eceefe;
  --accent-line: rgba(91, 108, 240, .32);
  --grad: linear-gradient(135deg, #6f7cff 0%, #8e5bd8 100%);
  --green: #1d9c5f;
  --green-soft: #e2f5eb;
  --gold: #b97c0c;
  --gold-soft: #fcf1d9;
  --red: #d63a4b;
  --red-soft: #fde7ea;
  --blue: #2b78ec;
  --blue-soft: #e4eefe;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(22, 26, 58, .04), 0 10px 30px -12px rgba(22, 26, 58, .12);
  --shadow-lg: 0 20px 60px -20px rgba(22, 26, 58, .35);
  --font: 'Jakarta', 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Amiri Quran', 'Amiri', 'Traditional Arabic', serif;
  --side-w: 260px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0a0e2a;
  --surface: #131943;
  --surface-2: #192052;
  --surface-3: #1f275e;
  --line: #242c62;
  --line-2: #303a78;
  --text: #eceeff;
  --text-2: #b9bfe9;
  --muted: #7f87bd;
  --accent: #8e9aff;
  --accent-2: #a8b2ff;
  --accent-soft: rgba(142, 154, 255, .14);
  --accent-line: rgba(142, 154, 255, .35);
  --green: #4cd391;
  --green-soft: rgba(76, 211, 145, .14);
  --gold: #f2c25c;
  --gold-soft: rgba(242, 194, 92, .14);
  --red: #ff7b8a;
  --red-soft: rgba(255, 123, 138, .14);
  --blue: #7fb2ff;
  --blue-soft: rgba(127, 178, 255, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 70px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0a0e2a;
    --surface: #131943;
    --surface-2: #192052;
    --surface-3: #1f275e;
    --line: #242c62;
    --line-2: #303a78;
    --text: #eceeff;
    --text-2: #b9bfe9;
    --muted: #7f87bd;
    --accent: #8e9aff;
    --accent-2: #a8b2ff;
    --accent-soft: rgba(142, 154, 255, .14);
    --accent-line: rgba(142, 154, 255, .35);
    --green: #4cd391;
    --green-soft: rgba(76, 211, 145, .14);
    --gold: #f2c25c;
    --gold-soft: rgba(242, 194, 92, .14);
    --red: #ff7b8a;
    --red-soft: rgba(255, 123, 138, .14);
    --blue: #7fb2ff;
    --blue-soft: rgba(127, 178, 255, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 70px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}

p {
  margin: 0 0 10px;
}

code {
  font: 500 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-2);
  word-break: break-word;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}

::selection {
  background: var(--accent-soft);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon-sm {
  width: 16px;
  height: 16px;
  flex: none;
}

.icon-xs {
  width: 13px;
  height: 13px;
  flex: none;
  display: inline-block;
  vertical-align: -2px;
}
/* ------------------------------------------------------------------ sky band */

.sky-band {
  position: absolute;
  inset: 0 0 auto 0;
  height: 270px;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #070b1f 0%, #1c2558 62%, #3e2f78 100%);
}

.sky-dawn .sky-band {
  background: linear-gradient(180deg, #1a2457 0%, #5b5aa6 60%, #e99aa6 100%);
}

.sky-day .sky-band {
  background: linear-gradient(180deg, #1c5bd0 0%, #3e88e8 60%, #78b2f2 100%);
}

.sky-golden .sky-band {
  background: linear-gradient(180deg, #2f4598 0%, #a46d92 58%, #ef9a5e 100%);
}

.sky-band .stars {
  position: absolute;
  inset: 0;
  opacity: .9;
  background-image:
    radial-gradient(1.3px 1.3px at 8% 22%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 18% 64%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 31% 14%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 44% 48%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 57% 20%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 66% 70%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 78% 30%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 88% 58%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 95% 12%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 25% 38%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 72% 8%, #fff 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 51% 82%, #fff 50%, transparent 52%);
}

.sky-dawn .sky-band .stars {
  opacity: .35;
}

.sky-day .sky-band .stars,
.sky-golden .sky-band .stars {
  display: none;
}

.sky-band .glow {
  position: absolute;
  width: 380px;
  height: 380px;
  right: 6%;
  top: -190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(221, 227, 255, .32), transparent 65%);
}

.sky-day .sky-band .glow {
  background: radial-gradient(circle, rgba(255, 251, 232, .55), transparent 65%);
}

.sky-golden .sky-band .glow {
  top: auto;
  bottom: -220px;
  background: radial-gradient(circle, rgba(255, 210, 127, .5), transparent 65%);
}

.sky-band::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, var(--bg));
}
/* ------------------------------------------------------------------ layout */

.admin {
  position: relative;
  z-index: 1;
}

.side {
  position: fixed;
  z-index: 30;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
}

.side-brand strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.side-brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(160deg, #141b4d 0%, #3e3f92 55%, #b65e8c 85%, #f3a07e 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px -6px rgba(62, 63, 146, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  overflow: hidden;
}

.brand-mark img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
  scrollbar-width: thin;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px;
  margin: 1px 0;
  border-radius: 12px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, color .15s;
}

.side-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.side-nav a.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-ic {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--tile);
  background: color-mix(in srgb, var(--tile) 13%, transparent);
  transition: background .15s, color .15s;
}

.nav-ic .icon {
  width: 18px;
  height: 18px;
}

.side-nav a.is-active .nav-ic {
  color: #fff;
  background: var(--tile);
  box-shadow: 0 6px 14px -6px var(--tile);
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav .count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.side-group {
  margin-top: 12px;
}

.side-group > span {
  display: block;
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.side-foot a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-weight: 600;
}

.side-foot a:hover {
  color: var(--accent);
}

.side-foot span {
  margin-left: auto;
}

.side-scrim {
  display: none;
}

.main {
  margin-left: calc(var(--side-w) + 28px);
  padding: 14px 26px 60px 14px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  margin-bottom: 18px;
}

.topbar .menu-btn {
  display: none;
}

.topbar .search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .15s;
}

.topbar .search:focus-within {
  background: rgba(255, 255, 255, .22);
}

.topbar .search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: #fff;
  font-weight: 500;
}

.topbar .search input::placeholder {
  color: rgba(255, 255, 255, .7);
}

.topbar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.me-btn {
  height: 46px;
  padding: 0 10px 0 6px;
  gap: 9px;
}

.me-text {
  text-align: left;
  line-height: 1.15;
}

.me-text strong {
  display: block;
  font-size: 13.5px;
}

.me-text small {
  font-size: 12px;
  opacity: .8;
}

.theme-moon {
  display: none;
}

html[data-theme="dark"] .theme-sun {
  display: none;
}

html[data-theme="dark"] .theme-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .theme-sun {
    display: none;
  }
  html[data-theme="auto"] .theme-moon {
    display: block;
  }
}

.content {
  max-width: 1320px;
}

.demo-note {
  position: relative;
  z-index: 40;
  text-align: center;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #3b2a00;
  background: linear-gradient(90deg, #ffd27f, #ffb36b);
}
/* ------------------------------------------------------------------ page head */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 6px 0 22px;
  color: #fff;
}

.page-head > div:first-child {
  flex: 1;
  min-width: 240px;
}

.page-head h1 {
  font-size: 28px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .18);
}

.page-head p {
  margin: 6px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, .82);
  font-weight: 500;
}

.page-head p a,
.page-head p code {
  color: #fff;
}

.page-head p code {
  background: rgba(255, 255, 255, .16);
}

.page-head .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-head .eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .8);
}

.crumb:hover {
  color: #fff;
}

.page-head.hero h1 {
  font-size: 32px;
}
/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head h2 .icon {
  color: var(--accent);
}

.card-head .actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.card-head > .muted,
.card-head > .badge,
.card-head > a.muted,
.card-head > .legend {
  margin-left: auto;
}

.card > .card-head:not(:first-child) {
  border-top: 1px solid var(--line);
}

.card-body {
  padding: 18px 20px;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.sticky-save {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.grid {
  display: grid;
  gap: 20px;
}

.grid > .card {
  margin-bottom: 0;
}

.grid + .grid,
.grid + .card,
.card + .grid {
  margin-top: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-main {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

.align-start {
  align-items: start;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  overflow: hidden;
}

.kpi .ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--tile);
  box-shadow: 0 8px 18px -8px var(--tile), inset 0 1px 0 rgba(255, 255, 255, .3);
  margin-bottom: 12px;
}

.kpi small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 12.5px;
}

.kpi strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 2px 0 4px;
}

.kpi .sub {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.up {
  color: var(--green);
  font-weight: 800;
}

.down {
  color: var(--red);
  font-weight: 800;
}
/* app icon tiles (same look as the app) */

.app-tile {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tile) 82%, #fff) 0%, var(--tile) 55%, color-mix(in srgb, var(--tile) 82%, #000) 100%);
  box-shadow: 0 6px 14px -6px var(--tile), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.app-tile svg {
  width: 20px;
  height: 20px;
}

.app-tile.lg {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.app-tile.lg svg {
  width: 30px;
  height: 30px;
}
/* setup checklist */

.setup-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.setup-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  transition: background .15s;
}

.setup-item:last-child {
  border-right: 0;
}

.setup-item:hover {
  background: var(--surface-2);
}

.setup-item > span:nth-child(2) {
  flex: 1;
}

.setup-item strong {
  display: block;
  font-size: 14px;
}

.setup-item small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
  margin-top: 2px;
  word-break: break-word;
}

.setup-item .tick {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 2px dashed var(--line-2);
  display: grid;
  place-items: center;
}

.setup-item.is-done .tick {
  border: 0;
  background: var(--green);
  color: #fff;
}

.setup-item.is-done strong {
  text-decoration: line-through;
  color: var(--muted);
}

.setup-item > .icon-sm {
  color: var(--muted);
  margin-top: 4px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tile strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-top: 4px;
}

.tile small {
  color: var(--muted);
  font-weight: 600;
}
/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--accent-line);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border: 0;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px -10px #6f5cf0;
}

.btn-primary:hover {
  background: var(--grad);
  filter: brightness(1.07);
  box-shadow: 0 10px 24px -10px #6f5cf0;
}

.btn-danger {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #f0596a, #d63a4b);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f0596a, #d63a4b);
  filter: brightness(1.07);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text);
}

.btn-danger-ghost:hover {
  color: var(--red);
  background: var(--red-soft);
}

.btn-glass {
  background: var(--surface-2);
  border-color: var(--line);
}

.page-head .btn-glass,
.topbar .btn-glass {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.page-head .btn-glass:hover,
.topbar .btn-glass:hover {
  background: rgba(255, 255, 255, .24);
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 13px;
}

.btn-icon {
  width: 42px;
  padding: 0;
}

.btn-sm.btn-icon {
  width: 32px;
}

.btn[disabled] {
  opacity: .6;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-row form,
td.actions form,
.actions form {
  display: inline;
}

form.inline {
  display: inline-flex;
  margin-left: 8px;
}

.link {
  color: var(--accent);
  font-weight: 700;
}
/* ------------------------------------------------------------------ forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.f-full {
  grid-column: 1 / -1;
}

.f-half {
  grid-column: span 1;
}

.field {
  margin-bottom: 16px;
}

.field > label:not(.switch):not(.check),
.label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.field .help {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.field .help a {
  color: var(--accent);
  font-weight: 600;
}

.field .error,
.error-text {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--red);
  font-weight: 600;
}

.req {
  color: var(--red);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.textarea {
  resize: vertical;
  line-height: 1.55;
}

.textarea.code {
  font: 500 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.textarea.arabic,
.arabic-input {
  font-family: var(--font-arabic);
  font-size: 23px;
  line-height: 2;
  padding: 12px 16px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--red);
}

.input[readonly] {
  background: var(--surface-2);
  color: var(--text-2);
}

.input-sm,
.select-sm {
  min-height: 34px;
  height: 34px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 13.5px;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9.5l6 6 6-6' fill='none' stroke='%238a8fb2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.form-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-section h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.input-group {
  display: flex;
}

.input-group .input {
  border-radius: 12px 0 0 12px;
}

.input-group .addon {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch .track {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  border-radius: 13px;
  background: var(--line-2);
  transition: background .2s;
}

.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  transition: transform .2s;
}

.switch input:checked + .track {
  background: var(--grad);
}

.switch input:checked + .track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .track {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.switch-help,
.field .switch + .help {
  margin-left: 56px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.color-field {
  display: flex;
  gap: 8px;
}

.color-field input[type=color] {
  width: 46px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.image-field {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.image-field .preview {
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 16px;
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}

.image-field .preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-field.wide .preview {
  width: 184px;
  height: 92px;
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

input[type=file] {
  font-size: 13px;
  color: var(--text-2);
  max-width: 100%;
}

input[type=file]::file-selector-button {
  margin-right: 10px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: 700 13px var(--font);
  cursor: pointer;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding: 4px;
}

.icon-picker label {
  cursor: pointer;
}

.icon-picker input {
  position: absolute;
  opacity: 0;
}

.icon-picker span {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  transition: all .15s;
}

.icon-picker svg {
  width: 22px;
  height: 22px;
}

.icon-picker label:hover span {
  border-color: var(--accent-line);
}

.icon-picker input:checked + span {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px -6px #6f5cf0;
}

.icon-picker input:focus-visible + span {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  gap: 4px;
  border-radius: 13px;
  background: var(--surface-3);
}

.seg label {
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
}

.seg span {
  display: block;
  padding: 7px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-2);
}

.seg input:checked + span {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.seg input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-weight: 600;
  cursor: pointer;
}

.check-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: none;
}

.check-card:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.sortable.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
  cursor: grab;
  user-select: none;
}

.chip-check input {
  accent-color: var(--accent);
}

.chip-check:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.row-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
  font-weight: 600;
  cursor: grab;
  user-select: none;
}

.row-check input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.handle {
  color: var(--muted);
}

.is-dragging {
  opacity: .5;
}

.repeat-rows {
  display: grid;
  gap: 8px;
}

.repeat-head,
.repeat-row {
  display: grid;
  grid-template-columns: 1.1fr .5fr 1.6fr;
  gap: 8px;
}

.repeat-head small {
  color: var(--muted);
  font-weight: 700;
}

.adjust-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.adjust-row label small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.steps-list {
  margin: 0 0 16px;
  padding-left: 20px;
  line-height: 1.8;
  color: var(--text-2);
}

.steps-list a {
  color: var(--accent);
  font-weight: 700;
}

.tool-list > div {
  padding: 2px 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tool-list > div:last-child {
  border: 0;
  margin: 0;
  padding-bottom: 0;
}
/* language tabs on forms with texts in several languages */

.lang-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky;
  top: 0;
  z-index: 6;
}

.lang-tabs-label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-right: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.lang-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2);
}

.lang-tab small {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.lang-tab.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.lang-tab.is-active small {
  color: rgba(255, 255, 255, .85);
}

.lang-tab .missing {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.tr-badge {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}
/* markdown editor */

.md {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.md:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.md-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.md-bar button {
  height: 30px;
  min-width: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.md-bar button:hover {
  background: var(--surface-3);
  color: var(--text);
}

.md-bar .grow {
  flex: 1;
}

.md-bar .md-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.md .md-text {
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  min-height: 320px;
  font-size: 15px;
}

.md-preview {
  padding: 16px 20px;
  min-height: 320px;
}

.prose {
  line-height: 1.7;
}

.prose h1 {
  font-size: 26px;
  margin: 4px 0 14px;
}

.prose h2 {
  font-size: 20px;
  margin: 22px 0 10px;
}

.prose h3 {
  font-size: 17px;
  margin: 18px 0 8px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 14px;
}

.prose blockquote {
  margin: 0 0 14px;
  padding: 10px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
}

.prose img {
  border-radius: 14px;
  margin: 8px 0 14px;
}

.prose a {
  color: var(--accent);
  font-weight: 600;
}

.prose hr {
  margin: 20px 0;
}
/* ------------------------------------------------------------------ tables */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
}

.table th:first-child {
  padding-left: 20px;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table td:first-child {
  padding-left: 20px;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background .12s;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table .actions {
  text-align: right;
  white-space: nowrap;
}

.table .actions > * {
  margin-left: 2px;
}

.table .strong,
.strong {
  font-weight: 700;
}

.table a.strong:hover {
  color: var(--accent);
}

.table .thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.table .thumb .app-tile {
  width: 44px;
  height: 44px;
}

.table .thumb.wide {
  width: 88px;
}

.table .thumb.wide[class*="style-"] {
  background: var(--grad);
}

.cell-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.arabic-cell {
  font-family: var(--font-arabic);
  font-size: 19px;
  line-height: 1.9;
  color: var(--text);
  text-align: right;
}

.arabic-cell.big {
  font-size: 24px;
  text-align: left;
}

.empty-row {
  padding: 0 !important;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 42px 20px;
  text-align: center;
  color: var(--text-2);
}

.empty strong {
  font-size: 16px;
}

.times-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.times-table tr.is-friday td:first-child strong {
  color: var(--accent);
}

.times-table tr.is-today {
  background: var(--accent-soft);
}

.time-input {
  width: 74px;
  height: 34px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-2);
  font: 600 14px/1 var(--font);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text);
}

.time-input:hover {
  border-color: var(--line-2);
}

.time-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.time-input:invalid {
  border-color: var(--red);
}
/* ------------------------------------------------------------------ badges, alerts, misc */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-green {
  background: var(--green-soft);
  color: var(--green);
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-red {
  background: var(--red-soft);
  color: var(--red);
}

.badge-gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--line-2);
  display: inline-block;
}

.dot.green {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.dot.red {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.dot.gold {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 500;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.alert > .icon {
  margin-top: 1px;
}

.alert a {
  font-weight: 700;
  text-decoration: underline;
}

.alert-success {
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
}

.alert-success > .icon {
  color: var(--green);
}

.alert-error {
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
}

.alert-error > .icon {
  color: var(--red);
}

.alert-info > .icon {
  color: var(--blue);
}

.alert-info {
  border-color: color-mix(in srgb, var(--blue) 25%, transparent);
}

.alert-warn {
  border-color: color-mix(in srgb, var(--gold) 40%, transparent);
}

.alert-warn > .icon {
  color: var(--gold);
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-3);
}

.tabs a,
.tabs button {
  padding: 6px 13px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-2);
  border: 0;
  background: none;
}

.tabs .is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.filters .select {
  width: auto;
  min-width: 150px;
  min-height: 40px;
  height: 40px;
}

.search-in {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  min-width: 200px;
}

.search-in:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-in input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
}

.grow {
  flex: 1;
}

.pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-2);
}

.pagination a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.pagination .is-active {
  background: var(--grad);
  color: #fff;
}

.pagination .is-disabled {
  opacity: .45;
}

.card-foot .pagination {
  margin-left: auto;
}

.chart {
  width: 100%;
  display: block;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
}

.chart .grid-line {
  stroke: var(--line);
  stroke-dasharray: 3 4;
}

.chart .area-a {
  fill: url(#none);
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
}

.chart .line-a {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .line-b {
  fill: none;
  stroke: #f0743e;
  stroke-width: 2.2;
  stroke-dasharray: 5 5;
  stroke-linejoin: round;
}

.chart .bar {
  fill: var(--accent);
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

.legend i.b {
  background: #f0743e;
}

.bars-list .row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 70px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.bars-list .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  gap: 7px;
  align-items: center;
}

.bars-list .flag {
  font-size: 16px;
}

.bars-list .track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.bars-list .track span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--grad);
}

.bars-list .val {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bars-list .val small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
}

.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 4px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--grad);
  border-radius: 4px;
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 6px 20px 10px;
}

.list-plain li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.list-plain li:last-child {
  border-bottom: 0;
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0;
  margin: 0;
  padding: 6px 20px 12px;
}

.kv dt,
.kv dd {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 700;
  padding-right: 20px;
}

.kv dd {
  font-weight: 600;
  word-break: break-word;
}

.kv dt:last-of-type,
.kv dd:last-of-type {
  border-bottom: 0;
}

.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}

.dl dt {
  color: var(--muted);
  font-weight: 700;
}

.dl dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.dl a {
  color: var(--accent);
}

.code-box {
  position: relative;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-3);
  font: 500 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  margin: 8px 0 12px;
}

.code-box code {
  background: none;
  padding: 0;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-row code {
  flex: 1;
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffd99a, #f0a07e);
  color: #3b1d10;
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.nowrap {
  white-space: nowrap;
}

.d-block {
  display: block;
}

.center {
  text-align: center;
}

.inline-upload {
  display: inline;
}

.inline-upload label {
  cursor: pointer;
}
/* dropdown, modal, toasts */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  min-width: 210px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all .15s;
}

.dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: var(--surface-2);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 14, 42, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
}

.modal-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--text-2);
}

.modal-card .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@keyframes pop {
  from {
    transform: scale(.96);
    opacity: 0;
  }
}

.toasts {
  position: fixed;
  z-index: 120;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  padding: 10px 18px;
  border-radius: 12px;
  background: #161a3a;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
}
/* settings */

.settings {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 14px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.settings-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.settings-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
/* app texts editor */

.texts-list {
  padding: 4px 0;
}

.text-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.text-row:last-child {
  border-bottom: 0;
}

.text-row code {
  font-size: 11.5px;
}

.text-src p {
  margin: 6px 0 0;
  color: var(--text-2);
}

.text-row.is-edited {
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
}

.edited-note {
  display: block;
  margin-top: 5px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}
/* push composer phone preview */

.phone-preview {
  position: sticky;
  top: 14px;
}

.phone {
  width: 300px;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 14px 12px 40px;
  border-radius: 34px;
  background: linear-gradient(180deg, #1c2558, #3e2f78);
  border: 6px solid #0d1130;
  box-shadow: var(--shadow-lg);
}

.phone-top {
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px 14px;
}

.phone-top .dots {
  width: 52px;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .25);
}

.notif {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  color: #161a3a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.notif-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7099;
  margin-bottom: 6px;
}

.app-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(160deg, #141b4d, #3e3f92 60%, #b65e8c);
  display: grid;
  place-items: center;
}

.app-dot img {
  width: 14px;
  height: 14px;
}

.notif strong {
  display: block;
  font-size: 14px;
}

.notif p {
  margin: 2px 0 0;
  font-size: 13px;
  color: #4a4f74;
  white-space: pre-line;
  word-break: break-word;
}

.notif img {
  margin-top: 10px;
  border-radius: 12px;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
}
/* ------------------------------------------------------------------ sign-in and installer */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(900px 520px at 85% -12%, rgba(124, 108, 240, .38), transparent 62%),
    radial-gradient(700px 400px at 0% 110%, rgba(240, 160, 126, .25), transparent 60%),
    linear-gradient(180deg, #070b1f 0%, #1c2558 55%, #3e2f78 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 30px 28px 26px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.auth-card .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-card .brand strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
}

.auth-card .brand small {
  color: var(--muted);
  font-weight: 600;
}

.auth-card h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-card > p {
  color: var(--text-2);
  margin-bottom: 18px;
}

.auth-card .alert {
  box-shadow: none;
}
/* ------------------------------------------------------------------ responsive */

@media (max-width: 1240px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .setup-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .setup-item:nth-child(2n) {
    border-right: 0;
  }
  .setup-item:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .phone-preview {
    position: static;
  }
}

@media (max-width: 980px) {
  .side {
    transform: translateX(calc(-100% - 20px));
    transition: transform .25s ease;
  }
  body.side-open .side {
    transform: none;
  }
  body.side-open .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(10, 14, 42, .45);
  }
  .main {
    margin-left: 0;
    padding: 10px 16px 50px;
  }
  .topbar .menu-btn {
    display: inline-flex;
  }
  .me-text {
    display: none;
  }
  .settings {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }
  .settings-nav a {
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3,
  .form-grid,
  .form-row,
  .kpis,
  .setup-list,
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .f-half {
    grid-column: 1 / -1;
  }
  .setup-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .page-head h1 {
    font-size: 24px;
  }
  .text-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .adjust-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .repeat-head {
    display: none;
  }
  .repeat-row {
    grid-template-columns: 1fr 70px;
  }
  .repeat-row input:last-child {
    grid-column: 1 / -1;
  }
  .topbar .search {
    max-width: none;
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
  }
  .kv dt {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
