/* ==========================================================================
   مشروعي — Design system
   Royal blue + gold, Moroccan zellige accents
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../assets/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-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-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../assets/fonts/cairo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --royal: #0A1A55;
  --royal-2: #12266F;
  --royal-3: #1C3588;
  --bg: #071339;
  --bg-2: #0A1A55;
  --card: rgba(255, 255, 255, .055);
  --card-2: rgba(255, 255, 255, .03);
  --field: rgba(255, 255, 255, .045);
  --field-b: rgba(255, 255, 255, .1);
  --line: rgba(216, 180, 90, .22);
  --line-soft: rgba(255, 255, 255, .07);
  --gold: #D8B45A;
  --gold-2: #F2DCA0;
  --gold-3: #A87E22;
  --ink: #F5F0E4;
  --ink-2: #E7E0CF;
  --muted: #9EA9CF;
  --muted-2: #7180B1;
  --green: #3DDC97;
  --green-soft: rgba(61, 220, 151, .13);
  --red: #FF8095;
  --red-soft: rgba(255, 128, 149, .13);
  --amber: #FBBF24;
  --blue: #7BA7FF;
  --tab: rgba(6, 15, 44, .92);
  --scrim: rgba(3, 8, 26, .72);
  --shadow: 0 22px 44px -24px rgba(0, 0, 0, .85);
  --gold-glow: 0 14px 34px -16px rgba(216, 180, 90, .75);
  --grad-gold: linear-gradient(135deg, #F7E7B4 0%, #E4C575 32%, #C9A03F 62%, #A87E22 100%);
  --grad-royal: linear-gradient(155deg, #1A3384 0%, #0D1F63 52%, #071139 100%);
  --grad-hero: linear-gradient(150deg, #1B3488 0%, #10246B 46%, #0A1A55 100%);
  --radius: 20px;
  --radius-sm: 14px;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' viewBox='0 0 132 132'%3E%3Cg fill='none' stroke='%23D8B45A' stroke-opacity='0.2' stroke-width='0.9'%3E%3Crect x='36' y='36' width='60' height='60'/%3E%3Crect x='36' y='36' width='60' height='60' transform='rotate(45 66 66)'/%3E%3Ccircle cx='66' cy='66' r='29'/%3E%3Ccircle cx='66' cy='66' r='6'/%3E%3Cpath d='M0 66h26M106 66h26M66 0v26M66 106v26'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="light"] {
  --bg: #F6F1E3;
  --bg-2: #FFFDF7;
  --card: #FFFFFF;
  --card-2: #FBF6E8;
  --field: #FFFFFF;
  --field-b: rgba(16, 28, 70, .14);
  --line: rgba(168, 126, 34, .28);
  --line-soft: rgba(16, 28, 70, .08);
  --gold: #B58A2A;
  --gold-2: #8F6A17;
  --gold-3: #D8B45A;
  --ink: #131F4C;
  --ink-2: #22305F;
  --muted: #6D7593;
  --muted-2: #8B92AB;
  --green: #0E9F6E;
  --green-soft: rgba(14, 159, 110, .1);
  --red: #D63C5B;
  --red-soft: rgba(214, 60, 91, .09);
  --blue: #2B58C8;
  --tab: rgba(255, 253, 247, .95);
  --scrim: rgba(16, 28, 70, .4);
  --shadow: 0 20px 40px -26px rgba(16, 28, 70, .45);
  --gold-glow: 0 14px 30px -18px rgba(168, 126, 34, .55);
  --grad-gold: linear-gradient(135deg, #F0DCA0 0%, #DFC078 34%, #C39B44 68%, #A87E22 100%);
  --grad-royal: linear-gradient(155deg, #16286E, #0C1A52);
  --grad-hero: linear-gradient(150deg, #17307F 0%, #0F2368 48%, #0A1A55 100%);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' viewBox='0 0 132 132'%3E%3Cg fill='none' stroke='%23A87E22' stroke-opacity='0.16' stroke-width='0.9'%3E%3Crect x='36' y='36' width='60' height='60'/%3E%3Crect x='36' y='36' width='60' height='60' transform='rotate(45 66 66)'/%3E%3Ccircle cx='66' cy='66' r='29'/%3E%3Ccircle cx='66' cy='66' r='6'/%3E%3Cpath d='M0 66h26M106 66h26M66 0v26M66 106v26'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Cairo', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
img { max-width: 100%; display: block; }
img, video, canvas { max-width: 100%; }
img[height], video[height] { height: auto; }
iframe, embed, object { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-2); }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- shell / phone frame ---------- */
body {
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(54, 84, 200, .35), transparent 62%),
    radial-gradient(700px 500px at 10% 110%, rgba(168, 126, 34, .14), transparent 60%),
    var(--bg);
}
.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(720px 380px at 50% -6%, rgba(64, 96, 220, .38), transparent 64%),
    radial-gradient(520px 420px at 105% 45%, rgba(168, 126, 34, .12), transparent 70%),
    var(--bg);
}
.shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern);
  opacity: .55;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
}
@media (min-width: 520px) {
  .shell {
    border-inline: 1px solid var(--line);
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9), 0 0 0 10px rgba(255, 255, 255, .02);
  }
}
.view {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px calc(22px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.view.is-flush { padding-inline: 0; }

/* ---------- splash — Luxe Maghribi ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(56px, env(safe-area-inset-top)) 28px max(30px, env(safe-area-inset-bottom));
  background:
    radial-gradient(640px 460px at 50% 30%, rgba(43, 74, 150, .5), transparent 68%),
    linear-gradient(180deg, #0A1931 0%, #12264A 50%, #F9F3E8 100%);
  overflow: hidden;
  transition: opacity .55s ease, visibility .55s;
}
.splash.is-out { opacity: 0; visibility: hidden; }
.splash__zellige {
  width: 220px;
  height: 180px;
  flex: none;
  margin-top: 4vh;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0 L38 22 L60 30 L38 38 L30 60 L22 38 L0 30 L22 22 Z' fill='none' stroke='%23C9A24B' stroke-opacity='0.35'/%3E%3C/svg%3E");
  background-size: 60px;
  opacity: .9;
  animation: rise 1s cubic-bezier(.2, .8, .2, 1) both, drift 50s linear infinite;
}
.splash__ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex: none;
  margin-top: -100px;
  padding: 4px;
  border-radius: 50%;
  border: 1.5px solid #C9A24B;
  background: rgba(10, 25, 49, .6);
  overflow: hidden;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .85), 0 0 60px -18px rgba(201, 162, 75, .55);
  animation: rise .9s .05s cubic-bezier(.2, .8, .2, 1) both;
}
.splash__ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid #C9A24B;
  pointer-events: none;
}
.splash__ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: translateY(10px) scale(1.35);
}
.splash__brand {
  margin-top: 26px;
  direction: ltr;
  padding-inline-start: .4em;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .4em;
  color: #C9A24B;
  animation: rise .9s .12s cubic-bezier(.2, .8, .2, 1) both;
}
.splash__tagline {
  margin-top: 14px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
  animation: rise .9s .2s cubic-bezier(.2, .8, .2, 1) both;
}
.splash__foot {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  animation: fade .8s .3s both;
}
.splash__bar {
  width: 80%;
  height: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .2);
  overflow: hidden;
}
.splash__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #C9A24B;
  animation: splashLoad 1.55s cubic-bezier(.3, .8, .3, 1) forwards;
}
.splash__loading {
  font-size: 12px;
  font-weight: 600;
  color: rgba(10, 25, 49, .55);
}
@keyframes splashLoad { to { width: 100%; } }

/* ---------- typography / utility ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -16px;
  padding: 14px 16px 12px;
  background: linear-gradient(to bottom, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px);
}
.topbar__brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.topbar__logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  padding: 2px;
  background: var(--grad-gold);
  flex: none;
  box-shadow: 0 6px 16px -8px rgba(216, 180, 90, .9);
}
.topbar__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.topbar__title {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.topbar__sub {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
}
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -.2px; }
.page-head p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.h1 { font-size: 26px; font-weight: 800; }
.h2 { font-size: 19px; font-weight: 800; }
.h3 { font-size: 15.5px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.gold { color: var(--gold); }
.gold-text {
  background: linear-gradient(120deg, #F7E7B4, #D8B45A 55%, #B0862C);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cur { font-size: .72em; opacity: .8; font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.center { text-align: center; }
.hidden { display: none !important; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
  font-size: 14.5px;
  font-weight: 800;
}
.section-title__lead { display: flex; align-items: center; gap: 8px; }
.section-title__lead::before {
  content: '';
  width: 4px;
  height: 15px;
  border-radius: 99px;
  background: var(--grad-gold);
  box-shadow: 0 0 12px rgba(216, 180, 90, .6);
}
.section-link { font-size: 12px; font-weight: 700; color: var(--gold-2); background: none; border: 0; padding: 4px; }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card--pad { padding: 18px; }
.card--gold { border-color: var(--line); }
.card--flat { box-shadow: none; }
.card--hero {
  background: var(--grad-hero);
  border: 1px solid rgba(216, 180, 90, .34);
  color: #fff;
  padding: 18px;
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .09);
}
.card--hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern);
  opacity: .5;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 0%, #000, transparent 68%);
  mask-image: radial-gradient(120% 120% at 100% 0%, #000, transparent 68%);
}
.card--hero > * { position: relative; z-index: 1; }
.card--glow::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 180, 90, .22), transparent 70%);
  top: -80px;
  inset-inline-end: -60px;
  pointer-events: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1;
  transition: transform .15s ease, box-shadow .2s, background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:active { transform: scale(.975); }
.btn svg { flex: none; }
.btn--gold { background: var(--grad-gold); color: #2C2104; box-shadow: var(--gold-glow); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--soft { background: rgba(216, 180, 90, .12); border-color: rgba(216, 180, 90, .3); color: var(--gold-2); }
[data-theme="light"] .btn--soft { color: #7A5B12; }
.btn--danger { background: var(--red-soft); border-color: rgba(255, 128, 149, .35); color: var(--red); }
.btn--quiet { background: var(--field); border-color: var(--line-soft); color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 12px; border-radius: 11px; font-size: 12.5px; gap: 6px; }
.btn--xs { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 11.5px; gap: 5px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--field);
  color: var(--ink-2);
  transition: background .18s, border-color .18s, transform .15s;
  flex: none;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn--gold { border-color: var(--line); color: var(--gold-2); background: rgba(216, 180, 90, .1); }
.icon-btn--danger { color: var(--red); border-color: rgba(255, 128, 149, .25); background: var(--red-soft); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 10px; }

.fab {
  position: absolute;
  inset-inline-end: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-gold);
  color: #2C2104;
  box-shadow: 0 18px 34px -12px rgba(0, 0, 0, .8), 0 0 0 6px rgba(216, 180, 90, .1);
  z-index: 30;
  transition: transform .16s;
}
.fab:active { transform: scale(.93); }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.6;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--gold { background: rgba(216, 180, 90, .14); color: var(--gold-2); border-color: rgba(216, 180, 90, .26); }
[data-theme="light"] .badge--gold { color: #7A5B12; }
.badge--green { background: var(--green-soft); color: var(--green); border-color: rgba(61, 220, 151, .2); }
.badge--red { background: var(--red-soft); color: var(--red); border-color: rgba(255, 128, 149, .2); }
.badge--amber { background: rgba(251, 191, 36, .12); color: #F5C24B; border-color: rgba(251, 191, 36, .2); }
[data-theme="light"] .badge--amber { color: #9A6A00; }
.badge--muted { background: var(--field); color: var(--muted); border-color: var(--line-soft); }
.badge--blue { background: rgba(96, 148, 255, .12); color: #92B4FF; border-color: rgba(96, 148, 255, .22); }
[data-theme="light"] .badge--blue { color: #2F5FD0; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line-soft);
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: .18s;
}
.chip.is-active {
  background: rgba(216, 180, 90, .16);
  border-color: rgba(216, 180, 90, .45);
  color: var(--gold-2);
}
[data-theme="light"] .chip.is-active { color: #7A5B12; }
.chip--ghost { border-style: dashed; }

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--field);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}
.seg button {
  flex: 1;
  min-height: 36px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: .18s;
  white-space: nowrap;
  padding: 0 6px;
}
.seg button.is-active {
  background: var(--grad-gold);
  color: #2C2104;
  box-shadow: 0 6px 14px -8px rgba(216, 180, 90, .9);
}

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 13px; }
.field > label, .field__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.field__hint { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; }
.input, .textarea, .select {
  width: 100%;
  min-height: 48px;
  border-radius: 13px;
  border: 1.5px solid var(--field-b);
  background: var(--field);
  color: var(--ink);
  padding: 0 13px;
  font-size: 14.5px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  appearance: none;
}
.textarea { min-height: 96px; padding: 12px 13px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 180, 90, .13);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239EA9CF' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  padding-inline-end: 13px;
  padding-inline-start: 38px;
}
html[dir="ltr"] .select { background-position: right 13px center; padding-inline-start: 13px; padding-inline-end: 38px; }
.input-group { position: relative; }
.input-group .input { padding-inline-end: 46px; }
.input-group__btn {
  position: absolute;
  inset-inline-end: 6px;
  top: 6px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-group__prefix {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.input.has-prefix { padding-inline-start: 52px; }

.switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 99px;
  background: var(--field-b);
  border: 1px solid var(--line-soft);
  flex: none;
  transition: .2s;
  padding: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #B9C1DC;
  transition: .2s cubic-bezier(.3, .8, .3, 1);
}
.switch.is-on { background: rgba(216, 180, 90, .28); border-color: rgba(216, 180, 90, .5); }
.switch.is-on::after { inset-inline-start: 23px; background: var(--gold-2); box-shadow: 0 0 10px rgba(242, 220, 160, .7); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 360px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

/* ---------- rows / lists ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  transition: border-color .18s, background .18s;
}
.row__avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  color: var(--gold-2);
  background: linear-gradient(150deg, rgba(216, 180, 90, .22), rgba(216, 180, 90, .06));
  border: 1px solid var(--line);
  overflow: hidden;
}
[data-theme="light"] .row__avatar { color: #7A5B12; }
.row__avatar img { width: 100%; height: 100%; object-fit: cover; }
.row__main { flex: 1; min-width: 0; }
.row__title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.row__sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.row__amt { font-size: 14px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row__acts { display: flex; gap: 5px; flex: none; }
.row--tight { padding: 10px 11px; }
.row--tap:active { background: var(--card-2); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(216, 180, 90, .03);
}
.empty__ico {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(216, 180, 90, .1);
  color: var(--gold-2);
  border: 1px solid var(--line);
}
.empty b { color: var(--ink); font-size: 14px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  padding: 13px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line-soft);
}
.stat__label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat__val { font-size: 18px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat--gold { border-color: var(--line); background: linear-gradient(160deg, rgba(216, 180, 90, .13), rgba(216, 180, 90, .03)); }
.stat--red { border-color: rgba(255, 128, 149, .2); background: linear-gradient(160deg, var(--red-soft), transparent); }
.stat--green { border-color: rgba(61, 220, 151, .2); background: linear-gradient(160deg, var(--green-soft), transparent); }

/* ---------- home ---------- */
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-label { font-size: 11.5px; color: rgba(255, 255, 255, .68); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.hero-value { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.hero-value b { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.hero-value small { font-size: 12px; color: var(--gold-2); font-weight: 700; }
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-split div small { display: block; font-size: 10px; color: rgba(255, 255, 255, .6); margin-bottom: 2px; }
.hero-split div b { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-badge {
  background: rgba(216, 180, 90, .16);
  border: 1px solid rgba(216, 180, 90, .4);
  color: var(--gold-2);
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  transition: .18s;
}
.quick:active { transform: scale(.96); }
.quick__ico {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(216, 180, 90, .12);
  color: var(--gold-2);
  border: 1px solid var(--line);
}
[data-theme="light"] .quick__ico { color: #7A5B12; }

.alert-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, .26);
  background: rgba(251, 191, 36, .08);
  font-size: 12px;
  color: var(--ink-2);
}
.alert-card--red { border-color: rgba(255, 128, 149, .3); background: var(--red-soft); }
.alert-card__ico { color: var(--amber); flex: none; }
.alert-card--red .alert-card__ico { color: var(--red); }

.summary-line { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 12.5px; }
.summary-line + .summary-line { border-top: 1px dashed var(--line-soft); }
.summary-line b { font-weight: 800; font-variant-numeric: tabular-nums; }
.summary-total {
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; font-weight: 800;
}
.progress { height: 6px; border-radius: 99px; background: var(--field); overflow: hidden; margin-top: 7px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--grad-gold); }
.progress--green > span { background: linear-gradient(90deg, #2FBF88, #3DDC97); }

/* ---------- charts ---------- */
.chart { display: flex; align-items: flex-end; gap: 7px; height: 132px; padding-top: 8px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.chart__track { width: 100%; height: 100%; display: flex; align-items: flex-end; }
.chart__bar {
  width: 100%;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, rgba(168, 126, 34, .75));
  box-shadow: 0 0 18px -6px rgba(216, 180, 90, .6);
  transition: height .5s cubic-bezier(.2, .8, .2, 1);
  position: relative;
}
.chart__bar.is-empty { background: var(--field); box-shadow: none; }
.chart__bar.is-active { background: linear-gradient(180deg, #FFF2CD, #E4C575 50%, #C9A03F); }
.chart__col.is-active .chart__label { color: var(--gold-2); font-weight: 800; }
.chart__label { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.chart__val { font-size: 9px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
[data-theme="light"] .chart__label { color: var(--muted); }

.spark { width: 100%; height: 38px; display: block; overflow: visible; }
.spark path.line { fill: none; stroke: var(--gold-2); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 2px 6px rgba(216, 180, 90, .45)); }
.spark path.area { fill: url(#sparkGrad); stroke: none; }

/* ---------- bar / meter list ---------- */
.meter { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; }
.meter__top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.meter__top b { font-variant-numeric: tabular-nums; }
.meter__bar { height: 5px; border-radius: 99px; background: var(--field); overflow: hidden; }
.meter__bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(216, 180, 90, .5), var(--gold-2)); }
.meter__bar.is-green > span { background: linear-gradient(90deg, rgba(61, 220, 151, .4), var(--green)); }
.meter__bar.is-red > span { background: linear-gradient(90deg, rgba(255, 128, 149, .4), var(--red)); }

/* ---------- auth ---------- */
.auth {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 20px 30px;
}
.auth__brand { text-align: center; margin-bottom: 22px; }
.auth__logo {
  width: 104px; height: 104px;
  margin: 0 auto 14px;
  border-radius: 26px;
  padding: 4px;
  background: var(--grad-gold);
  box-shadow: 0 24px 40px -22px rgba(0, 0, 0, .9), 0 0 50px -16px rgba(216, 180, 90, .5);
}
.auth__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
.auth__name { font-size: 34px; font-weight: 800; letter-spacing: .3px; }
.auth__tag { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.auth__card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .035));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
}
[data-theme="light"] .auth__card { background: #fff; }
.auth__tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.auth__tab {
  flex: 1;
  background: none;
  border: 0;
  padding: 8px 0 11px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  position: relative;
}
.auth__tab.is-active { color: var(--gold-2); }
[data-theme="light"] .auth__tab.is-active { color: #7A5B12; }
.auth__tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  inset-inline: 18%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-gold);
}
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 11px;
  margin: 15px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.google-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: #fff;
  color: #1F2937;
  font-weight: 700;
  font-size: 14px;
  transition: transform .15s;
}
.google-btn:active { transform: scale(.98); }
.bio-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(216, 180, 90, .05);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}
.bio-btn__ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(216, 180, 90, .12);
  color: var(--gold-2);
  flex: none;
}
[data-theme="light"] .bio-btn__ico { color: #7A5B12; }
.auth__hint {
  margin-top: 14px;
  text-align: center;
  font-size: 10.5px;
  color: var(--muted-2);
  line-height: 1.6;
}
.auth__foot { margin-top: 18px; text-align: center; font-size: 10.5px; color: var(--muted-2); display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- onboarding ---------- */
.onb-head { padding: 22px 0 6px; }
.onb-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.onb-steps span { height: 4px; flex: 1; border-radius: 99px; background: var(--field); }
.onb-steps span.is-on { background: var(--grad-gold); box-shadow: 0 0 12px rgba(216, 180, 90, .4); }
.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.biz {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 13px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(170deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
  text-align: start;
  transition: .18s;
  overflow: hidden;
}
.biz:active { transform: scale(.975); }
.biz.is-selected { border-color: var(--gold); background: linear-gradient(170deg, rgba(216, 180, 90, .17), rgba(216, 180, 90, .04)); }
.biz__ico {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px;
  background: linear-gradient(150deg, rgba(216, 180, 90, .22), rgba(216, 180, 90, .05));
  border: 1px solid var(--line);
  margin-bottom: 9px;
}
.biz__name { font-size: 13.5px; font-weight: 800; }
.biz__type { font-size: 10px; color: var(--muted); margin-top: 1px; }
.biz__check {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--grad-gold);
  color: #2C2104;
  display: none;
  align-items: center;
  justify-content: center;
}
.biz.is-selected .biz__check { display: flex; }
.biz--custom {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  border-style: dashed;
  border-color: var(--line);
  background: linear-gradient(120deg, rgba(216, 180, 90, .1), rgba(216, 180, 90, .02));
}
.biz--custom .biz__ico { margin-bottom: 0; flex: none; }
.biz--custom .biz__name { font-size: 14.5px; }
.biz__spark { margin-inline-start: auto; color: var(--gold-2); }
.detect-card { border: 1px solid var(--line); background: linear-gradient(160deg, rgba(216, 180, 90, .1), rgba(255, 255, 255, .02)); }
.detect-type { display: flex; align-items: center; gap: 12px; }
.detect-type__ico {
  width: 58px; height: 58px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: linear-gradient(150deg, rgba(216, 180, 90, .26), rgba(216, 180, 90, .06));
  border: 1px solid var(--line);
  flex: none;
}
.conf-bar { height: 5px; border-radius: 99px; background: var(--field); overflow: hidden; margin-top: 6px; }
.conf-bar > span { display: block; height: 100%; background: var(--grad-gold); border-radius: 99px; }
.module-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.module-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 9px;
  font-size: 10.5px; font-weight: 700;
  background: var(--field);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
}
.tpl-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.tpl-meta b { color: var(--ink); font-weight: 700; }
.example-chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- tabbar ---------- */
.tabbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--tab);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 -18px 36px -30px rgba(0, 0, 0, .9);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0 3px;
  background: none;
  border: 0;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  transition: color .18s;
}
.tab__ico {
  width: 40px;
  height: 27px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .18s;
}
.tab.is-active { color: var(--gold-2); }
.tab.is-active .tab__ico { background: rgba(216, 180, 90, .16); box-shadow: inset 0 0 0 1px rgba(216, 180, 90, .28); }
[data-theme="light"] .tab.is-active { color: #7A5B12; }
.tab.is-active .tab__ico svg { filter: drop-shadow(0 3px 8px rgba(216, 180, 90, .45)); }

/* ---------- layer: sheets / modals ---------- */
.layer { position: fixed; inset: 0; z-index: 120; }
.layer__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  animation: fade .22s ease both;
}
.layer__host {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}
.sheet {
  pointer-events: auto;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .85);
  animation: sheetUp .3s cubic-bezier(.22, .85, .25, 1) both;
  padding-bottom: env(safe-area-inset-bottom);
}
[data-theme="light"] .sheet { background: linear-gradient(180deg, #FFFDF7, #F7F1E1); }
.sheet__grip { width: 42px; height: 4px; border-radius: 99px; background: var(--field-b); margin: 9px auto 2px; flex: none; }
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 4px;
  flex: none;
}
.sheet__title { font-size: 17px; font-weight: 800; }
.sheet__sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.sheet__body { padding: 12px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }
.sheet__foot {
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(to top, var(--bg-2), transparent);
  display: flex;
  gap: 10px;
  flex: none;
}
.sheet__foot .btn { flex: 1; }

.layer--center .layer__host { justify-content: center; align-items: center; padding: 20px; }
.modal {
  pointer-events: auto;
  width: 100%;
  max-width: 380px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--bg-2), var(--bg));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
  padding: 20px;
  animation: pop .26s cubic-bezier(.2, .9, .3, 1) both;
}
[data-theme="light"] .modal { background: #FFFDF7; }
.modal__ico {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(255, 128, 149, .25);
}
.modal__ico--gold { background: rgba(216, 180, 90, .14); color: var(--gold-2); border-color: var(--line); }
.modal h3 { font-size: 18px; font-weight: 800; }
.modal p { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.65; }
.modal__acts { display: flex; gap: 9px; margin-top: 18px; }
.modal__acts .btn { flex: 1; }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  z-index: 400;
  inset-inline: 0;
  bottom: calc(86px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 18px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 420px;
  padding: 11px 14px;
  border-radius: 14px;
  background: #0D1E58;
  border: 1px solid var(--line);
  color: #F5F0E4;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9);
  animation: toastIn .28s cubic-bezier(.2, .85, .3, 1) both;
  pointer-events: auto;
}
[data-theme="light"] .toast { background: #10204F; }
.toast--ok .toast__ico { color: var(--green); }
.toast--err .toast__ico { color: var(--red); }
.toast--info .toast__ico { color: var(--gold-2); }
.toast.is-out { animation: toastOut .22s ease forwards; }
.toast__ico { display: flex; flex: none; }
.toast__msg { flex: 1; }
.toast__act {
  background: rgba(216, 180, 90, .16);
  border: 1px solid var(--line);
  color: var(--gold-2);
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

/* ---------- invoice / print ---------- */
.invoice {
  background: #FFFDF7;
  color: #15204A;
  border-radius: 18px;
  padding: 18px;
  font-size: 12px;
  line-height: 1.6;
}
.invoice__top { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 2px solid #D8B45A; }
.invoice__logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.invoice__biz { flex: 1; }
.invoice__biz b { font-size: 15px; display: block; color: #0A1A55; }
.invoice__biz span { font-size: 10px; color: #6B7392; }
.invoice__no { text-align: end; font-size: 10px; color: #6B7392; }
.invoice__no b { display: block; font-size: 13px; color: #15204A; }
.invoice__meta { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; font-size: 11px; color: #4A5375; }
.invoice__meta b { color: #15204A; }
.invoice table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.invoice th {
  font-size: 10px; text-align: start; color: #6B7392; font-weight: 700;
  padding: 7px 0; border-bottom: 1px solid #E4DCC6;
}
.invoice td { padding: 9px 0; border-bottom: 1px dashed #E9E2CE; font-size: 11.5px; }
.invoice td:last-child, .invoice th:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.invoice__totals { margin-top: 10px; margin-inline-start: auto; width: 65%; }
.invoice__totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 11.5px; }
.invoice__totals div.grand { border-top: 2px solid #D8B45A; margin-top: 4px; padding-top: 8px; font-weight: 800; font-size: 14px; color: #0A1A55; }
.invoice__foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed #E4DCC6; }
.invoice__qr { width: 82px; height: 82px; flex: none; }
.invoice__qr svg, .invoice__qr img { width: 100%; height: 100%; }
.invoice__thanks { font-size: 10px; color: #6B7392; }
.invoice__thanks b { display: block; font-size: 11.5px; color: #0A1A55; margin-bottom: 2px; }
.invoice__brand { margin-top: 8px; text-align: center; font-size: 9px; color: #9AA2BC; letter-spacing: .6px; }

#print-root { display: none; }

/* ---------- misc ---------- */
.avatar-mini {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(216, 180, 90, .14);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-weight: 800;
  font-size: 14px;
  flex: none;
}
[data-theme="light"] .avatar-mini { color: #7A5B12; }
.notif-dot {
  position: absolute;
  top: 6px; inset-inline-end: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--bg);
}
.icon-btn { position: relative; }

.settings-group { border-radius: 18px; border: 1px solid var(--line-soft); background: var(--card); overflow: hidden; }
.settings-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  width: 100%;
  background: none;
  border: 0;
  text-align: start;
  color: var(--ink);
}
.settings-row + .settings-row { border-top: 1px solid var(--line-soft); }
.settings-row__ico {
  width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(216, 180, 90, .1);
  border: 1px solid var(--line);
  color: var(--gold-2);
  flex: none;
}
[data-theme="light"] .settings-row__ico { color: #7A5B12; }
.settings-row__main { flex: 1; min-width: 0; }
.settings-row__title { font-size: 13.5px; font-weight: 700; }
.settings-row__sub { font-size: 10.5px; color: var(--muted); }
.settings-row--danger .settings-row__title, .settings-row--danger .settings-row__ico { color: var(--red); }
.settings-row--danger .settings-row__ico { background: var(--red-soft); border-color: rgba(255, 128, 149, .25); }
.chev { color: var(--muted-2); transform: rotate(180deg); }

.profile-card { display: flex; align-items: center; gap: 13px; padding: 16px; }
.profile-card__img {
  width: 58px; height: 58px; border-radius: 18px; padding: 3px;
  background: var(--grad-gold); flex: none;
}
.profile-card__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; }
.profile-card__name { font-size: 16px; font-weight: 800; }
.profile-card__sub { font-size: 11.5px; color: var(--muted); }

.lang-opt {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 0; background: none; border: 0;
  border-bottom: 1px solid var(--line-soft); color: var(--ink);
  font-size: 13.5px; font-weight: 600;
}
.lang-opt:last-child { border-bottom: 0; }
.lang-opt.is-active { color: var(--gold-2); font-weight: 800; }
[data-theme="light"] .lang-opt.is-active { color: #7A5B12; }

.upload {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 14px; border: 1px dashed var(--line);
  background: rgba(216, 180, 90, .04); width: 100%; color: var(--ink-2);
  font-size: 12px; font-weight: 600; text-align: start;
}
.upload__preview {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  background: var(--field); border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); overflow: hidden;
}
.upload__preview img { width: 100%; height: 100%; object-fit: cover; }

.staff-pin {
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  font-weight: 800;
  color: var(--gold-2);
}

/* ---------- animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { background-position: 0 0; } to { background-position: 264px 264px; } }
@keyframes load { 0% { transform: translateX(130%); } 100% { transform: translateX(-230%); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.anim-in { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.anim-in-2 { animation: rise .38s .06s cubic-bezier(.2, .8, .2, 1) both; }
.anim-in-3 { animation: rise .38s .12s cubic-bezier(.2, .8, .2, 1) both; }
.spin { display: inline-flex; animation: spin 1s linear infinite; }

/* ---------- support ---------- */
.sheet__form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet__form .sheet__body { flex: 1; min-height: 0; }

.search-field .input { padding-inline-start: 44px; }
.search-field__ico {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--muted);
  pointer-events: none;
}

.item-card { padding: 12px; }
.item-card .row { padding: 0; background: none; border: 0; border-radius: 0; }
.item-card__top { align-items: flex-start; }
.item-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}
.item-card__foot .row__acts { margin-inline-start: auto; }

.chart__bar.is-negative {
  background: linear-gradient(180deg, #FF9A9A, #E15B5B 55%, rgba(160, 40, 40, .8));
  box-shadow: 0 0 18px -6px rgba(225, 91, 91, .6);
}
.chart__bar.is-active.is-negative { background: linear-gradient(180deg, #FFC7C7, #EF7373 50%, #C24B4B); }

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"] { color-scheme: dark; }

.mt-10 { margin-top: 10px; }

/* ---------- voice, caisse, devis, projects ---------- */
.icon-btn--voice { color: var(--gold-2); border-color: var(--line); background: rgba(216, 180, 90, .08); }
.icon-btn--voice:active { background: rgba(216, 180, 90, .2); }

.item-card.is-off { opacity: .62; }
.item-card.is-off .row__avatar { filter: grayscale(1); }

.calc-box { background: linear-gradient(160deg, rgba(216, 180, 90, .08), transparent); border-color: var(--line); }
.calc-total { font-size: 18px; font-weight: 800; }

.voice-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: start;
  padding: 11px 13px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(216, 180, 90, .45);
  background: linear-gradient(135deg, rgba(18, 40, 120, .5), rgba(216, 180, 90, .1));
  color: var(--ink-2);
  cursor: pointer;
  transition: .18s;
}
.voice-card:active { transform: scale(.985); }
[data-theme="light"] .voice-card { background: linear-gradient(135deg, rgba(10, 26, 85, .06), rgba(216, 180, 90, .14)); }
.voice-card__ico {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-gold); color: #2C2104;
  box-shadow: var(--gold-glow); flex: none;
}
.voice-card__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.voice-card__txt b { font-size: 13px; }
.voice-card__txt span { font-size: 10.5px; color: var(--muted); }
.voice-card__wave { display: flex; align-items: center; gap: 2px; height: 18px; flex: none; }
.voice-card__wave i { width: 2.5px; height: 6px; border-radius: 99px; background: var(--gold-2); opacity: .55; }
.voice-card__wave i:nth-child(2) { height: 12px; }
.voice-card__wave i:nth-child(3) { height: 16px; }
.voice-card__wave i:nth-child(4) { height: 9px; }
.voice-heard {
  font-size: 11.5px; line-height: 1.7; color: var(--gold-2);
  background: rgba(216, 180, 90, .08); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 11px; margin: -6px 0 12px;
}
.voice-heard.is-live { animation: voicePulse 1.1s ease-in-out infinite; }
.voice-heard.is-miss { color: var(--red); background: var(--red-soft); border-color: rgba(255, 128, 149, .3); }
@keyframes voicePulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.cash-badge { font-variant-numeric: tabular-nums; }
.cash-bars { display: grid; gap: 10px; margin-top: 16px; }
.cash-bar__head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: rgba(255, 255, 255, .72); margin-bottom: 5px; gap: 8px; }
.cash-bar__head b { font-size: 12px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.cash-bar__head span { display: inline-flex; align-items: center; gap: 5px; }
.cash-bar__track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.cash-bar__fill { display: block; height: 100%; border-radius: 99px; transition: width .5s ease; }
.cash-bar__fill.is-in { background: linear-gradient(90deg, #2FBF88, var(--green)); }
.cash-bar__fill.is-out { background: linear-gradient(90deg, #C9405D, var(--red)); }
.cash-move { padding: 11px 12px; }
.cash-move__in { background: var(--green-soft); color: var(--green); border-color: rgba(61, 220, 151, .22); }
.cash-move__out { background: var(--red-soft); color: var(--red); border-color: rgba(255, 128, 149, .22); }
.cash-plus, .cash-minus { font-weight: 800; font-variant-numeric: tabular-nums; }
.cash-plus { color: var(--green); }
.cash-minus { color: var(--red); }

.devis-head { display: flex; flex-direction: column; gap: 2px; }
.devis-lines { display: flex; flex-direction: column; gap: 8px; }
.devis-line { padding: 11px 12px; }
.devis-add-row { display: flex; gap: 8px; margin-top: 10px; }
.devis-add-row .btn { flex: 1; }
.devis-summary { margin-top: 14px; padding: 14px; }
.devis-summary > div { padding: 6px 0; font-size: 12.5px; }
.devis-summary > div + div { border-top: 1px dashed var(--line-soft); }
.devis-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.input--mini { width: 108px; height: 38px; text-align: end; padding: 0 10px; font-weight: 700; }
.devis-total-row { font-weight: 800; font-size: 13.5px; }
.devis-total-row .calc-total { font-size: 19px; }
.devis-actions { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
.devis-actions .btn--block { flex: 1; }
.devis-actions .btn--soft { width: 54px; justify-content: center; }
[dir="ltr"] .flip-rtl { transform: scaleX(-1); }

/* ---------- print ---------- */
@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  .invoice { border-radius: 0; padding: 0; max-width: 190mm; margin: 0 auto; }
  .invoice__qr { width: 90px; height: 90px; }
}

/* ---------- small screens ---------- */
@media (max-width: 370px) {
  .biz-grid { grid-template-columns: 1fr; }
  .biz--custom { grid-column: auto; }
  .hero-value b { font-size: 27px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .quick { font-size: 9.5px; padding: 10px 2px 8px; }
}

/* ==========================================================================
   Luxe Maghribi — login & dashboard (splash above)
   ========================================================================== */
.shell--luxe {
  --lx-navy: #0A1931;
  --lx-navy-2: #12264A;
  --lx-beige: #F9F3E8;
  --lx-beige-2: #EFE6D5;
  --lx-gold: #C9A24B;
  --lx-gold-2: #E8D9A8;
  --lx-text: #0A1931;
  --lx-grey: #8A8A8A;
  --lx-green: #1E9E62;
  --lx-red: #E74C3C;
  --lx-line: #EFE6D5;
  --lx-shadow: 0 10px 30px rgba(10, 25, 49, .08);
  background:
    radial-gradient(620px 380px at 100% -4%, rgba(201, 162, 75, .1), transparent 64%),
    radial-gradient(520px 380px at 0% 20%, rgba(18, 38, 74, .05), transparent 70%),
    var(--lx-beige);
  color: var(--lx-text);
}
.shell--luxe::before { display: none; }
.shell--luxe .view { padding: 0; }

/* ---------- auth ---------- */
.auth-luxe {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--lx-text);
}
.auth-luxe__body {
  flex: 1;
  width: 100%;
  max-width: 404px;
  margin: 0 auto;
  padding: 20px 22px 4px;
}
.auth-luxe__head { text-align: center; margin-bottom: 18px; }
.auth-luxe__title {
  font-size: 29px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -.3px;
  color: var(--lx-navy);
}
.auth-luxe__sub { margin-top: 3px; font-size: 13.5px; color: rgba(10, 25, 49, .6); }
.auth-luxe__tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--lx-beige-2);
  border: 1px solid #E8DCC4;
  border-radius: 16px;
}
.auth-luxe__tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: none;
  font-size: 13.5px;
  font-weight: 800;
  color: #7A7364;
  transition: .18s;
}
.auth-luxe__tab.is-active {
  background: var(--lx-navy);
  color: var(--lx-gold-2);
  box-shadow: 0 8px 18px -10px rgba(10, 25, 49, .75);
}
.auth-luxe .field { margin-bottom: 12px; }
.auth-luxe .field > label, .auth-luxe .field__label {
  font-size: 11.5px;
  font-weight: 800;
  color: rgba(10, 25, 49, .58);
  margin-bottom: 6px;
}
.auth-luxe .field__hint { color: rgba(10, 25, 49, .45); font-size: 10px; }
.auth-luxe .input, .auth-luxe .select {
  min-height: 52px;
  border-radius: 15px;
  border: 1px solid var(--lx-line);
  background: #fff;
  color: var(--lx-navy);
  font-weight: 600;
  box-shadow: 0 10px 24px -20px rgba(10, 25, 49, .55);
}
.auth-luxe .input::placeholder { color: #A9A294; font-weight: 500; }
.auth-luxe .input:focus, .auth-luxe .select:focus {
  border-color: var(--lx-gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 75, .16);
}
.auth-luxe .input-group__prefix { color: var(--lx-navy); font-size: 13.5px; font-weight: 800; }
.auth-luxe .input-group__btn {
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
  color: #8A8A8A;
}
.auth-luxe .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230A1931' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  padding-inline-end: 13px;
  padding-inline-start: 38px;
}
html[dir="ltr"] .auth-luxe .select {
  background-position: right 13px center;
  padding-inline-start: 13px;
  padding-inline-end: 38px;
}
.auth-luxe__cta {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 15px;
  background: var(--lx-navy);
  color: var(--lx-gold-2);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 14px 28px -14px rgba(10, 25, 49, .7);
  transition: transform .15s, background .2s, opacity .2s;
}
.auth-luxe__cta:active { transform: scale(.985); background: var(--lx-navy-2); }
.auth-luxe__divider { color: #A39780; margin: 15px 0; }
.auth-luxe__google {
  min-height: 52px;
  border-radius: 15px;
  border: 1px solid #E8DCC4;
  box-shadow: 0 10px 24px -20px rgba(10, 25, 49, .5);
}
.auth-luxe__mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.auth-mini {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--lx-line);
  box-shadow: 0 10px 24px -20px rgba(10, 25, 49, .5);
  color: var(--lx-navy);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  transition: transform .16s;
}
.auth-mini:active { transform: scale(.97); }
.auth-mini__ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 162, 75, .14);
  border: 1px solid rgba(201, 162, 75, .3);
  color: #A87E22;
}
.auth-luxe__hint {
  margin-top: 14px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(10, 25, 49, .45);
}
.auth-luxe__alt {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(10, 25, 49, .6);
}
.auth-luxe__alt button {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: #A87E22;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-luxe__foot {
  margin-top: 10px;
  padding: 0 22px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 10.5px;
  color: rgba(10, 25, 49, .4);
}

/* ---------- dashboard ---------- */
.lx-page { min-height: 100%; }
.lx-head {
  position: relative;
  padding: calc(18px + env(safe-area-inset-top)) 20px 44px;
  background:
    radial-gradient(420px 260px at 92% -12%, rgba(201, 162, 75, .24), transparent 66%),
    linear-gradient(150deg, #12264A 0%, #0A1931 58%, #07132B 100%);
  border-radius: 0 0 28px 28px;
  color: #fff;
  overflow: hidden;
}
.lx-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern);
  opacity: .42;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(130% 110% at 100% 0%, #000, transparent 72%);
  mask-image: radial-gradient(130% 110% at 100% 0%, #000, transparent 72%);
}
.lx-head::after {
  content: '✦';
  position: absolute;
  inset-inline-start: 4px;
  top: -10px;
  font-size: 96px;
  line-height: 1;
  color: rgba(201, 162, 75, .13);
  pointer-events: none;
}
.lx-head__row { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.lx-id { flex: 1; min-width: 0; }
.lx-hello {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.lx-hello svg { color: var(--lx-gold-2); flex: none; }
.lx-biz {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(232, 217, 168, .88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lx-biz__dot { color: var(--lx-gold); }
.lx-head__acts { display: flex; align-items: center; gap: 8px; flex: none; }
.lx-bell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
}
.lx-dot {
  position: absolute;
  top: 9px;
  inset-inline-end: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lx-red);
  box-shadow: 0 0 0 2px #0A1931;
}
.lx-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F7E7B4, #C9A24B);
  border: 2px solid rgba(255, 255, 255, .55);
  color: var(--lx-navy);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6);
}
.lx-body { padding: 0 18px 26px; }
.lx-balance {
  position: relative;
  z-index: 2;
  margin-top: -30px;
  padding: 17px 16px 14px;
  background: #fff;
  border: 1px solid rgba(10, 25, 49, .05);
  border-radius: 20px;
  box-shadow: 0 18px 40px -24px rgba(10, 25, 49, .45);
}
.lx-balance__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lx-balance__label { font-size: 12px; font-weight: 600; color: var(--lx-grey); }
.lx-balance__amount {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.6px;
  color: var(--lx-navy);
  font-variant-numeric: tabular-nums;
}
.lx-balance__amount span { font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--lx-grey); }
.lx-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.lx-trend.is-up { background: rgba(30, 158, 98, .1); color: var(--lx-green); }
.lx-trend.is-down { background: rgba(231, 76, 60, .1); color: var(--lx-red); }
.lx-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.lx-pill { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 12px; }
.lx-pill span { display: flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 700; opacity: .85; }
.lx-pill b { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lx-pill.is-in { background: rgba(30, 158, 98, .09); color: #167A4B; }
.lx-pill.is-out { background: rgba(231, 76, 60, .08); color: #C0392B; }
.lx-pill.is-neutral { background: rgba(201, 162, 75, .13); color: #8F6A17; }
.lx-spark { margin-top: 10px; opacity: .9; }
.lx-spark .spark { height: 34px; }
.lx-spark .spark path.line { stroke: var(--lx-gold); filter: none; }
.lx-spark .spark circle { fill: var(--lx-gold); }
.lx-balance__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--lx-line);
  font-size: 10.5px;
  color: var(--lx-grey);
}
.lx-balance__foot b { font-weight: 800; font-variant-numeric: tabular-nums; }
.lx-balance__foot b.is-up { color: var(--lx-green); }
.lx-balance__foot b.is-down { color: var(--lx-red); }
.lx-alerts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lx-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(201, 162, 75, .1);
  border: 1px solid rgba(201, 162, 75, .26);
  color: #6E5514;
  font-size: 11.5px;
  font-weight: 600;
  text-align: start;
}
.lx-alert.is-danger { background: rgba(231, 76, 60, .07); border-color: rgba(231, 76, 60, .24); color: #B03A2E; }
.lx-alert__ico { display: flex; flex: none; color: var(--lx-gold); }
.lx-alert.is-danger .lx-alert__ico { color: var(--lx-red); }
.lx-alert__txt { flex: 1; }
.lx-alert .chev { color: currentColor; opacity: .6; }
.lx-quick { display: flex; gap: 8px; margin-top: 14px; }
.lx-quick__btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 11px 3px 9px;
  border-radius: 15px;
  background: #fff;
  border: 1px solid var(--lx-line);
  box-shadow: var(--lx-shadow);
  color: var(--lx-navy);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  transition: transform .16s;
}
.lx-quick__btn:active { transform: scale(.96); }
.lx-quick__ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 162, 75, .12);
  border: 1px solid rgba(201, 162, 75, .24);
  color: #A87E22;
}
.lx-sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
.lx-sec h2 { font-size: 14.5px; font-weight: 900; color: var(--lx-navy); }
.lx-sec__link { background: none; border: 0; padding: 3px; font-size: 11.5px; font-weight: 800; color: #A87E22; }
.lx-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lx-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--lx-line);
  box-shadow: var(--lx-shadow);
  color: var(--lx-navy);
  text-align: start;
}
.lx-stat__ico { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; margin-bottom: 5px; }
.lx-stat__ico.is-green { background: rgba(30, 158, 98, .11); color: var(--lx-green); }
.lx-stat__ico.is-gold { background: rgba(201, 162, 75, .14); color: #A87E22; }
.lx-stat__ico.is-red { background: rgba(231, 76, 60, .1); color: var(--lx-red); }
.lx-stat__ico.is-blue { background: rgba(43, 88, 200, .1); color: #2B58C8; }
.lx-stat__label { font-size: 11px; font-weight: 600; color: var(--lx-grey); }
.lx-stat__val { font-size: 18px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lx-stat__val small { font-size: 10px; font-weight: 600; color: var(--lx-grey); }
.lx-stat__flag {
  position: absolute;
  top: 12px;
  inset-inline-end: 10px;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(231, 76, 60, .09);
  color: var(--lx-red);
  font-size: 9px;
  font-weight: 800;
}
.lx-card { background: #fff; border: 1px solid var(--lx-line); border-radius: 16px; box-shadow: var(--lx-shadow); }
.lx-line { display: flex; align-items: center; justify-content: space-between; padding: 8px 13px; font-size: 12px; color: #6F6A60; }
.lx-line + .lx-line { border-top: 1px dashed #F0E8D8; }
.lx-line b { color: var(--lx-navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.lx-line b.is-out { color: var(--lx-red); }
.lx-summary { padding-bottom: 10px; }
.lx-summary .lx-line:first-child { padding-top: 12px; }
.lx-summary__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 13px 0;
  padding: 10px 0 8px;
  border-top: 1px solid #E8D9A8;
  font-size: 13px;
  font-weight: 900;
  color: var(--lx-navy);
}
.lx-summary__total b { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.lx-summary__total b.is-up { color: var(--lx-green); }
.lx-summary__total b.is-down { color: var(--lx-red); }
.lx-summary__note { display: flex; align-items: center; gap: 5px; padding: 0 13px 4px; font-size: 10.5px; font-weight: 600; }
.lx-summary__note.is-ok { color: var(--lx-green); }
.lx-summary__note.is-warn { color: var(--lx-red); }
.lx-list { display: flex; flex-direction: column; gap: 8px; }
.lx-op {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--lx-line);
  box-shadow: var(--lx-shadow);
}
.lx-op__ico { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.lx-op__ico.is-in { background: rgba(30, 158, 98, .1); color: var(--lx-green); }
.lx-op__ico.is-out { background: rgba(231, 76, 60, .09); color: var(--lx-red); }
.lx-op__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lx-op__title { font-size: 12.5px; font-weight: 800; color: var(--lx-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-op__sub { font-size: 10px; color: var(--lx-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-op__amt { font-size: 12.5px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lx-op__amt.is-in { color: var(--lx-green); }
.lx-op__amt.is-out { color: var(--lx-red); }
.lx-op__acts { display: flex; gap: 4px; flex: none; }
.lx-mini {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FBF6E8;
  border: 1px solid #F0E8D8;
  color: #8A6A1E;
}
.lx-mini.is-danger { background: rgba(231, 76, 60, .07); border-color: rgba(231, 76, 60, .18); color: var(--lx-red); }
.lx-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 20px; text-align: center; }
.lx-empty__ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  background: #FBF3E3;
  color: #A87E22;
}
.lx-empty b { font-size: 13px; color: var(--lx-navy); }
.lx-empty span:last-child { font-size: 11px; color: var(--lx-grey); }
.lx-debts { overflow: hidden; }
.lx-debt { display: flex; align-items: center; gap: 9px; padding: 10px 11px; }
.lx-debt + .lx-debt { border-top: 1px dashed #F0E8D8; }
.lx-debt__ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #FBF3E3;
  border: 1px solid var(--lx-line);
  color: #A87E22;
}
.lx-debt__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lx-debt__main b { font-size: 12px; color: var(--lx-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-debt__main small { font-size: 10px; color: var(--lx-grey); }
.lx-debt__side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.lx-debt__side b { font-size: 12px; font-weight: 900; color: var(--lx-navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lx-badge { padding: 1px 6px; border-radius: 99px; background: #FBF3E3; color: #8F6A17; font-size: 9px; font-weight: 800; }
.lx-badge.is-danger { background: rgba(231, 76, 60, .1); color: var(--lx-red); }
.lx-pay {
  flex: none;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #E8D9A8;
  background: #FBF6E8;
  color: #8F6A17;
  font-size: 10px;
  font-weight: 800;
}
.lx-debt-none {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 13px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--lx-line);
  color: #167A4B;
  font-size: 11.5px;
  box-shadow: var(--lx-shadow);
}
.lx-debt-none svg { color: var(--lx-green); }
.lx-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 10px;
  color: rgba(10, 25, 49, .35);
}
.tabbar--luxe {
  background: #FFFDF7;
  border-top: 1px solid rgba(10, 25, 49, .08);
  box-shadow: 0 -12px 30px -26px rgba(10, 25, 49, .5);
}
.tabbar--luxe .tab { color: #9A958A; }
.tabbar--luxe .tab.is-active { color: var(--lx-navy, #0A1931); }
.tabbar--luxe .tab.is-active .tab__ico {
  background: rgba(201, 162, 75, .16);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 75, .3);
  color: #A87E22;
}
.tabbar--luxe .tab.is-active .tab__ico svg { filter: drop-shadow(0 3px 8px rgba(201, 162, 75, .4)); }

@media (max-width: 370px) {
  .auth-luxe__body { padding-inline: 16px; }
  .auth-luxe__title { font-size: 26px; }
  .lx-body { padding-inline: 14px; }
  .lx-balance__amount { font-size: 27px; }
  .lx-quick__btn { font-size: 9px; padding-inline: 2px; }
  .lx-stat { padding: 10px; }
  .lx-stat__val { font-size: 16px; }
  .lx-pay { padding: 0 8px; }
}

.moroccan-top{
  height: 55px;
  width: 100%;
  background-color: #F9F3E8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='30' viewBox='0 0 60 30'%3E%3Cg fill='none' stroke='%23C9A24B' stroke-width='1'%3E%3Cpath d='M30 0 L38 10 L30 20 L22 10 Z'/%3E%3Cpath d='M0 15 L8 25 L0 30 L-8 25 Z'/%3E%3Cpath d='M60 15 L68 25 L60 30 L52 25 Z'/%3E%3Ccircle cx='30' cy='10' r='2' fill='%23C9A24B'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  opacity: 0.7;
  border-bottom: 1px solid #C9A24B;
}

/* ==========================================================================
   Phones (< 520px) — readability, tap targets, overflow.
   The desktop frame (>= 520px) is intentionally left untouched.
   ========================================================================== */
@media (max-width: 519px) {
  html, body { overflow-x: hidden; }
  body { font-size: 16px; }

  /* readable body text (16px also stops iOS from zooming into inputs) */
  .input, .textarea, .select,
  .auth-luxe .input, .auth-luxe .select { font-size: 16px; }
  .modal p, .row__title, .settings-row__title, .lang-opt,
  .lx-op__title, .toast { font-size: 16px; }
  .btn { font-size: 15px; }

  /* tap targets: at least 44 x 44px */
  .btn, .btn--sm, .btn--xs { min-height: 44px; }
  .btn--sm, .btn--xs { min-width: 44px; }
  .seg button, .auth-luxe__tab, .chip, .lx-pay, .toast__act, .tab,
  .section-link, .lx-sec__link {
    min-height: 44px;
    min-width: 44px;
  }
  .chip, .section-link, .lx-sec__link, .toast__act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .icon-btn { width: 44px; height: 44px; }
  .lx-bell { width: 44px; height: 44px; }
  .icon-btn--sm { width: 38px; height: 38px; }
  .lx-mini { width: 36px; height: 36px; }
  .row__acts { gap: 6px; }
  .lx-op__acts { gap: 8px; }
  .input-group__btn { width: 44px; height: 44px; top: 2px; inset-inline-end: 2px; }
  .input-group .input { padding-inline-end: 50px; }
  .auth-luxe .input-group__btn { height: 44px; }

  /* compact icon controls keep their look but get a 44px invisible hit area */
  .icon-btn--sm, .lx-mini, .switch { position: relative; }
  .icon-btn--sm::before, .lx-mini::before, .switch::before {
    content: '';
    position: absolute;
    top: min(0px, calc((100% - 44px) / 2));
    bottom: min(0px, calc((100% - 44px) / 2));
    left: min(0px, calc((100% - 44px) / 2));
    right: min(0px, calc((100% - 44px) / 2));
  }

  /* nothing may push the page sideways */
  .view, .sheet__body, .modal { overflow-wrap: anywhere; }
  .sheet, .modal, .toast { max-width: 100%; }
  .invoice { overflow-x: auto; }
  .invoice__meta { flex-wrap: wrap; }
  .invoice__meta > *, .invoice__biz { min-width: 0; overflow-wrap: anywhere; }
  pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
  table { max-width: 100%; }
}
