@font-face {
  font-family: "IRANSans";
  src: url("assets/fonts/IRANSans.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "IRANSans";
  src: url("assets/fonts/IRANSans_Medium.ttf") format("truetype");
  font-weight: 500;
}

@font-face {
  font-family: "IRANSans";
  src: url("assets/fonts/IRANSans_Bold.ttf") format("truetype");
  font-weight: 700;
}

:root {
  color-scheme: light;
  --bg: #eaf1f8;
  --bg-2: #dfe8f3;
  --bg-3: #f7fafd;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f5f8fc;
  --text: #18263d;
  --muted: #66778f;
  --line: #cedae8;
  --line-strong: #9fb6d0;
  --accent: #2563d8;
  --accent-2: #173865;
  --accent-3: #1d58bd;
  --accent-soft: rgba(47, 104, 218, 0.1);
  --sky-soft: rgba(73, 147, 230, 0.1);
  --teal-soft: rgba(38, 155, 126, 0.1);
  --amber-soft: rgba(194, 144, 48, 0.12);
  --rose-soft: rgba(192, 101, 124, 0.1);
  --success: #14755b;
  --danger: #d53a4e;
  --warning: #8b6a1e;
  --shadow: 0 14px 34px rgba(18, 57, 141, 0.07);
  --shadow-soft: 0 8px 18px rgba(17, 42, 100, 0.06);
  --radius: 10px;
  --radius-lg: 14px;
  --border-width: 1px;
  --border-strong: 2px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08111f;
  --bg-2: #0d1829;
  --bg-3: #101d30;
  --panel: #111d2e;
  --panel-strong: #17273d;
  --panel-soft: #0b1524;
  --text: #edf6ff;
  --muted: #96a9c2;
  --line: #263a55;
  --line-strong: #3d5877;
  --accent: #6ea8ff;
  --accent-2: #dbeaff;
  --accent-3: #4f8fe8;
  --accent-soft: rgba(110, 168, 255, 0.14);
  --sky-soft: rgba(74, 143, 232, 0.16);
  --teal-soft: rgba(74, 181, 151, 0.14);
  --amber-soft: rgba(220, 172, 71, 0.15);
  --rose-soft: rgba(238, 104, 130, 0.13);
  --success: #75d6b1;
  --danger: #ff91a8;
  --warning: #e5bf68;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IRANSans", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  touch-action: manipulation;
}

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

body.route-busy {
  cursor: progress;
}

button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

button i,
.icon i,
.hero-glow i,
.floating-create i {
  line-height: 1;
  font-size: 1em;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.68;
  cursor: wait;
}

h1,
h2,
p,
strong,
span {
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.45;
  font-weight: 500;
}

h2 {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
}

.shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

.hidden {
  display: none !important;
}

.connection-status {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 60;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: var(--border-width) solid color-mix(in srgb, var(--warning) 38%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 94%, var(--amber-soft));
  color: var(--warning);
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.connection-status.syncing {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--panel) 92%, var(--accent-soft));
  color: var(--accent-2);
}

.connection-status.synced {
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
  background: color-mix(in srgb, var(--panel) 92%, var(--teal-soft));
  color: var(--success);
}

.connection-status i {
  font-size: 12px;
}

.route-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(47, 104, 218, 0.34), transparent 34%),
    linear-gradient(135deg, rgba(6, 17, 39, 0.9), rgba(13, 45, 107, 0.84));
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.route-loader.visible {
  opacity: 1;
}

.route-loader-bar {
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #16398d, #0d5bd8, #4fa3ff);
  box-shadow: 0 0 20px rgba(13, 91, 216, 0.34);
  animation: loader-sweep 360ms ease;
}

.route-loader-dot {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(211, 229, 255, 0.9);
  border-top-color: #123d8b;
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(6, 20, 52, 0.18);
  animation: loader-spin 520ms linear infinite;
}

.route-busy .app-content > section:not(.hidden) {
  opacity: 0.72;
  transform: translateY(2px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.panel {
  background: var(--panel);
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: panel-rise 340ms ease both;
}

[data-theme="dark"] .panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, #213b60), var(--panel));
  border-color: color-mix(in srgb, var(--line) 86%, #78aaff);
}

.order-item,
.bulk-bar,
.selector input:checked + span,
.radio-card input:checked + span {
  border-width: var(--border-strong);
}

.subtle,
.status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.list-status {
  display: block;
  min-height: 20px;
  margin-top: -6px;
}

.success-status {
  color: var(--success);
  font-weight: 500;
}

.warning-status {
  color: var(--warning);
}

.section-kicker,
.badge,
.eyebrow,
.type-pill,
.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.section-kicker,
.badge,
.eyebrow {
  background: var(--accent-soft);
  color: var(--accent-2);
  gap: 6px;
  margin-bottom: 2px;
}

.section-kicker::before,
.badge::before,
.eyebrow::before,
.choice-group legend::before,
.customer-card strong::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  line-height: 1;
}

.section-kicker::before {
  content: "\f0c9";
  font-size: 10px;
}

.badge::before {
  content: "\f0ae";
  font-size: 10px;
}

.eyebrow::before {
  content: "\f0ea";
  font-size: 10px;
}

.login-screen {
  min-height: calc(100vh - 44px);
  display: grid;
  place-items: center;
  padding: 18px 0;
}

.auth {
  width: min(420px, 100%);
  padding: 22px;
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: 0 18px 48px rgba(17, 42, 100, 0.11);
}

.brand,
.sidebar-brand,
.title-block,
.section-head,
.form-head,
.button-row,
.bulk-bar,
.sidebar-mini-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head > div,
.form-head > div,
.list-head > div {
  display: grid;
  gap: 7px;
}

.mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: #fff;
  background: #235fd7;
  box-shadow: 0 10px 20px rgba(32, 100, 245, 0.18);
  font-weight: 500;
}

.stack,
.order-form,
.profile-page,
.editor-side,
.notes-list,
.log-list,
.draft-notes,
.customer-results,
.duplicate-hint,
.orders-list,
.sidebar-tools {
  display: grid;
  gap: 14px;
}

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

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  font-size: 13px;
  font-weight: 400;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  background: color-mix(in srgb, var(--panel-soft) 88%, #162c49);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.13);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-left: 82px;
}

.mini-button,
.mini-tag,
.primary,
.ghost,
.text-button,
.chip-button,
.icon-only,
.nav-button {
  border: var(--border-width) solid transparent;
}

.mini-button,
.mini-tag {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 500;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mini-button {
  position: absolute;
  left: 7px;
  top: 7px;
}

.primary {
  background: linear-gradient(135deg, #256ce8, #1752bf);
  color: #fff;
  padding: 0 14px;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(29, 98, 241, 0.17);
}

[data-theme="dark"] .primary {
  background: linear-gradient(135deg, #3d85ff, #1d5fd7);
  color: #f8fbff;
  box-shadow: 0 10px 24px rgba(30, 104, 230, 0.18);
}

.primary:hover {
  box-shadow: 0 10px 22px rgba(29, 98, 241, 0.22);
}

.ghost,
.text-button,
.chip-button,
.icon-only {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--text);
  padding: 0 11px;
  font-weight: 400;
}

.text-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ghost:hover,
.text-button:hover,
.chip-button:hover,
.icon-only:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--accent-2);
  box-shadow: none;
}

[data-theme="dark"] .ghost:hover,
[data-theme="dark"] .text-button:hover,
[data-theme="dark"] .chip-button:hover,
[data-theme="dark"] .icon-only:hover {
  background: color-mix(in srgb, var(--panel-soft) 78%, #1d3555);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--accent-2);
}

.icon-only {
  width: 38px;
  padding: 0;
}

.icon-text,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button[id*="copy"],
button[data-action="copy"],
button[data-action="copy-order-number"],
button[data-copy-note],
button[data-copy-draft-note] {
  min-height: 28px;
  padding-inline: 8px;
  font-size: 10px;
  border-radius: 8px;
}

button[id*="copy"] .icon,
button[data-action="copy"] .icon,
button[data-action="copy-order-number"] .icon {
  width: 13px;
  height: 13px;
}

button[id*="copy"] i,
button[data-action="copy"] i,
button[data-action="copy-order-number"] i,
button[data-copy-note] i,
button[data-copy-draft-note] i {
  font-size: 11px;
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.icon svg,
.icon i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.app-shell {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 194px;
  gap: 18px;
  align-items: start;
}

.mobile-menu-button,
.sidebar-backdrop {
  display: none;
}

.app-content {
  direction: rtl;
  display: grid;
  gap: 16px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1557c8;
  color: #fff;
}

[data-theme="dark"] .hero-panel {
  background: linear-gradient(135deg, #173d91, #0d2a63);
  border-color: rgba(144, 190, 255, 0.25);
}

.hero-panel .title-block {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.hero-panel .section-kicker,
.hero-panel .subtle {
  color: rgba(255, 255, 255, 0.9);
}

.hero-panel .section-kicker {
  background: rgba(255, 255, 255, 0.14);
}

.hero-glow {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-glow i {
  color: rgba(255, 255, 255, 0.92);
  font-size: 38px;
}

.app-sidebar {
  direction: rtl;
  position: sticky;
  top: 14px;
  padding: 14px;
  min-height: min(640px, calc(100vh - 28px));
  background: linear-gradient(180deg, #123f94, #0e2d6b);
  color: #fff;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 11px;
  border-color: rgba(180, 210, 255, 0.26);
  box-shadow: 0 18px 42px rgba(4, 16, 45, 0.24);
}

[data-theme="dark"] .app-sidebar {
  background: linear-gradient(180deg, #132d62, #0a1a38);
  border-color: rgba(120, 170, 240, 0.22);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
}

.app-sidebar .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 15px;
  box-shadow: none;
}

.sidebar-brand {
  align-items: center;
  gap: 10px;
}

.sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-close {
  display: none;
}

.sidebar-close .icon i {
  font-size: 18px;
}

.sidebar-brand-copy {
  display: grid;
  gap: 4px;
}

.sidebar-brand-copy strong {
  font-size: 14px;
  font-weight: 500;
}

.sidebar-brand-copy span {
  font-size: 11px;
  color: rgba(232, 241, 255, 0.76);
}

.sidebar-menu {
  display: grid;
  gap: 8px;
  align-content: start;
  align-self: start;
  grid-auto-rows: max-content;
}

.nav-button {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  justify-content: flex-start;
  width: 100%;
  border-radius: 9px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  color: rgba(246, 250, 255, 0.92);
  font-size: 12px;
  gap: 8px;
  line-height: 1.4;
  align-self: start;
}

.nav-badge {
  margin-inline-start: auto;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(214, 230, 255, 0.24);
  color: #fff;
  font-size: 10.5px;
  line-height: 1;
}

.list-filters input.hidden {
  display: none;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(191, 218, 255, 0.32);
  box-shadow: none;
}

.nav-button.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(209, 227, 255, 0.5);
  color: #fff;
}

.nav-button .icon,
.sidebar-tools .icon,
.sidebar-icon .icon {
  width: 16px;
  height: 16px;
}

.nav-button .icon svg,
.nav-button .icon i,
.sidebar-tools .icon svg,
.sidebar-tools .icon i,
.sidebar-icon .icon svg,
.sidebar-icon .icon i {
  width: 16px;
  height: 16px;
  font-size: 14px;
}

.nav-button span:last-child {
  white-space: nowrap;
}

.sidebar-tools {
  display: grid;
  gap: 9px;
  align-self: end;
}

.sidebar-tools .ghost {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.restore-picker {
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
}

.restore-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.restore-picker .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  border: var(--border-width) solid rgba(162, 202, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f9ff;
  cursor: pointer;
}

.sidebar-tools .icon-only {
  min-height: 34px;
  width: 38px;
}

.theme-label {
  display: none;
}

.sidebar-tools .danger-outline,
.danger-button,
.danger-card span,
.danger-mini {
  color: var(--danger);
}

.sidebar-tools .danger-outline,
.danger-button,
.danger-mini {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--rose-soft) 76%, var(--panel-soft));
}

.sidebar-tools {
  align-content: end;
}

.sidebar-tools .ghost,
.sidebar-tools .icon-only {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(162, 202, 255, 0.14);
  color: #f5f9ff;
}

.sidebar-tools .ghost:hover,
.sidebar-tools .icon-only:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(209, 227, 255, 0.34);
  box-shadow: 0 18px 34px rgba(7, 22, 60, 0.26);
}

.sidebar-tools .danger-outline {
  color: #ffe3e8;
}

.sidebar-mini-actions {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
}

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

.rate-panel,
.converter-panel,
.orders-page,
.customers-page,
.form-panel,
.result,
.side-panel {
  padding: 14px;
}

.rate-panel,
.converter-panel,
.side-panel,
.form-panel,
.orders-page,
.customers-page {
  display: grid;
  gap: 16px;
}

.rate-panel {
  background: var(--panel);
}

.converter-panel {
  background: var(--panel);
}

.profile-page .form-panel {
  background: var(--panel);
}

.section-head,
.form-head,
.list-head,
.button-row,
.bulk-bar {
  justify-content: space-between;
}

#selectedCount {
  font-size: 12px;
  line-height: 1.85;
}

.rate-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0;
}

.rate-value strong {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.25;
  font-weight: 700;
}

.converter-row,
.list-filters {
  display: grid;
  gap: 10px;
}

.converter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2px;
  margin-bottom: 10px;
}

.converter-panel .button-row {
  margin-top: 4px;
  justify-content: flex-start;
  gap: 12px;
}

.rate-panel .button-row button,
.converter-panel .button-row button {
  flex: 0 0 auto;
  min-height: 30px;
  padding-inline: 10px;
  font-size: 11px;
  border-radius: 9px;
}

.converter-panel input {
  min-height: 44px;
}

.orders-page {
  padding-bottom: 20px;
}

.customer-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}

.customer-form.editing-customer {
  border: var(--border-width) solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-soft) 54%, var(--panel));
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.customers-list {
  display: grid;
  gap: 12px;
}

.customer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: var(--border-strong) solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.customer-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.customer-card strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}

.customer-card strong::before {
  content: "\f007";
  color: var(--accent);
  font-size: 11px;
}

.customer-card span:not(.state-pill) {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.customer-card-main,
.customer-card-head,
.customer-card-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.customer-card-main {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.customer-card-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.customer-card-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.trash-page {
  display: grid;
  gap: 12px;
  padding: 14px;
  align-content: start;
}

.trash-page .list-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 0 0 2px;
}

.trash-page .list-head > div {
  display: grid;
  gap: 3px;
}

.trash-page .list-head h2 {
  font-size: 16px;
}

.trash-page #trashCount {
  min-height: 24px;
  padding: 0 9px;
  border: var(--border-width) solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--accent-2);
}

.trash-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: start;
  gap: 7px;
  padding: 6px;
  border: var(--border-width) solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel-soft) 78%, var(--panel));
}

.trash-tabs .chip-button {
  min-height: 32px;
  padding-inline: 13px;
  border-radius: 9px;
  background: transparent;
}

.trash-list {
  display: grid;
  gap: 10px;
}

.trash-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: var(--border-strong) solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.trash-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.trash-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.trash-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  border: var(--border-width) solid color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--panel));
  color: var(--accent);
}

.trash-icon i {
  display: block;
  font-size: 15px;
  line-height: 1;
}

.trash-card strong,
.trash-card-main span,
.trash-card small {
  display: block;
}

.trash-card strong {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.trash-card-main span,
.trash-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.trash-card-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.trash-meta,
.trash-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trash-meta {
  padding: 6px;
  border: var(--border-width) solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-soft) 74%, var(--panel));
}

.trash-meta .summary-amount {
  padding: 0 6px;
  white-space: nowrap;
}

.trash-actions .text-button {
  min-height: 32px;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--panel));
  color: var(--accent-2);
  white-space: nowrap;
}

.customer-trash-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

[data-theme="dark"] .trash-card {
  background: color-mix(in srgb, var(--panel) 92%, #203756);
}

[data-theme="dark"] .trash-tabs,
[data-theme="dark"] .trash-meta {
  background: color-mix(in srgb, var(--panel-soft) 86%, #1b3556);
}

.floating-create {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 2px solid rgba(210, 229, 255, 0.74);
  background: linear-gradient(145deg, #0d5bd8, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 40px rgba(13, 91, 216, 0.32);
}

.floating-create:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(13, 91, 216, 0.42);
}

.floating-create i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  pointer-events: none;
}

.floating-payment {
  bottom: 88px;
  background: linear-gradient(145deg, #159a68, #22b573);
  box-shadow: 0 18px 40px rgba(20, 125, 87, 0.28);
}

.floating-payment:hover {
  box-shadow: 0 22px 50px rgba(20, 125, 87, 0.4);
}

.filters-shell {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
}

.filters-toggle {
  display: none;
  justify-content: space-between;
  min-height: 38px;
  padding-inline: 12px;
  font-size: 11.5px;
}

.list-filters {
  grid-template-columns: minmax(0, 1.25fr) repeat(5, minmax(0, 0.92fr));
  gap: 12px;
}

.purchase-preview {
  margin-top: -4px;
  min-height: 18px;
  padding-inline: 4px;
  line-height: 1.9;
}

.bulk-bar {
  margin-bottom: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel-soft) 90%, transparent);
  border-radius: var(--radius);
  border: var(--border-strong) solid var(--line);
}

.bulk-actions,
.order-actions,
.quick-actions,
.submit-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.orders-list {
  gap: 14px;
}

.order-item {
  border: var(--border-strong) solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(17, 42, 100, 0.05);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
  animation: none;
}

[data-theme="dark"] .order-item {
  background: color-mix(in srgb, var(--panel) 88%, #182b45);
  border-color: color-mix(in srgb, var(--line) 88%, #517aaa);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.order-item:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(18, 57, 141, 0.09);
}

.order-row,
.order-main-row,
.order-title-row,
.quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-row {
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

[data-theme="dark"] .order-row {
  background: color-mix(in srgb, var(--panel) 92%, #1c314e);
  border-bottom-color: color-mix(in srgb, var(--line) 84%, #5c81ad);
}

.order-main-row {
  align-items: flex-start;
}

.order-main {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel-soft) 78%, var(--panel));
}

.order-title-stack {
  display: grid;
  gap: 3px;
}

.order-title-row {
  align-items: flex-start;
}

.order-title-pills {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.order-meta-cluster {
  display: grid;
  gap: 4px;
}

.order-main strong,
.customer-option strong,
.note-item strong,
.log-item strong,
.draft-note-item span {
  display: block;
  line-height: 1.6;
  font-size: 14.5px;
  font-weight: 500;
}

.order-main span,
.customer-option span,
.note-item span,
.log-item span,
.quick-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.order-item .order-main strong {
  font-size: 15px;
}

.order-item .order-main span,
.order-item .quick-label {
  font-size: 12px;
}

.order-item .type-pill,
.order-item .state-pill {
  min-height: 26px;
  font-size: 11px;
}

.type-pill.type-currency {
  background: var(--sky-soft);
  color: #0c57bc;
}

.type-pill.type-cracked {
  background: var(--rose-soft);
  color: #b53156;
}

.type-pill.type-shared {
  background: var(--teal-soft);
  color: #0b8f63;
}

.type-pill.type-telegram {
  background: color-mix(in srgb, #2aabee 14%, var(--panel));
  color: #116a9d;
}

.type-pill.type-whatsapp {
  background: color-mix(in srgb, #20b15a 14%, var(--panel));
  color: #117541;
}

.type-pill.type-call {
  background: color-mix(in srgb, #7c5cff 13%, var(--panel));
  color: #4f3bb5;
}

.type-pill.type-other,
.type-pill.type-default {
  background: var(--amber-soft);
  color: var(--warning);
}

[data-theme="dark"] .type-pill.type-currency { color: #a8ccff; }
[data-theme="dark"] .type-pill.type-cracked { color: #ffb6c7; }
[data-theme="dark"] .type-pill.type-shared { color: #9ce8d0; }
[data-theme="dark"] .type-pill.type-telegram { color: #87d7ff; }
[data-theme="dark"] .type-pill.type-whatsapp { color: #8ce9ad; }
[data-theme="dark"] .type-pill.type-call { color: #c5bbff; }
[data-theme="dark"] .type-pill.type-other,
[data-theme="dark"] .type-pill.type-default { color: #ffd998; }

.duplicate-hint {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: var(--border-width) solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel));
  padding: 12px;
}

.duplicate-hint div {
  display: grid;
  gap: 4px;
}

.duplicate-hint strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-2);
}

.duplicate-hint span {
  font-size: 12px;
  color: var(--muted);
}

.order-state-pills,
.note-item,
.log-item,
.draft-note-item,
.customer-option {
  border: var(--border-width) solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  padding: 10px 12px;
}

.order-state-pills {
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.order-summary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding: 10px 14px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.summary-amount {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.summary-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
}

#orderAgeInfo {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  min-height: 24px;
  padding-inline: 9px;
}

.order-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px 14px 13px;
  background: var(--bg-3);
}

[data-theme="dark"] .order-foot {
  background: var(--panel-soft);
}

[data-theme="dark"] .order-main {
  background: color-mix(in srgb, var(--panel-soft) 84%, #213754);
  border-color: color-mix(in srgb, var(--line) 84%, #587eaa);
}

.quick-stack {
  display: grid;
  gap: 8px;
}

.order-foot .quick-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.order-foot .quick-actions {
  gap: 7px;
}

.order-foot .chip-button {
  min-width: 78px;
  min-height: 30px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.order-foot button:hover,
.order-foot button:active {
  transform: none;
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .ghost,
[data-theme="dark"] .text-button,
[data-theme="dark"] .chip-button,
[data-theme="dark"] .icon-only {
  background: var(--panel-soft);
  border-color: var(--line);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  color: var(--text);
}

[data-theme="dark"] .bulk-bar,
[data-theme="dark"] .note-builder,
[data-theme="dark"] .order-summary-line {
  background: color-mix(in srgb, var(--panel-soft) 82%, var(--panel));
}

[data-theme="dark"] .bulk-bar,
[data-theme="dark"] .note-builder,
[data-theme="dark"] .choice-group,
[data-theme="dark"] .duplicate-hint,
[data-theme="dark"] .note-item,
[data-theme="dark"] .log-item,
[data-theme="dark"] .draft-note-item,
[data-theme="dark"] .customer-option {
  border-color: color-mix(in srgb, var(--line) 88%, #5b7da8);
}

.state-pill.tone-success {
  background: var(--teal-soft);
  color: var(--success);
}

.state-pill.tone-warning {
  background: var(--amber-soft);
  color: var(--warning);
}

.state-pill.tone-accent {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.state-pill.tone-muted {
  background: color-mix(in srgb, var(--line) 38%, transparent);
  color: var(--muted);
}

.log-item,
.note-item {
  display: grid;
  gap: 8px;
}

.log-item {
  border-right: 3px solid color-mix(in srgb, var(--accent) 44%, transparent);
}

.note-item {
  border-right: 3px solid color-mix(in srgb, var(--success) 34%, transparent);
}

.quick-stack {
  display: grid;
  gap: 8px;
}

.quick-row {
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.quick-label {
  min-width: 52px;
  padding-top: 0;
  font-size: 10px;
}

.selector {
  display: grid;
  place-items: center;
  padding-top: 3px;
}

.selector input {
  display: none;
}

.selector span {
  width: 19px;
  height: 19px;
  border: var(--border-width) solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
  position: relative;
  transition: border-color 180ms ease, background 180ms ease;
}

.selector:hover span,
.customer-option:hover,
.draft-note-item:hover,
.note-item:hover,
.log-item:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.selector input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.selector input:checked + span::after {
  content: "";
  position: absolute;
  inset: 4px 5px 5px 4px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.text-button,
.chip-button {
  min-height: 28px;
  font-size: 10.5px;
  padding-inline: 9px;
  border-radius: 8px;
}

.chip-button.active {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-2);
}

.note-compose {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.note-compose textarea {
  min-height: 118px;
}

.note-compose button {
  justify-self: start;
  min-width: 92px;
  min-height: 34px;
}

input[name="purchaseCost"] {
  min-height: 40px;
  padding-block: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 92%, var(--panel-soft));
  font-size: 13px;
  letter-spacing: 0;
}

[data-theme="dark"] input[name="purchaseCost"] {
  background: color-mix(in srgb, var(--panel-soft) 88%, #182a42);
}

.note-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.note-builder {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: var(--border-width) dashed var(--line-strong);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
}

.draft-note-item,
.customer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.draft-note-item {
  align-items: flex-start;
}

.draft-note-item span {
  padding-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notes-list,
.log-list,
.draft-notes {
  gap: 9px;
}

.note-item,
.log-item {
  padding: 9px 11px;
  gap: 5px;
  align-content: start;
  min-height: 0;
}

.note-item strong,
.log-item strong {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.6;
}

.note-item span,
.log-item span {
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.note-item span {
  color: color-mix(in srgb, var(--text) 74%, var(--muted));
}

.note-item .mini-tag,
.log-item .mini-tag {
  min-height: 28px;
  padding-inline: 9px;
  font-size: 11px;
}

.customer-option {
  width: 100%;
  text-align: right;
}

.editor-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.form-head {
  margin-bottom: 18px;
}

.result p {
  margin: 14px 0 16px;
  font-size: 15px;
  line-height: 2;
}

.choice-group {
  margin: 0;
  padding: 12px;
  border: var(--border-width) solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel-soft) 80%, transparent);
  display: grid;
  gap: 12px;
}

.choice-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.choice-group legend::before {
  content: "\f192";
  color: var(--accent);
  font-size: 10px;
}

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

.radio-grid.compact {
  grid-template-columns: 1fr;
}

.radio-card {
  position: relative;
  margin: 0;
  min-height: 52px;
  padding: 0;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.radio-card span {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: var(--border-width) solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.radio-card:hover span {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.radio-card input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-2);
}

.danger-card input:checked + span,
.danger-card:hover span {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 84%, var(--panel));
  color: var(--warning);
}

.back-primary {
  background: linear-gradient(145deg, #173d9d, #0e2f74);
  color: #fff;
}

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--line) 44%, transparent), color-mix(in srgb, var(--panel-soft) 70%, var(--line)), color-mix(in srgb, var(--line) 44%, transparent));
  background-size: 200% 100%;
  animation: skeleton-wave 1.05s linear infinite;
}

.skeleton-line.wide { width: 86%; }
.skeleton-line.medium { width: 58%; margin-top: 10px; }
.skeleton-line.short { width: 38%; margin-top: 10px; }

.error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.9;
}

.error:empty {
  display: none;
}

@keyframes loader-sweep {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(-320%);
    opacity: 1;
  }
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeleton-wave {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 1120px) {
  .shell {
    width: min(100% - 42px, 1440px);
    padding: 62px 0 28px;
  }

  .app-content {
    gap: 14px;
  }

  .mobile-menu-button {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top));
    right: 18px;
    z-index: 46;
    width: 44px;
    height: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(182, 209, 255, 0.34);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(22, 82, 198, 0.98), rgba(10, 42, 110, 0.98));
    color: #fff;
    box-shadow: 0 18px 32px rgba(8, 28, 74, 0.28);
  }

  body.sidebar-open .mobile-menu-button {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
  }

  .mobile-menu-button i {
    font-size: 18px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 38;
    display: block;
    pointer-events: none;
    opacity: 0;
    border: 0;
    border-radius: 0;
    background: rgba(6, 17, 39, 0.42);
    backdrop-filter: blur(2px);
    transition: opacity 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    direction: rtl;
  }

  .app-sidebar {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 44;
    width: min(356px, calc(100vw - 24px));
    min-height: auto;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    order: initial;
    grid-template-rows: auto auto auto;
    gap: 14px;
    padding: calc(16px + env(safe-area-inset-top)) 14px 16px;
    align-self: auto;
    align-content: start;
    border-radius: 20px;
    border: 1px solid rgba(185, 214, 255, 0.2);
    background: linear-gradient(180deg, rgba(14, 48, 122, 0.98), rgba(7, 24, 67, 0.98));
    transform: translateX(108%);
    transition: transform 240ms ease, opacity 220ms ease, box-shadow 220ms ease;
    box-shadow: none;
    animation: none;
    will-change: transform;
    opacity: 0;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    opacity: 1;
    box-shadow: 0 24px 64px rgba(4, 14, 38, 0.42);
  }

  body:not(.sidebar-open) .app-sidebar {
    transform: translateX(108%);
    opacity: 0;
    box-shadow: none;
  }

  .sidebar-topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: flex-start;
    padding-left: 42px;
    padding-bottom: 10px;
    margin-bottom: 4px;
    background: linear-gradient(180deg, rgba(12, 41, 104, 0.98), rgba(12, 41, 104, 0.84), transparent);
  }

  .sidebar-close {
    display: inline-flex;
    position: absolute;
    top: 0;
    left: 0;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 11px;
    color: #f9fbff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(188, 214, 255, 0.22);
    box-shadow: none;
    align-items: center;
    justify-content: center;
  }

  .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(198, 220, 255, 0.32);
  }

  .sidebar-close .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .sidebar-menu {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(182, 209, 255, 0.12);
  }

  .nav-button {
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 13px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(184, 213, 255, 0.06);
  }

  .nav-button .icon,
  .sidebar-tools .icon,
  .sidebar-icon .icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .nav-button .icon i,
  .sidebar-tools .icon i,
  .sidebar-icon .icon i {
    font-size: 15px;
  }

  .hero-glow {
    display: none;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 14.5px;
  }

  .sidebar-tools {
    grid-template-columns: minmax(0, 1fr);
    align-self: start;
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(182, 209, 255, 0.12);
  }

  .sidebar-tools .ghost,
  .restore-picker .ghost {
    min-height: 40px;
    border-radius: 10px;
    font-size: 12px;
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .sidebar-mini-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sidebar-tools .icon-only {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding-inline: 12px;
    gap: 10px;
    border-radius: 11px;
    font-size: 13px;
    border: var(--border-width) solid rgba(162, 202, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
  }

  .theme-label {
    display: inline;
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  .tools-grid,
  .editor-page,
  .order-foot,
  .customer-form {
    grid-template-columns: 1fr;
  }

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

  .tools-grid,
  .orders-list,
  .customers-list {
    gap: 12px;
  }

  .bulk-bar {
    padding: 11px;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 26px, 1440px);
    padding: 58px 0 22px;
  }

  .mobile-menu-button {
    right: 14px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 12px;
  }

  .mobile-menu-button i {
    font-size: 17px;
  }

  h1 {
    font-size: 20.5px;
  }

  h2 {
    font-size: 14.5px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 42px;
    border-radius: 10px;
  }

  .order-main strong,
  .draft-note-item span {
    font-size: 13px;
  }

  .section-kicker,
  .badge,
  .eyebrow,
  .type-pill,
  .state-pill,
  .status,
  .order-main span,
  .quick-label,
  .note-item span,
  .log-item span {
    font-size: 11px;
  }

  .hero-panel,
  .form-head,
  .order-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-panel {
    padding: 13px;
  }

  .app-sidebar {
    width: min(336px, calc(100vw - 20px));
    right: 10px;
    bottom: 10px;
    top: 10px;
    padding: calc(16px + env(safe-area-inset-top)) 12px 14px;
    gap: 12px;
  }

  .sidebar-brand {
    display: flex;
  }

  .sidebar-topbar {
    padding-left: 40px;
    padding-bottom: 12px;
    margin-bottom: 0;
  }

  .sidebar-close {
    top: 2px;
    left: 0;
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 10px;
    border-color: rgba(188, 214, 255, 0.24);
  }

  .sidebar-close .icon i {
    font-size: 15px;
  }

  .sidebar-brand-copy strong {
    font-size: 18px;
    line-height: 1.35;
  }

  .sidebar-brand-copy span {
    font-size: 12px;
    line-height: 1.8;
  }

  .sidebar-menu {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .nav-button {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    justify-content: flex-start;
    padding: 0 14px;
    font-size: 13.2px;
  }

  .nav-button .icon {
    display: inline-flex;
  }

  .sidebar-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .sidebar-tools .ghost {
    min-height: 42px;
    font-size: 12.6px;
    padding-inline: 13px;
  }

  .sidebar-mini-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sidebar-tools .icon-only {
    min-height: 48px;
    width: 100%;
    justify-content: flex-start;
    padding-inline: 13px;
    gap: 10px;
    font-size: 12.8px;
  }

  .actions button,
  .button-row button,
  .bulk-actions button,
  .order-actions button,
  .submit-row button,
  .quick-actions button {
    flex: 1;
  }

  .order-item {
    border-radius: 11px;
  }

  .order-item .order-main strong {
    font-size: 14px;
  }

  .order-item .order-main span,
  .order-item .quick-label,
  .order-summary-line {
    font-size: 11.5px;
  }

  .order-main {
    padding: 9px 10px;
  }

  .order-item .type-pill,
  .order-item .state-pill {
    min-height: 25px;
    font-size: 11px;
  }

  .summary-amount {
    font-size: 13.5px;
  }

  .order-row,
  .order-summary-line,
  .order-foot {
    padding-inline: 11px;
  }

  .order-main-row,
  .order-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .order-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .trash-card,
  .customer-trash-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 11px;
  }

  .trash-card-side {
    align-items: flex-start;
    justify-content: space-between;
  }

  .trash-meta,
  .trash-actions {
    justify-content: flex-start;
  }

  .trash-tabs .chip-button {
    flex: 1 1 130px;
  }

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

  .order-actions button,
  .quick-actions button,
  .bulk-actions button {
    min-height: 32px;
    font-size: 10.5px;
    padding-inline: 9px;
  }

  .quick-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .quick-actions {
    gap: 6px;
  }

  .order-form,
  .converter-row,
  .note-compose,
  .customer-form,
  .sidebar-mini-actions {
    grid-template-columns: 1fr;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .list-filters {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 1px;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 220ms ease, opacity 180ms ease, margin-top 180ms ease;
  }

  .list-filters.filters-open {
    max-height: 760px;
    opacity: 1;
    margin-top: 2px;
  }

  .sidebar-tools .sidebar-mini-actions {
    grid-template-columns: 1fr;
  }

  .choice-group {
    gap: 11px;
    padding: 11px;
  }

  .trash-page {
    padding: 12px;
    gap: 10px;
  }

  .trash-page .list-head {
    align-items: flex-start;
  }

  .trash-card {
    padding: 11px;
  }

  .trash-card-main {
    gap: 10px;
  }

  .trash-icon {
    width: 36px;
    height: 36px;
  }

  .trash-card strong {
    font-size: 13.5px;
  }

  .trash-card-main span,
  .trash-card small {
    font-size: 11px;
  }

  .trash-card-side {
    display: grid;
    gap: 8px;
    justify-content: stretch;
  }

  .trash-meta {
    justify-content: flex-start;
  }

  .trash-actions .text-button {
    width: 100%;
  }

  .choice-group .radio-grid,
  .choice-group .radio-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .choice-group .radio-card {
    min-height: 46px;
  }

  .choice-group .radio-card span {
    min-height: 46px;
    font-size: 12px;
    padding: 9px 10px;
  }

  .converter-panel .button-row {
    margin-top: 10px;
    gap: 10px;
  }

  .converter-panel .button-row button {
    flex: 1;
  }

  .note-builder {
    gap: 14px;
    padding: 12px;
  }

  .note-compose {
    gap: 12px;
  }

  .note-compose button {
    width: 100%;
    justify-self: stretch;
  }

  .draft-note-item,
  .note-item,
  .log-item {
    padding: 9px 10px;
  }

  .note-item,
  .log-item {
    gap: 4px;
  }

  .note-item strong,
  .log-item strong {
    font-size: 11.4px;
  }

  .note-item span,
  .log-item span {
    line-height: 1.65;
    font-size: 11px;
  }

  .note-item .mini-tag,
  .log-item .mini-tag {
    min-height: 26px;
    font-size: 10.4px;
    padding-inline: 8px;
  }

  .bulk-bar {
    position: static;
    z-index: auto;
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 11px;
    box-shadow: var(--shadow-soft);
  }

  input[name="purchaseCost"] {
    min-height: 38px;
    font-size: 12.4px;
    padding-inline: 11px;
  }

  #selectedCount {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    border: var(--border-width) solid color-mix(in srgb, var(--accent) 22%, var(--line));
    background: color-mix(in srgb, var(--panel) 90%, var(--accent-soft));
    font-size: 10.4px;
    line-height: 1.7;
    text-align: center;
  }

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

  .bulk-actions button {
    width: 100%;
    min-height: 30px;
    font-size: 10px;
    padding-inline: 8px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .hero-panel,
  .rate-panel,
  .converter-panel,
  .orders-page,
  .customers-page,
  .form-panel,
  .result,
  .side-panel,
  .auth {
    padding: 13px;
  }

  .app-sidebar {
    padding: calc(18px + env(safe-area-inset-top)) 13px 16px;
  }

  .customer-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .customer-card-actions {
    justify-content: stretch;
  }

  .customer-card-actions .text-button {
    flex: 1 1 112px;
  }

  .floating-create {
    right: 18px;
    bottom: 18px;
    width: 50px;
    height: 50px;
  }

  .floating-payment {
    bottom: 78px;
  }

  .order-actions,
  .quick-actions {
    width: 100%;
  }
}
