/* ==========================================================================
   Digi Jagmohan ERP - Modern Enterprise Design System
   Designed for High Efficiency, Visual Clarity, Zero AI Bloat & Cross-Platform Precision
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Surfaces & Canvas (Dark Slate Enterprise Default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #172033;
  --bg-card: #131c2e;
  --bg-card-hover: #19253d;
  --bg-input: #0e1626;
  --bg-elevated: #1a253a;

  /* Hairlines & Borders */
  --border-color: #212c42;
  --border-subtle: #172033;
  --border-focus: #3b82f6;

  /* Text Hierarchy */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;

  /* Brand Accents */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-bg: rgba(37, 99, 235, 0.12);

  --success: #10b981;
  --success-hover: #059669;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.28);

  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.28);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.28);

  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.12);
  --info-border: rgba(2, 132, 199, 0.28);

  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.12);

  /* Layout Dimensions */
  --sidebar-width: 254px;
  --topbar-height: 60px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Elevation Shadows (Natural diffuse, no glowing neon) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --shadow-dropdown: 0 14px 30px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);

  /* Transitions */
  --transition: all 0.16s cubic-bezier(0.2, 0, 0, 1);
  --transition-slow: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

/* ==========================================================================
   Clean Enterprise Light Theme
   ========================================================================== */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --bg-elevated: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #2563eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-bg: rgba(37, 99, 235, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-dropdown: 0 14px 30px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* SVG Icon Helper Style */
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 30;
  user-select: none;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-pill);
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.85rem 0.85rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

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

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

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background-color: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-item .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  opacity: 0.85;
}

.nav-item.active .icon {
  opacity: 1;
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  line-height: 1;
}

/* ==========================================================================
   Main Content Area & Topbar
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  gap: 1.25rem;
  z-index: 20;
}

.search-box {
  position: relative;
  width: 360px;
}

.search-box input {
  width: 100%;
  height: 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 2.5rem 0 2.25rem;
  color: var(--text-primary);
  font-size: 0.83rem;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Cash Drawer Status Live Pill */
.drawer-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.drawer-status-pill:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
}

.drawer-status-icon {
  display: flex;
  align-items: center;
}

.drawer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Topbar Icon Buttons */
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.topbar-icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Executive User Menu & Dropdown */
.user-menu-container {
  position: relative;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.65rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.user-profile-badge:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #ffffff;
}

.user-info .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
}

.user-info .user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.user-menu-chevron {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  margin-left: 0.2rem;
  transition: transform 0.2s ease;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  padding: 0.5rem 0;
  z-index: 100;
  animation: fadeIn 0.15s ease-out;
}

.user-dropdown-header {
  padding: 0.65rem 1rem 0.5rem;
}

.user-dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.4rem 0;
}

.user-dropdown-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 1rem 0.25rem;
}

.user-shift-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 0.4rem;
}

.user-shift-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}

.user-shift-item:hover {
  background-color: var(--bg-tertiary);
}

.user-shift-item.active {
  background-color: var(--primary-bg);
}

.user-shift-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.user-dropdown-item:hover {
  background-color: var(--bg-tertiary);
}

.user-dropdown-item.text-danger {
  color: var(--danger);
}
.user-dropdown-item.text-danger:hover {
  background-color: var(--danger-bg);
}

/* ==========================================================================
   Page Content Viewport
   ========================================================================== */
.content-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: var(--bg-primary);
}

.content-viewport::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.content-viewport::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-pill);
}

/* Page Header Structure */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ==========================================================================
   KPI & Metrics Grid
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card.clickable:active {
  transform: translateY(0);
}

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

.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.card-icon.primary { background-color: var(--primary-bg); color: var(--primary); }
.card-icon.success { background-color: var(--success-bg); color: var(--success); }
.card-icon.warning { background-color: var(--warning-bg); color: var(--warning); }
.card-icon.danger { background-color: var(--danger-bg); color: var(--danger); }
.card-icon.info { background-color: var(--info-bg); color: var(--info); }
.card-icon.purple { background-color: var(--purple-bg); color: var(--purple); }

.card-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.card-subtitle {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   Polished Data Tables & Grids
   ========================================================================== */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.table-header-bar {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-tertiary);
}

.table-header-bar h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

table.data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

table.data-table tbody tr {
  transition: background-color 0.12s ease;
}

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

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.font-mono { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-info { background-color: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-primary { background-color: var(--primary-bg); color: var(--primary); border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-secondary { background-color: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* ==========================================================================
   Buttons & Interactive States
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}

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

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

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

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

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.btn-sm { padding: 0.32rem 0.65rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 0.95rem; font-weight: 700; }

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  height: 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  color: var(--text-primary);
  font-size: 0.83rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
  height: auto;
  padding: 0.6rem 0.75rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}
.form-row > * { flex: 1; }

/* ==========================================================================
   Clean Enterprise Empty States (No Bouncing Emojis)
   ========================================================================== */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.empty-state-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 360px;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(4, 8, 16, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  padding: 1rem;
  animation: fadeIn 0.18s ease-out;
}

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

.modal-content.modal-lg { max-width: 880px; }
.modal-content.modal-xl { max-width: 1100px; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalZoomIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

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

.modal-footer {
  padding: 0.95rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--bg-tertiary);
}

/* ==========================================================================
   Toast Notifications Stack
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 290px;
  max-width: 420px;
  animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

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

/* Keyboard hint chips */
.kbd-chip {
  display: inline-block;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Retail POS High-Speed Counter Layout
   ========================================================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.25rem;
  height: calc(100vh - 110px);
}

.pos-cart-panel {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
}

.pos-summary-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pos-grand-total {
  border-top: 2px dashed var(--border-color);
  margin-top: 0.65rem;
  padding-top: 0.85rem;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}

.pos-qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-input);
}

.pos-qty-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.pos-qty-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.pos-qty-input {
  width: 38px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: center;
  font-weight: 700;
  font-size: 0.83rem;
  font-family: var(--font-mono);
}

.pos-qty-input:focus {
  outline: none;
  background: rgba(37, 99, 235, 0.08);
}

/* ==========================================================================
   Printable Invoice & Thermal Receipt Styling
   ========================================================================== */
@media print {
  body {
    background-color: white !important;
    color: black !important;
    height: auto !important;
    overflow: visible !important;
  }
  .sidebar, .topbar, .no-print, #toast-container, .modal-backdrop {
    display: none !important;
  }
  .content-viewport {
    padding: 0 !important;
    background: white !important;
    overflow: visible !important;
  }
  .print-area {
    display: block !important;
    width: 100% !important;
    color: black !important;
    background: white !important;
  }
}
