@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700;800;900&display=swap");

:root {
  --bg: #07111f;
  --bg-soft: #0f1b31;
  --panel: rgba(12, 21, 38, 0.86);
  --panel-strong: rgba(18, 31, 54, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --text: #f1f5f9;
  --muted: #9fb0c9;
  --line: rgba(148, 163, 184, 0.16);
  --primary: #14b8a6;
  --primary-strong: #0f766e;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.36);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --app-font: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  min-height: 100%;
  direction: rtl;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 24%),
    radial-gradient(circle at left center, rgba(245, 158, 11, 0.1), transparent 18%),
    linear-gradient(180deg, #07111f 0%, #0b1425 100%);
  color: var(--text);
  font-family: var(--app-font);
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

body.auth-locked {
  overflow: hidden;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  direction: rtl;
  text-align: right;
}
[hidden] {
  display: none !important;
}

.page-shell {
  width: 100%;
  margin: 0 auto;
  padding: 18px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas: "main sidebar";
  direction: ltr;
  gap: 18px;
}

.ops-sidebar {
  grid-area: sidebar;
  direction: rtl;
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.sidebar-brand,
.sidebar-card,
.hero,
.status-banner,
.panel,
.subpanel,
.queue-item,
.stat-card,
.detail-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar-brand,
.sidebar-card,
.panel,
.subpanel,
.detail-block {
  padding: 18px;
}

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

.sidebar-brand h1,
.hero-copy h2,
.section-head h2,
.section-head h3,
.order-title h3 {
  margin: 0;
  line-height: 1.15;
}

.sidebar-brand p,
.hero-copy p,
.section-note,
.subpanel-body,
.queue-meta,
.detail-block label,
.timeline-item p,
.doc-card strong,
.stat-card small,
.sidebar-copy-stack span {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  color: #8fd6ca;
}

.sidebar-copy-stack,
.mini-stack,
.subpanel-body,
.queue-list,
.form-stack {
  display: grid;
  gap: 10px;
}

.order-lookup-form {
  display: grid;
  gap: 10px;
}

.sidebar-copy-stack strong {
  font-size: 1rem;
}

.sidebar-actions,
.inline-form-actions {
  display: flex;
  justify-content: flex-start;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
}

.toggle input {
  accent-color: var(--primary);
}

.section-nav {
  display: grid;
  gap: 10px;
}

.primary-button,
.ghost-button,
.section-nav button,
.doc-actions a {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.primary-button:hover,
.ghost-button:hover,
.section-nav button:hover,
.doc-actions a:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #f8fafc;
  font-weight: 700;
  padding: 12px 16px;
}

.primary-button.accent {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.primary-button.danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
}

.ghost-button {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  padding: 10px 14px;
  width: 100%;
}

.section-nav button {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  padding: 12px 14px;
  text-align: right;
  font-weight: 800;
}

.section-nav button.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(245, 158, 11, 0.18));
  border: 1px solid rgba(20, 184, 166, 0.22);
}

.auth-logout {
  border-color: rgba(239, 68, 68, 0.2);
}

.ops-main {
  grid-area: main;
  direction: rtl;
  display: grid;
  gap: 16px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  align-items: flex-start;
}

.hero-copy {
  max-width: 760px;
}

.screen-route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.route-chip {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}

.route-chip:hover {
  transform: translateY(-1px);
}

.route-chip.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(245, 158, 11, 0.14));
  border-color: rgba(20, 184, 166, 0.3);
}

.route-chip-summary,
.desk-head-actions,
.desk-drill-top,
.desk-detail-head,
.desk-drill-actions,
.desk-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.route-chip-summary {
  margin-bottom: 12px;
}

.route-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-banner {
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.status-banner[data-kind="success"] {
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.status-banner[data-kind="error"] {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.status-banner[data-kind="loading"] {
  border-color: rgba(20, 184, 166, 0.45);
}

.ops-grid,
.stat-grid,
.two-up,
.workflow-grid,
.check-grid,
.quick-actions-grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.quick-actions-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.desk-head-actions {
  justify-content: flex-end;
}

.desk-surface {
  align-items: stretch;
  grid-template-areas: "list detail";
}

.desk-list-panel,
.desk-detail-panel {
  min-height: 100%;
}

.desk-list-panel {
  grid-area: list;
}

.desk-detail-panel {
  grid-area: detail;
}

.desk-drill-list,
.desk-detail-surface {
  display: grid;
  gap: 12px;
}

.desk-drill-item,
.desk-detail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.46);
}

.desk-drill-item {
  display: grid;
  gap: 12px;
  cursor: pointer;
  text-align: inherit;
  width: 100%;
}

.desk-drill-item:hover,
.desk-drill-item.active,
.desk-detail-card {
  border-color: rgba(20, 184, 166, 0.28);
}

.desk-drill-item.active {
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.22), 0 10px 28px rgba(2, 6, 23, 0.28);
}

.desk-drill-hint,
.desk-detail-note {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.desk-drill-actions,
.desk-detail-actions {
  justify-content: flex-start;
}

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

.ops-360-surface {
  display: grid;
  gap: 12px;
}

.surface-summary,
.surface-block,
.surface-note-card,
.surface-route-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.surface-summary,
.surface-block {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.surface-kpi-row,
.surface-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.surface-note-card {
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.surface-note-card strong {
  display: block;
}

.surface-note-card p,
.surface-note-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.surface-route-card {
  width: 100%;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  text-align: right;
  cursor: pointer;
}

.surface-route-card strong,
.surface-route-card small {
  display: block;
}

.surface-route-card small {
  color: var(--muted);
  line-height: 1.6;
}

.surface-route-card.active {
  border-color: rgba(20, 184, 166, 0.3);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.12);
}

.surface-route-button {
  width: auto;
}

.desk-drill-actions .pill.active {
  background: rgba(20, 184, 166, 0.16);
}

.subpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.9rem;
}

.pill-row,
.team-mini-list,
.doc-actions,
.queue-top,
.timeline-head,
.order-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pill,
.status-chip,
.hero-chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.5);
}

.pill.active,
.status-chip {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.badge.urgent {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.queue-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.queue-filter button {
  grid-column: span 4;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  padding: 12px 14px;
}

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

label {
  display: grid;
  gap: 6px;
}

label span {
  font-weight: 700;
}

.queue-item {
  padding: 16px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  outline: none;
}

.queue-item:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.queue-item.urgent {
  border-color: rgba(239, 68, 68, 0.35);
}

.queue-name {
  font-weight: 700;
  margin: 0;
}

.queue-meta-grid,
.detail-grid,
.check-grid,
.channels-grid {
  display: grid;
  gap: 10px 12px;
}

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

.detail-grid div,
.checkbox-row,
.doc-card,
.timeline-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.detail-grid div {
  padding: 14px;
}

.detail-grid label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.detail-grid strong {
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.checkbox-row input {
  width: auto;
}

.docs-list,
.timeline-list,
.document-checklist {
  display: grid;
  gap: 10px;
}

.doc-card,
.timeline-item,
.empty-state {
  padding: 14px;
}

.desk-feed-item {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.desk-feed-item.is-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.desk-feed-item.is-clickable:hover,
.desk-feed-item.is-clickable:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 166, 0.34);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.14), 0 20px 42px rgba(2, 6, 23, 0.24);
}

.desk-feed-item:focus-visible {
  outline: none;
}

.desk-feed-head,
.desk-feed-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.desk-feed-head strong {
  font-size: 1rem;
}

.desk-feed-actions {
  align-items: center;
}

.desk-open-button {
  width: auto;
  min-width: 140px;
  padding-inline: 14px;
}

.desk-feed-item .pill {
  white-space: nowrap;
}

.quick-action-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

.quick-action-card strong,
.quick-action-card p {
  margin: 0;
}

.quick-action-card.is-disabled {
  opacity: 0.7;
}

.quick-action-card.is-recommended {
  border-color: rgba(20, 184, 166, 0.34);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.12);
}

.quick-action-card .ghost-button,
.quick-action-card .primary-button {
  width: 100%;
}

.doc-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.doc-actions a {
  padding: 8px 12px;
  background: rgba(20, 184, 166, 0.12);
  text-decoration: none;
}

.section-inline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.empty-state.large {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(20, 184, 166, 0.16), transparent 32%),
    radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(4, 11, 20, 0.96), rgba(8, 15, 28, 0.98));
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 36px 90px rgba(2, 6, 23, 0.56);
}

.auth-card h2 {
  margin: 0;
  line-height: 1.15;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

.auth-message,
.auth-hint,
.form-gate-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 4px;
}

.boot-error {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

@media (max-width: 1200px) {
  .page-shell,
  .workflow-grid,
  .two-up {
    grid-template-columns: 1fr;
  }

  .page-shell {
    grid-template-areas:
      "sidebar"
      "main";
  }

  .ops-360-grid,
  .surface-route-grid {
    grid-template-columns: 1fr;
  }

  .desk-surface {
    grid-template-areas:
      "list"
      "detail";
  }

  .ops-sidebar {
    position: relative;
    top: 0;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
  }

  .hero,
  .section-head,
  .queue-filter,
  .queue-meta-grid,
  .detail-grid,
  .stat-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .queue-filter button {
    grid-column: auto;
  }
}

body {
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.14), transparent 24%),
    radial-gradient(circle at bottom left, rgba(13, 148, 136, 0.18), transparent 26%),
    linear-gradient(180deg, #052129 0%, #08313a 18%, #06242b 100%);
}

.page-shell {
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas: "main sidebar";
  direction: ltr;
}

.ops-sidebar {
  grid-area: sidebar;
}

.ops-main {
  grid-area: main;
}

.sidebar-brand,
.sidebar-card,
.hero,
.status-banner,
.panel,
.subpanel,
.queue-item,
.stat-card,
.detail-block {
  background: rgba(6, 37, 45, 0.92);
  border: 1px solid rgba(151, 201, 196, 0.12);
  box-shadow: 0 24px 60px rgba(1, 14, 19, 0.28);
}

.sidebar-brand p,
.hero-copy p,
.section-note,
.subpanel-body,
.queue-meta,
.detail-block label,
.timeline-item p,
.doc-card strong,
.stat-card small,
.sidebar-copy-stack span {
  color: rgba(221, 242, 240, 0.72);
}

.eyebrow {
  color: #89f4e3;
}

.primary-button {
  background: linear-gradient(135deg, #67e8cf, #14b8a6);
  color: #032127;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(126, 243, 209, 0.12);
}

.section-nav button {
  background: rgba(255, 255, 255, 0.03);
}

.section-nav button.active {
  background: linear-gradient(135deg, rgba(92, 234, 213, 0.26), rgba(27, 166, 155, 0.22));
  border: 1px solid rgba(126, 243, 209, 0.26);
}

.hero {
  background: linear-gradient(180deg, rgba(8, 51, 60, 0.94), rgba(6, 38, 45, 0.96));
}

.route-chip,
.pill,
.hero-chip,
.badge {
  background: rgba(126, 243, 209, 0.09);
  border: 1px solid rgba(126, 243, 209, 0.16);
  color: #dffcf8;
}

.route-chip.active {
  background: linear-gradient(135deg, rgba(92, 234, 213, 0.24), rgba(27, 166, 155, 0.22));
  border-color: rgba(126, 243, 209, 0.3);
}

.status-banner {
  background: rgba(8, 47, 56, 0.94);
}

.stat-card,
.queue-item,
.desk-drill-item,
.desk-detail-card,
.subpanel,
.sidebar-card,
.hero,
.panel {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover,
.queue-item:hover,
.desk-drill-item:hover,
.desk-detail-card:hover,
.subpanel:hover,
.sidebar-card:hover,
.panel:hover {
  transform: translateY(-2px);
}

.desk-drill-item.active,
.queue-item.urgent,
.section-nav button.active {
  box-shadow: 0 0 0 1px rgba(126, 243, 209, 0.14), 0 18px 40px rgba(3, 14, 18, 0.28);
}

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .ops-sidebar,
  .ops-main {
    grid-column: auto;
  }
}
