/* COOL BUDGET POS — Shopify Polaris-Inspired Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Nunito:wght@600;700;800&display=swap');

:root {
  --bg-app: #f4f5f7;
  --bg-surface: #ffffff;
  --bg-subdued: #f8f9fa;
  --bg-sidebar: #141414;
  --bg-sidebar-hover: #242424;
  --bg-sidebar-active: #2e2e2e;
  --text-primary: #1f2022;
  --text-secondary: #616469;
  --text-muted: #8c9196;
  --border-color: #e4e5e7;
  --border-strong: #c9cccf;
  --shopify-green: #008060;
  --shopify-green-hover: #006e52;
  --shopify-green-light: #e3f1ed;
  --danger: #d72c0d;
  --danger-light: #fff4f4;
  --warning: #b98900;
  --warning-light: #fff8e6;
  --info: #2c6ecb;
  --info-light: #eef5ff;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.14);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* App Shell — Shopify Smooth Rounded Frame */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-sidebar);
}

/* Sidebar Navigation */
.sidebar {
  width: 248px;
  background: var(--bg-sidebar);
  color: #e3e3e3;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar.collapsed {
  width: 68px;
}

.sidebar-brand {
  padding: 16px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-dev-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-shop-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.sidebar-collapse-btn:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}

.sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  padding: 14px 10px 10px;
  gap: 10px;
}

.sidebar.collapsed .sidebar-shop-name,
.sidebar.collapsed .sidebar-branch-pill,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-meta,
.sidebar.collapsed .btn-logout {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 10px;
}

.sidebar-branch-pill {
  margin: 4px 12px 6px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-branch-pill span {
  font-size: 10.5px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-branch-pill strong {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
}

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

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #7d8287;
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #c9cdd2;
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}

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

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #ffffff;
  font-weight: 600;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.88;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--shopify-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

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

.user-meta strong {
  display: block;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  text-transform: capitalize;
}

.btn-logout {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-logout:hover {
  background: rgba(215, 44, 13, 0.85);
  color: #fff;
}

/* Main Content — Rounded Shopify Canvas */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  margin: 8px 8px 8px 0;
  border-radius: 16px;
  overflow: hidden;
  min-height: calc(100vh - 16px);
}

.topbar {
  height: 58px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}

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

.topbar-logo-link {
  display: inline-flex;
  align-items: center;
}

.topbar-shop-logo {
  height: 30px;
  max-width: 170px;
  object-fit: contain;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
}

.page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.content-container {
  padding: 22px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & Tables (Polaris Style) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

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

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

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

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

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

.btn-primary {
  background: var(--shopify-green);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.btn-primary:hover:not(:disabled) {
  background: var(--shopify-green-hover);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover:not(:disabled) {
  background: #f6f6f7;
}

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

.btn-danger:hover:not(:disabled) {
  background: #b82309;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 600;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--shopify-green);
  box-shadow: 0 0 0 2px rgba(0, 128, 96, 0.15);
}

.form-help {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: var(--shopify-green-light); color: #005c45; }
.badge-warning { background: var(--warning-light); color: #7a5800; }
.badge-danger { background: var(--danger-light); color: #a82008; }
.badge-info { background: var(--info-light); color: #1d4f9c; }
.badge-neutral { background: #e4e5e7; color: #4a4d52; }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
}

table.data-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subdued);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: #fafbfb;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
}

.alert-success { background: var(--shopify-green-light); border-color: #a7d7c8; color: #004d3a; }
.alert-danger { background: var(--danger-light); border-color: #f3b8b0; color: #8c1b07; }
.alert-info { background: var(--info-light); border-color: #b7d2f7; color: #194485; }
.alert-warning { background: var(--warning-light); border-color: #f1d98a; color: #6d4f00; }

/* POS Terminal Layout */
.pos-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.pos-catalog {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow: hidden;
}

.pos-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pos-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.pos-search-wrap input {
  padding-left: 36px;
  height: 40px;
}

.pos-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 6px;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-pill.active, .cat-pill:hover {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

/* Fast Billing Options Bar, Suggestions, Staging Fields, Popover & Sale Stats */
.pos-options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pos-search-row {
  align-items: flex-end;
}

.staging-fields {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.staging-fields.hidden {
  display: none;
}

.stage-field {
  width: 96px;
}

.stage-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.stage-field input {
  height: 40px;
  padding: 6px 9px;
  font-size: 13px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 290px;
  overflow-y: auto;
  z-index: 60;
  display: none;
}

.search-suggestions.open {
  display: block;
}

.suggestion-item {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--shopify-green-light);
}

.suggestion-item.out {
  opacity: 0.55;
}

.cart-item {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 6px;
  margin: 0 -6px;
}

.cart-item:hover {
  background: var(--bg-subdued);
}

.cart-item-popover {
  position: fixed;
  z-index: 150;
  width: 245px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
}

.popover-title {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sale-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.sale-stat-box {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.sale-stat-box span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.85;
}

.sale-stat-box strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

.stat-pieces { background: #eef5ff; border-color: #b7d2f7; color: #1d4f9c; }
.stat-total  { background: #f4f5f7; border-color: #d0d3d8; color: #1f2022; }
.stat-paid   { background: #e3f1ed; border-color: #a7d7c8; color: #005c45; }
.stat-change { background: #fff8e6; border-color: #f1d98a; color: #8a5300; }

.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  align-content: start;
  padding-right: 4px;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  user-select: none;
}

.product-card:hover {
  border-color: var(--shopify-green);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.product-card.out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-thumb {
  width: 100%;
  height: 112px;
  border-radius: var(--radius-sm);
  background: var(--bg-subdued);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

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

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

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

/* POS Cart Panel */
.pos-cart {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.cart-customer {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subdued);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cart-customer input {
  padding: 6px 9px;
  font-size: 12.5px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 18px;
}

.cart-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
  padding: 20px;
}

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

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

.cart-item-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-stepper button {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--bg-subdued);
  cursor: pointer;
  font-weight: 600;
}

.qty-stepper button:hover {
  background: #e4e5e7;
}

.qty-stepper span {
  min-width: 28px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
}

.cart-item-total {
  font-weight: 600;
  font-size: 13px;
  min-width: 68px;
  text-align: right;
}

.cart-summary {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subdued);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-row.total {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--border-strong);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

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

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-subdued);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #202223;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.2s ease;
}

.toast.success { border-left: 4px solid #36d399; }
.toast.error { border-left: 4px solid #f87171; }

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f2f4 0%, #e4ece9 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

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

.login-brand img {
  height: 54px;
  object-fit: contain;
  margin-bottom: 8px;
}

.login-brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.login-brand .sub-brand-link {
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Receipt Print Styles — 80mm Thermal Optimized (Dark Crisp Fonts, 1-Copy) */
#printReceiptRoot {
  display: none;
}

.receipt-paper {
  font-family: 'Nunito', Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.32;
  color: #000000;
  background: #ffffff;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.rc-header {
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #000000;
}

.rc-logo {
  max-height: 30px;
  max-width: 175px;
  object-fit: contain;
  margin-bottom: 3px;
}

.rc-branch {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #000000;
}

.rc-contact {
  font-size: 10px;
  font-weight: 600;
  color: #000000;
  margin-top: 2px;
}

.rc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 4px;
  padding: 5px 0;
  font-size: 10px;
  font-weight: 600;
  color: #000000;
  border-bottom: 1px dashed #000000;
}

.rc-right {
  text-align: right;
}

.rc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0;
  font-size: 10.5px;
  font-weight: 600;
  color: #000000;
}

.rc-table th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #000000 !important;
  color: #ffffff !important;
  padding: 5px 5px;
  border: none;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.rc-table td {
  padding: 4px 0;
  border-bottom: 1px dotted #000000;
  vertical-align: top;
}

.rc-item-name {
  font-weight: 700;
  padding-right: 4px !important;
  word-break: break-word;
}

.rc-item-unit {
  font-size: 9.5px;
  color: #000000;
  font-weight: 600;
}

.rc-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 700;
}

.rc-totals {
  border-top: 1.5px solid #000000;
  padding-top: 5px;
  margin-top: 2px;
}

.rc-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.rc-grand-total {
  font-size: 13px;
  font-weight: 800;
  padding: 4px 0;
  margin: 4px 0;
  border-top: 1px dashed #000000;
  border-bottom: 1px dashed #000000;
}

.rc-pay-line {
  font-size: 10px;
  font-weight: 700;
  color: #000000;
}

.rc-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1.5px solid #000000;
  font-size: 10px;
  font-weight: 700;
  color: #000000;
}

.rc-qr {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.rc-qr svg {
  width: 40px;
  height: 40px;
  display: block;
}

.rc-footer-text {
  flex: 1;
  line-height: 1.3;
}

.rc-site {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 800;
}

@page {
  size: 80mm auto;
  margin: 2mm 3mm;
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
  body > *:not(#printReceiptRoot) {
    display: none !important;
  }
  #printReceiptRoot {
    display: block !important;
    width: 100% !important;
    max-width: 72mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }
  #printReceiptRoot .receipt-paper {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 1024px) {
  .pos-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .pos-cart {
    border-left: none;
    border-top: 1px solid var(--border-color);
    height: auto;
  }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-area {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}
