/* ================= SOFT UI DESIGN TOKENS ================= */
:root {
  --font-logo: 'Bitcount Grid Single', monospace;
  --font-brand: 'Space Grotesk', sans-serif;
  --font-sans: 'Space Grotesk', sans-serif;
  --font-table-header: 'Smooch Sans', sans-serif;
  --ink: #212220;
  --violet: #958CE8;
  --sky: #ACD1FD;
  --mist: #DBDBE5;
  --navy: #041A53;
  --success: #2ea36f;
  --warning: #b98224;
  --danger: #d65353;
  --info: #377fb2;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 50%;
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
}

body,
body[data-theme="light"] {
  --bg-primary: #DBDBE5;
  --bg-secondary: #E7E7EF;
  --bg-panel: #DBDBE5;
  --bg-elevated: #E7E7EF;
  --bg-input: #DBDBE5;
  --bg-soft: rgba(255, 255, 255, 0.4);
  --text-main: #041A53;
  --text-muted: rgba(4, 26, 83, 0.65);
  --text-strong: #041A53;
  --border-color: rgba(4, 26, 83, 0.08);
  --border-hover: rgba(149, 140, 232, 0.4);
  --color-primary: #958CE8;
  --color-primary-hover: #8277dc;
  --color-secondary: #ACD1FD;
  --color-success: #2ea36f;
  --color-warning: #b98224;
  --color-danger: #d65353;
  --color-info: #377fb2;
  --color-id-sku: #8277f2;
  --glass-bg: #E7E7EF;
  --soft-shadow: 4px 4px 8px rgba(0,0,0,0.08), -4px -4px 8px rgba(255,255,255,0.8);
  --soft-shadow-sm: 2px 2px 5px rgba(0,0,0,0.06), -2px -2px 5px rgba(255,255,255,0.7);
  --soft-inset: inset 3px 3px 6px rgba(0,0,0,0.06), inset -3px -3px 6px rgba(255,255,255,0.7);
  --focus-ring: 0 0 0 4px rgba(149, 140, 232, 0.18);
}

body[data-theme="dark"] {
  --bg-primary: #212220;
  --bg-secondary: #2B2C29;
  --bg-panel: #212220;
  --bg-elevated: #2B2C29;
  --bg-input: #212220;
  --bg-soft: rgba(172, 209, 253, 0.06);
  --text-main: #DBDBE5;
  --text-muted: rgba(219, 219, 229, 0.66);
  --text-strong: #ACD1FD;
  --border-color: rgba(219, 219, 229, 0.08);
  --border-hover: rgba(172, 209, 253, 0.28);
  --color-primary: #958CE8;
  --color-primary-hover: #aca5f2;
  --color-secondary: #ACD1FD;
  --color-success: #7dd9aa;
  --color-warning: #e5bf73;
  --color-danger: #ff8a8a;
  --color-info: #ACD1FD;
  --color-id-sku: #a552d9;
  --glass-bg: #2B2C29;
  --soft-shadow: 3px 3px 6px rgba(0,0,0,0.45), -3px -3px 6px rgba(255,255,255,0.03);
  --soft-shadow-sm: 2px 2px 4px rgba(0,0,0,0.35), -2px -2px 4px rgba(255,255,255,0.02);
  --soft-inset: inset 2px 2px 5px rgba(0,0,0,0.4), inset -2px -2px 5px rgba(255,255,255,0.02);
  --focus-ring: 0 0 0 4px rgba(172, 209, 253, 0.13);
}

/* ================= BASIC RESET & LAYOUT ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text-main);
  background: var(--bg-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(149, 140, 232, 0.36);
  border-radius: 999px;
}

/* ================= UTILITY CLASSES ================= */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--soft-shadow);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-id-sku { color: var(--color-id-sku); font-size: 11px; font-weight: normal; font-family: monospace; }
.text-green { color: var(--color-success); }
.text-yellow { color: var(--color-warning); }
.text-red { color: var(--color-danger); }
.hidden { display: none !important; }
.pulses { animation: pulseAnim 2s infinite; }
.col-span-2 { grid-column: span 2 / span 2; }
.font-bold { font-weight: 500; }

@keyframes pulseAnim {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(149, 140, 232, 0.34); }
  70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(149, 140, 232, 0); }
  100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(149, 140, 232, 0); }
}

@keyframes indicatorPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ================= AUTHENTICATION ================= */
body.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 24px;
}

.login-container {
  width: min(100%, 460px);
  padding: 36px;
}

.login-theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
}

.brand-section {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo,
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: var(--navy);
  background: linear-gradient(145deg, var(--sky), var(--violet));
  box-shadow: var(--soft-shadow-sm);
  font-family: var(--font-brand);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-logo {
  margin-bottom: 16px;
}

.brand-name {
  color: var(--text-strong);
  font-family: var(--font-logo);
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.brand-tagline,
.card-subtitle,
.settings-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.tab-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 24px;
}

.filters {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tab-btn,
.filter-chip {
  flex: 1;
  border: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-fast);
}

.tab-btn {
  padding: 11px 14px;
}

.filter-chip {
  padding: 8px 13px;
  font-size: 12px;
}

.expandable-filters {
  display: inline-flex;
  gap: 0;
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.expandable-filters:hover,
.expandable-filters:focus-within,
.expandable-filters.expanded {
  gap: 6px;
}

.expandable-filters .filter-chip {
  flex: none; /* Override flex: 1 normally on .filter-chip */
}

.expandable-filters .filter-chip:not(.active) {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  opacity: 0;
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.expandable-filters:hover .filter-chip:not(.active),
.expandable-filters:focus-within .filter-chip:not(.active),
.expandable-filters.expanded .filter-chip:not(.active) {
  max-width: 120px;
  padding-left: 13px;
  padding-right: 13px;
  opacity: 1;
}

.tab-btn.active,
.filter-chip.active {
  color: var(--navy);
  background: linear-gradient(145deg, var(--sky), var(--violet));
  box-shadow: var(--soft-shadow-sm);
}

.auth-card {
  display: none;
}

.auth-card.active {
  display: block;
}

.card-title,
.view-title {
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-weight: 500;
  letter-spacing: 0;
}

.settings-title,
.modal-header h3 {
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-weight: 500;
  letter-spacing: 0;
}

.card-title {
  font-size: 22px;
  margin-bottom: 8px;
}

/* ================= FORMS & CONTROLS ================= */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.form-group label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select,
.search-bar input,
.compact-table input,
.compact-table select,
.badge {
  width: 100%;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: var(--soft-inset);
  outline: none;
  transition: var(--transition-fast);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 13px 16px;
  font-size: 14px;
}

.form-group textarea {
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.search-bar input:focus,
.compact-table input:focus,
.compact-table select:focus {
  border-color: var(--border-hover);
  box-shadow: var(--soft-inset), var(--focus-ring);
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .col {
  flex: 1;
}

.input-tip,
.demo-tip {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 6px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 22px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ================= BUTTONS ================= */
.btn,
.theme-toggle,
.close-btn {
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.btn:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--navy);
  background: linear-gradient(145deg, var(--sky), var(--violet));
  box-shadow: var(--soft-shadow-sm);
}

.btn-primary:hover {
  filter: saturate(1.08) brightness(1.05);
  box-shadow: var(--soft-shadow);
}

.btn-secondary,
.btn-logout,
.theme-toggle,
.close-btn {
  color: var(--text-main);
  background: var(--bg-elevated);
  box-shadow: var(--soft-shadow-sm);
}

.btn-secondary:hover,
.btn-logout:hover,
.close-btn:hover {
  border-color: var(--border-hover);
}

.btn-block {
  width: 100%;
}

.button-row,
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-logout {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--text-muted);
}

.btn-google {
  color: var(--ink);
  background: #f7f7fb;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 14px;
}

.theme-toggle i,
.theme-toggle svg {
  width: 14px !important;
  height: 14px !important;
}

/* ================= ONBOARDING AND ALERTS ================= */
.pending-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--sky), var(--violet));
  box-shadow: var(--soft-shadow-sm);
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pending-status-box,
.demo-tip,
.order-summary-box,
.csv-sample-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  box-shadow: var(--soft-inset);
}

.pending-status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  margin: 20px 0;
  font-size: 13px;
}

.status-indicator,
.indicator-dot {
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background: var(--color-warning);
}

.pending-description {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 22px;
}

.pending-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-input);
  box-shadow: var(--soft-inset);
  margin-bottom: 26px;
}

.pending-progress-bar .bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--violet));
  animation: loadingAnim 3s infinite alternate;
}

@keyframes loadingAnim {
  0% { width: 34%; }
  100% { width: 92%; }
}

.demo-tip {
  padding: 12px;
  text-align: center;
}

.alert {
  position: relative;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--soft-shadow-sm);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 15px;
}

.alert-error { color: var(--color-danger); background: rgba(214, 83, 83, 0.12); }
.alert-success { color: var(--color-success); background: rgba(46, 163, 111, 0.12); }
.alert-info { color: var(--color-info); background: rgba(172, 209, 253, 0.18); }

#mainAlertBanner {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1200;
  max-width: min(420px, calc(100vw - 40px));
}

/* ================= MAIN APP LAYOUT ================= */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 18px;
  background: var(--bg-panel);
  border-right: 0;
  box-shadow: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 6px 22px;
}

.logo-name {
  display: block;
  color: var(--text-strong);
  font-family: var(--font-logo);
  font-size: 19px;
  font-weight: bold;
}

.logo-badge,
.profile-role {
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 10px 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: var(--transition-fast);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--bg-input);
  box-shadow: var(--soft-inset);
  color: var(--text-muted);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text-strong);
  background: var(--bg-elevated);
  border-color: var(--border-color);
  box-shadow: var(--soft-shadow-sm);
}

.nav-item.active .nav-icon {
  background: linear-gradient(145deg, var(--sky), var(--violet));
  color: var(--navy);
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--soft-shadow-sm);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: var(--navy);
  background: linear-gradient(145deg, var(--sky), var(--violet));
  font-weight: 500;
}

.profile-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.profile-name {
  max-width: 160px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.content-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 0 30px;
  height: 72px;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

body[data-theme="dark"] .content-header {
  background: transparent;
}

.view-title {
  font-size: 24px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.header-actions,
.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  box-shadow: var(--soft-shadow-sm);
  font-size: 11px;
  font-weight: 500;
}

.indicator-dot {
  width: 8px;
  height: 8px;
}

.indicator-dot.green { background: var(--color-success); }
.indicator-dot.red { background: var(--color-danger); }
.indicator-dot.pulse {
  background: var(--color-primary);
  animation: indicatorPulse 1.5s infinite;
}

.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.content-view {
  display: none;
}

.content-view.active {
  display: block;
}

/* ================= DASHBOARD ================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}

.metric-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 132px;
  padding: 24px;
  transition: var(--transition-normal);
}

.metric-card:hover,
.dashboard-card:hover,
.settings-card:hover {
  transform: translateY(-2px);
}

.metric-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.metric-value {
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 500;
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--bg-input);
  box-shadow: var(--soft-inset);
}

.metric-icon.bg-blue { color: var(--color-info); }
.metric-icon.bg-green { color: var(--color-success); }
.metric-icon.bg-yellow { color: var(--color-warning); }
.metric-icon.bg-purple { color: var(--color-primary); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.dashboard-card,
.settings-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.card-header {
  margin-bottom: 16px;
}

.card-headline {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 500;
}

.chart-wrapper {
  position: relative;
  flex: 1;
  min-height: 260px;
}

/* ================= TABLES ================= */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.search-bar input {
  width: min(340px, calc(100vw - 48px));
  padding: 12px 16px;
  font-size: 13px;
}

.card-table-container {
  overflow: hidden;
  position: relative;
}

.mobile-expand-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  box-shadow: var(--soft-shadow-sm);
}

@media (max-width: 820px) {
  .mobile-expand-btn {
    display: inline-flex;
  }
}

.expanded-table .mobile-expand-btn {
  background: var(--sky);
  color: var(--navy);
  border-color: var(--sky);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.main-table,
.compact-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.main-table {
  font-size: 13px;
}

.compact-table {
  font-size: 12px;
}

.main-table th,
.main-table td,
.compact-table th,
.compact-table td {
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.main-table th,
.main-table td {
  padding: 16px 18px;
}

.compact-table th,
.compact-table td {
  padding: 10px 12px;
}

.main-table th,
.compact-table th {
  color: var(--text-muted);
  background: var(--bg-soft);
  font-family: var(--font-table-header);
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.main-table tbody tr,
.compact-table tbody tr {
  transition: var(--transition-fast);
}

.main-table tbody tr:hover,
.compact-table tbody tr:hover {
  background: rgba(172, 209, 253, 0.1);
}

code,
pre {
  color: var(--text-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
}

.badge-pending { color: var(--color-warning); }
.badge-confirmed { color: var(--color-primary); }
.badge-completed { color: var(--color-success); }
.badge-cancelled { color: var(--color-danger); }

.btn-action-group {
  display: flex;
  gap: 7px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-main);
  background: var(--bg-hover, rgba(0,0,0,0.05));
  transform: translateY(-1px);
}

.btn-icon svg {
  width: 16px !important;
  height: 16px !important;
  display: block;
}

.payment-proof-thumb {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  box-shadow: var(--soft-shadow-sm);
  cursor: zoom-in;
  transition: var(--transition-fast);
}

.payment-proof-thumb:hover {
  transform: scale(1.08);
}

.receipt-empty {
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}

/* ================= SETTINGS AND MODALS ================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 24px;
}

.settings-title {
  font-size: 19px;
  margin-bottom: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  opacity: 0;
  pointer-events: none;
  background: rgba(4, 26, 83, 0.28);
  backdrop-filter: blur(12px);
  transition: opacity 0.25s ease;
}

body[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.54);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(100%, 520px);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 30px;
  transform: translateY(16px);
  transition: transform 0.25s ease;
  border-radius: var(--radius-lg);
}

.modal-large {
  width: min(100%, 960px);
  max-width: 960px;
}

#categoryModal {
  z-index: 1050;
}
#categoryModal .modal-card {
  margin-left: 15%;
  margin-top: -10%;
}
@media (max-width: 768px) {
  #categoryModal .modal-card {
    margin-left: 0;
    margin-top: 0;
  }
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 22px;
}

.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 14px;
  font-size: 24px;
  line-height: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 28px;
}

.border-left {
  border-left: 1px solid var(--border-color);
  padding-left: 28px;
}

.form-subtitle {
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.order-items-builder {
  max-height: 230px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  box-shadow: var(--soft-inset);
  margin-bottom: 15px;
}

.order-summary-box {
  padding: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 9px;
}

.summary-line.total {
  color: var(--text-strong);
  border-top: 1px dashed var(--border-color);
  font-size: 15px;
  font-weight: 500;
  margin: 12px 0 0;
  padding-top: 12px;
}

.csv-sample-box {
  padding: 14px;
  margin-bottom: 18px;
  font-family: 'M PLUS Code Latin', monospace;
  font-size: 11px;
  overflow-x: auto;
}

/* ================= PRINTING ================= */
.print-only {
  display: none;
}

@media print {
  @page {
    margin: 0;
  }

  body > *:not(.print-only) {
    display: none !important;
  }

  .print-only,
  .print-only * {
    display: block !important;
  }

  .print-only {
    position: static;
    width: 100%;
    padding: 0;
    margin: 0;
  }
}

/* ================= INVOICE STYLES (Print & Preview) ================= */
.receipt-container {
  width: auto;
  margin: 0 auto;
  text-align: center;
  color: #000;
  font-family: 'Manrope', sans-serif;
}

.receipt-header h2 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 2px;
  color: #000;
}

.receipt-header p,
.receipt-footer {
  font-size: 12px;
  color: #000;
}

.receipt-divider {
  border-top: 1px dashed #000;
  margin: 6px 0;
}

.receipt-details {
  text-align: left;
  font-size: 12px;
  line-height: 1.4;
  margin: 8px 0;
  color: #000;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
  color: #000;
}

.receipt-table th {
  border-bottom: 1.5px solid #000;
  text-align: left;
  padding-bottom: 4px;
  font-family: var(--font-table-header);
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.receipt-table th.right-align {
  text-align: right;
}

.receipt-table td {
  padding: 4px 0;
  text-align: left;
}
.receipt-table td.right-align {
  text-align: right;
}

.receipt-totals {
  text-align: right;
  font-size: 12px;
  line-height: 1.5;
  color: #000;
}

.receipt-totals .bold {
  font-weight: 500;
  font-size: 14px;
}

.receipt-footer {
  margin-top: 15px;
  font-style: italic;
  font-size: 12px;
  color: #000;
}

.receipt-short-divider {
  border-top: 1px dashed #000;
  width: 50%;
  margin: 4px 0 4px auto;
}

/* 2-inch format specific sizes */
.receipt-size-2 .receipt-header h2 { font-size: 14px; }
.receipt-size-2 .receipt-header p,
.receipt-size-2 .receipt-footer { font-size: 10px; }
.receipt-size-2 .receipt-details { font-size: 10px; margin: 4px 0; }
.receipt-size-2 .receipt-table { font-size: 10px; }
.receipt-size-2 .receipt-totals { font-size: 10px; }
.receipt-size-2 .receipt-totals .bold { font-size: 12px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .col-span-2 {
    grid-column: auto;
  }

  .content-header {
    grid-template-columns: 1fr;
    height: auto;
    padding: 16px 20px;
    padding-bottom: 24px;
    gap: 12px;
    position: relative;
  }

  .header-actions {
    position: absolute;
    top: 16px;
    right: 20px;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .theme-toggle i,
  .theme-toggle svg {
    width: 12px !important;
    height: 12px !important;
  }

  .header-actions,
  .header-status {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 74px; /* Space for the bottom nav */
  }

  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    height: 70px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar-header {
    padding: 0;
    margin: 0;
    gap: 10px;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .logo-name {
    font-size: 16px;
  }

  .sidebar-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    gap: 0;
    box-shadow: var(--soft-shadow-sm);
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    padding: 6px 4px;
    border-radius: 8px;
    background: transparent;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-item.active {
    background: transparent;
    color: var(--sky);
  }
  
  .nav-item.active .nav-icon {
    background: rgba(149, 140, 232, 0.15);
    color: var(--sky);
  }

  .sidebar-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0;
    border-top: 0;
  }

  .user-profile {
    display: none; /* Hide profile info on mobile header, just show logout or avatar */
  }

  .btn-logout {
    padding: 6px 12px;
    font-size: 12px;
  }

  .view-container,
  .content-header {
    padding: 16px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .border-left {
    border-left: 0;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 24px;
  }
  
  .order-split-view {
    display: flex;
    flex-direction: column-reverse;
  }
  
  .pos-cart-panel {
    border-left: none;
    border-bottom: 1px solid var(--border-color);
    max-height: 50vh;
    overflow-y: auto;
  }
  .nav-item:nth-child(1) { order: 3; } /* Dashboard */
  .nav-item:nth-child(2) { order: 1; } /* Orders */
  .nav-item:nth-child(3) { order: 2; } /* Inventory */
  .nav-item:nth-child(4) { order: 4; } /* Customers */
  .nav-item:nth-child(5) { order: 5; } /* Settings */
  .nav-item:nth-child(6) { display: none; } /* Super Admin hidden on mobile */

  /* Hide unnecessary table columns for mobile - overridden by .expanded-table */
  #ordersView .card-table-container:not(.expanded-table) .main-table th:nth-child(1),
  #ordersView .card-table-container:not(.expanded-table) .main-table td:nth-child(1),
  #ordersView .card-table-container:not(.expanded-table) .main-table th:nth-child(4),
  #ordersView .card-table-container:not(.expanded-table) .main-table td:nth-child(4),
  #ordersView .card-table-container:not(.expanded-table) .main-table th:nth-child(6),
  #ordersView .card-table-container:not(.expanded-table) .main-table td:nth-child(6),
  #ordersView .card-table-container:not(.expanded-table) .main-table th:nth-child(7),
  #ordersView .card-table-container:not(.expanded-table) .main-table td:nth-child(7) {
    display: none !important;
  }

  #inventoryView .card-table-container:not(.expanded-table) .main-table th:nth-child(4),
  #inventoryView .card-table-container:not(.expanded-table) .main-table td:nth-child(4),
  #inventoryView .card-table-container:not(.expanded-table) .main-table th:nth-child(5),
  #inventoryView .card-table-container:not(.expanded-table) .main-table td:nth-child(5),
  #inventoryView .card-table-container:not(.expanded-table) .main-table th:nth-child(8),
  #inventoryView .card-table-container:not(.expanded-table) .main-table td:nth-child(8) {
    display: none !important;
  }

  #customersView .card-table-container:not(.expanded-table) .main-table th:nth-child(3),
  #customersView .card-table-container:not(.expanded-table) .main-table td:nth-child(3),
  #customersView .card-table-container:not(.expanded-table) .main-table th:nth-child(4),
  #customersView .card-table-container:not(.expanded-table) .main-table td:nth-child(4),
  #customersView .card-table-container:not(.expanded-table) .main-table th:nth-child(6),
  #customersView .card-table-container:not(.expanded-table) .main-table td:nth-child(6),
  #customersView .card-table-container:not(.expanded-table) .main-table th:nth-child(7),
  #customersView .card-table-container:not(.expanded-table) .main-table td:nth-child(7) {
    display: none !important;
  }

  /* Admin table (part of app but in root view maybe? actually no view wrapper for admin user table. Wait, it's just in a section but does it have an ID?) let's skip admin, mostly desktop use anyway */
  
  /* Hide connection indicators on non-settings mobile views */
  body:not([data-active-view="settings"]) .header-status {
    display: none;
  }

}

@media (max-width: 560px) {
  body.login-page {
    align-items: flex-start;
    padding: 78px 16px 16px;
  }

  .login-container,
  .modal-card {
    padding: 24px;
  }

  .form-row,
  .button-row,
  .button-group,
  .modal-footer {
    flex-direction: column;
  }

  .btn,
  .button-group .btn,
  .modal-footer .btn {
    width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .metric-card {
    padding: 16px 12px;
  }

  #invoicePreviewModal .modal-card {
    width: 90%;
    max-width: 340px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .metric-value {
    font-size: 18px;
  }

  .dashboard-grid {
    gap: 16px;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .main-table th {
    padding: 10px 8px;
    white-space: nowrap;
    font-size: inherit;
  }
  .main-table td {
    padding: 10px 8px;
    white-space: nowrap;
    font-size: 12px;
  }
}

/* ================= ORDER CATALOG UI ================= */
.order-catalog-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  height: calc(100vh - 120px);
  margin: -30px; /* offset modal padding to be full flush */
  border-radius: inherit;
  overflow: hidden;
}
.modal-col {
  display: flex;
  flex-direction: column;
  padding: 30px;
  overflow-y: auto;
}
.catalog-col {
  background: var(--bg-elevated);
  min-height: 50vh;
}
.cart-col {
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-color);
}
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-elevated);
  margin-bottom: 24px;
}
.pos-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: 20px;
  padding: 0 16px;
  flex: 1;
  max-width: 300px;
}
.pos-search-wrapper .search-icon {
  color: #a78bfa; /* purple tint matching image */
  margin-right: 8px;
}
.pos-search-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 100%;
  padding: 10px 0;
}
.pos-search-wrapper input:focus {
  outline: none;
}
.pos-search-wrapper input::placeholder {
  color: var(--text-muted);
}
.pos-category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pos-category-chips::-webkit-scrollbar {
  display: none;
}
.pos-filter-chip {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-input);
  border: none;
  color: #a1a1aa; /* inactive gray */
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.pos-filter-chip.active {
  background: #a78bfa; /* Light purple */
  color: #fff;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  align-content: start;
}
.product-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--soft-shadow);
  border-color: var(--color-primary);
}
.product-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}
.prod-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}
.placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
}
.prod-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}
.prod-price {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
}
.prod-stock {
  font-size: 11px;
  font-weight: 500;
}
.cart-items-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  overflow: hidden;
  margin-bottom: 16px;
}
.cart-title {
  padding: 12px;
  margin: 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elevated);
}
.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
}
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  gap: 12px;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-qty {
  width: 50px;
  padding: 4px;
  text-align: center;
  font-size: 12px;
}
.cart-price {
  width: 80px;
  padding: 4px;
  text-align: right;
  font-size: 12px;
}
.order-summary-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.summary-line.total {
  font-size: 16px;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-bottom: 0;
}
.customer-info-box {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 820px) {
  .order-catalog-grid {
    grid-template-columns: 1fr;
    height: auto;
    margin: 0;
  }
}

/* ================= CALCULATOR ================= */
.floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--sky), var(--violet));
  border: none;
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.floating-btn:hover {
  transform: scale(1.05);
}

.calculator-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--soft-shadow);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.calc-header h4 { margin: 0; font-size: 16px; }
.calc-display {
  width: 100%;
  height: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 28px;
  text-align: right;
  padding: 8px 12px;
  margin-bottom: 12px;
  color: var(--text-main);
  outline: none;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.calc-btn {
  height: 48px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}
.calc-btn:hover {
  background: var(--border-color);
}
.calc-btn:active {
  transform: translateY(2px);
}
.calc-zero {
  grid-column: span 2;
}
.calc-clear {
  grid-column: span 2;
  color: var(--color-danger);
}
.calc-op {
  color: var(--sky);
}
.calc-equal {
  background: linear-gradient(145deg, var(--sky), var(--violet));
  color: white;
  border: none;
}
.calc-equal:hover {
  filter: brightness(1.1);
}

@media (max-width: 820px) {
  .floating-btn {
    bottom: 110px;
    width: 48px;
    height: 48px;
  }
  .floating-btn i {
    width: 20px;
    height: 20px;
  }
  .calculator-panel {
    bottom: 166px;
  }
}

/* ================= MOBILE CATALOG FIX ================= */
@media (max-width: 560px) {
  .catalog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .pos-search-wrapper {
    max-width: 100%;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .product-card {
    padding: 8px;
    gap: 4px;
  }
  .product-card .prod-name {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .product-card .prod-price {
    font-size: 11px;
  }
  .product-card .prod-stock {
    font-size: 10px;
  }
  .pos-category-chips {
    justify-content: flex-start;
  }
}

/* ================= PAGINATION ================= */
.table-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
  margin-top: 16px;
}
.pagination-summary {
  color: var(--text-muted);
  font-size: 14px;
}
.pagination-summary strong {
  color: var(--text-strong);
  font-weight: 600;
}
.order-summary-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.summary-line.total {
  font-size: 16px;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-bottom: 0;
}
.customer-info-box {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 820px) {
  .order-catalog-grid {
    grid-template-columns: 1fr;
    height: auto;
    margin: 0;
  }
}

/* ================= CALCULATOR ================= */
.floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--sky), var(--violet));
  border: none;
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.floating-btn:hover {
  transform: scale(1.05);
}

.calculator-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--soft-shadow);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.calc-header h4 { margin: 0; font-size: 16px; }
.calc-display {
  width: 100%;
  height: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 28px;
  text-align: right;
  padding: 8px 12px;
  margin-bottom: 12px;
  color: var(--text-main);
  outline: none;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.calc-btn {
  height: 48px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}
.calc-btn:hover {
  background: var(--border-color);
}
.calc-btn:active {
  transform: translateY(2px);
}
.calc-zero {
  grid-column: span 2;
}
.calc-clear {
  grid-column: span 2;
  color: var(--color-danger);
}
.calc-op {
  color: var(--sky);
}
.calc-equal {
  background: linear-gradient(145deg, var(--sky), var(--violet));
  color: white;
  border: none;
}
.calc-equal:hover {
  filter: brightness(1.1);
}

@media (max-width: 820px) {
  .floating-btn {
    bottom: 110px;
    width: 48px;
    height: 48px;
  }
  .floating-btn i {
    width: 20px;
    height: 20px;
  }
  .calculator-panel {
    bottom: 166px;
  }
}

/* ================= MOBILE CATALOG FIX ================= */
@media (max-width: 560px) {
  .catalog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .pos-search-wrapper {
    max-width: 100%;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .product-card {
    padding: 8px;
    gap: 4px;
  }
  .product-card .prod-name {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .product-card .prod-price {
    font-size: 11px;
  }
  .product-card .prod-stock {
    font-size: 10px;
  }
  .pos-category-chips {
    justify-content: flex-start;
  }
}

/* ================= PAGINATION ================= */
.table-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
  margin-top: 16px;
}

.pagination-summary {
  color: var(--text-muted);
  font-size: 14px;
}
.pagination-summary strong {
  color: var(--text-strong);
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 38px;
  transition: var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--color-primary);
}

.pagination-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-nav {
  padding: 8px 10px;
  border: none;
}

.pagination-btn.pagination-nav:hover:not(:disabled) {
  border-color: transparent;
  color: var(--color-primary);
}

/* ================= ROW ACTION MENU ================= */
.row-action-menu {
  position: relative;
  display: inline-block;
}

.row-action-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.row-action-trigger:hover {
  background: var(--bg-elevated);
  color: var(--color-primary);
}

.row-action-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--soft-shadow);
  z-index: 100;
  display: none;
  flex-direction: column;
  padding: 6px;
}

.row-action-menu.open .row-action-dropdown {
  display: flex;
}

.row-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  border-radius: 6px;
  transition: var(--transition-fast);
}

.row-action-item:hover {
  background: var(--bg-elevated);
}

.row-action-item.danger {
  color: var(--color-danger);
}

.row-action-item.danger:hover {
  background: rgba(214, 83, 83, 0.1);
}

.row-action-item i {
  width: 16px;
  height: 16px;
}
