/* ==========================================================================
   DAPUR ABANG ADEK - POS SYSTEM STYLESHEET
   Tema: Modern Minimalis (Hitam, Merah, Putih)
   ========================================================================== */

:root {
  /* Palette */
  --bg-dark: #0f1115;
  --bg-sidebar: #15181e;
  --bg-card: #1c2028;
  --bg-card-hover: #232834;
  --bg-input: #12141a;
  --border-color: #2b313e;
  --border-focus: #ef4444;

  /* Red Accents */
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: rgba(220, 38, 38, 0.15);
  --primary-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-white: #ffffff;

  /* Status Colors */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.15);

  /* Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 15px rgba(220, 38, 38, 0.35);

  /* Layout */
  --sidebar-width: 250px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body:not(.authenticated) .app-container {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% 0, rgba(220, 38, 38, 0.18), transparent 38%),
    var(--bg-dark);
}

body.authenticated .auth-screen {
  display: none;
}

.auth-card {
  width: min(100%, 420px);
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-brand-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 1rem;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.auth-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.auth-card h1 {
  color: var(--text-white);
  font-size: 1.35rem;
  text-align: center;
}

.auth-description {
  margin: 0.4rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-mode-btn {
  min-height: 42px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.auth-mode-btn:hover {
  border-color: var(--primary);
  color: var(--text-white);
}

.auth-mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text-white);
}

.auth-card .form-group {
  margin-bottom: 1rem;
}

.auth-message {
  min-height: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--danger);
  font-size: 0.82rem;
}

.auth-submit {
  width: 100%;
}

.pwa-install[hidden] {
  display: none;
}

.auth-note {
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-align: center;
}

/* App Wrapper */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg-dark);
  position: relative;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.brand-section {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-text h1 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.nav-menu {
  flex: 1;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 0.5rem 0.75rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
}

.nav-item.active {
  background: var(--primary-gradient);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

.nav-item.active svg {
  transform: scale(1.08);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-version {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: rgba(21, 24, 30, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.page-title-box h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
}

.page-title-box p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.live-clock {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sync-status[hidden] {
  display: none;
}

.sync-status.sync-error {
  color: var(--danger);
  border-color: var(--danger);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.avatar {
  width: 36px;
  height: 36px;
  background: #2b313e;
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.85rem;
}

/* View Sections */
.content-area {
  padding: 1.75rem 2rem;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out forwards;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   BUTTONS & FORM ELEMENTS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  outline: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

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

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Inputs & Form Groups */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.input-group {
  display: flex;
  position: relative;
  align-items: center;
}

.input-group .form-control {
  padding-left: 2.5rem;
}

.input-icon-left {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dim);
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: capitalize;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gray { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* ==========================================================================
   STAT CARDS (DASHBOARD)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-red { background: var(--danger-bg); color: var(--danger); }
.icon-green { background: var(--success-bg); color: var(--success); }
.icon-blue { background: var(--info-bg); color: var(--info); }
.icon-amber { background: var(--warning-bg); color: var(--warning); }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.stat-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Dashboard Content Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Top Products List */
.top-products-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.top-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.top-product-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rank-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-product-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-white);
}

.top-product-qty {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.top-product-revenue {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--success);
}

/* ==========================================================================
   MODERN DATA TABLE
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  background: rgba(21, 24, 30, 0.9);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

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

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   KASIR / POS SECTION
   ========================================================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.5rem;
  height: calc(100vh - var(--header-height) - 3.5rem);
}

.pos-products-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pos-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

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

.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.pill-btn {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.pill-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-white);
}

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: minmax(116px, auto);
  align-content: start;
  gap: 1.15rem;
  overflow-y: auto;
  padding-right: 0.5rem;
  flex: 1;
}

.product-pos-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.product-pos-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.product-pos-card.out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.product-pos-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.product-pos-details {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.product-pos-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.product-pos-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ef4444;
}

/* POS Cart Panel (Right) */
.pos-cart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.cart-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(21, 24, 30, 0.5);
}

.cart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.cart-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.cart-item-info {
  flex: 1;
  padding-right: 0.5rem;
}

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 0.2rem;
}

.cart-item-price {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition);
}

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

.qty-number {
  font-size: 0.85rem;
  font-weight: 700;
  width: 24px;
  text-align: center;
}

.cart-item-subtotal {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-white);
  min-width: 75px;
  text-align: right;
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
}

.btn-remove-item:hover {
  color: var(--danger);
}

/* Empty State */
.empty-cart-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  text-align: center;
  gap: 0.75rem;
  padding: 2rem;
}

.empty-cart-icon {
  font-size: 3rem;
  opacity: 0.5;
}

/* Cart Calculation & Payment */
.cart-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(21, 24, 30, 0.7);
}

.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.calc-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.calc-total .amount {
  color: #ef4444;
  font-size: 1.35rem;
}

.checkout-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out forwards;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-lg {
  max-width: 760px;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(21, 24, 30, 0.6);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(21, 24, 30, 0.6);
}

/* Quick Cash Buttons */
.quick-cash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quick-cash-btn {
  padding: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.quick-cash-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #fff;
}

/* Receipt Print Preview */
.receipt-box {
  background: #ffffff;
  color: #000000;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  max-width: 340px;
  margin: 0 auto;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #444;
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
}

.receipt-logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
}

.receipt-header h3 {
  font-size: 1.1rem;
  font-weight: bold;
}

.receipt-header p {
  font-size: 0.75rem;
  color: #555;
}

.receipt-meta {
  border-bottom: 1px dashed #444;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.receipt-items {
  border-bottom: 1px dashed #444;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
}

.receipt-item {
  margin-bottom: 0.45rem;
}

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

.receipt-item-detail {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding-left: 0.5rem;
}

.receipt-qty {
  margin-top: 0.6rem;
}

.receipt-totals {
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.receipt-totals .receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.receipt-grand-total {
  font-weight: 700;
  font-size: 1rem;
}

.receipt-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

.toast-body {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .pos-cart-panel {
    height: 480px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .top-header {
    padding: 0 1rem;
  }

  .content-area {
    padding: 1rem;
  }

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

  .live-clock {
    display: none;
  }
}

/* Print Styling */
@media print {
  body * {
    visibility: hidden;
  }
  #receiptPrintArea, #receiptPrintArea * {
    visibility: visible;
  }
  #receiptPrintArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 72mm;
    max-width: 72mm;
    margin: 0;
    padding: 4mm;
    border-radius: 0;
    box-shadow: none;
    color: #000;
  }
}
