/* ==========================================================================
   BILLZ 2.0 Exact 1:1 Visual Replica Stylesheet (artels.billz.io Dark & Light)
   ========================================================================== */

:root {
  --bg-canvas: #1c1c1c;
  --bg-card: #242424;
  --bg-elevated: #2c2c2c;
  --bg-row: #383838;
  --bg-row-hover: #424242;
  --bg-input: #333333;
  --sidebar-bg: #2e2e2e;
  --sidebar-hover: #3a3a3a;
  --sidebar-active-bg: #444444;

  --primary: #1e78ff;
  --primary-hover: #1565df;
  --primary-soft: rgba(30, 120, 255, 0.16);
  --accent-blue-text: #4da3ff;

  --emerald: #27ae60;
  --emerald-soft: rgba(39, 174, 96, 0.16);
  --amber: #f2994a;
  --amber-soft: rgba(242, 153, 74, 0.16);
  --danger: #eb5757;
  --danger-soft: rgba(235, 87, 87, 0.18);
  --violet: #9b51e0;
  --violet-soft: rgba(155, 81, 224, 0.18);

  --text-main: #ffffff;
  --text-secondary: #c4c4c4;
  --text-muted: #8e8e8e;
  --border-color: #383838;
  --border-subtle: #2f2f2f;

  --card-glow: 0 0 28px rgba(255, 255, 255, 0.03), 0 4px 14px rgba(0, 0, 0, 0.35);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --sidebar-width: 212px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

body.light-theme {
  --bg-canvas: #dfe3ea;
  --bg-card: #eef1f6;
  --bg-elevated: #e5e9f0;
  --bg-row: #e7ebf2;
  --bg-row-hover: #dce2ec;
  --bg-input: #e4e8ef;
  --sidebar-bg: #e6e9f0;
  --sidebar-hover: #dadfe8;
  --sidebar-active-bg: #d2e1f8;
  --text-main: #1a2233;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #cbd3df;
  --border-subtle: #d5dce6;
  --accent-blue-text: #1d64d8;
  --card-glow: 0 1px 4px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.tabular-nums { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.blue-num { color: var(--accent-blue-text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   APP SHELL & MOBILE PREVIEW MODE
   ========================================================================== */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-layout.mobile-preview-mode {
  background: #0b0b0b;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.app-layout.mobile-preview-mode .sidebar { display: none; }

.app-layout.mobile-preview-mode .main-wrapper {
  width: 412px;
  max-width: 100%;
  height: 92vh;
  border-radius: 28px;
  border: 6px solid #333;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  position: relative;
  background: var(--bg-canvas);
}

.app-layout.mobile-preview-mode .mobile-bottom-nav { display: flex !important; }
.app-layout.mobile-preview-mode .pos-billz-grid,
.app-layout.mobile-preview-mode .debts-split-grid,
.app-layout.mobile-preview-mode .dashboard-chart-grid {
  grid-template-columns: 1fr !important;
}

/* ==========================================================================
   1:1 BILLZ SIDEBAR (#2e2e2e, Z Circle Logo, Drilldown Submenu, Bottom Avatar)
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 40;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-top-logo {
  height: 68px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.billz-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.billz-z-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  color: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
}

.billz-wordmark {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: #ffffff;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: #a0a0a0;
  font-size: 16px;
  cursor: pointer;
}

.sidebar-menu-area {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

/* Back header when inside a submenu (e.g. "< Товары") */
.submenu-back-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  color: #ffffff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 4px;
}

.submenu-back-header:hover {
  background: var(--sidebar-hover);
}

.sidebar-main-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sidebar-main-item:hover {
  background: var(--sidebar-hover);
}

.sidebar-main-item.active {
  background: var(--sidebar-active-bg);
  color: var(--accent-blue-text);
}

.sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-item-icon {
  color: var(--primary);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-sub-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sidebar-sub-item:hover {
  background: var(--sidebar-hover);
}

.sidebar-sub-item.active {
  background: var(--sidebar-active-bg);
  color: var(--accent-blue-text);
}

.sidebar-user-footer {
  margin-top: auto;
}

.sidebar-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2c94c;
  color: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

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

.user-chip-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.user-chip-store {
  font-size: 12px;
  color: #a0a0a0;
}

.sidebar-support-bar {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e0e0e0;
  cursor: pointer;
}

/* ==========================================================================
   MAIN CONTENT AREA & TOP OPERATIONAL UTILITY BAR
   ========================================================================== */

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-canvas);
}

.top-utility-bar {
  height: 52px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg-canvas);
}

.workspace-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 36px;
}

/* Big BILLZ Page Header ("Все магазины v", "Каталог", "Долги клиентов") */
.billz-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.billz-h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.billz-store-dropdown {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 28px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.billz-store-dropdown option {
  background: #242424;
  color: #ffffff;
  font-size: 16px;
}

/* ==========================================================================
   1:1 BILLZ DARK CARDS, PILL BUTTONS, INPUTS & ROUNDED ROW TABLES
   ========================================================================== */

.billz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-glow);
}

.billz-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.billz-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--card-glow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.stat-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #333333;
  color: var(--accent-blue-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value-blue {
  font-size: 23px;
  font-weight: 800;
  color: var(--accent-blue-text);
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

/* Segmented Filter Pills (Вчера, Сегодня, Неделя, Месяц, Год / Все, Активные...) */
.billz-pill-bar {
  display: inline-flex;
  align-items: center;
  background: #242424;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 4px;
  flex-wrap: wrap;
}

.billz-pill-tab {
  padding: 8px 16px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.billz-pill-tab.active {
  background: #383838;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.billz-chip-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.billz-chip {
  padding: 7px 15px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.billz-chip.active {
  background: #383838;
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-dark {
  background: #383838;
  color: #ffffff;
  border-color: #444444;
}

.btn-dark:hover {
  background: #454545;
}

.btn-outline {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-row-hover);
}

.btn-emerald { background: var(--emerald); color: #fff; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-violet { background: var(--violet); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-lg {
  padding: 14px 22px;
  font-size: 15px;
  border-radius: 14px;
}

/* Full-width Blue Action Banner Button (like on Долги клиентов right pane) */
.billz-action-banner-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.billz-action-banner-btn:hover {
  background: var(--primary-hover);
}

/* Inputs & Search Bar */
.input, .select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.input:focus, .select:focus {
  border-color: var(--primary);
}

.select option {
  background: #242424;
  color: #ffffff;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input-wrap .input {
  width: 100%;
  padding-left: 40px;
}

/* 1:1 BILLZ Table with Alternating Rounded Row Pills */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:nth-child(even) td {
  background: var(--bg-row);
}

.data-table tbody tr:hover td {
  background: var(--bg-row-hover);
}

.data-table td {
  padding: 14px 16px;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.data-table tbody tr td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.billz-link {
  color: var(--accent-blue-text);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.billz-link:hover {
  text-decoration: underline;
}

.prod-thumb-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-soft); color: var(--accent-blue-text); }
.badge-emerald { background: var(--emerald-soft); color: #4cd964; }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-violet { background: var(--violet-soft); color: #c490ff; }
.badge-slate { background: #383838; color: #d1d5db; }

/* ==========================================================================
   1:1 BILLZ POS SCREEN (/order/create)
   ========================================================================== */

.pos-billz-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  min-height: calc(100vh - 110px);
}

.pos-left-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pos-dashed-cart-box {
  flex: 1;
  min-height: 360px;
  border: 1.5px dashed #4a4a4a;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.pos-right-sidebar {
  border-left: 1px solid var(--border-color);
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.hotkey-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid #666;
  color: #ccc;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   1:1 BILLZ DEBTS SCREEN (/clients/debts)
   ========================================================================== */

.debts-split-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
  align-items: start;
}

.debt-card-row {
  background: var(--bg-row);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  transition: background 0.15s;
}

.debt-card-row:hover {
  background: var(--bg-row-hover);
}

.debt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.debt-dot.paid {
  background: var(--emerald);
}

/* ==========================================================================
   DASHBOARD CHART & STORE CARDS
   ========================================================================== */

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: stretch;
}

.store-legend-pill {
  background: var(--bg-row);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

/* Form helpers */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.module-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* ==========================================================================
   MODALS &AKT SVERKA PRINTABLE DOCUMENT
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-box.modal-xl { max-width: 980px; }

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 18px; font-weight: 800; color: var(--text-main); }
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.akt-document {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
}

.akt-header-block {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.akt-title { font-size: 19px; font-weight: 800; text-transform: uppercase; }

.akt-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--bg-row);
  border-radius: 12px;
}

.akt-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  height: 62px;
  background: #242424;
  border-top: 1px solid var(--border-color);
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  z-index: 45;
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9e9e9e;
  background: transparent;
  border: none;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 2px;
  cursor: pointer;
}

.mobile-nav-btn svg { width: 19px; height: 19px; }
.mobile-nav-btn.active { color: var(--accent-blue-text); }

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #2c2c2c;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--primary);
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-bottom-nav { display: flex; }
  .pos-billz-grid, .debts-split-grid, .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }
  .header-hide-mobile { display: none; }
}

@media print {
  body { background: #ffffff !important; margin: 0 !important; padding: 0 !important; }
  body > *:not(#printableArea) { display: none !important; }
  #printableArea, #printableArea * { visibility: visible !important; }
  #printableArea {
    display: block !important;
    position: static !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #printableArea .pos-thermal-receipt-wrap,
  #printableArea #receiptPrintBlock {
    width: 72mm !important;
    max-width: 72mm !important;
    margin: 0 auto !important;
    padding: 2mm 3mm !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
}


/* ==========================================================================
   APEX / BILLZ 2.0 UNIFIED SHELL, SIDEBAR, TOPBAR & MODULE CLASSES
   ========================================================================== */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-canvas);
}

.sidebar-logo {
  height: 68px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.16s ease;
}
.sidebar-logo:hover {
  background: rgba(255, 255, 255, 0.04);
}

.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #06b6d4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.logo-text {
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: #ffffff;
}
.logo-subtext {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #60a5fa;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #e5e5e5;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--accent-blue-text);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-chevron {
  font-size: 16px;
  color: #8e8e8e;
  margin-left: auto;
}

.nav-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(30, 120, 255, 0.22);
  color: var(--accent-blue-text);
}

.sidebar-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-group-header:hover {
  background: var(--sidebar-hover);
}

.sidebar-subitems {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 6px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-user-chip:hover {
  background: var(--sidebar-hover);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2c94c;
  color: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.user-store {
  font-size: 11.5px;
  color: #a0a0a0;
}

.sidebar-support-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #d4d4d4;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.sidebar-support-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Main Area & Topbar */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-canvas);
}

.topbar {
  height: 60px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
  background: var(--bg-card);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.control-pill:hover {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pill-icon-store {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
}

.pill-icon-rate {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

.pill-icon-role {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
}

.pill-edit-ico {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-left: 2px;
}

.control-pill select,
.control-pill input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.control-pill select option {
  background: #242424;
  color: #ffffff;
}

.rate-pill {
  cursor: pointer;
  border-color: rgba(59, 130, 246, 0.42);
  gap: 6px;
}

.rate-pill input {
  width: 54px;
  text-align: center;
  color: #60a5fa;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.topbar-dd-wrap {
  position: relative;
  display: inline-flex;
}

.topbar-dd-wrap .control-pill {
  cursor: pointer;
}

.pill-chev {
  color: var(--text-secondary);
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.topbar-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 245px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: ddFadeIn 0.12s ease-out;
}

body.light-theme .topbar-dd-menu {
  border-color: var(--border-color);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
}

.topbar-dd-menu.hidden {
  display: none !important;
}

@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar-dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: none;
  background: transparent;
  color: var(--text-main);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.topbar-dd-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.light-theme .topbar-dd-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.topbar-dd-item.active {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
}

.topbar-dd-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 1px;
}

.topbar-dd-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.theme-toggle-btn {
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.theme-toggle-btn:hover {
  background: var(--bg-row-hover);
}

.content-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

/* Cards, Grids, Segmented Tabs & Debts Layout */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-glow);
}

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

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

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

.right {
  text-align: right !important;
}

.billz-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.billz-segmented-tabs {
  display: inline-flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.seg-tab {
  padding: 8px 18px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.seg-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.billz-period-pills {
  display: inline-flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 4px;
  flex-wrap: wrap;
}

.period-pill {
  padding: 7px 14px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.period-pill.active {
  background: var(--bg-row);
  color: var(--text-main);
}

.billz-debts-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}

.billz-debt-card {
  background: var(--bg-row);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  transition: background 0.15s;
}

.billz-debt-card:hover {
  background: var(--bg-row-hover);
}

.debt-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debt-amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.debt-amount-blue {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-blue-text);
  font-family: var(--font-mono);
}

.debt-due-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.debt-client-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.btn-repay {
  padding: 9px 18px;
  border-radius: 11px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-repay:hover {
  background: var(--primary-hover);
}

.billz-debts-right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.billz-blue-action-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.billz-blue-action-banner:hover {
  background: var(--primary-hover);
}

/* Reconciliation Sheet */
.recon-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--card-glow);
}

.recon-header-stamp {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.recon-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

/* Badges */
.badge-primary { background: var(--primary-soft); color: var(--accent-blue-text); }
.badge-success { background: var(--emerald-soft); color: #4cd964; }
.badge-warning { background: var(--amber-soft); color: var(--amber); }

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.btn-secondary {
  background: var(--bg-row);
  color: var(--text-main);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 2px;
}

.mob-tab.active {
  color: var(--accent-blue-text);
}


/* ==========================================================================
   1:1 BILLZ POS PAYMENT SCREEN & LIVE THERMAL RECEIPT (media_1794684400202)
   ========================================================================== */

.pos-payment-layout {
  display: grid;
  grid-template-columns: 315px 1fr;
  gap: 36px;
  min-height: calc(100vh - 105px);
  align-items: start;
  padding: 6px 10px 24px 4px;
}

.pos-thermal-receipt-wrap {
  position: sticky;
  top: 10px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}

.pos-thermal-zig-top {
  height: 10px;
  width: 100%;
  background:
    linear-gradient(-45deg, #ffffff 5px, transparent 0),
    linear-gradient(45deg, #ffffff 5px, transparent 0);
  background-repeat: repeat-x;
  background-size: 10px 10px;
  background-position: left bottom;
}

.pos-thermal-paper {
  background: #ffffff;
  color: #111111;
  padding: 16px 18px 22px 18px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11.5px;
  line-height: 1.45;
  border-radius: 0 0 4px 4px;
}

.pos-thermal-paper .rcp-divider {
  border: none;
  border-top: 1.5px solid #1f2937;
  margin: 10px 0;
}

.pos-thermal-paper .rcp-leader-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  margin: 3px 0;
}

.pos-thermal-paper .rcp-leader-dots {
  flex: 1;
  border-bottom: 1px dotted #9ca3af;
  margin: 0 4px;
  position: relative;
  top: -3px;
}

.pos-payment-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1120px;
}

.pos-pay-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pos-btn-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: #2b2b2b;
  border: 1px solid #3d3d3d;
  color: #4da3ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.pos-btn-back-pill:hover {
  background: #363636;
}

.pos-btn-pay-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  background: #1e78ff;
  border: none;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(30, 120, 255, 0.35);
  transition: background 0.15s;
}

.pos-btn-pay-pill:hover {
  background: #1565df;
}

.pos-pay-totals-row {
  display: flex;
  align-items: flex-start;
  gap: 140px;
  flex-wrap: wrap;
}

.pos-pay-total-block .lbl {
  font-size: 16px;
  font-weight: 700;
  color: #a3a3a3;
  margin-bottom: 4px;
}

.pos-pay-total-block .val {
  font-size: 31px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.pos-pay-total-block.to-pay .lbl {
  color: #4cd964;
}

.pos-pay-total-block.to-pay .val {
  color: #4cd964;
}

.pos-pay-total-block.to-pay.unpaid .lbl,
.pos-pay-total-block.to-pay.unpaid .val {
  color: #f2994a;
}

.pos-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pos-method-trigger {
  height: 48px;
  background: #333333;
  border: 1px solid #424242;
  border-radius: 10px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pos-method-trigger:hover {
  background: #3d3d3d;
  border-color: #555555;
}

.pos-method-trigger .left-part {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-method-trigger .plus-icon {
  font-size: 18px;
  color: #c4c4c4;
  font-weight: 500;
}

.pos-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}

.pos-slot-card {
  background: #242424;
  border: 1px solid #3f3f3f;
  border-radius: 12px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-slot-header {
  background: #333333;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid #3f3f3f;
}

.pos-slot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-slot-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}

.pos-slot-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pos-slot-amount-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  font-family: var(--font-sans);
}

.pos-slot-amount-input:focus {
  border-bottom: 1.5px solid var(--primary);
}

.pos-slot-empty {
  border: 1px dashed #363636;
  border-radius: 12px;
  min-height: 112px;
  background: transparent;
}

@media (max-width: 1100px) {
  .pos-payment-layout {
    grid-template-columns: 1fr;
  }
  .pos-methods-grid,
  .pos-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   MOBILE & PWA RESPONSIVE LAYER (<= 1024px & <= 768px)
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #2b2b2e;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  z-index: 48;
  backdrop-filter: blur(2px);
}
.mobile-sidebar-backdrop.active {
  display: block;
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9ca3af;
  background: transparent;
  border: none;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.mob-tab.active {
  color: #1e78ff;
}
.mob-tab svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .sidebar {
    z-index: 60;
    transition: transform 0.22s ease;
  }
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 50;
  }
  .content-canvas {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .toast-container {
    bottom: 78px;
    right: 12px;
    left: 12px;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
  }
  .page-title {
    font-size: 17px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topbar-right::-webkit-scrollbar {
    display: none;
  }
  .control-pill {
    flex-shrink: 0;
    font-size: 12px;
    height: 32px;
    padding: 0 8px;
  }
  .content-canvas {
    padding: 12px !important;
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .billz-page-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }
  .billz-store-dropdown {
    width: 100%;
  }
  .billz-pill-bar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .billz-pill-tab {
    flex-shrink: 0;
  }
  .dash-two-col-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .dash-target-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .dash-target-grid > div {
    border-right: none !important;
    padding: 8px 14px !important;
  }
  .dash-target-subrow > div:first-child {
    padding-left: 24px !important;
  }
  #dash-target-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  .table-wrap,
  .billz-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 16px !important;
  }
  .pos-methods-grid,
  .pos-slots-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   LIGHT THEME GLOBAL HARMONIZATION (Soft, Eye-Friendly Daylight Mode)
   ========================================================================== */
body.light-theme .sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}
body.light-theme .sidebar .logo-text,
body.light-theme .sidebar .user-name,
body.light-theme .sidebar-group-header {
  color: #111827 !important;
}
body.light-theme .sidebar .nav-item {
  color: #3f4b5e !important;
}
body.light-theme .sidebar .nav-item:hover {
  background: var(--sidebar-hover) !important;
  color: #111827 !important;
}
body.light-theme .sidebar .nav-item.active {
  background: var(--sidebar-active-bg) !important;
  color: #1d64d8 !important;
}
body.light-theme .sidebar-user-chip,
body.light-theme .sidebar-support-btn {
  background: #dde2eb !important;
  border: 1px solid var(--border-color) !important;
  color: #273244 !important;
}
body.light-theme .topbar {
  background: var(--sidebar-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
}
body.light-theme .control-pill,
body.light-theme .theme-toggle-btn {
  background: #dde2eb !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}
body.light-theme .control-pill select,
body.light-theme .control-pill input {
  color: var(--text-main) !important;
}
body.light-theme .rate-pill input {
  color: #1d64d8 !important;
}
body.light-theme .pill-icon-store {
  background: rgba(29, 100, 216, 0.14);
  color: #1d64d8;
}
body.light-theme .pill-icon-rate {
  background: rgba(4, 120, 87, 0.14);
  color: #047857;
}
body.light-theme .pill-icon-role {
  background: rgba(126, 34, 206, 0.14);
  color: #7e22ce;
}
body.light-theme .topbar-dd-item.active {
  background: rgba(29, 100, 216, 0.13);
  color: #1d64d8;
}
body.light-theme .billz-card,
body.light-theme .card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  box-shadow: var(--card-glow) !important;
}
body.light-theme .billz-pill-bar {
  background: #d6dce6 !important;
}
body.light-theme .billz-pill-tab {
  color: #3f4b5e !important;
}
body.light-theme .billz-pill-tab.active {
  background: #eef1f6 !important;
  color: #111827 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1) !important;
}
body.light-theme .billz-store-dropdown {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}
body.light-theme .mobile-bottom-nav {
  background: var(--sidebar-bg) !important;
  border-top: 1px solid var(--border-color) !important;
}
body.light-theme .mob-tab {
  color: #475569 !important;
}
body.light-theme .mob-tab.active {
  color: #1d64d8 !important;
}
body.light-theme .modal-card {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
}
body.light-theme .btn-secondary,
body.light-theme .btn-dark {
  background: #dde2eb !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}
body.light-theme .btn-secondary:hover,
body.light-theme .btn-dark:hover {
  background: #d2d8e3 !important;
}
body.light-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body.light-theme select,
body.light-theme textarea {
  background-color: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-color);
}
body.light-theme .control-pill input {
  background-color: transparent !important;
}

/* Override hardcoded dark inline surfaces & white text across modules, modals & drawers */
body.light-theme #apex-account-drawer {
  background: var(--bg-card) !important;
  border-right: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  box-shadow: 12px 0 36px rgba(15, 23, 42, 0.16) !important;
}
body.light-theme [style*="background:#1118"],
body.light-theme [style*="background:#1414"],
body.light-theme [style*="background:#1818"],
body.light-theme [style*="background:#1c1c"],
body.light-theme [style*="background: #1c1c"],
body.light-theme [style*="background:#1e1e"],
body.light-theme [style*="background:#1e29"],
body.light-theme [style*="background:#1f1f"],
body.light-theme [style*="background:#2020"],
body.light-theme [style*="background:#222"],
body.light-theme [style*="background:#2323"],
body.light-theme [style*="background:#2424"],
body.light-theme [style*="background: #2424"],
body.light-theme [style*="background:#2525"],
body.light-theme [style*="background:#2626"],
body.light-theme [style*="background:#2727"],
body.light-theme [style*="background:#2828"],
body.light-theme [style*="background:#2929"],
body.light-theme [style*="background:#2a2a"],
body.light-theme [style*="background:#2b2b"],
body.light-theme [style*="background: #2b2b"],
body.light-theme [style*="background:#2c2c"],
body.light-theme [style*="background:#2e2e"],
body.light-theme [style*="background:#2f2f"],
body.light-theme [style*="background:#3232"],
body.light-theme [style*="background:#333"],
body.light-theme [style*="background:#3838"],
body.light-theme [style*="background:#3a3a"],
body.light-theme [style*="background:#3d3d"],
body.light-theme [style*="background:#3f3f"],
body.light-theme [style*="background: rgb(28, 28, 28)"],
body.light-theme [style*="background: rgb(30, 30, 30)"],
body.light-theme [style*="background: rgb(31, 31, 31)"],
body.light-theme [style*="background: rgb(32, 32, 32)"],
body.light-theme [style*="background: rgb(34, 34, 34)"],
body.light-theme [style*="background: rgb(35, 35, 35)"],
body.light-theme [style*="background: rgb(36, 36, 36)"],
body.light-theme [style*="background: rgb(37, 37, 37)"],
body.light-theme [style*="background: rgb(38, 38, 38)"],
body.light-theme [style*="background: rgb(39, 39, 39)"],
body.light-theme [style*="background: rgb(40, 40, 40)"],
body.light-theme [style*="background: rgb(41, 41, 41)"],
body.light-theme [style*="background: rgb(42, 42, 42)"],
body.light-theme [style*="background: rgb(43, 43, 43)"],
body.light-theme [style*="background: rgb(44, 44, 44)"],
body.light-theme [style*="background: rgb(46, 46, 46)"],
body.light-theme [style*="background: rgb(47, 47, 47)"],
body.light-theme [style*="background: rgb(50, 50, 50)"],
body.light-theme [style*="background: rgb(51, 51, 51)"],
body.light-theme [style*="background: rgb(56, 56, 56)"],
body.light-theme [style*="background: rgb(58, 58, 58)"],
body.light-theme [style*="background: rgb(61, 61, 64)"],
body.light-theme [style*="background: rgb(63, 63, 70)"] {
  background: #e5e9f0 !important;
  border-color: #cbd3df !important;
}

body.light-theme .main-area button[style*="background:#3232"] {
  background: #d2e1f8 !important;
  color: #1d64d8 !important;
  border: 1px solid #b6cef2 !important;
}
body.light-theme button[style*="background:#333"],
body.light-theme button[style*="background:#2626"],
body.light-theme button[style*="background:#3a3a"] {
  background: #d8dfe9 !important;
  border: 1px solid #c2cbd8 !important;
  color: #1a2233 !important;
}

body.light-theme .main-area tr[style*="background:#2b2b"],
body.light-theme .main-area tr[style*="background:#2424"] {
  background: #e2e6ee !important;
}
body.light-theme .main-area tr[style*="background:#222"],
body.light-theme .main-area tr[style*="background:#1f1f"] {
  background: #eef1f6 !important;
}

body.light-theme [style*="color:#fff"],
body.light-theme [style*="color: #fff"],
body.light-theme [style*="color:#ffffff"],
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color:#f3f4f6"],
body.light-theme [style*="color:#e5e7eb"],
body.light-theme [style*="color:#d1d5db"] {
  color: #1a2233 !important;
}

body.light-theme [style*="color:#9ca3af"] {
  color: #475569 !important;
}

/* Keep white text on primary blue, green, red, dark action buttons */
body.light-theme button[style*="background:#1e78ff"],
body.light-theme button[style*="background: #1e78ff"],
body.light-theme button[style*="background:#2563eb"],
body.light-theme button[style*="background: #2563eb"],
body.light-theme button[style*="background:#16a34a"],
body.light-theme button[style*="background:#ef4444"],
body.light-theme .btn-primary {
  color: #ffffff !important;
}
body.light-theme button[style*="background:#1e78ff"],
body.light-theme button[style*="background: #1e78ff"],
body.light-theme .btn-primary {
  background-color: #1e78ff !important;
}
body.light-theme button[style*="background:#2563eb"],
body.light-theme button[style*="background: #2563eb"] {
  background-color: #2563eb !important;
}
body.light-theme button[style*="background:#16a34a"] {
  background-color: #16a34a !important;
}
body.light-theme button[style*="background:#ef4444"] {
  background-color: #ef4444 !important;
}

/* 2D rectangular "Создать" button in POS client header */
.pos-client-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff !important;
  background: #2563eb !important;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
.pos-client-create-btn:hover {
  background: #1d4ed8 !important;
  border-color: #60a5fa;
}
.pos-client-create-btn:active {
  background: #1e40af !important;
}

/* Interactive hover differentiation across cards, sections, tables & buttons */
.main-area div[onclick][style*="cursor:pointer"],
.main-area div[onclick][style*="cursor: pointer"] {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.main-area div[onclick][style*="cursor:pointer"]:hover,
.main-area div[onclick][style*="cursor: pointer"]:hover {
  transform: translateY(-2px);
  border-color: #3b82f6 !important;
  box-shadow: 0 8px 22px rgba(30, 120, 255, 0.18), 0 0 0 1px rgba(59, 130, 246, 0.32) !important;
}

body.light-theme .main-area div[onclick][style*="cursor:pointer"]:hover,
body.light-theme .main-area div[onclick][style*="cursor: pointer"]:hover {
  background: #dde4f0 !important;
  border-color: #1d64d8 !important;
  box-shadow: 0 8px 20px rgba(29, 100, 216, 0.14), 0 0 0 1px rgba(29, 100, 216, 0.25) !important;
}

.sidebar .nav-item,
.sidebar-subitem,
.sidebar-support-btn,
.sidebar-user-chip {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar .nav-item:hover,
.sidebar-subitem:hover {
  transform: none;
}

.sidebar-support-btn:hover,
.sidebar-user-chip:hover {
  border-color: rgba(59, 130, 246, 0.35) !important;
}

.main-area tbody tr {
  transition: background-color 0.12s ease;
}

.main-area tbody tr:hover {
  background: var(--bg-row-hover) !important;
}

.main-area button[onclick],
.control-pill,
.btn {
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, filter 0.15s ease;
}

.main-area button[onclick]:hover:not(:disabled),
.control-pill:hover,
.btn:hover:not(:disabled) {
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow: 0 4px 12px rgba(30, 120, 255, 0.14);
}
