/* ==========================================================================
   e-Dhaq design system
   Tokens first, then layout, then components. Bootstrap is overridden
   globally so every page picks up the same look without per-page markup.
   ========================================================================== */

:root {
  /* Brand */
  --edhaq-primary: #d71920;
  --edhaq-primary-600: #b8141a;
  --edhaq-primary-50: #fef2f2;
  --edhaq-primary-100: #fde3e4;

  /* Neutrals */
  --edhaq-ink: #0f172a;
  --edhaq-text: #1e293b;
  --edhaq-muted: #64748b;
  --edhaq-subtle: #94a3b8;
  --edhaq-border: #e2e8f0;
  --edhaq-border-strong: #cbd5e1;
  --edhaq-surface: #ffffff;
  --edhaq-bg: #f6f7fb;
  --edhaq-fill: #f1f5f9;

  /* Semantic */
  --edhaq-success: #16a34a;
  --edhaq-warning: #d97706;
  --edhaq-danger: #dc2626;
  --edhaq-info: #2563eb;

  /* Sidebar */
  --edhaq-sidebar: #0f1422;
  --edhaq-sidebar-2: #151b2c;
  --edhaq-sidebar-text: #aab2c5;

  /* Shape & depth */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 24px -6px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .18);
  --ring: 0 0 0 4px rgba(215, 25, 32, .14);

  /* Bootstrap hooks */
  --bs-body-font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--edhaq-text);
  --bs-body-bg: var(--edhaq-bg);
  --bs-border-color: var(--edhaq-border);
  --bs-primary: var(--edhaq-primary);
  --bs-primary-rgb: 215, 25, 32;
  --bs-link-color: var(--edhaq-primary);
  --bs-link-color-rgb: 215, 25, 32;
  --bs-link-hover-color: var(--edhaq-primary-600);
  --bs-link-hover-color-rgb: 184, 20, 26;
  --bs-secondary-color: var(--edhaq-muted);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--bs-body-font-family);
  background: var(--edhaq-bg);
  color: var(--edhaq-text);
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--edhaq-ink);
  letter-spacing: -0.015em;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn:hover,
.nav-link:hover,
.brand:hover,
.page-link:hover {
  text-decoration: none;
}

::selection {
  background: var(--edhaq-primary-100);
}

/* ==========================================================================
   App shell
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 272px;
  flex: 0 0 272px;
  background: linear-gradient(180deg, var(--edhaq-sidebar-2) 0%, var(--edhaq-sidebar) 100%);
  color: #fff;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .04);
}

.sidebar-brand {
  margin-bottom: 1.25rem;
  padding: 0 .35rem;
}

.brand {
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  line-height: 1.1;
}

.brand-tagline {
  color: #6f7891;
  font-size: .72rem;
  font-weight: 500;
  margin-top: 2px;
}

.role-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: .15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

.sidebar .nav-link {
  color: var(--edhaq-sidebar-text);
  border-radius: 10px;
  padding: .6rem .8rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 500;
  font-size: .9rem;
  transition: background-color .15s ease, color .15s ease;
}

.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

.sidebar .nav-link.active {
  color: #fff;
  background: var(--edhaq-primary);
  box-shadow: 0 6px 16px -6px rgba(215, 25, 32, .7);
}

.sidebar .nav-link:focus-visible,
.nav-group-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .6);
  outline-offset: 2px;
}

.nav-icon,
.nav-group-icon {
  width: 1.15rem;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
}

.nav-link-flat {
  font-weight: 600;
}

.nav-section-label,
.menu-section-label {
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #5b6480;
  font-weight: 700;
  padding: 1.1rem .8rem .4rem;
}

.menu-subsection-label {
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5b6480;
  font-weight: 700;
  padding: .3rem .35rem .1rem;
}

.nav-group {
  margin-bottom: 2px;
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .7rem;
  background: none;
  border: none;
  color: var(--edhaq-sidebar-text);
  padding: .6rem .8rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
  text-align: left;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.nav-group-label {
  flex: 1;
}

.nav-group-arrow {
  font-size: .7rem;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  opacity: .5;
}

.nav-group.open .nav-group-arrow {
  transform: rotate(90deg);
  opacity: .9;
}

.nav-group.open .nav-group-toggle {
  color: #fff;
}

.nav-group-items {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: .15rem 0 .35rem .6rem;
  margin-left: 1.15rem;
  border-left: 1px solid rgba(255, 255, 255, .08);
}

.nav-group-items.show {
  display: flex;
}

.nav-group-items .nav-link {
  font-size: .86rem;
  padding: .5rem .75rem;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding-top: .9rem;
  margin-top: .75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: inherit;
  text-decoration: none;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, .09);
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--edhaq-primary) 0%, #f97316 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
}

.sidebar-user-name {
  color: #e8ebf3;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.sidebar-user-role {
  color: #6f7891;
  font-size: .72rem;
  font-weight: 500;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 39;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  display: block;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .85);
  border-bottom: 1px solid var(--edhaq-border);
  backdrop-filter: saturate(180%) blur(12px);
  padding: .75rem 1.5rem;
  min-height: 64px;
  display: flex;
  align-items: center;
}

.top-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--edhaq-ink);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--edhaq-ink);
  font-weight: 800;
  font-size: 1.1rem;
}

.top-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.public-nav a {
  color: var(--edhaq-muted);
  font-size: .9rem;
  font-weight: 600;
}

.public-nav a:hover {
  color: var(--edhaq-primary);
  text-decoration: none;
}

.sidebar-toggle {
  background: #fff;
  border: 1px solid var(--edhaq-border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  color: var(--edhaq-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--edhaq-fill);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .75rem .25rem .25rem;
  border-radius: 999px;
  border: 1px solid var(--edhaq-border);
  background: #fff;
  color: var(--edhaq-text);
  font-weight: 600;
  font-size: .85rem;
}

.user-chip:hover {
  border-color: var(--edhaq-border-strong);
  text-decoration: none;
}

.user-chip .sidebar-user-avatar {
  width: 28px;
  height: 28px;
  font-size: .75rem;
}

.auth-actions .btn {
  min-width: 86px;
}

.main-content {
  flex: 1 0 auto;
  padding: 1.75rem;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  min-width: 0;
}

.footer {
  margin-top: auto;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--edhaq-border);
  background: #fff;
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
}

.footer-content {
  color: var(--edhaq-subtle);
  font-size: .8rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
}

.footer-content strong {
  color: var(--edhaq-primary);
}

/* ==========================================================================
   Page headings
   ========================================================================== */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--edhaq-ink);
  margin-bottom: .25rem;
}

.page-subtitle {
  color: var(--edhaq-muted);
  margin: 0;
}

.section-title {
  font-weight: 800;
  margin-bottom: .8rem;
}

/* ==========================================================================
   Bootstrap overrides
   ========================================================================== */

.card {
  border: 1px solid var(--edhaq-border) !important;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm) !important;
  background: var(--edhaq-surface);
}

.card-body {
  padding: 1.35rem;
}

.card-header,
.card-footer {
  background: transparent;
  border-color: var(--edhaq-border);
  padding: 1rem 1.35rem;
}

.card-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--edhaq-ink);
  margin-bottom: 1rem;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f8fafc;
  --bs-table-border-color: var(--edhaq-border);
  margin-bottom: 0;
  font-size: .9rem;
}

.table > thead th,
.table > thead td {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--edhaq-muted);
  background: var(--edhaq-fill);
  border-bottom: 1px solid var(--edhaq-border);
  padding: .7rem .9rem;
  white-space: nowrap;
}

.table > thead th:first-child { border-top-left-radius: var(--radius-sm); }
.table > thead th:last-child  { border-top-right-radius: var(--radius-sm); }

.table > tbody td {
  padding: .8rem .9rem;
  border-color: var(--edhaq-border);
}

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

.table-light {
  --bs-table-bg: var(--edhaq-fill);
}

/* Forms */
.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--edhaq-text);
  margin-bottom: .4rem;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: var(--edhaq-border-strong);
  padding: .6rem .85rem;
  font-size: .925rem;
  color: var(--edhaq-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control-sm,
.form-select-sm {
  padding: .35rem .6rem;
  font-size: .82rem;
  border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--edhaq-primary);
  box-shadow: var(--ring);
}

.form-control::placeholder {
  color: var(--edhaq-subtle);
}

.form-check-input:checked {
  background-color: var(--edhaq-primary);
  border-color: var(--edhaq-primary);
}

.form-text {
  color: var(--edhaq-muted);
  font-size: .8rem;
}

.input-icon {
  position: relative;
}

.input-icon > i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--edhaq-subtle);
  pointer-events: none;
}

.input-icon > .form-control {
  padding-left: 2.5rem;
}

.code-input {
  font-size: 1.6rem !important;
  font-weight: 700;
  letter-spacing: .6em;
  text-align: center;
  padding: .7rem !important;
}

/* Buttons */
.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  padding: .55rem 1.05rem;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

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

.btn-sm {
  border-radius: var(--radius-sm);
  font-size: .8rem;
  padding: .35rem .7rem;
}

.btn-lg {
  border-radius: 12px;
  font-size: 1rem;
  padding: .75rem 1.25rem;
}

.btn-edhaq,
.btn-primary {
  background: var(--edhaq-primary);
  border: 1px solid var(--edhaq-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-edhaq:hover,
.btn-edhaq:focus,
.btn-primary:hover,
.btn-primary:focus {
  background: var(--edhaq-primary-600);
  border-color: var(--edhaq-primary-600);
  color: #fff;
}

.btn-edhaq:focus-visible,
.btn-primary:focus-visible {
  box-shadow: var(--ring);
}

.btn-outline-primary {
  color: var(--edhaq-primary);
  border-color: #f3b6b8;
}

.btn-outline-primary:hover {
  background: var(--edhaq-primary-50);
  color: var(--edhaq-primary-600);
  border-color: var(--edhaq-primary);
}

.btn-outline-dark,
.btn-outline-secondary {
  color: var(--edhaq-text);
  border-color: var(--edhaq-border-strong);
  background: #fff;
}

.btn-outline-dark:hover,
.btn-outline-secondary:hover {
  background: var(--edhaq-fill);
  color: var(--edhaq-ink);
  border-color: var(--edhaq-border-strong);
}

.btn-success {
  background: var(--edhaq-success);
  border-color: var(--edhaq-success);
}

/* Badges */
.badge {
  font-weight: 600;
  border-radius: 999px;
  padding: .35em .7em;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--edhaq-fill);
  color: var(--edhaq-muted);
}

.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-danger  { background: #fee2e2; color: #b91c1c; }
.badge-soft-info    { background: #dbeafe; color: #1d4ed8; }
.badge-soft-primary { background: var(--edhaq-primary-50); color: var(--edhaq-primary-600); }

/* Alerts */
.alert {
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .9rem;
}

.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Pagination */
.pagination {
  gap: .3rem;
}

.page-link {
  border-radius: var(--radius-sm) !important;
  border-color: var(--edhaq-border);
  color: var(--edhaq-text);
  font-weight: 600;
  font-size: .85rem;
  min-width: 36px;
  text-align: center;
}

.page-item.active .page-link {
  background: var(--edhaq-primary);
  border-color: var(--edhaq-primary);
}

/* Modals & dropdowns */
.modal-content {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.dropdown-menu {
  border: 1px solid var(--edhaq-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .35rem;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  font-size: .9rem;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
  color: var(--edhaq-primary);
}

.nav-pills .nav-link.active {
  background: var(--edhaq-primary-50);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Stat cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--edhaq-surface);
  border: 1px solid var(--edhaq-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}

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

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--stat-accent, var(--edhaq-primary));
  background: color-mix(in srgb, var(--stat-accent, var(--edhaq-primary)) 12%, #fff);
  flex: 0 0 auto;
}

.stat-body { min-width: 0; }

.stat-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--edhaq-muted);
}

.stat-value {
  margin: .15rem 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--edhaq-ink);
  line-height: 1.2;
}

.stat-primary { --stat-accent: #d71920; }
.stat-blue    { --stat-accent: #2563eb; }
.stat-warning { --stat-accent: #d97706; }
.stat-success { --stat-accent: #16a34a; }
.stat-danger  { --stat-accent: #dc2626; }
.stat-purple  { --stat-accent: #9333ea; }
.stat-teal    { --stat-accent: #0d9488; }
.stat-slate   { --stat-accent: #475569; }

.metric-card {
  background: var(--edhaq-surface);
  border: 1px solid var(--edhaq-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.metric-card span {
  color: var(--edhaq-muted);
  font-weight: 600;
  font-size: .8rem;
}

.metric-card h4 {
  margin: .4rem 0 0;
  color: var(--edhaq-ink);
  font-weight: 800;
  letter-spacing: -.02em;
}

/* Status snapshot pills */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .6rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--edhaq-border);
  border-radius: 10px;
  padding: .55rem .75rem;
  background: #fff;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-color, #64748b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color, #64748b) 18%, transparent);
  flex: 0 0 auto;
}

.status-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--edhaq-text);
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-count {
  font-size: .85rem;
  font-weight: 800;
  color: var(--edhaq-ink);
}

/* Info banner */
.info-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  color: var(--edhaq-text);
  font-size: .9rem;
}

.info-banner strong {
  display: block;
  color: var(--edhaq-ink);
  margin-bottom: .15rem;
}

.info-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  color: var(--edhaq-info);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex: 0 0 auto;
  box-shadow: var(--shadow-xs);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--edhaq-muted);
}

.empty-state i {
  font-size: 2.25rem;
  color: var(--edhaq-border-strong);
  display: block;
  margin-bottom: .6rem;
}

.empty-state p {
  margin: 0;
}

/* Order progress */
.order-progress {
  display: grid;
  grid-template-columns: repeat(14, minmax(90px, 1fr));
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.progress-step {
  min-width: 90px;
  text-align: center;
  position: relative;
}

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin: 0 auto .4rem;
  border: 2px solid var(--edhaq-border-strong);
  background: var(--edhaq-fill);
}

.step-label {
  font-size: .73rem;
  color: var(--edhaq-muted);
  line-height: 1.15;
}

.progress-step.completed .step-dot {
  background: var(--edhaq-success);
  border-color: var(--edhaq-success);
}

.progress-step.active .step-dot {
  background: var(--edhaq-primary);
  border-color: var(--edhaq-primary);
  box-shadow: var(--ring);
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
  color: var(--edhaq-ink);
  font-weight: 600;
}

/* Auth pages */
.auth-wrap {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--edhaq-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
}

.auth-wide {
  max-width: 720px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}

.auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--edhaq-primary-50);
  color: var(--edhaq-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 1rem;
}

.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .35rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--edhaq-muted);
  margin-bottom: 1.75rem;
  font-size: .9rem;
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--edhaq-border);
  font-size: .875rem;
}

/* ==========================================================================
   Public landing
   ========================================================================== */

.public-hero {
  background:
    radial-gradient(1200px 400px at 100% 0%, rgba(215, 25, 32, .08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  border: 1px solid var(--edhaq-border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.public-hero-inner {
  padding: 2.5rem;
}

.public-badge {
  color: var(--edhaq-primary-600);
  border: 1px solid var(--edhaq-primary-100);
  background: var(--edhaq-primary-50);
  font-weight: 600;
}

.public-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  margin: 0 0 1rem;
  font-weight: 800;
}

.public-hero-copy {
  color: var(--edhaq-muted);
  font-size: 1.05rem;
  max-width: 58ch;
  margin-bottom: 1.5rem;
}

.public-hero-panel {
  border: 1px solid var(--edhaq-border);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.public-logo {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
}

.public-hero-metrics {
  display: grid;
  gap: .65rem;
}

.public-hero-metrics div {
  background: var(--edhaq-fill);
  border-radius: var(--radius);
  padding: .75rem .9rem;
}

.public-hero-metrics span {
  color: var(--edhaq-muted);
  font-size: .82rem;
  display: block;
}

.public-hero-metrics strong {
  color: var(--edhaq-ink);
  font-size: .95rem;
}

.flow-step,
.feature-card {
  border: 1px solid var(--edhaq-border);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  height: 100%;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s ease, transform .15s ease;
}

.flow-step:hover,
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.flow-step span {
  display: inline-flex;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: var(--edhaq-primary);
  color: #fff;
  font-weight: 700;
  margin-bottom: .75rem;
}

.flow-step h4,
.feature-card h4 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: .4rem;
}

.flow-step p,
.feature-card p {
  color: var(--edhaq-muted);
  margin: 0;
  font-size: .9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    z-index: 40;
    height: 100vh;
    transition: left .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    padding: 1.1rem 1rem;
  }

  .top-nav {
    padding: .6rem 1rem;
  }

  .public-hero-inner {
    padding: 1.5rem;
  }

  .public-nav {
    gap: .85rem !important;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }
}

@media (max-width: 768px) {
  .order-progress {
    grid-template-columns: repeat(14, minmax(78px, 1fr));
  }

  .page-title {
    font-size: 1.35rem;
  }
}

/* ==========================================================================
   Legal & support pages
   ========================================================================== */

.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
  line-height: 1.7;
}

.legal-header {
  margin-bottom: 2rem;
}

.legal h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: .75rem 0 .5rem;
}

.legal h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 2.25rem 0 .75rem;
  scroll-margin-top: 80px;
}

.legal h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 .5rem;
}

.legal-meta {
  color: var(--edhaq-muted);
  font-size: .9rem;
}

.legal .lead {
  font-size: 1.05rem;
  color: var(--edhaq-text);
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: .4rem;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  background: #fff;
  border: 1px solid var(--edhaq-border);
  border-radius: var(--radius-lg);
}

.legal-toc a {
  font-size: .85rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--edhaq-fill);
  color: var(--edhaq-text);
}

.legal-toc a:hover {
  background: var(--edhaq-primary-50);
  color: var(--edhaq-primary);
  text-decoration: none;
}

.support-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  height: 100%;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--edhaq-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  color: var(--edhaq-text);
  transition: box-shadow .15s ease, transform .15s ease;
}

.support-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--edhaq-text);
}

.support-card strong {
  color: var(--edhaq-ink);
  margin-top: .5rem;
}

.support-card span:last-child {
  color: var(--edhaq-muted);
  font-size: .9rem;
  word-break: break-all;
}

.support-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--edhaq-primary-50);
  color: var(--edhaq-primary);
}

.support-icon-green { background: #dcfce7; color: #16a34a; }
.support-icon-blue  { background: #dbeafe; color: #2563eb; }

.faq .accordion-item {
  border: 1px solid var(--edhaq-border);
  border-radius: var(--radius) !important;
  margin-bottom: .6rem;
  overflow: hidden;
}

.faq .accordion-button {
  font-weight: 700;
  color: var(--edhaq-ink);
  font-size: .98rem;
}

.faq .accordion-button:not(.collapsed) {
  background: var(--edhaq-primary-50);
  color: var(--edhaq-primary-600);
  box-shadow: none;
}

.faq .accordion-button:focus {
  box-shadow: var(--ring);
}

.faq .accordion-body {
  color: var(--edhaq-text);
}
