/* ================================================================
   Nixie DMS — App Stylesheet
   Dark Navy + Orange theme (matching nixie.in)
   ================================================================ */

/* ── Design Tokens ───────────────────────────────────── */
:root {
  --navy:       #0A1628;
  --navy-2:     #112035;
  --navy-3:     #0D2040;
  --navy-4:     #0B1A30;
  --border:     #1E3050;
  --border-l:   #263A56;
  --orange:     #FF6B35;
  --orange-h:   #e85a22;
  --orange-bg:  rgba(255,107,53,.08);
  --green:      #00C853;
  --green-bg:   rgba(0,200,83,.12);
  --red:        #FF4D4D;
  --red-bg:     rgba(255,77,77,.1);
  --yellow:     #FFBD2E;
  --yellow-bg:  rgba(255,189,46,.1);
  --blue:       #4DA6FF;
  --blue-bg:    rgba(77,166,255,.1);
  --text:       #E8EAF0;
  --muted:      #8892A4;
  --white:      #FFFFFF;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;
  --radius-pill:999px;
  --shadow:     0 4px 24px rgba(0,0,0,0.25);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.35);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.15);
  --font-head:  'Poppins', sans-serif;
  --font-body:  'Inter', sans-serif;
  --trans:      0.2s ease;
  --sidebar-w:  260px;
  --topbar-h:   60px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--orange); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--orange-h); }
h1,h2,h3,h4 { font-family: var(--font-head); color: var(--white); font-weight: 700; line-height: 1.3; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════
   AUTH SCREENS
═══════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,107,53,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(77,166,255,.04) 0%, transparent 50%),
    var(--navy);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.auth-logo {
  font-family: var(--font-head); font-size: 1.8rem; font-weight: 800;
  color: var(--white); text-align: center; margin-bottom: 32px;     border-bottom: 1px solid var(--border);
}
.auth-logo img{width: 150px; margin: auto;}
.auth-logo span { color: var(--orange); }
.auth-screen { display: none; }
.auth-screen.active { display: block; }
.auth-screen h2 { text-align: center; margin-bottom: 6px; font-size: 1.4rem; }
.auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 28px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 20px; }
.otp-input {
  text-align: center; font-size: 1.8rem; font-weight: 700;
  letter-spacing: 12px; font-family: var(--font-head);
}
.expired-icon { text-align: center; font-size: 3rem; margin-bottom: 12px; }

/* Alert inside auth */
.alert {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .85rem; text-align: center;
}
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(255,77,77,.2); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(0,200,83,.2); }

/* ══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control {
  width: 100%; background: var(--navy-3); border: 1px solid var(--border);
  color: var(--text); padding: 11px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .92rem; transition: border-color var(--trans);
}
.form-control:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,53,.1); }
.form-control::placeholder { color: rgba(136,146,164,.6); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892A4' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }

.customer-combobox {
  position: relative;
}

.customer-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.customer-combobox-trigger.has-value {
  color: var(--white);
}

.customer-combobox-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-combobox-icon {
  color: var(--muted);
  font-size: .8rem;
  transition: transform var(--trans);
}

.customer-combobox.is-open .customer-combobox-icon {
  transform: rotate(180deg);
}

.customer-combobox-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--navy-2);
  border: 1px solid var(--border-l);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 12px;
}

.customer-combobox-search-wrap {
  margin-bottom: 10px;
}

.customer-combobox-search {
  padding-right: 14px;
}

.customer-combobox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.customer-combobox-option,
.customer-combobox-create-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--navy-3);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans), color var(--trans);
}

.customer-combobox-option:hover,
.customer-combobox-option.is-selected,
.customer-combobox-create-btn:hover {
  border-color: var(--orange);
  background: rgba(255,107,53,.08);
}

.customer-combobox-option-name {
  display: block;
  font-weight: 600;
  color: var(--white);
}

.customer-combobox-option-meta {
  display: block;
  margin-top: 2px;
  font-size: .76rem;
  color: var(--muted);
}

.customer-combobox-empty {
  padding: 14px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: .82rem;
}

.customer-combobox-create {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.customer-combobox-create-title {
  margin-bottom: 10px;
  font-family: var(--font-head);
  font-size: .9rem;
  color: var(--white);
}

.customer-combobox-create-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; transition: all var(--trans);
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: var(--white); border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-h); border-color: var(--orange-h); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: rgba(255,77,77,.2); }
.btn-danger:hover { background: rgba(255,77,77,.18); }
.btn-ghost { background: transparent; color: var(--muted); border: none; padding: 6px 12px; }
.btn-ghost:hover { color: var(--white); }
.btn-sm { padding: 7px 16px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-green { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-green:hover { background: #00b34a; border-color: #00b34a; }

/* ══════════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════════ */
.app-layout {
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--navy-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  font-family: var(--font-head); font-size: 1.4rem; font-weight: 800;
  color: var(--white); padding: 24px 22px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img{width: 150px; margin: auto;}
.sidebar-logo span { color: var(--orange); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); opacity: .6;
  padding: 16px 22px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px; color: var(--muted); font-size: .88rem; font-weight: 500;
  transition: all var(--trans); border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-link.active { color: var(--orange); background: var(--orange-bg); border-left-color: var(--orange); }
.nav-icon { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.sidebar-footer-row {
  display: flex; justify-content: space-between; align-items: center;
}
.sidebar-user { font-size: .82rem; color: var(--muted); }
.sidebar-logout { font-size: .82rem; color: var(--muted); transition: color var(--trans); }
.sidebar-logout:hover { color: var(--red); }

/* ── Topbar ── */
.topbar {
  display: none; /* shown on mobile */
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--navy-2); border-bottom: 1px solid var(--border);
  padding: 0 20px; align-items: center; z-index: 90;
}
.topbar-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  font-size: 1.2rem; padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer;
}
.topbar-title { font-family: var(--font-head); font-weight: 700; color: var(--white); margin-left: 14px; font-size: 1rem; }
.topbar-actions { margin-left: auto; }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 32px 36px;
  min-height: 100vh;
  background: var(--navy);
  overflow-x: hidden;
  max-width: 100vw;
}

/* Pages */
.page { display: none; }
.page.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-desc { color: var(--muted); font-size: .9rem; }

/* ══════════════════════════════════════════════════════
   PANELS & CARDS
═══════════════════════════════════════════════════════ */
.panel {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.panel-title {
  font-family: var(--font-head); font-size: 1rem; font-weight: 700;
  color: var(--white); margin-bottom: 18px;
}

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: all var(--trans); position: relative; overflow: hidden;
  min-width: 0;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--orange), #ff9a6c);
  opacity: 0; transition: opacity var(--trans);
}
.stat-card:hover { border-color: rgba(255,107,53,.2); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon { font-size: 1.6rem; margin-bottom: 10px; }
.stat-card .stat-value {
  font-family: var(--font-head); font-size: 1.8rem; font-weight: 800;
  color: var(--white); line-height: 1;
}
.stat-card .stat-label { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.stat-clickable { cursor: pointer; }
.stat-clickable:hover::before { opacity: 1; }
.stat-clickable:active { transform: translateY(0) scale(.98); }

/* ── Dashboard Charts ── */
.dash-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-section-top-lg { margin-top: 20px; }
.dash-section-top { margin-top: 16px; }
.dash-chart-panel { padding: 16px; }
.dash-chart-panel canvas { max-height: 260px; }
.dashboard-recent-sales-state {
  padding: 12px 16px;
  color: var(--muted);
  font-size: .88rem;
}
.dashboard-empty-message {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}
@media (max-width: 768px) {
  .dash-charts-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Search Bar ── */
.search-bar { padding: 12px 16px 0; display: flex; align-items: center; gap: 8px; }
.search-bar input { max-width: 360px; }
.search-clear { font-size: .85rem; opacity: .6; cursor: pointer; }
.search-clear:hover { opacity: 1; }

.list-toolbar {
  padding: 12px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list-toolbar-tight {
  padding-top: 0;
}

.list-toolbar-search-only {
  justify-content: flex-end;
}

.list-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-toolbar-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
  max-width: 380px;
  margin-left: auto;
}

.list-toolbar-search-wide {
  max-width: 460px;
}

.list-toolbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .95rem;
  pointer-events: none;
  z-index: 1;
}

.list-toolbar-input {
  max-width: none !important;
  padding-left: 38px;
  padding-right: 42px;
}

.list-toolbar-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  z-index: 1;
}

/* ── Data Tables ── */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: .75rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--orange); }
.data-table th.sort-asc::after { content: ' ▲'; font-size: .6rem; }
.data-table th.sort-desc::after { content: ' ▼'; font-size: .6rem; }
.data-table td {
  padding: 12px 14px; font-size: .88rem; border-bottom: 1px solid rgba(30,48,80,.5);
  color: var(--text);
}
.data-table tr:hover td { background: rgba(255,255,255,.015); }
.data-table .actions { display: flex; gap: 6px; }
.dashboard-recent-sales-wrap { width: 100%; overflow-x: auto; }
.dashboard-recent-sales-table { width: 100%; min-width: 520px; }
.dashboard-recent-sales-table th:nth-child(1),
.dashboard-recent-sales-table td:nth-child(1),
.dashboard-recent-sales-table th:nth-child(4),
.dashboard-recent-sales-table td:nth-child(4),
.dashboard-recent-sales-table th:nth-child(5),
.dashboard-recent-sales-table td:nth-child(5) { white-space: nowrap; }
.dashboard-recent-sales-table td:nth-child(2),
.dashboard-recent-sales-table td:nth-child(3) { word-break: break-word; }

.product-thumb-btn {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  vertical-align: middle;
  margin-right: 6px;
  cursor: zoom-in;
}

.product-thumb-img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}

.product-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  vertical-align: middle;
  margin-right: 6px;
  font-size: 18px;
}

.product-image-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-image-preview.is-hidden {
  display: none;
}

.product-image-preview-img {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15);
  display: block;
}

.product-image-input-wrap {
  flex: 1;
  min-width: 0;
}

.product-image-input {
  padding: 6px;
}

.product-image-help {
  color: var(--muted);
  font-size: 11px;
}

.zoomable-image {
  cursor: zoom-in;
}

.image-zoom-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.image-zoom-range {
  width: 180px;
}

.image-zoom-value {
  font-size: 12px;
  color: var(--muted);
  min-width: 46px;
  text-align: right;
}

.image-zoom-wrap {
  max-height: 68vh;
  overflow: auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  justify-content: center;
}

.image-zoom-target {
  max-width: 100%;
  transform-origin: center center;
  transform: scale(1);
  transition: transform 120ms ease;
}

.image-zoom-tip {
  font-size: 12px;
  color: var(--muted);
}

.modal-intro-text {
  margin-bottom: 16px;
  font-size: .9rem;
}

.modal-action-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-action-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Empty state */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty-state span { font-size: 3rem; display: block; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: .9rem; }

/* Badges */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill);
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-muted { background: rgba(136,146,164,.1); color: var(--muted); }

/* Sub badge (topbar) */
.sub-badge {
  font-size: .72rem; font-weight: 700; padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* ══════════════════════════════════════════════════════
   SUBSCRIPTION / PRICING
═══════════════════════════════════════════════════════ */
.sub-status-card {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.sub-status-card .sub-plan {
  font-family: var(--font-head); font-size: 1.3rem; font-weight: 800;
  color: var(--white); margin-bottom: 4px;
}
.sub-status-card .sub-detail { color: var(--muted); font-size: .9rem; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pricing-card {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: all var(--trans); text-align: center; position: relative;
}
.pricing-card:hover { border-color: rgba(255,107,53,.3); transform: translateY(-3px); box-shadow: var(--shadow); }
.pricing-card.featured { border-color: var(--orange); }
.pricing-card .plan-badge {
  display: inline-block; background: var(--orange); color: var(--white);
  font-size: .68rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-pill); margin-bottom: 12px;
}
.pricing-card .plan-name { font-size: .88rem; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.pricing-card .plan-price {
  font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; color: var(--white);
}
.pricing-card .plan-price sup { font-size: .9rem; }
.pricing-card .plan-period { font-size: .8rem; color: var(--muted); }
.pricing-card .plan-per { font-size: .78rem; color: var(--green); font-weight: 600; margin: 6px 0 16px; }
.pricing-card .btn { margin-top: 16px; }

/* Pricing mini (in expired screen) */
.pricing-mini { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 20px 0; }
.pricing-mini-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--navy-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--trans);
}
.pricing-mini-item:hover { border-color: var(--orange); }
.pricing-mini-item .plan-info { text-align: left; }
.pricing-mini-item .plan-info strong { color: var(--white); font-size: .9rem; display: block; }
.pricing-mini-item .plan-info small { color: var(--muted); font-size: .78rem; }
.pricing-mini-item .plan-cost { font-family: var(--font-head); font-weight: 700; color: var(--orange); }

/* ══════════════════════════════════════════════════════
   QUICK ACTIONS
═══════════════════════════════════════════════════════ */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-btn {
  background: var(--navy-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  color: var(--text); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all var(--trans);
  font-family: var(--font-body);
}
.quick-btn:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-bg); }

/* ══════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 500px;
  max-height: 85vh; overflow-y: auto; overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; }
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 1.2rem;
  cursor: pointer; padding: 4px; transition: color var(--trans);
}
.modal-close:hover { color: var(--white); }
.modal-body { padding: 24px; }
.modal-body .form-group:last-of-type { margin-bottom: 20px; }

/*common classes*/
.mt20{margin-top: 20px;}
.mb10{margin-bottom: 10px;}
.mb20{margin-bottom: 20px;}
.d-flex{display: flex;}
.flex-wrap{flex-wrap: wrap;}
.gap-8{gap: 8px;}

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--navy-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 20px;
  font-size: .88rem; box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
}
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-info { border-left: 3px solid var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ══════════════════════════════════════════════════════
   PROFILE
═══════════════════════════════════════════════════════ */
.profile-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0; gap: 16px;
  border-bottom: 1px solid rgba(30,48,80,.4);
}
.profile-row:last-child { border-bottom: none; }
.profile-row .label { font-size: .85rem; color: var(--muted); flex-shrink: 0; min-width: 100px; }
.profile-row .value { font-size: .9rem; color: var(--white); font-weight: 600; text-align: right; word-break: break-word; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 360px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-layout { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .topbar { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 76px 16px 24px;
    max-width: 100vw;
  }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .modal-overlay { padding: 10px; }
  .modal { max-height: 90vh; }
  .customer-combobox-panel {
    position: static;
    margin-top: 8px;
  }
  .data-table th, .data-table td { padding: 10px 8px; font-size: .8rem; }
  .pricing-grid { max-width: 100%; }
  .list-toolbar {
    align-items: stretch;
  }
  .list-toolbar-search,
  .list-toolbar-search-wide {
    order: -1;
    margin-left: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .list-toolbar-filters {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .stat-card { padding: 16px 14px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 72px 12px 20px; }
  .dashboard-recent-sales-wrap { margin: 0 -4px; padding-bottom: 2px; }
  .dashboard-recent-sales-table { min-width: 560px; }
  .list-toolbar {
    padding: 12px 12px 14px;
  }
  .list-toolbar-filters .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
}

/* ══════════════════════════════════════════════════════
   PASSWORD TOGGLE & PIN INPUT
═══════════════════════════════════════════════════════ */
.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1rem; padding: 4px;
  transition: color var(--trans); line-height: 1;
}
.input-toggle:hover { color: var(--text); }
.pin-input {
  text-align: center; font-size: 1.8rem; font-weight: 700;
  letter-spacing: 12px; font-family: var(--font-head);
}

/* ── Scrollbar (webkit) ── */

/* ── Analytics Bar Charts ── */
.bar-bg { background: rgba(255,255,255,.06); border-radius: 4px; height: 8px; width: 100%; min-width: 60px; }
.bar-fill { background: var(--accent); height: 100%; border-radius: 4px; transition: width .4s ease; }
.analytics-list table { font-size: .88rem; }
#analytics-grid { margin-top: 4px; }
@media (max-width: 768px) {
  #analytics-grid { grid-template-columns: 1fr !important; }
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-l); }

/* ── Loading spinner ── */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   REPORTS & INVOICE STYLES
═══════════════════════════════════════════════════════ */
/* Report filter bar */
.report-filters .form-control { background: var(--navy-3); border-color: var(--border); font-size: .85rem; padding: 8px 12px; }

.is-hidden { display: none !important; }

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

.settings-upload-card {
  background: var(--navy-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.settings-upload-preview {
  height: 140px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
}

.settings-upload-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.settings-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
  padding: 12px;
}

.settings-file-input {
  padding: 8px;
}

.invoice-sheet {
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 18px;
}

.invoice-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}

.invoice-topline-title {
  color: #111827;
}

.invoice-topline-tag {
  border: 1px solid #cbd5e1;
  color: #64748b;
  border-radius: 4px;
  padding: 2px 8px;
}

.invoice-branding {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 6px solid var(--orange);
}

.invoice-branding-logo-wrap {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invoice-branding-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 4px;
}

.invoice-branding-logo-fallback {
  background: #1f2937;
  color: #fff;
  font-size: 52px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invoice-branding-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 4px;
}

.invoice-branding-line {
  font-size: 14px;
  margin-bottom: 2px;
  color: #334155;
}

.invoice-meta-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 10px 14px;
  background: #fff4ef;
  border-top: 2px solid var(--orange);
  font-size: 14px;
}

.invoice-billto-block {
  padding-bottom: 12px;
  border-bottom: 3px solid var(--orange);
}

.invoice-section-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.invoice-billto-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.invoice-billto-line,
.invoice-greeting,
.invoice-bank-block,
.invoice-terms-copy,
.invoice-summary-words-value,
.invoice-signoff-company,
.invoice-notes {
  color: #334155;
}

.invoice-billto-line,
.invoice-greeting,
.invoice-bank-block,
.invoice-summary-row,
.invoice-signoff-company {
  font-size: 14px;
}

.invoice-greeting {
  margin: 14px 0 8px;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.invoice-items-table thead th {
  text-align: left;
  padding: 10px 8px;
  font-size: 12px;
  border-bottom: 2px solid var(--orange);
  color: #111827;
}

.invoice-items-table thead th:nth-child(n+2),
.invoice-items-table tbody td:nth-child(n+2) {
  text-align: center;
}

.invoice-items-table thead th:last-child,
.invoice-items-table tbody td:last-child {
  text-align: right;
}

.invoice-items-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  vertical-align: top;
}

.invoice-item-name {
  font-weight: 700;
}

.invoice-footer-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}

.invoice-footer-left,
.invoice-footer-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-bank-block,
.invoice-terms-block {
  padding-top: 8px;
  border-top: 2px solid var(--orange);
}

.invoice-qr-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid #d1d5db;
  padding: 6px;
  background: #fff;
}

.invoice-terms-copy {
  line-height: 1.6;
}

.invoice-summary-card {
  border-top: 2px solid var(--orange);
  padding-top: 10px;
}

.invoice-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.invoice-summary-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 2px solid #9ca3af;
  font-size: 18px;
  color: #111827;
}

.invoice-summary-words {
  margin-top: 14px;
  text-align: right;
}

.invoice-summary-words-label,
.invoice-signoff-label {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.invoice-signoff {
  margin-top: 18px;
  text-align: right;
}

.invoice-signoff-images {
  min-height: 92px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 6px;
}

.invoice-seal-image {
  max-width: 90px;
  max-height: 90px;
  object-fit: contain;
  opacity: .92;
}

.invoice-sign-image {
  max-width: 140px;
  max-height: 72px;
  object-fit: contain;
}

.invoice-notes {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #d1d5db;
  font-size: 13px;
}

/* Report responsive grid */
@media (max-width: 768px) {
  #page-reports > div:nth-child(3) { grid-template-columns: 1fr !important; }
  .settings-upload-grid,
  .invoice-branding,
  .invoice-footer-grid {
    grid-template-columns: 1fr;
  }
  .invoice-meta-strip,
  .invoice-topline {
    flex-direction: column;
    align-items: flex-start;
  }
  .invoice-summary-words,
  .invoice-signoff {
    text-align: left;
  }
  .invoice-signoff-images {
    justify-content: flex-start;
  }
}

/* Invoice item row responsive */
.inv-item-row .form-row { grid-template-columns: 1fr 1fr 1fr; }
.quot-item-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}
.quot-item-remove {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: .9rem;
}
.quot-item-product-group { flex: 1.6; }
.quot-item-total-group { min-width: 140px; }
.quot-stock {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.quot-line-total {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.04);
}
@media (max-width: 480px) {
  .inv-item-row .form-row { grid-template-columns: 1fr; }
  .quot-item-total-group { min-width: 0; }
}

/* Delete button red hover */
.btn-ghost:hover { color: var(--white); }
.actions .btn-ghost:last-child:hover { color: var(--red); }

/* ══════════════════════════════════════════════════════
   GUIDED TOUR STYLES
═══════════════════════════════════════════════════════ */

/* Tour Start Prompt */
.tour-prompt-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.tour-prompt-card {
  background: var(--navy-2, #111827); border: 1px solid var(--border, #2a3548);
  border-radius: 16px; padding: 40px 36px; text-align: center;
  max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: tourPromptIn .3s ease;
}
@keyframes tourPromptIn { from { opacity:0; transform:scale(.9) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
.tour-prompt-icon { font-size: 48px; margin-bottom: 16px; }
.tour-prompt-title { font-size: 1.3rem; font-weight: 700; color: var(--white, #fff); margin-bottom: 8px; }
.tour-prompt-desc { color: var(--muted, #9ca3af); font-size: .92rem; line-height: 1.6; margin-bottom: 28px; }
.tour-prompt-actions { display: flex; flex-direction: column; gap: 10px; }
.tour-prompt-actions .btn { font-size: .95rem; padding: 12px 20px; }

/* Tour Overlay & Highlight */
.tour-overlay { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.tour-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); pointer-events: auto;
}
.tour-highlight {
  position: relative; z-index: 10001; pointer-events: auto;
  box-shadow: 0 0 0 4px var(--orange, #FF6B35), 0 0 0 9999px rgba(0,0,0,.55);
  border-radius: 8px;
  animation: tourPulse 2s infinite;
}
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--orange, #FF6B35), 0 0 0 9999px rgba(0,0,0,.55); }
  50% { box-shadow: 0 0 0 6px var(--orange, #FF6B35), 0 0 12px var(--orange, #FF6B35), 0 0 0 9999px rgba(0,0,0,.55); }
}

/* Tour Tooltip */
.tour-tooltip {
  position: fixed; z-index: 10002; pointer-events: auto;
  background: var(--navy-2, #111827); border: 1px solid var(--border, #2a3548);
  border-radius: 12px; padding: 20px; min-width: 280px; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: tourTooltipIn .25s ease;
}
@keyframes tourTooltipIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.tour-tooltip-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tour-step-badge {
  background: var(--orange, #FF6B35); color: #fff; font-size: .75rem;
  font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.tour-close {
  background: none; border: none; color: var(--muted, #9ca3af);
  font-size: 1.3rem; cursor: pointer; padding: 0 4px; line-height: 1;
}
.tour-close:hover { color: var(--white, #fff); }
.tour-tooltip-title { font-size: 1.05rem; font-weight: 700; color: var(--white, #fff); margin-bottom: 8px; }
.tour-tooltip-content { color: var(--muted, #9ca3af); font-size: .88rem; line-height: 1.6; margin-bottom: 16px; }
.tour-tooltip-actions { display: flex; justify-content: space-between; gap: 8px; }
.tour-tooltip-actions .btn { min-width: 80px; }

/* Tour tooltip arrow */
.tour-tooltip::before {
  content: ''; position: absolute; width: 12px; height: 12px;
  background: var(--navy-2, #111827); border: 1px solid var(--border, #2a3548);
  transform: rotate(45deg);
}
.tour-tooltip.pos-right::before { left: -7px; top: 24px; border-right: none; border-top: none; }
.tour-tooltip.pos-left::before { right: -7px; top: 24px; border-left: none; border-bottom: none; }
.tour-tooltip.pos-bottom::before { top: -7px; left: 30px; border-bottom: none; border-right: none; }
.tour-tooltip.pos-top::before { bottom: -7px; left: 30px; border-top: none; border-left: none; }

/* Admin tour management styles */
.tour-card {
  border: 1px solid var(--border, #2a3548); border-radius: 10px;
  padding: 16px; margin-bottom: 12px; transition: border-color .2s;
}
.tour-card:hover { border-color: var(--orange, #FF6B35); }
.tour-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tour-card-title { font-weight: 600; font-size: .95rem; color: var(--white, #fff); }
.tour-card-meta { display: flex; gap: 10px; align-items: center; font-size: .82rem; color: var(--muted, #9ca3af); }
.tour-badge-active { background: rgba(0,200,83,.15); color: #00C853; padding: 2px 8px; border-radius: 10px; font-size: .75rem; }
.tour-badge-inactive { background: rgba(255,77,77,.12); color: #FF4D4D; padding: 2px 8px; border-radius: 10px; font-size: .75rem; }
.tour-step-card {
  border: 1px solid var(--border, #2a3548); border-radius: 8px;
  padding: 14px; margin-bottom: 10px; background: var(--navy-3, #0f172a);
}
.tour-step-card-header { display: flex; justify-content: space-between; align-items: start; }
.tour-step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--orange, #FF6B35);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.tour-step-info { flex: 1; margin-left: 12px; }
.tour-step-info strong { font-size: .9rem; color: var(--white, #fff); }
.tour-step-info small { display: block; color: var(--muted, #9ca3af); font-size: .8rem; margin-top: 2px; }
