/* EasyKash seller panel — design system (extends the public-site redesign) */

@font-face { font-family: "Inter Local"; src: url("../../assets/fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Local"; src: url("../../assets/fonts/Inter-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter Local"; src: url("../../assets/fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito Local"; src: url("../../assets/fonts/Nunito-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito Local"; src: url("../../assets/fonts/Nunito-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito Local"; src: url("../../assets/fonts/Nunito-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Ping AR LT Local"; src: url("../../assets/fonts/PingAR-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ping AR LT Local"; src: url("../../assets/fonts/PingAR-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ping AR LT Local"; src: url("../../assets/fonts/PingAR-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --font-ui: "Inter Local", "Segoe UI", system-ui, sans-serif;
  --font-display: "Nunito Local", "Inter Local", system-ui, sans-serif;
  --font-ar: "Ping AR LT Local", "Segoe UI", Tahoma, sans-serif;

  --ink: #171819;
  --ink-soft: #42474c;
  --muted: #727980;
  --faint: #9aa1a8;
  --line: rgba(23, 24, 25, 0.12);
  --line-soft: rgba(23, 24, 25, 0.07);
  --paper: #ffffff;
  --cream: #f4f1eb;
  --sky: #e9f4fb;
  --sky-deep: #d6eaf7;
  --wash: #f5f8fb;
  --accent: #16afe2;
  --accent-dark: #0d8ec2;
  --accent-tint: rgba(22, 175, 226, 0.12);
  --success: #1f9d63;
  --success-tint: #dff5ea;
  --warning: #b7791f;
  --warning-tint: #fbefd2;
  --danger: #d64545;
  --danger-tint: #fbe3e3;
  --info-tint: var(--accent-tint);

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 30px;
  --shadow-card: 0 10px 35px rgba(24, 35, 45, 0.08);
  --shadow-soft: 0 22px 70px rgba(26, 38, 48, 0.1);
  --shadow-float: 0 18px 50px rgba(24, 35, 45, 0.18);

  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --t-fast: 150ms;
  --t-base: 200ms;

  --side-w: 264px;
  --top-h: 64px;
  --bottom-h: 64px;
  --content-max: 1240px;
  --gutter: 16px;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-hero: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0, var(--wash) 480px);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body, html[lang="ar"] button, html[lang="ar"] input, html[lang="ar"] select, html[lang="ar"] textarea { font-family: var(--font-ar); }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .display { font-family: var(--font-ar); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
.num, .table td.num, .stat-value, .money { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -48px; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 999px; z-index: 700; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.side {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 400;
  width: min(84vw, 320px); padding: 18px 14px 24px;
  background: var(--paper); border-inline-end: 1px solid var(--line-soft);
  overflow-y: auto; transform: translateX(calc(-100% * var(--dir, 1)));
  transition: transform 260ms var(--ease); display: flex; flex-direction: column; gap: 6px;
}
html[dir="rtl"] .side { --dir: -1; }
.side.is-open { transform: none; box-shadow: var(--shadow-float); }
.side-backdrop { position: fixed; inset: 0; z-index: 390; background: rgba(23, 24, 25, 0.35); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); }
.side-backdrop.is-open { opacity: 1; pointer-events: auto; }
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 14px; }
.side-brand img { width: 118px; height: auto; }
.side-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--wash); cursor: pointer; }
.side-group { padding-top: 10px; }
.side-group + .side-group { border-top: 1px solid var(--line-soft); margin-top: 6px; }
.side-label { display: block; padding: 8px 12px 4px; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
html[lang="ar"] .side-label { letter-spacing: 0; }
.side-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  color: var(--ink-soft); font-weight: 500; font-size: 0.9rem; text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.side-item:hover { background: var(--wash); color: var(--ink); text-decoration: none; }
.side-item.is-active { background: var(--ink); color: #fff; }
.side-item.is-active svg { stroke: #fff; }
.side-item svg { width: 20px; height: 20px; flex: none; stroke: currentColor; }
.side-item .ext { margin-inline-start: auto; width: 14px; height: 14px; opacity: 0.6; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: var(--text-xs); color: var(--faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 300; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter);
  background: rgba(233, 244, 251, 0.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(23, 24, 25, 0.06);
}
.top-menu { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--paper); box-shadow: 0 2px 10px rgba(24, 35, 45, 0.08); cursor: pointer; }
.top-title { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang="ar"] .top-title { font-family: var(--font-ar); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .btn-icon { background: var(--paper); box-shadow: 0 2px 10px rgba(24, 35, 45, 0.06); }
.top-user { display: none; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 0; border-radius: 999px; background: var(--paper); box-shadow: 0 2px 10px rgba(24, 35, 45, 0.06); cursor: pointer; }
html[dir="rtl"] .top-user { padding: 4px 4px 4px 10px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.8rem; font-family: var(--font-display); }
.top-branch { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.6); font-weight: 500; font-size: var(--text-sm); cursor: pointer; }
.top-branch svg { width: 16px; height: 16px; }
.lang { display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 999px; background: var(--paper); box-shadow: 0 2px 10px rgba(24, 35, 45, 0.06); font-weight: 600; font-size: var(--text-sm); text-decoration: none; color: var(--ink); }
.lang:hover { text-decoration: none; background: var(--sky-deep); }

.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 20px var(--gutter) calc(var(--bottom-h) + 32px); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-head h1 { font-size: var(--text-xl); }
.page-head p { color: var(--muted); max-width: 60ch; margin-top: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: var(--text-sm); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs span::before { content: "/"; margin-inline-end: 6px; color: var(--faint); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: var(--text-md); }
.section-head a, .section-head .link { font-size: var(--text-sm); font-weight: 600; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
.stack { display: grid; gap: 12px; min-width: 0; }
.stack > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.strong { font-weight: 600; }

/* Bottom bar (mobile) */
.bottom {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 350; height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line-soft);
}
.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 0.68rem; font-weight: 600; text-decoration: none; }
.bottom a svg { width: 22px; height: 22px; stroke: currentColor; }
.bottom a.is-active { color: var(--ink); }
.bottom .bottom-create { position: relative; color: #fff; }
.bottom .bottom-create span.disc { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -22px; border-radius: 999px; background: var(--ink); box-shadow: 0 10px 24px rgba(23, 24, 25, 0.28); }
.bottom .bottom-create span.disc svg { stroke: #fff; }
.bottom .bottom-create small { color: var(--ink); font-size: 0.68rem; font-weight: 600; }

/* ---------- Cards, stats ---------- */
.card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 20px; }
.card-tint { background: var(--sky); border-color: transparent; }
.card-ink { background: var(--ink); color: #fff; border-color: transparent; }
.card-ink .muted { color: rgba(255, 255, 255, 0.65); }
.card-flat { background: transparent; border: 0; padding: 0; }
.card h2, .card h3 { margin-bottom: 4px; }
.stat { display: grid; gap: 6px; }
.stat-label { font-size: var(--text-sm); color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.01em; }
html[lang="ar"] .stat-value { font-family: var(--font-ar); }
.stat-value small { font-size: 0.55em; font-weight: 600; color: var(--muted); margin-inline-start: 4px; }
.stat-hero .stat-value { font-size: var(--text-hero); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; }
.delta-up { background: var(--success-tint); color: var(--success); }
.delta-down { background: var(--danger-tint); color: var(--danger); }
.delta-flat { background: var(--wash); color: var(--muted); }
.balance-card { display: grid; gap: 18px; min-width: 0; }
.balance-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.balance-row > * { min-width: 0; }
.stat { min-width: 0; }
.stat-value { overflow-wrap: break-word; }
.balance-row .stat-label { color: rgba(255, 255, 255, 0.65); }
.hairline { height: 1px; background: var(--line-soft); }
.card-ink .hairline { background: rgba(255, 255, 255, 0.14); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: 999px; font-weight: 600; font-size: 0.9rem; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform var(--t-base) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-fast);
}
.btn:hover { text-decoration: none; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 8px 22px rgba(10, 12, 14, 0.14); }
.btn-dark:hover { background: #000; transform: translateY(-1px); box-shadow: 0 12px 28px rgba(10, 12, 14, 0.2); }
.btn-ghost { background: rgba(255, 255, 255, 0.55); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #fff; border-color: rgba(23, 24, 25, 0.28); }
.btn-light { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(24, 35, 45, 0.06); }
.btn-light:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(24, 35, 45, 0.12); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-danger:hover { background: #f6cccc; }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: var(--text-sm); }
.btn-sm svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--ink); }
.btn-icon:hover { background: var(--wash); }
.btn-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }
.field .req { color: var(--danger); margin-inline-start: 2px; }
.input, .select, .textarea, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font: inherit; color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea, .textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field select, .select { appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2342474c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
html[dir="rtl"] .field select, html[dir="rtl"] .select { background-position: left 14px center; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field .hint { font-size: var(--text-xs); color: var(--muted); }
.field.is-error input, .field.is-error select, .field.is-error textarea { border-color: var(--danger); }
.field .error { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--danger); font-weight: 500; }
.field .error svg { width: 14px; height: 14px; stroke: currentColor; }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-inline-start: 0; border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); background: var(--wash); font-size: var(--text-sm); font-weight: 600; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line-soft); }
.seg button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: var(--text-sm); color: var(--muted); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(23, 24, 25, 0.18); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #cfd5da; position: relative; transition: background var(--t-base); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform var(--t-base) var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(18px); }
html[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.question { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.question:first-of-type { border-top: 0; }
.question .q { font-size: 0.9rem; font-weight: 500; max-width: 46ch; }
.question .q small { display: block; color: var(--muted); font-weight: 400; font-size: var(--text-xs); }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.method { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-size: var(--text-sm); font-weight: 600; transition: border-color var(--t-fast), background var(--t-fast); }
.method img, .method svg { width: 26px; height: 26px; flex: none; }
.method input { position: absolute; opacity: 0; width: 0; height: 0; }
.method .tick { margin-inline-start: auto; width: 20px; height: 20px; border-radius: 999px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.method .tick svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; display: none; }
.method.is-on { border-color: var(--ink); background: var(--sky); }
.method.is-on .tick { background: var(--ink); border-color: var(--ink); }
.method.is-on .tick svg { display: block; }
.summary-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--text-sm); color: var(--muted); }
.form-foot { position: sticky; bottom: calc(var(--bottom-h) + 8px); z-index: 100; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line-soft); box-shadow: var(--shadow-card); backdrop-filter: blur(12px); }
.form-foot .row { gap: 8px; }
details.disclosure { border: 1px solid var(--line-soft); border-radius: 16px; background: #fff; }
details.disclosure summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; cursor: pointer; font-weight: 600; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary .sum { font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
details.disclosure summary svg.chev { width: 18px; height: 18px; stroke: var(--muted); transition: transform var(--t-base) var(--ease); flex: none; }
details.disclosure[open] summary svg.chev { transform: rotate(180deg); }
details.disclosure .body { padding: 0 18px 18px; display: grid; gap: 14px; }
.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--wash); border: 1px solid transparent; font-size: var(--text-sm); font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
html[dir="rtl"] .step { padding: 8px 8px 8px 14px; }
.step i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-style: normal; font-size: var(--text-xs); }
.step.is-active { background: var(--ink); color: #fff; }
.step.is-active i { background: #fff; color: var(--ink); border-color: #fff; }
.step.is-done i { background: var(--success); border-color: var(--success); color: #fff; }
.form-step { display: none; }
.form-step.is-active { display: grid; gap: 16px; }
.form-card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 20px; display: grid; gap: 16px; }
.form-card > h3 { margin-bottom: -4px; }
.upload { display: grid; place-items: center; gap: 6px; min-height: 120px; padding: 18px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--wash); text-align: center; color: var(--muted); font-size: var(--text-sm); cursor: pointer; }
.upload strong { color: var(--ink); }
.upload svg { width: 24px; height: 24px; stroke: var(--muted); }
.items-table td .field input { min-height: 40px; }
.item-row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.item-row:first-child { border-top: 0; }
.type-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.type-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line-soft); border-radius: 18px; background: #fff; text-decoration: none; color: var(--ink); transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-fast); }
.type-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--line); }
.type-card .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--sky); flex: none; }
.type-card .ic svg { width: 22px; height: 22px; stroke: var(--ink); }
.type-card strong { display: block; font-size: 0.95rem; }
.type-card p { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }
.code-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--wash); border: 1px solid var(--line-soft); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--text-sm); overflow: hidden; }
.code-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--sky); font-size: var(--text-sm); }
.callout svg { width: 20px; height: 20px; flex: none; stroke: var(--accent-dark); }
.callout-warn { background: var(--warning-tint); }
.callout-warn svg { stroke: var(--warning); }
.callout-danger { background: var(--danger-tint); }
.callout-danger svg { stroke: var(--danger); }
.callout ol, .callout ul { margin: 4px 0 0; padding-inline-start: 18px; }

/* ---------- Tables & lists ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 200px; min-width: 160px; }
.search input { width: 100%; min-height: 40px; padding: 8px 14px 8px 40px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; }
html[dir="rtl"] .search input { padding: 8px 40px 8px 14px; }
.search svg { position: absolute; top: 50%; inset-inline-start: 14px; width: 18px; height: 18px; transform: translateY(-50%); stroke: var(--muted); pointer-events: none; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; }
.chip svg { width: 14px; height: 14px; stroke: currentColor; }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.is-on svg { stroke: #fff; }
.chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wash); font-size: var(--text-xs); }
.chip.is-on .chip-count { background: rgba(255, 255, 255, 0.2); }
.table-wrap { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { position: sticky; top: 0; background: var(--wash); text-align: start; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
html[lang="ar"] .table th { letter-spacing: 0; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--wash); }
.table td.num, .table th.num { text-align: end; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 2px; }
.table .actions { text-align: end; white-space: nowrap; }
.table .actions .btn-icon { width: 34px; height: 34px; }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: var(--text-sm); color: var(--muted); }
.pager { display: inline-flex; align-items: center; gap: 4px; }
.pager button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 600; font-size: var(--text-sm); }
.pager button[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager button svg { width: 16px; height: 16px; stroke: currentColor; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-warning { background: var(--warning-tint); color: var(--warning); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-info { background: var(--accent-tint); color: var(--accent-dark); }
.badge-neutral { background: var(--wash); color: var(--muted); }
.method-mini { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); }
.method-mini img { width: 20px; height: 20px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; }
.empty .ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--sky); margin-bottom: 4px; }
.empty .ic svg { width: 24px; height: 24px; stroke: var(--accent-dark); }
.empty h3 { font-size: var(--text-md); }
.empty p { max-width: 40ch; color: var(--muted); font-size: var(--text-sm); }
.empty .row { margin-top: 8px; justify-content: center; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.list-item:first-child { border-top: 0; }
.list-item:hover { text-decoration: none; }
.list-item .ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--wash); flex: none; }
.list-item .ic svg { width: 20px; height: 20px; stroke: var(--ink-soft); }
.list-item .ic img { width: 22px; height: 22px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .body strong { display: block; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .body span { display: block; font-size: var(--text-xs); color: var(--muted); }
.list-item .end { text-align: end; font-weight: 600; white-space: nowrap; }
.list-item .end span { display: block; font-size: var(--text-xs); color: var(--muted); font-weight: 500; }
.mobile-cards { display: grid; gap: 10px; }
.mcard { display: grid; gap: 8px; padding: 14px 16px; background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; }
.mcard .row-between strong { font-size: 0.95rem; }
.mcard dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: var(--text-sm); }
.mcard dt { color: var(--muted); }
.mcard dd { margin: 0; text-align: end; font-weight: 500; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 14px 12px; border: 0; background: transparent; font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Drawers, sheets, menus, toasts ---------- */
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 500; width: min(92vw, 420px); background: #fff; box-shadow: var(--shadow-float); transform: translateX(calc(100% * var(--dir, 1))); transition: transform 260ms var(--ease); display: flex; flex-direction: column; }
html[dir="rtl"] .drawer { --dir: -1; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-body { padding: 20px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 500; max-height: 86dvh; overflow-y: auto; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); background: #fff; border-radius: 24px 24px 0 0; box-shadow: var(--shadow-float); transform: translateY(105%); transition: transform 280ms var(--ease); }
.sheet.is-open { transform: none; }
.sheet .grab { width: 40px; height: 4px; margin: 6px auto 14px; border-radius: 999px; background: var(--line); }
.backdrop { position: fixed; inset: 0; z-index: 450; background: rgba(23, 24, 25, 0.35); opacity: 0; pointer-events: none; transition: opacity 200ms; }
.backdrop.is-open { opacity: 1; pointer-events: auto; }
.menu { position: absolute; z-index: 460; min-width: 200px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow-float); display: none; }
.menu.is-open { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; font-size: var(--text-sm); font-weight: 500; color: var(--ink); text-align: start; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--wash); text-decoration: none; }
.menu a svg, .menu button svg { width: 16px; height: 16px; stroke: currentColor; }
.menu .sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
.menu .head { padding: 8px 12px 4px; font-size: var(--text-xs); color: var(--muted); }
.has-menu { position: relative; }
.toast { position: fixed; bottom: calc(var(--bottom-h) + 16px); inset-inline-start: 50%; transform: translate(-50%, 20px); z-index: 600; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: var(--text-sm); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 200ms, transform 220ms var(--ease); white-space: nowrap; }
html[dir="rtl"] .toast { transform: translate(50%, 20px); }
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }
html[dir="rtl"] .toast.is-open { transform: translate(50%, 0); }
.toast svg { width: 16px; height: 16px; stroke: var(--mint, #c8f2df); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--wash); font-family: ui-monospace, monospace; font-size: 0.7rem; }
.progress { height: 6px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.steps-h { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps-h div { padding: 12px; border-radius: 14px; background: var(--wash); font-size: var(--text-sm); }
.steps-h div strong { display: block; }
.steps-h div.is-active { background: var(--ink); color: #fff; }
.chart { width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--text-xs); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.avatar-sm { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--sky); color: var(--ink); font-weight: 700; font-size: var(--text-xs); font-family: var(--font-display); flex: none; }
.qr { display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; width: 168px; height: 168px; padding: 8px; background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; }
.qr i { background: var(--ink); }
.qr i.off { background: transparent; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row .btn-icon { width: 44px; height: 44px; background: var(--wash); }
.reveal { animation: rise 420ms var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html[dir="rtl"] .ic-arrow-end, html[dir="rtl"] .ic-arrow-start, html[dir="rtl"] .ic-chevron-end, html[dir="rtl"] .ic-chevron-start, html[dir="rtl"] .ic-external, html[dir="rtl"] .ic-send { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.only-mobile { display: initial; }
.only-desktop { display: none !important; }
/* .only-mobile/.only-desktop only set `display` generically; components with a
   non-default display (flex/grid) need it restored explicitly or the utility
   class collapses their layout at equal specificity. */
.btn.only-mobile, .list-item.only-mobile { display: inline-flex; }
.grid.only-mobile { display: grid; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .field-row { grid-template-columns: repeat(2, 1fr); }
  .field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .methods { grid-template-columns: repeat(3, 1fr); }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .item-row { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
  .top-branch { display: inline-flex; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .app { grid-template-columns: var(--side-w) 1fr; }
  .side { position: sticky; top: 0; height: 100dvh; width: var(--side-w); transform: none; box-shadow: none; background: transparent; border-inline-end: 1px solid rgba(23, 24, 25, 0.06); }
  .side-close, .side-backdrop, .top-menu { display: none; }
  .bottom { display: none; }
  .content { padding-bottom: 48px; }
  .form-foot { bottom: 16px; }
  .toast { bottom: 24px; }
  .top { background: rgba(245, 248, 251, 0.75); }
  .top-title { font-size: 1.1rem; }
  .top-user { display: inline-flex; }
  .methods { grid-template-columns: repeat(4, 1fr); }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .balance-row { grid-template-columns: repeat(3, 1fr); }
  .only-mobile { display: none !important; }
  .only-desktop { display: initial !important; }
  .stat.only-desktop { display: grid !important; }
  .btn.only-desktop, .list-item.only-desktop { display: inline-flex !important; }
  .grid.only-desktop { display: grid !important; }
  .mobile-cards { display: none; }
  .table-wrap { display: block; }
}
@media (max-width: 1023px) {
  .table-wrap.has-cards { display: none; }
}
@media (min-width: 1280px) {
  .content { padding-top: 28px; }
  .grid-dash { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
}
