/* =====================================================================
   JUSOOR · Design system
   RTL-first, Bootstrap 5 as the base layer, brand = green + white.
   Sections: tokens · base · app shell · nav · page head · cards ·
             tables · forms · buttons · badges · login · invoice · misc
   ===================================================================== */

/* ---------- Tokens ---------- */
:root{
  --brand-50:  #eafaf1;
  --brand-100: #cdf1de;
  --brand-200: #9de8bd;
  --brand-300: #64d896;
  --brand-400: #35c378;
  --brand-500: #16a85d;
  --brand-600: #0e8f4d;
  --brand-700: #0b7440;
  --brand-800: #0a5c34;
  --brand-900: #073f24;

  --ink-900: #0f1c17;
  --ink-700: #2b3a34;
  --ink-600: #4a5b54;
  --ink-400: #7b8a84;
  --ink-300: #9aa8a2;

  --bg:        #e7f2ec;
  --surface:   #ffffff;
  --surface-2: #f0f8f3;
  --line:      #d7e8dd;

  --danger:  #d64550;
  --warning: #e8a33d;
  --info:    #2f7fd1;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 28, 23, .06);
  --shadow-md: 0 4px 16px rgba(15, 28, 23, .08);
  --shadow-lg: 0 12px 32px rgba(15, 28, 23, .12);

  --ease: cubic-bezier(.4, 0, .2, 1);

  --topbar-h: 64px;
  --sidebar-w: 264px;

  --sidebar-bg: #0b2018;
  --sidebar-ink: #a9bab2;

  /* Chart palette — validated (dataviz six-checks) against the light surface.
     Fixed slot order; slot 1 is the brand. Amber sits in the contrast-relief
     band, covered by legends + tooltips + the table view. */
  --viz-1: #0e8f4d;
  --viz-2: #2f7fd1;
  --viz-3: #d18a1f;
  --viz-4: #6b4bc4;
  --viz-5: #d64550;
  --viz-6: #0b8f83;
  --viz-grid: #e3efe8;
  --viz-ink: #4a5b54;
  --viz-tooltip-bg: #12291e;
}

[data-theme="dark"]{
  --ink-900: #eaf2ee;
  --ink-700: #d2ded8;
  --ink-600: #a9b9b2;
  --ink-400: #7f8f89;
  --ink-300: #6b7a74;

  --bg:        #0d1512;
  --surface:   #141f1a;
  --surface-2: #18251f;
  --line:      #24352d;

  --brand-50:  #12281d;
  --brand-100: #17372700;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);

  --sidebar-bg: #08150f;

  /* Same six hues re-stepped for the dark surface (validated separately). */
  --viz-1: #16a85d;
  --viz-2: #3987e5;
  --viz-3: #c98500;
  --viz-4: #9085e9;
  --viz-5: #e66767;
  --viz-6: #2fa39a;
  --viz-grid: #24352d;
  --viz-ink: #a9b9b2;
  --viz-tooltip-bg: #060d09;
}

/* ---------- Base ---------- */
*, *::before, *::after{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--brand-600); text-decoration: none; }
a:hover{ color: var(--brand-700); }

h1, h2, h3, h4, h5{ color: var(--ink-900); font-weight: 700; margin: 0; }

.muted, .text-muted{ color: var(--ink-400) !important; }

::selection{ background: var(--brand-200); color: var(--ink-900); }

:focus-visible{
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =====================================================================
   App shell
   ===================================================================== */
.topbar{
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 1030;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--brand-800) 0%, var(--brand-700) 55%, var(--brand-600) 100%);
  box-shadow: 0 2px 12px rgba(7, 63, 36, .28);
}
[data-theme="dark"] .topbar{
  background: linear-gradient(90deg, #08150f 0%, #0b2018 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.topbar-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-brand .logo-img{ height: 42px; width: auto; filter: brightness(0) invert(1); }

.topbar-spacer{ flex: 1; }

.topbar-date{
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
  white-space: nowrap;
}

/* Hamburger — visible only under the desktop breakpoint */
.nav-toggle{
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-size: 20px;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover{ background: rgba(255, 255, 255, .22); color: #fff; }

.icon-btn{
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover{ background: rgba(255, 255, 255, .22); color: #fff; }

/* Profile dropdown trigger */
.profile-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background .18s var(--ease);
}
.profile-btn:hover{ background: rgba(255, 255, 255, .22); color: #fff; }
.profile-btn img{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-300);
}
.profile-name{ max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown-menu{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  padding: 6px;
  min-width: 200px;
}
.dropdown-item{
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  width: 100%;
  background: none;
  border: 0;
  text-align: start;
}
.dropdown-item:hover, .dropdown-item:focus{ background: var(--brand-50); color: var(--brand-700); }
.dropdown-item.is-danger:hover{ background: #fdecee; color: var(--danger); }
[data-theme="dark"] .dropdown-item.is-danger:hover{ background: #3a1d21; }
.dropdown-divider{ border-color: var(--line); }

/* ---------- Sidebar ---------- */
.sidebar{
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;                 /* physical: the drawer lives on the right in RTL */
  left: auto;
  z-index: 1040;
  width: var(--sidebar-w);
  max-width: 82vw;
  padding: calc(var(--topbar-h) + 16px) 12px 24px;
  background: var(--sidebar-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform .28s var(--ease);
}
.sidebar-backdrop{
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(8, 21, 15, .55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s var(--ease);
}

.sidebar ul{ list-style: none; margin: 0; padding: 0; }
.sidebar > ul > li + li{ margin-top: 2px; }

.sidebar a{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-ink);
  font-size: 14.5px;
  font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.sidebar a i{ font-size: 17px; width: 20px; text-align: center; flex: none; }
.sidebar a:hover{ background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar a.active{
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 6px 14px rgba(11, 116, 64, .35);
}

/* Collapsible groups */
.sidebar .submenu-toggle{ position: relative; cursor: pointer; }
.sidebar .submenu-toggle::after{
  content: "\f282";                 /* bi-chevron-down */
  font-family: "bootstrap-icons";
  margin-inline-start: auto;
  font-size: 11px;
  transition: transform .22s var(--ease);
}
.sidebar li.open > .submenu-toggle::after{ transform: rotate(180deg); }
.sidebar .submenu{
  display: none;
  margin: 2px 0 6px;
  padding-inline-start: 30px;
}
.sidebar li.open > .submenu{ display: block; }
.sidebar .submenu a{
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 400;
  color: #8b9c95;
}
.sidebar .submenu a::before{
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  flex: none;
}
.sidebar .submenu a:hover, .sidebar .submenu a.active{ color: #fff; background: rgba(255, 255, 255, .06); }

.sidebar-section{
  color: #55665f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 16px 14px 6px;
}

/* ---------- Page canvas ---------- */
.page{
  padding-top: calc(var(--topbar-h) + 24px);
  padding-bottom: 40px;
  padding-right: calc(var(--sidebar-w) + 24px);   /* clears the fixed right sidebar */
  padding-left: 24px;
  min-height: 100vh;
}
.page.page-login{ padding: 0; }
.page > .container-fluid{ max-width: 1440px; margin-inline: auto; padding: 0; }

/* =====================================================================
   Responsive: below 992px the sidebar becomes an off-canvas drawer
   ===================================================================== */
@media (max-width: 991.98px){
  .nav-toggle{ display: inline-flex; }

  /* Anchored right:0 → +100% slides it fully off the right edge. */
  .sidebar{ transform: translateX(100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar{ transform: translateX(0); }
  body.nav-open .sidebar-backdrop{ opacity: 1; visibility: visible; }
  body.nav-open{ overflow: hidden; }

  .page{ padding-right: 16px; padding-left: 16px; padding-top: calc(var(--topbar-h) + 16px); }
  .topbar-date{ display: none; }
  .profile-name{ display: none; }
  .profile-btn{ padding: 5px; }
}

@media (max-width: 575.98px){
  body{ font-size: 14.5px; }
  .page{ padding-inline: 12px; }
  .topbar{ padding: 0 12px; gap: 8px; }
  .topbar-brand .logo-img{ height: 34px; }
}

/* =====================================================================
   Page header
   ===================================================================== */
.page-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-title{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.page-title-icon{
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: none;
}
.page-sub{ color: var(--ink-400); margin: 4px 0 0; font-size: 14px; }
.page-head-actions{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 575.98px){
  .page-title{ font-size: 20px; }
  .page-head-actions{ width: 100%; }
  .page-head-actions .btn{ flex: 1; justify-content: center; }
}

/* =====================================================================
   Cards (replaces the old Bootstrap-3 "panel")
   ===================================================================== */
.card, .panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}
.card-header, .panel-heading{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink-900);
}
.card-header i, .panel-heading i{ color: var(--brand-600); margin-inline-end: 6px; }
.card-body, .panel-body{ padding: 18px; }

.count-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  margin-inline-start: 6px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
}

/* Form cards */
.form-card{ max-width: 100%; }
.form-card-narrow{ max-width: 640px; margin-inline: auto; }

/* =====================================================================
   Tables — scroll on tablets, stack into cards on phones
   ===================================================================== */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: -18px;              /* bleed to the card edges */
  padding: 0;
}

/* A card body whose only job is to hold a table: let the table scroll
   sideways instead of stretching the page. */
.card-body:has(> table.table){
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.table{
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink-700);
  font-size: 14px;
}
table.table th{
  background: var(--surface-2);
  color: var(--ink-600);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.table td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.table tbody tr:last-child td{ border-bottom: 0; }
table.table tbody tr{ transition: background .15s var(--ease); }
table.table tbody tr:hover{ background: var(--brand-50); }

/* Legacy Bootstrap-3 table modifiers, neutralised into the new look */
.table-bordered, .table-bordered th, .table-bordered td{ border-inline: 0; }
.table-striped tbody tr:nth-child(odd){ background: var(--surface-2); }
.table-striped tbody tr:hover{ background: var(--brand-50); }

.img-avatar{
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
}
.img-circle, .rounded-circle{ border-radius: 50% !important; }

.actions{ display: inline-flex; gap: 6px; }

@media (max-width: 767.98px){
  .table-wrap{ margin: 0; overflow: visible; }
  .card-body:has(> table.table){ padding: 14px; overflow: visible; }

  table.table, table.table thead, table.table tbody,
  table.table tr, table.table th, table.table td{ display: block; }

  table.table thead{ display: none; }

  table.table tbody tr{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 6px 14px;
    margin-bottom: 12px;
  }
  table.table tbody tr:hover{ background: var(--surface); }

  table.table td{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    text-align: start !important;
  }
  table.table tbody tr td:last-child{ border-bottom: 0; }

  /* the header label, injected from the <th> text by ui.js */
  table.table td::before{
    content: attr(data-label);
    color: var(--ink-400);
    font-size: 12.5px;
    font-weight: 700;
    flex: none;
  }
  table.table td:empty{ display: none; }
}

/* =====================================================================
   Forms
   ===================================================================== */
.form-group{ margin-bottom: 18px; }

label, .control-label{
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
}

.form-control, .form-select, select.form-control{
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.form-control::placeholder{ color: var(--ink-300); }
.form-control:focus, .form-select:focus{
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-50);
  outline: 0;
}
textarea.form-control{ min-height: 110px; resize: vertical; }

.input-group{ display: flex; align-items: stretch; }
.input-group > .form-control{ border-radius: 0; }
.input-group > :first-child{ border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); }
.input-group > :last-child{ border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.input-group-text, .input-group-addon{
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-400);
  font-size: 14px;
  white-space: nowrap;
}
.input-group .input-group-addon + .form-control,
.input-group .form-control + .input-group-addon{ border-inline-start: 0; }

.help-block, .form-text{ color: var(--ink-400); font-size: 12.5px; margin-top: 5px; }

/* Search bar + autocomplete suggestions (sales) */
.search-bar{ display: flex; gap: 10px; }
.search-bar .input-affix{ flex: 1; }
.search-bar .btn{ flex: none; }
@media (max-width: 575.98px){
  .search-bar{ flex-direction: column; }
  .search-bar .btn{ width: 100%; }
}
.suggest-list{ margin-top: 8px; }
.suggest-list .list-group-item, .suggest-list li{
  list-style: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 4px;
  cursor: pointer;
}
.suggest-list li:hover{ background: var(--brand-50); color: var(--brand-700); }

.form-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}
@media (max-width: 575.98px){
  .form-actions{ flex-direction: column; }
  .form-actions .btn{ width: 100%; }
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;                 /* comfortable touch target */
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:active{ transform: translateY(1px); }

.btn-primary{ background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover{ background: var(--brand-700); border-color: var(--brand-700); color: #fff; box-shadow: 0 6px 16px rgba(11, 116, 64, .28); }

.btn-info{ background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.btn-info:hover{ background: var(--brand-100); color: var(--brand-800); }

.btn-danger{ background: #fdecee; border-color: #f8d7db; color: var(--danger); }
.btn-danger:hover{ background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-warning{ background: #fdf3e3; border-color: #f7e4c4; color: #a86a12; }
.btn-warning:hover{ background: var(--warning); border-color: var(--warning); color: #fff; }

.btn-default, .btn-secondary{ background: var(--surface); border-color: var(--line); color: var(--ink-700); }
.btn-default:hover, .btn-secondary:hover{ background: var(--surface-2); color: var(--ink-900); }

[data-theme="dark"] .btn-danger{ background: #3a1d21; border-color: #55272d; }
[data-theme="dark"] .btn-warning{ background: #3a2f1b; border-color: #554626; color: #e8b45c; }

.btn-sm, .btn-xs{ min-height: 36px; padding: 6px 12px; font-size: 13px; gap: 5px; }
.btn-lg{ min-height: 52px; padding: 14px 26px; font-size: 16px; }
.btn-block{ width: 100%; }

.btn-group{ display: inline-flex; gap: 6px; }
.btn-group form{ display: inline; margin: 0; }

/* =====================================================================
   Badges / labels / chips
   ===================================================================== */
.badge, .label{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-50);
  color: var(--brand-700);
}
.label-success, .badge-success, .bg-success{ background: var(--brand-50) !important; color: var(--brand-700) !important; }
.label-danger, .badge-danger, .bg-danger{ background: #fdecee !important; color: var(--danger) !important; }
.label-warning, .bg-warning{ background: #fdf3e3 !important; color: #a86a12 !important; }
.label-info, .bg-info{ background: #e8f1fb !important; color: var(--info) !important; }
[data-theme="dark"] .label-danger, [data-theme="dark"] .bg-danger{ background: #3a1d21 !important; }
[data-theme="dark"] .label-warning, [data-theme="dark"] .bg-warning{ background: #3a2f1b !important; color: #e8b45c !important; }
[data-theme="dark"] .label-info, [data-theme="dark"] .bg-info{ background: #16293c !important; color: #71b0ef !important; }

.chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-600);
  font-size: 13px;
}

.inv-chip{
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
}
.inv-chip-label{ font-size: 11.5px; color: var(--brand-700); font-weight: 600; }
.inv-chip-value{ font-size: 17px; font-weight: 800; color: var(--brand-800); }
[data-theme="dark"] .inv-chip-value{ color: var(--brand-300); }

/* =====================================================================
   Alerts
   ===================================================================== */
.alert{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink-700);
}
.alert-success{ background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
.alert-danger{ background: #fdecee; border-color: #f8d7db; color: #9c2d38; }
.alert-warning{ background: #fdf3e3; border-color: #f7e4c4; color: #8a5610; }
.alert-info{ background: #e8f1fb; border-color: #cfe2f6; color: #1d5f9e; }
[data-theme="dark"] .alert-danger{ background: #3a1d21; border-color: #55272d; color: #f0a7ae; }
[data-theme="dark"] .alert-success{ background: #12281d; color: var(--brand-200); }

/* =====================================================================
   Login
   ===================================================================== */
.login-wrap{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--surface);
}
.login-aside{
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 56px;
  background: linear-gradient(160deg, var(--brand-700) 0%, var(--brand-900) 100%);
  color: #fff;
  overflow: hidden;
}
.login-aside::after{           /* soft brand glow */
  content: "";
  position: absolute;
  inset-block-start: -20%;
  inset-inline-start: -10%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 195, 120, .35) 0%, transparent 65%);
}
.login-aside > *{ position: relative; z-index: 1; }
.login-aside .brand-logo-img{ height: 86px; width: auto; align-self: flex-start; filter: brightness(0) invert(1); }
.login-aside h2{ color: #fff; font-size: 30px; font-weight: 800; line-height: 1.35; }
.login-aside p{ color: rgba(255, 255, 255, .78); font-size: 15px; max-width: 42ch; margin: 0; }
.login-points{ list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 12px; }
.login-points li{ display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .9); font-size: 14.5px; }
.login-points i{ color: var(--brand-300); font-size: 18px; }

.login-panel{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.login-card{ width: 100%; max-width: 400px; }
.login-card h1{ font-size: 25px; margin-bottom: 6px; }
.login-card .login-sub{ color: var(--ink-400); margin-bottom: 28px; font-size: 14.5px; }
.login-card .btn{ width: 100%; margin-top: 6px; }
.login-mobile-logo{ display: none; }

.input-affix{ position: relative; }
.input-affix > i{
  position: absolute;
  inset-inline-start: 14px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  font-size: 16px;
  pointer-events: none;
}
.input-affix .form-control{ padding-inline-start: 42px; }
.pw-toggle{
  position: absolute;
  inset-inline-end: 8px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pw-toggle:hover{ background: var(--surface-2); color: var(--brand-600); }

@media (max-width: 900px){
  .login-wrap{ grid-template-columns: 1fr; }
  .login-aside{ display: none; }
  .login-mobile-logo{
    display: block;
    height: 46px;
    width: auto;
    margin: 0 auto 24px;
  }
  .login-panel{ min-height: 100vh; background: var(--bg); }
  .login-card{
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px 24px;
  }
}

/* =====================================================================
   Dashboard components
   ===================================================================== */
.stat-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
  perspective: 900px;              /* the 3D stage for card tilt */
}
.stat-grid-3{ grid-template-columns: repeat(3, 1fr); }
.stat-card{
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%;
  position: relative;
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink-900);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.stat-card.tilt{
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  will-change: transform;
}
.stat-card.tilt.is-hovered{
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.stat-card .glare{
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(240px circle at var(--gx) var(--gy), rgba(255, 255, 255, .35), transparent 60%);
  transition: opacity .25s var(--ease);
}
[data-theme="dark"] .stat-card .glare{
  background: radial-gradient(240px circle at var(--gx) var(--gy), rgba(157, 232, 189, .12), transparent 60%);
}
.stat-card.is-hovered .glare{ opacity: 1; }
.stat-card:hover{
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
  color: var(--ink-900);
}
.stat-card-top{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-card h2{ font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-card p{ margin: 4px 0 0; color: var(--ink-400); font-size: 13px; }
.stat-card-brand{ border-color: var(--brand-200); background: linear-gradient(180deg, var(--brand-50), var(--surface) 70%); }

.stat-icon{
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stat-icon-green{ background: var(--brand-50); color: var(--brand-600); }
.stat-icon-blue{ background: #e8f1fb; color: var(--info); }
.stat-icon-amber{ background: #fdf3e3; color: #b8791b; }
.stat-icon-violet{ background: #efeafb; color: #6b4bc4; }
[data-theme="dark"] .stat-icon-blue{ background: #16293c; }
[data-theme="dark"] .stat-icon-amber{ background: #3a2f1b; }
[data-theme="dark"] .stat-icon-violet{ background: #251f3d; }

.stat-change{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.stat-up{ background: var(--brand-50); color: var(--brand-700); }
.stat-down{ background: #fdecee; color: var(--danger); }
[data-theme="dark"] .stat-down{ background: #3a1d21; color: #f0a7ae; }

.dash-2col{ display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
.dash-2col-even{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chart-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.chart-card-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.chart-card-head h3{ font-size: 15.5px; font-weight: 700; }
.chart-card-sub{ color: var(--ink-400); font-size: 12.5px; }
.chart-card-body{ padding: 18px; flex: 1; min-height: 0; }
.chart-card-body canvas{ max-width: 100%; }

.range-toggle{
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.range-btn{
  border: 0;
  background: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-400);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.range-btn:hover{ color: var(--brand-700); }
.range-btn.active{ background: var(--brand-600); color: #fff; }

.chart-skeleton{
  height: 240px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer{ from{ background-position: 200% 0; } to{ background-position: -200% 0; } }

.doughnut-wrap{ position: relative; max-width: 260px; margin-inline: auto; }
.doughnut-center{
  position: absolute;
  inset-block-start: 42%;
  inset-inline: 0;
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
}
.doughnut-center strong{ display: block; font-size: 24px; font-weight: 800; }
.doughnut-center span{ color: var(--ink-400); font-size: 12px; }

/* Compact list rows inside dashboard cards */
.list-clean{ display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.stock-row, .product-row, .sale-row, .rank-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-900);
  transition: background .15s var(--ease);
}
.stock-row:hover, .product-row:hover, .sale-row:hover, .rank-row:hover{ background: var(--brand-50); color: var(--ink-900); }
.stock-name, .sale-name{ font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-qty{ font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; flex: none; }
.stock-qty.is-low{ background: #fdf3e3; color: #a86a12; }
.stock-qty.is-out{ background: #fdecee; color: var(--danger); }
[data-theme="dark"] .stock-qty.is-low{ background: #3a2f1b; color: #e8b45c; }
[data-theme="dark"] .stock-qty.is-out{ background: #3a1d21; color: #f0a7ae; }

.product-row img{ width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex: none; }
.product-row-info{ display: flex; flex-direction: column; flex: 1; min-width: 0; }
.product-row-info strong{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-row-price{ font-weight: 700; color: var(--brand-700); flex: none; }

.sale-avatar{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sale-meta{ display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 13px; flex: none; }

.empty-hint{ text-align: center; padding: 28px 12px; color: var(--ink-400); }

@media (max-width: 1200px){
  .stat-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991.98px){
  .dash-2col, .dash-2col-even{ grid-template-columns: 1fr; }
}
@media (max-width: 575.98px){
  .stat-grid{ grid-template-columns: 1fr; }
  .stat-card h2{ font-size: 24px; }
}

/* =====================================================================
   Welcome panel + profile card
   ===================================================================== */
.welcome-panel{ text-align: center; padding: 48px 24px; }
.welcome-icon{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}
.welcome-panel h2{ font-size: 22px; margin-bottom: 8px; }
.welcome-panel p{ max-width: 52ch; margin-inline: auto; }

.profile-card{ max-width: 560px; margin-inline: auto; }
.profile-cover{ height: 110px; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); }
.profile-body{ text-align: center; padding-top: 0; }
.profile-avatar{
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-md);
  margin-top: -52px;
  margin-bottom: 12px;
  background: var(--surface);
}
.profile-body h2{ font-size: 20px; }
.justify-content-center{ justify-content: center; }

/* =====================================================================
   Invoice
   ===================================================================== */
.invoice{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 900px;
  margin-inline: auto;
}
.invoice-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--brand-600);
  margin-bottom: 22px;
}
.invoice-no{ font-size: 20px; font-weight: 800; color: var(--brand-700); }
.invoice-date{ color: var(--ink-400); font-size: 13.5px; }
.invoice-parties{ display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.party{ background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; }
.party h4{ font-size: 13px; color: var(--ink-400); text-transform: uppercase; margin-bottom: 6px; }
.invoice-footer{ margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.totals{ margin-inline-start: auto; max-width: 300px; }
.totals .grand{ font-size: 19px; font-weight: 800; color: var(--brand-700); }

@media (max-width: 575.98px){
  .invoice{ padding: 20px; }
  .invoice-parties{ grid-template-columns: 1fr; }
}
@media print{
  .topbar, .sidebar, .sidebar-backdrop, .page-head-actions, .btn-print, .btn-back{ display: none !important; }
  .page{ padding: 0 !important; }
  .invoice{ border: 0; box-shadow: none; max-width: none; }
  .page-break{ page-break-after: always; }
}

/* =====================================================================
   Kanban (orders board)
   ===================================================================== */
.kanban-board{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.kanban-column{
  --col-accent: var(--brand-500);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--col-accent);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
/* Column accents follow the order lifecycle: fresh → in progress → done / cancelled. */
.kanban-column.status-new{ --col-accent: var(--info); }
.kanban-column.status-accepted{ --col-accent: #6b4bc4; }
.kanban-column.status-preparing{ --col-accent: var(--warning); }
.kanban-column.status-ready{ --col-accent: #0b8f83; }
.kanban-column.status-shipped{ --col-accent: var(--brand-400); }
.kanban-column.status-delivered{ --col-accent: var(--brand-600); }
.kanban-column.status-cancelled{ --col-accent: var(--danger); }

.kanban-column-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.kanban-column-header::before{
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--col-accent);
  flex: none;
}
.kanban-column-header .badge{ margin-inline-start: auto; }
.kanban-column-body{ padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.kanban-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.kanban-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kanban-card:active{ cursor: grabbing; }
.kanban-card.sortable-ghost{
  opacity: .45;
  border: 2px dashed var(--brand-400);
  background: var(--brand-50);
}
.kanban-card.sortable-drag{
  transform: rotate(2deg) scale(1.03);
  box-shadow: var(--shadow-lg);
}
.kanban-card-header{ display: flex; justify-content: space-between; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.kanban-card-body{ color: var(--ink-600); font-size: 13.5px; }
.kanban-card-footer{ display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.kanban-price{ font-weight: 800; color: var(--brand-700); }

@media (max-width: 767.98px){
  .kanban-board{ grid-auto-flow: row; grid-auto-columns: auto; }
}

/* =====================================================================
   Misc / animation
   ===================================================================== */
.fade-in-up{ animation: fadeInUp .35s var(--ease) both; }
@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: none; }
}

/* Staggered entrance: stat cards then chart cards ride in one after another. */
.stat-card, .chart-card, .page > .container-fluid > .card{
  animation: riseIn .45s var(--ease) both;
}
.stat-grid .stat-card:nth-child(1){ animation-delay: .03s; }
.stat-grid .stat-card:nth-child(2){ animation-delay: .09s; }
.stat-grid .stat-card:nth-child(3){ animation-delay: .15s; }
.stat-grid .stat-card:nth-child(4){ animation-delay: .21s; }
.dash-2col .chart-card:nth-child(1), .dash-2col-even .chart-card:nth-child(1){ animation-delay: .18s; }
.dash-2col .chart-card:nth-child(2), .dash-2col-even .chart-card:nth-child(2){ animation-delay: .26s; }
@keyframes riseIn{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: none; }
}

/* Table rows reveal with a slight stagger (class added by ui.js). */
.row-reveal{ animation: rowIn .3s var(--ease) both; }
@keyframes rowIn{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: none; }
}

/* Button ripple (span injected by ui.js). */
.btn{ position: relative; overflow: hidden; }
.btn .ripple{
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  transform: scale(0);
  animation: ripple .55s var(--ease);
  pointer-events: none;
}
.btn-default .ripple, .btn-secondary .ripple, .btn-info .ripple{ background: rgba(14, 143, 77, .25); }
@keyframes ripple{ to{ transform: scale(2.6); opacity: 0; } }

.img-thumbnail{
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--surface);
  max-width: 100%;
  height: auto;
}
.img-size-2{ width: 90px; height: 90px; object-fit: cover; }

.upload-form{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-form .form-control{ min-height: 36px; padding: 5px 10px; font-size: 13px; width: auto; }
@media (max-width: 575.98px){
  .upload-form{ width: 100%; }
  .upload-form .form-control{ flex: 1; width: 100%; }
}

.btn-file{ position: relative; overflow: hidden; }
.btn-file input[type="file"]{
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 100px;
}

/* Bootstrap grid gutter tune-up for our card spacing */
.row{ --bs-gutter-x: 22px; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* =====================================================================
   Pagination (Laravel Bootstrap-5 paginator)
   ===================================================================== */
.pagination-wrap{ display: flex; justify-content: center; padding: 16px 0 4px; }
.pagination{ margin: 0; gap: 4px; }
.pagination .page-link{
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  background: var(--surface);
  min-width: 38px;
  text-align: center;
  font-weight: 600;
}
.pagination .page-link:hover{ background: var(--brand-50); color: var(--brand-700); }
.pagination .page-item.active .page-link{
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.pagination .page-item.disabled .page-link{ color: var(--ink-300); background: var(--surface-2); }

/* Two side-by-side fields in auth forms; stacks on phones. */
.form-row-2{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 575.98px){ .form-row-2{ grid-template-columns: 1fr; } }

.login-alt{ text-align: center; margin: 18px 0 0; color: var(--ink-400); font-size: 14px; }
.login-alt a{ font-weight: 700; }

/* Status filter tabs (platform sellers list) */
.filter-tabs{ display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-tab{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-600);
  font-size: 13.5px;
  font-weight: 600;
}
.filter-tab:hover{ background: var(--brand-50); color: var(--brand-700); }
.filter-tab.active{ background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.filter-tab.active .count-pill{ background: rgba(255,255,255,.2); color: #fff; }

/* =====================================================================
   Commission box (product form — final customer price)
   ===================================================================== */
.commission-box{
  margin: 6px 0 20px;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--brand-50), var(--surface) 70%);
  overflow: hidden;
}
.commission-head{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.commission-rows{ padding: 8px 16px; }
.commission-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--ink-700);
  border-bottom: 1px dashed var(--line);
}
.commission-row span:last-child{ font-weight: 700; font-variant-numeric: tabular-nums; }
.commission-row.commission-total{
  border-bottom: 0;
  margin-top: 2px;
  font-size: 16px;
  color: var(--brand-800);
}
.commission-row.commission-total span:last-child{ font-size: 20px; font-weight: 800; color: var(--brand-700); }
[data-theme="dark"] .commission-row.commission-total{ color: var(--brand-200); }
[data-theme="dark"] .commission-row.commission-total span:last-child{ color: var(--brand-300); }
.commission-note{
  margin: 0;
  padding: 10px 16px 14px;
  font-size: 12.5px;
  color: var(--ink-400);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.commission-note i{ margin-top: 2px; color: var(--brand-600); }
.mini-label{ display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-700); }

/* Info list (store settings help card) */
.info-list{ list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.info-list li{ display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-600); }
.info-list i{ color: var(--brand-600); font-size: 16px; flex: none; margin-top: 1px; }
.form-sep{ border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* IBAN cell with copy button (platform payout sheet) */
.iban-cell{ display: inline-flex; align-items: center; gap: 8px; }
.iban-cell code{
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--ink-900);
  white-space: nowrap;
}
.copy-btn{
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-400);
  border-radius: 6px;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.copy-btn:hover{ background: var(--brand-50); color: var(--brand-700); }
.copy-btn.is-copied{ background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* =====================================================================
   Support chat
   ===================================================================== */
.chat-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-width: 860px;
  overflow: hidden;
}
.chat-head{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.chat-avatar{
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  flex: none;
}
.chat-body{
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  max-height: 55vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0/22px 22px,
    var(--bg);
}
.bubble-row{ display: flex; }
.bubble-row.is-mine{ justify-content: flex-start; }
.bubble-row.is-theirs{ justify-content: flex-end; }
.bubble{
  max-width: 76%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
}
.bubble-row.is-mine .bubble{
  background: var(--brand-600);
  color: #fff;
  border-end-start-radius: 4px;
}
.bubble-row.is-theirs .bubble{
  background: var(--surface);
  color: var(--ink-900);
  border: 1px solid var(--line);
  border-end-end-radius: 4px;
}
.bubble-meta{ margin-top: 5px; font-size: 11.5px; opacity: .75; }
.bubble-row.is-theirs .bubble-meta{ color: var(--ink-400); opacity: 1; }

.chat-empty{ margin: auto; text-align: center; color: var(--ink-400); }
.chat-empty i{ font-size: 34px; color: var(--brand-300); }
.chat-empty p{ margin: 8px 0 2px; font-weight: 700; color: var(--ink-600); }

.chat-form{
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.chat-form textarea{ resize: vertical; min-height: 46px; }
.chat-form .btn{ flex: none; }
.chat-error{ color: var(--danger); font-size: 13px; padding: 0 18px 12px; margin: 0; }

@media (max-width: 575.98px){
  .chat-form{ flex-direction: column; align-items: stretch; }
  .chat-form .btn{ width: 100%; }
  .bubble{ max-width: 88%; }
}

/* Conversation list (platform inbox) */
.thread-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-900);
  transition: background .15s var(--ease);
}
.thread-row:hover{ background: var(--brand-50); color: var(--ink-900); }
.thread-row.is-unread{ background: var(--brand-50); }
.thread-avatar{
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-800);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
  flex: none;
}
[data-theme="dark"] .thread-avatar{ background: var(--brand-700); color: #fff; }
.thread-main{ display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.thread-top{ display: flex; align-items: center; gap: 8px; }
.thread-preview{ font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-time{ font-size: 12px; flex: none; }

/* Sidebar unread badge */
.nav-badge{
  margin-inline-start: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* =====================================================================
   Product image uploader
   ===================================================================== */
.uploader{ position: relative; }

.uploader-drop{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 20px;
  border: 2px dashed var(--brand-200);
  border-radius: var(--radius);
  background: var(--brand-50);
  color: var(--ink-700);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
}
.uploader-drop:hover{ border-color: var(--brand-400); background: var(--brand-100); }
.uploader-drop.is-over{ border-color: var(--brand-600); background: var(--brand-100); transform: scale(1.01); }
.uploader-icon{
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 2px;
}
.uploader-drop strong{ font-size: 15px; }
.uploader-hint{ font-size: 12.5px; color: var(--ink-400); }

.uploader-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.up-card{
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  cursor: grab;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.up-card:hover{ box-shadow: var(--shadow-md); }
.up-card.is-primary{ border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.up-card.is-dragging{ opacity: .45; transform: scale(.96); }
.up-card img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.up-star, .up-remove{
  position: absolute;
  inset-block-start: 6px;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 28, 23, .58);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s var(--ease), background .18s var(--ease);
}
.up-star{ inset-inline-start: 6px; }
.up-remove{ inset-inline-end: 6px; }
.up-card:hover .up-star, .up-card:hover .up-remove{ opacity: 1; }
.up-card.is-primary .up-star{ opacity: 1; background: var(--brand-600); }
.up-star:hover{ background: var(--brand-600); }
.up-remove:hover{ background: var(--danger); }

.up-size{
  position: absolute;
  inset-block-end: 6px;
  inset-inline-start: 6px;
  background: rgba(15, 28, 23, .62);
  color: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
}
.up-badge{
  position: absolute;
  inset-block-end: 6px;
  inset-inline-end: 6px;
  background: var(--brand-600);
  color: #fff;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 700;
}

.uploader-note{
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--ink-400);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.uploader-note i{ color: var(--brand-600); }

.uploader-flash{
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fdecee;
  border: 1px solid #f8d7db;
  color: var(--danger);
  font-size: 13px;
}
[data-theme="dark"] .uploader-flash{ background: #3a1d21; border-color: #55272d; color: #f0a7ae; }

/* Existing images on the edit page */
.img-manager{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.img-tile{
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.img-tile.is-primary{ border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.img-tile img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile-actions{
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: linear-gradient(transparent, rgba(15, 28, 23, .78));
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.img-tile:hover .img-tile-actions{ opacity: 1; }
.img-tile-actions form{ flex: 1; margin: 0; }
.img-tile-actions button{
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 5px;
  font-size: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, .92);
  color: var(--ink-700);
}
.img-tile-actions button:hover{ background: #fff; }
.img-tile-actions .is-danger:hover{ background: var(--danger); color: #fff; }
.img-tile-badge{
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  background: var(--brand-600);
  color: #fff;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 700;
}

/* =====================================================================
   Media library (gallery)
   ===================================================================== */
.media-search{ display: flex; align-items: center; gap: 8px; }
.media-search .input-affix{ min-width: 240px; }
.media-search .form-control{ min-height: 38px; padding: 6px 12px 6px 38px; font-size: 13.5px; }
@media (max-width: 575.98px){
  .media-search{ width: 100%; }
  .media-search .input-affix{ flex: 1; min-width: 0; }
}

.media-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.media-tile{
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.media-tile:hover{ box-shadow: var(--shadow-md); border-color: var(--brand-200); transform: translateY(-2px); }
.media-tile > a{ display: block; aspect-ratio: 1; background: var(--surface-2); }
.media-tile img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.media-tile figcaption{
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.media-name{
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: start;
}
.media-meta{ font-size: 11.5px; color: var(--ink-400); direction: ltr; text-align: start; }

.media-used{
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  background: var(--brand-600);
  color: #fff;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.media-actions{
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.media-tile:hover .media-actions{ opacity: 1; }
.media-actions form{ margin: 0; }
.media-copy, .media-delete{
  width: 30px; height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 28, 23, .62);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.media-copy:hover{ background: var(--brand-600); }
.media-delete:hover{ background: var(--danger); }

/* Touch devices have no hover — keep the controls visible. */
@media (hover: none){
  .media-actions{ opacity: 1; }
}

/* Inline editable cells (platform pricing table) */
.cell-input{
  min-height: 36px;
  padding: 5px 8px;
  font-size: 13.5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Toggle switch */
.switch{ display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.switch input{ position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track{
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background .18s var(--ease);
}
.switch-track::after{
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease);
}
.switch input:checked + .switch-track{ background: var(--brand-600); }
.switch input:checked + .switch-track::after{ transform: translateX(-18px); }
[dir="ltr"] .switch input:checked + .switch-track::after{ transform: translateX(18px); }
.switch input:focus-visible + .switch-track{ outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* Platform shipping settings row */
.shipping-row{
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: start;
}
.shipping-save{ align-self: center; padding-top: 22px; }
@media (max-width: 767.98px){
  .shipping-row{ grid-template-columns: 1fr; }
  .shipping-save{ padding-top: 0; }
  .shipping-save .btn{ width: 100%; }
}
.shipping-preview{
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-800);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
[data-theme="dark"] .shipping-preview{ color: var(--brand-200); }

/* Label row with an inline action (AI copywriter button) */
.label-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.label-row label{ margin: 0; }

.ai-note{ font-size: 12.5px; margin-top: 6px; min-height: 1em; }
.ai-note.is-ok{ color: var(--brand-700); }
.ai-note.is-error{ color: var(--danger); }
[data-theme="dark"] .ai-note.is-ok{ color: var(--brand-300); }

/* Blog cover preview in the article editor */
.cover-preview{
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.article-editor{ min-height: 380px; line-height: 1.9; font-size: 15.5px; }

/* =====================================================================
   Delivery: shipment board, courier panel
   ===================================================================== */
.assign-form{display:flex;gap:6px;align-items:center;margin:0}
.assign-form .cell-input{min-width:130px;text-align:start;font-size:13px}

/* status timeline */
.timeline{list-style:none;margin:0;padding:0;position:relative}
.timeline::before{
  content:"";position:absolute;inset-block:10px;inset-inline-start:9px;
  width:2px;background:var(--line);
}
.timeline li{position:relative;padding-inline-start:34px;padding-block:10px}
.timeline li::before{
  content:"";position:absolute;inset-inline-start:3px;inset-block-start:16px;
  width:14px;height:14px;border-radius:50%;
  background:var(--surface);border:2px solid var(--line);
}
.timeline li.done::before{background:var(--brand-500);border-color:var(--brand-500)}
.timeline li b{display:block;font-size:15.5px}
.timeline li span{color:var(--ink-400);font-size:13.5px}

/* pickup / drop-off legs in the courier view */
.leg{display:flex;gap:14px;padding:16px 0;border-bottom:1px dashed var(--line)}
.leg:last-child{border-bottom:0}
.leg-dot{
  width:14px;height:14px;border-radius:50%;flex:none;margin-top:6px;
  box-shadow:0 0 0 4px var(--brand-50);
}
.leg-dot.pickup{background:var(--warning)}
.leg-dot.drop{background:var(--brand-600)}
.leg-label{display:block;font-size:12px;font-weight:700;color:var(--ink-400);letter-spacing:.04em}
.leg b{display:block;font-size:17px;margin:2px 0 3px}
.leg .muted{display:block;font-size:14px;margin-bottom:8px}
.leg-actions{display:flex;gap:8px;flex-wrap:wrap}

/* cash-on-delivery callout — the number a driver must not misread */
.cod-box{
  border-radius:var(--radius);padding:22px;margin-bottom:22px;text-align:center;
  background:linear-gradient(160deg,var(--warning),#c9820f);color:#fff;
  box-shadow:var(--shadow-md);
}
.cod-box.is-done{background:linear-gradient(160deg,var(--brand-600),var(--brand-800))}
.cod-box.is-paid{background:var(--surface-2);color:var(--ink-700);border:1px solid var(--line);box-shadow:none}
.cod-label{display:block;font-size:13px;font-weight:600;opacity:.85}
.cod-amount{display:block;font-size:34px;font-weight:800;line-height:1.25;font-variant-numeric:tabular-nums}
.cod-note{display:block;font-size:12.5px;opacity:.85;margin-top:4px}

.status-form{margin:0}

/* Shipment status chip on the merchant's order board */
.ship-chip{
  display:inline-flex;align-items:center;gap:5px;
  background:var(--brand-50);color:var(--brand-700);
  border:1px solid var(--brand-100);border-radius:999px;
  padding:3px 10px;font-size:11.5px;font-weight:700;margin-bottom:8px;
}

/* =====================================================================
   Courier portal sign-in — same layout, its own signature so a driver
   knows at a glance they are on the right door.
   ===================================================================== */
.login-delivery .login-aside{
  background: linear-gradient(160deg, var(--brand-800) 0%, #06331d 100%);
}
.login-delivery .login-aside::after{
  background: radial-gradient(circle, rgba(224, 163, 24, .28) 0%, transparent 65%);
}
/* faint road markings running under the copy */
.login-delivery .login-aside::before{
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 120px;
  background: repeating-linear-gradient(
    -70deg,
    rgba(255, 255, 255, .05) 0 22px,
    transparent 22px 60px
  );
  pointer-events: none;
}
.login-delivery .login-points i{ color: var(--warning); }

.login-badge{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  font-size: 12.5px;
  font-weight: 700;
}
.login-badge i{ font-size: 15px; }

.login-note{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-400);
  font-size: 12.5px;
  line-height: 1.6;
}
.login-note i{ color: var(--brand-600); font-size: 14px; margin-top: 1px; flex: none; }

/* =====================================================================
   Delivery-partner applications waiting for review
   ===================================================================== */
.card-accent{ border-color: var(--warning); box-shadow: 0 0 0 3px rgba(224,163,24,.09); }
.card-accent .card-header strong{ color: #9a6b0d; }

.req-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  gap:16px;
}
.req-card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  padding:18px;
}
.req-card h4{ font-size:17px; font-weight:800; margin:10px 0 12px; }

.req-kind{
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 11px;border-radius:999px;
  background:var(--brand-50);color:var(--brand-700);
  border:1px solid var(--brand-100);
  font-size:11.5px;font-weight:700;
}
.req-kind.is-solo{ background:#fdf5e3;color:#8a5f0b;border-color:#f0dcae; }

.req-line{
  display:flex;align-items:flex-start;gap:8px;
  margin:0 0 7px;font-size:13.5px;color:var(--ink-600);
}
.req-line i{ color:var(--ink-400);font-size:14px;margin-top:2px;flex:none; }

.req-notes{
  margin:12px 0 0;padding:10px 12px;
  background:var(--surface-2);border-radius:var(--radius-sm);
  font-size:13px;color:var(--ink-600);line-height:1.65;
}
.req-actions{ display:flex;gap:8px;margin-top:16px; }
.req-actions form{ margin:0; }

/* radio cards on the public partner sign-up */
.choice-row{ display:grid;grid-template-columns:1fr 1fr;gap:12px; }
.choice input{ position:absolute;opacity:0;pointer-events:none; }
.choice-box{
  display:block;padding:16px 14px;text-align:center;cursor:pointer;
  border:2px solid var(--line);border-radius:var(--radius);
  background:var(--surface);transition:border-color .15s,background .15s;
}
.choice-box i{ font-size:22px;color:var(--ink-400);display:block;margin-bottom:7px; }
.choice-box b{ display:block;font-size:14.5px; }
.choice-box small{ display:block;font-size:12px;color:var(--ink-400);margin-top:3px; }
.choice input:checked + .choice-box{
  border-color:var(--brand-500);background:var(--brand-50);
}
.choice input:checked + .choice-box i{ color:var(--brand-600); }
.choice input:focus-visible + .choice-box{ outline:2px solid var(--brand-500);outline-offset:2px; }

.login-card-wide{ max-width:620px; }
.field-hint{ display:block;margin-top:5px;font-size:12px;color:var(--ink-400); }

@media (max-width:520px){
  .choice-row{ grid-template-columns:1fr; }
}

/* info-list also used as a definition list (courier bank page) */
dl.info-list{ display:grid; grid-template-columns:auto 1fr; gap:9px 14px; align-items:baseline; }
dl.info-list dt{ font-size:12.5px; color:var(--ink-400); font-weight:600; white-space:nowrap; }
dl.info-list dd{ margin:0; font-size:14px; color:var(--ink-700); }

/* payout details on the platform's settlement view */
.bank-box{
  margin-top:14px;padding:14px 16px;
  border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-2);
}
.bank-box h5{ font-size:13px;font-weight:700;color:var(--ink-500);margin:0 0 10px; }
.bank-box .missing{ color:var(--danger);font-size:13px;font-weight:600; }

/* =====================================================================
   Surveys (admin side) and the prospective-merchant board
   ===================================================================== */

/* --- survey builder --- */
.q-item{
  border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:12px 14px;margin-bottom:10px;background:var(--surface);
}
.q-item > summary{
  display:flex;align-items:center;gap:10px;cursor:pointer;list-style:none;
}
.q-item > summary::-webkit-details-marker{display:none}
.q-num{
  width:24px;height:24px;flex:none;border-radius:50%;
  background:var(--brand-600);color:#fff;font-size:12px;font-weight:700;
  display:grid;place-items:center;
}
.q-text{flex:1;font-weight:600;font-size:14.5px}
.q-type{font-size:11.5px;color:var(--ink-400);white-space:nowrap}
.q-req{
  font-size:10.5px;font-weight:700;color:var(--danger);
  border:1px solid currentColor;border-radius:999px;padding:1px 7px;
}
.q-form{margin-top:16px;padding-top:16px;border-top:1px dashed var(--line)}

.check-inline{display:inline-flex;align-items:center;gap:7px;font-size:14px;cursor:pointer}
.check-inline input{width:16px;height:16px}

/* --- share links --- */
.share-url{
  display:flex;align-items:center;gap:8px;
  background:var(--brand-50);border:1px solid var(--brand-100);
  border-radius:var(--radius-sm);padding:10px 12px;
}
.share-url code{flex:1;font-size:12.5px;word-break:break-all;color:var(--brand-800)}

.share-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.share-list li{
  display:grid;grid-template-columns:70px 1fr auto;gap:8px;align-items:center;
  border:1px solid var(--line);border-radius:var(--radius-sm);padding:7px 10px;
}
.share-list span{font-size:12.5px;font-weight:600}
.share-list code{font-size:11px;word-break:break-all;color:var(--ink-500)}

/* --- results --- */
.src-row{display:flex;gap:8px;flex-wrap:wrap}
.src-chip{
  display:inline-flex;align-items:center;gap:7px;
  border:1px solid var(--line);border-radius:999px;padding:6px 14px;
  font-size:13px;color:var(--ink-600);text-decoration:none;
}
.src-chip b{color:var(--brand-700)}
.src-chip.active{background:var(--brand-600);border-color:var(--brand-600);color:#fff}
.src-chip.active b{color:#fff}

.bars{display:grid;gap:12px}
.bar-row{display:grid;grid-template-columns:minmax(90px,1fr) 2.4fr auto;gap:12px;align-items:center}
.bar-label{font-size:14px}
.bar-track{height:11px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.bar-fill{
  display:block;height:100%;border-radius:999px;
  background:linear-gradient(90deg,var(--brand-400),var(--brand-600));
  transition:width .5s var(--ease-out, ease);
}
.bar-val{font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap}

.answer-list{list-style:none;margin:0;padding:0;display:grid;gap:9px}
.answer-list li{
  padding:11px 14px;border-radius:var(--radius-sm);
  background:var(--surface-2);font-size:14px;line-height:1.7;
}

/* --- leads funnel --- */
.funnel{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));
  gap:10px;margin-bottom:22px;
}
.funnel-step{
  display:block;text-align:center;text-decoration:none;
  border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);padding:14px 8px;
  transition:border-color .18s,transform .18s;
}
.funnel-step:hover{transform:translateY(-2px);border-color:var(--brand-300)}
.funnel-step .n{display:block;font-size:23px;font-weight:800;line-height:1.2}
.funnel-step .l{display:block;font-size:12px;color:var(--ink-400);margin-top:2px}
.funnel-step.active{border-color:var(--brand-600);box-shadow:0 0 0 2px var(--brand-100)}
.funnel-step.tone-success .n{color:var(--brand-600)}
.funnel-step.tone-brand .n{color:var(--brand-500)}
.funnel-step.tone-warning .n{color:var(--warning)}
.funnel-step.tone-danger .n{color:var(--danger)}
.funnel-step.tone-info .n{color:var(--info, var(--ink-600))}

.lead-chip{
  display:inline-block;padding:3px 11px;border-radius:999px;
  font-size:11.5px;font-weight:700;border:1px solid transparent;
}
.lead-chip.tone-muted{background:var(--surface-2);color:var(--ink-500);border-color:var(--line)}
.lead-chip.tone-info{background:#e8f1fb;color:#1e5a96;border-color:#c9dff5}
.lead-chip.tone-brand{background:var(--brand-50);color:var(--brand-700);border-color:var(--brand-100)}
.lead-chip.tone-warning{background:#fdf5e3;color:#8a5f0b;border-color:#f0dcae}
.lead-chip.tone-success{background:var(--brand-100);color:var(--brand-800);border-color:var(--brand-200)}
.lead-chip.tone-danger{background:#fdeded;color:#9c2b26;border-color:#f5c2c0}

.row-due{background:#fffaf0}
.due-flag{color:var(--danger);font-weight:700}

.filter-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0}
.filter-bar .form-control{width:auto;min-width:150px;font-size:13.5px}

.call-item{padding:14px 0;border-bottom:1px dashed var(--line)}
.call-item:last-child{border-bottom:0}
.call-head{display:flex;gap:9px;align-items:center;flex-wrap:wrap;font-size:12.5px;margin-bottom:7px}
.call-item p{margin:0;font-size:14.5px;line-height:1.75;white-space:pre-line}

.hint-list{list-style:none;margin:0;padding:0;display:grid;gap:11px}
.hint-list li{
  position:relative;padding-inline-start:20px;font-size:13.5px;color:var(--ink-600);line-height:1.7;
}
.hint-list li::before{
  content:"";position:absolute;inset-inline-start:0;inset-block-start:9px;
  width:7px;height:7px;border-radius:50%;background:var(--brand-500);
}

@media (max-width:640px){
  .bar-row{grid-template-columns:1fr;gap:5px}
  .share-list li{grid-template-columns:1fr auto}
  .share-list span{grid-column:1 / -1}
}
