/* ============== Tokens (Premium Light) ============== */
:root {
  --bg: #f8fafc;
  --bg-grad: radial-gradient(1000px 800px at 0% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
    radial-gradient(900px 700px at 100% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 60%),
    #f1f5f9;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-2: rgba(255, 255, 255, 0.9);
  --surface-3: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #475569;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --primary: #f59e0b;
  --primary-2: #d97706;
  --primary-soft: rgba(245, 158, 11, 0.1);
  --primary-glow: 0 10px 24px -8px rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 30px -8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --grad-primary: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-grad);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* Glassmorphism Util */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* ============== Login ============== */
.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg-grad);
  padding: 20px;
  z-index: 100;
}

.login-card {
  width: 100%;
  max-width: 380px;
  border-radius: 24px;
  padding: 32px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  animation: pop .35s cubic-bezier(.2, .9, .3, 1.2);
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand h1 {
  margin: 12px 0 4px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.login-brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.brand-logo.big {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin: 0 auto;
  box-shadow: var(--primary-glow);
}

.login-roles {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  margin-bottom: 18px;
}

.role-pill {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .2s;
}

.role-pill.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.login-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 10px 0 6px;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.login-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 16px;
  margin-top: 8px;
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--primary-glow);
  transition: transform .15s;
}

.login-btn:hover {
  transform: translateY(-1px);
}

.login-hint {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ============== App layout ============== */
.app {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: 100vh;
  gap: 16px;
  padding: 16px;
}

.app.admin-active {
  grid-template-columns: 1fr;
}

/* ============== Sidebar ============== */
.sidebar {
  position: fixed;
  top: 16px;
  left: -280px;
  bottom: 16px;
  width: 260px;
  border-radius: var(--radius-xl);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
  z-index: 1000;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.sidebar.open {
  left: 16px;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
  display: none;
  backdrop-filter: blur(4px);
}

.sidebar.open~.sidebar-overlay {
  display: block;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: var(--primary-glow);
}

.brand-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
}

.categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  flex: 1;
  overflow-y: auto;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: all .2s;
  text-align: center;
  position: relative;
}

.cat:hover {
  background: #f1f5f9;
  color: var(--text);
}

.cat.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.cat.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.cat .ic {
  font-size: 24px;
}

.cat.locked {
  opacity: .35;
  cursor: not-allowed;
}

.cat.locked::after {
  content: '🔒';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
}

.logout-btn {
  margin-top: 10px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all .15s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}

/* ============== Main ============== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  border-radius: var(--radius-xl);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
}

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

.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.2s;
  position: relative;
  z-index: 1100;
}

.menu-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  padding: 8px 0;
}

.search input::placeholder {
  color: var(--text-muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.user-role {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.products,
.admin-panel {
  flex: 1;
  border-radius: var(--radius-xl);
  overflow-y: auto;
}

.products {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  align-content: start;
}

.product {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform .2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow .2s, border-color .2s;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.product:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  background: #fff;
}

.product .img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 50px;
  margin-bottom: 12px;
}

.product .name {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 6px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product .price {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

.product-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
}

.stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.stock-badge.drink-stock {
  background: #195B9B;
  box-shadow: 0 4px 10px rgba(25, 91, 155, 0.3);
}

.product {
  position: relative;
}

/* Admin Panel */
.admin-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

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

.admin-header h2 {
  font-size: 24px;
  color: var(--text);
  margin: 0;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 12px;
  width: fit-content;
}

.admin-tab {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.admin-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 10px;
}

/* Report Filters */
.report-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.f-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.f-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.f-group input,
.f-group select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13px;
  min-width: 150px;
}

/* Admin Tables & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-card h3 {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .val {
  font-size: 28px;
  color: var(--text);
  font-weight: 800;
}

.stat-card .val.gold {
  color: var(--primary);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
}

.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.admin-table tr {
  transition: all 0.15s;
}

.admin-table tr:hover td {
  background: #f8fafc;
  cursor: pointer;
}

/* ============== Order panel ============== */
.order-panel {
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow: hidden;
}

.order-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
  border: 1px solid transparent;
}

.tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(245, 158, 11, 0.2);
}

.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  background: #f8fafc;
  transition: all .15s;
}

.action-btn:hover:not(:disabled) {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.order-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.order-mode {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border);
}

.mode {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.mode.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.order-scroll-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 -8px 12px -8px;
  padding: 0 8px;
}

.order-items {
  margin: 0;
  padding: 0;
}

.empty-order {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
  font-size: 14px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-strong);
  animation: slideIn .25s ease;
}

.order-item .thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.order-item .info {
  flex: 1;
  min-width: 0;
}

.order-item .info .n {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-item .info .p {
  font-size: 12px;
  color: var(--primary);
  margin-top: 2px;
  font-weight: 600;
}

.order-item .info .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.qty button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all .15s;
  border: 1px solid var(--border);
}

.qty button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.qty .count {
  font-size: 13px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  color: var(--text);
}

.order-summary {
  border-top: 1px solid var(--border-strong);
  padding-top: 16px;
  margin-top: 12px;
  flex-shrink: 0;
}

/* Premium Plastic Bag Option Toggle */
.plastic-bag-option {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.plastic-bag-option:hover {
  background: var(--surface-3);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.bag-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.bag-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bag-icon {
  font-size: 22px;
}

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

.bag-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.bag-price {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  margin-top: 1px;
}

/* Premium Custom Switch Container */
.switch-container {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.switch-input:checked+.switch-slider {
  background-color: var(--primary);
}

.switch-input:checked+.switch-slider:before {
  transform: translateX(20px);
}

.row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-soft);
  padding: 6px 0;
}

.row.total {
  color: var(--text);
  font-weight: 800;
  font-size: 20px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.payment-methods {
  margin-top: 16px;
}

.payment-methods label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

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

.pm-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.pm-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.checkout-btn {
  width: 100%;
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all .2s;
  box-shadow: var(--primary-glow);
}

.checkout-btn:disabled {
  background: #f1f5f9;
  color: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.checkout-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(245, 158, 11, 0.5);
}

/* ============== Modals ============== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .2s ease;
}

#receiptModal {
  z-index: 100 !important;
}

.modal {
  background: #ffffff;
  border-radius: 28px;
  width: 100%;
  max-width: 480px;
  padding: 32px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.2);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all .15s;
}

.modal-close:hover {
  background: #e2e8f0;
  color: var(--text);
}

.modal-head {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding-right: 30px;
}

.modal-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 40px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.modal-info h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.modal-info p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.modal-price {
  font-size: 20px;
  color: var(--primary);
  font-weight: 800;
}

.deal-list {
  margin: 10px 0;
  padding-left: 20px;
  list-style-type: disc;
  color: var(--text-soft);
  font-size: 14px;
}

.deal-list li {
  margin-bottom: 4px;
}

.modal-section {
  margin-bottom: 20px;
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 12px;
}

.qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

.qty-pill button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  display: grid;
  place-items: center;
  transition: all .15s;
  box-shadow: var(--shadow-xs);
}

.qty-pill button:hover {
  background: var(--primary);
  color: #fff;
}

.qty-pill span {
  min-width: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.addons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.addon {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 14px;
  font-size: 14px;
  transition: all .15s;
  border: 1.5px solid var(--border-strong);
  color: var(--text-soft);
}

.addon:hover {
  border-color: var(--primary);
}

.addon.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.addon .addon-plus {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
  transition: transform .2s, background .2s;
  box-shadow: var(--shadow-xs);
}

.addon.active .addon-plus {
  transform: rotate(45deg);
  background: var(--primary);
  color: #fff;
}

.addon .addon-name {
  flex: 1;
  font-weight: 600;
  text-align: left;
}

.addon em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

#modalNotes {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  background: #f8fafc;
  color: var(--text);
  transition: border-color .15s;
}

#modalNotes:focus {
  border-color: var(--primary);
  background: #fff;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-strong);
  gap: 16px;
}

.foot-total span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
}

.foot-total strong {
  font-size: 26px;
  color: var(--primary);
  font-weight: 800;
}

.foot-actions {
  display: flex;
  gap: 10px;
}

.btn-ghost {
  padding: 14px 22px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}

.btn-primary {
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--primary-glow);
  transition: transform .15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary.full {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* Small modal */
.small-modal {
  max-width: 400px;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.modal-sub {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============== Receipt Modal Content ============== */
.receipt-modal {
  max-width: 900px;
  padding: 20px;
  background: #e2e8f0;
}

.receipt-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px;
}

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

.receipt {
  background: #fff;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  color: #000;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  position: relative;
  max-width: 300px;
  width: 100%;
  margin: 0 auto;
}

.receipt::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background-image: radial-gradient(circle, transparent, transparent 50%, #fff 50%, #fff 100%);
  background-size: 12px 12px;
  background-position: 0 0;
}

.receipt-head {
  text-align: center;
  margin-bottom: 10px;
  border-bottom: 2px dashed #000;
  padding-bottom: 10px;
}

.receipt-logo {
  display: none;
  font-size: 28px;
  margin-bottom: 4px;
}

.receipt-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
}

.receipt-head p {
  margin: 2px 0 0;
  font-size: 12px;
}

.receipt-type {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  text-transform: uppercase;
  border: 1px solid #000;
  padding: 3px;
}

.receipt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: bold;
}

.receipt-meta div {
  display: flex;
  flex-direction: column;
}

.receipt-divider {
  height: 1px;
  border-top: 1px dashed #000;
  margin: 8px 0;
}

.receipt-items {
  font-size: 13px;
}

.ritem {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  gap: 10px;
}

.ritem .nm {
  flex: 1;
  font-weight: bold;
}

.ritem .qy {
  margin-right: 12px;
}

.ritem .pr {
  font-weight: bold;
}

.ritem-notes {
  font-size: 11px;
  font-style: italic;
  color: #444;
  padding-left: 8px;
}

.receipt-totals {
  font-size: 13px;
  margin-top: 8px;
}

.rrow {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-weight: bold;
}

.rrow.grand {
  font-size: 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #000;
}

.receipt-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  font-weight: bold;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 16px;
}

/* ============== Order History Popup ============== */
.history-modal {
  max-width: 540px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 20px 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.history-item .n {
  font-weight: 600;
  color: var(--text);
}

.history-item .p {
  font-weight: 700;
  color: var(--primary);
}

.history-totals {
  background: #f8fafc;
  padding: 16px;
  border-radius: 16px;
  margin-top: 16px;
}

/* ============== Forms ============== */
select {
  width: 100%;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

select option {
  background: #fff;
  color: #000;
}

input[type="file"] {
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============== Toast ============== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all .25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 200;
  box-shadow: var(--primary-glow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============== Animations ============== */
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============== Print ============== */
@media print {
  body * {
    visibility: hidden !important;
  }

  #receiptModal,
  #receiptModal * {
    visibility: visible !important;
  }

  #receiptModal {
    position: absolute;
    inset: 0;
    background: transparent;
    display: block;
    padding: 0;
  }

  #receiptModal .modal {
    box-shadow: none;
    max-height: none;
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    background: transparent;
    border: none;
  }

  .receipt-container {
    display: block;
    gap: 0;
    max-height: none;
    overflow: visible;
  }

  .receipt {
    box-shadow: none;
    margin: 0 auto;
    padding: 8px 4px;
    width: 72mm;
    page-break-after: always;
  }

  .receipt::after {
    display: none;
  }

  .no-print {
    display: none !important;
  }

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

/* ============== Responsive ============== */
@media (max-width: 1100px) {
  .app {
    grid-template-columns: 1fr 320px;
  }

  .app.admin-active {
    grid-template-columns: 1fr;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 12px;
    gap: 12px;
  }

  .main {
    min-width: 0;
  }

  .order-panel {
    position: static;
    height: auto;
    max-height: none;
    border-radius: 16px;
    overflow: visible;
  }

  .topbar {
    padding: 12px 16px;
    border-radius: 14px;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
  }

  .sidebar {
    max-width: 85vw;
    width: 150px;
  }

  .admin-panel {
    padding: 16px;
    border-radius: 14px;
  }

  .admin-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .admin-tab {
    font-size: 12px;
    padding: 8px 14px;
  }

  .report-filters {
    flex-direction: column;
    gap: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-table {
    font-size: 12px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
  }

  .modal {
    max-width: 95vw;
    margin: 10px;
    padding: 20px;
  }

  .receipt-container {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 8px;
    gap: 8px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar-left {
    width: 100%;
  }

  .user-chip {
    justify-content: flex-end;
  }

  .user-meta {
    display: none;
  }

  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .product .name {
    font-size: 12px;
  }

  .product .price {
    font-size: 11px;
  }

  .product .img {
    height: 70px;
    font-size: 28px;
  }

  .order-header h2 {
    font-size: 16px;
  }

  .order-summary {
    gap: 10px;
  }

  .checkout-btn {
    padding: 12px;
    font-size: 13px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 150px;
  }

  .modal {
    padding: 16px;
  }

  .history-modal {
    max-width: 95vw;
  }
}

/* ============== Profit & Loss and Employee Salaries Modules ============== */
.val.success {
  color: #10b981 !important;
}

.val.danger {
  color: #ef4444 !important;
}

.val.info {
  color: #3b82f6 !important;
}

.financial-breakdown {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .financial-breakdown {
    grid-template-columns: 1fr;
  }
}

.performance-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge.inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn-primary.full {
  width: 100%;
}

.f-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.f-row:last-child {
  border-bottom: none;
}

.f-row span {
  color: var(--text-soft);
  font-weight: 500;
}

.f-row strong {
  color: var(--text);
  font-weight: 700;
}

/* ============== Receipt Width Settings ============== */
.receipt-58mm {
  width: 58mm;
  max-width: 100%;
}

.receipt-80mm {
  width: 80mm;
  max-width: 100%;
}

/* ============== Bulk Delete Actions Premium Layout ============== */
.bulk-delete-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(239, 68, 68, 0.04);
  border: 1px dashed rgba(239, 68, 68, 0.25);
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bulk-delete-bar span {
  font-weight: 600;
  color: var(--danger);
  font-size: 13px;
}

.bulk-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--danger);
}

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