/* styles.css - Pharmacy Management System (PMS)
 * Professional Healthcare Retail POS Theme
 * Zero CDN dependencies, pure offline CSS, custom print stylesheet
 */

:root {
  --primary: #0F766E;
  --primary-dark: #0B5450;
  --primary-light: #CCFBF1;
  --primary-hover: #115E59;
  
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --success-border: #86EFAC;
  
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --warning-border: #FCD34D;
  
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --danger-border: #FCA5A5;
  
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --border-color: #E2E8F0;
  --border-focus: #0F766E;
  
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
  
  --sidebar-width: 250px;
  --topbar-height: 64px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

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

body {
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Layout Hierarchy */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-page);
}

/* Left Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--primary-dark);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease-in-out;
  z-index: 40;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand-icon {
  width: 34px;
  height: 34px;
  background-color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

.sidebar-brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.sidebar-brand-text span {
  font-size: 11px;
  color: #99F6E4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

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

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 12px 4px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.nav-item.active {
  background-color: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

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

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

/* Top Bar */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  z-index: 30;
}

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

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

.topbar-search {
  position: relative;
  width: 100%;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-page);
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
}

.topbar-search input:focus {
  border-color: var(--border-focus);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.topbar-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

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

/* Sync status indicator */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  user-select: none;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

.sync-indicator.synced .sync-dot {
  animation: pulseGreen 1s ease;
}

@keyframes pulseGreen {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Stock Alerts Bell */
.alerts-bell-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.alerts-bell-btn:hover {
  background-color: var(--bg-subtle);
}

.alerts-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Alerts Dropdown */
.alerts-dropdown {
  display: none;
  position: absolute;
  top: 54px;
  right: 180px;
  width: 320px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 100;
}

.alerts-dropdown.show {
  display: block;
}

.alerts-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alerts-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}

.alert-item {
  padding: 10px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.1s;
}

.alert-item:hover {
  background-color: #F8FAFC;
}

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

/* User Profile Badge in Topbar */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.user-role-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.logout-btn:hover {
  background-color: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Views Management */
.view-section {
  display: none;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

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

/* Page Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  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;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.card-body {
  padding: 20px;
}

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

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

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

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

.btn-secondary:hover {
  background-color: var(--bg-subtle);
}

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

.btn-success:hover {
  background-color: #15803D;
}

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

.btn-danger:hover {
  background-color: #B91C1C;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
}

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

/* Metric / KPI Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon.teal {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.metric-icon.green {
  background-color: var(--success-bg);
  color: var(--success);
}

.metric-icon.amber {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.metric-icon.red {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.metric-info h4 {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-info .metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.metric-info .metric-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

.data-table th {
  background-color: #F8FAFC;
  color: #475569;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

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

.data-table tbody tr:nth-child(even) {
  background-color: #FAFAFB;
}

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

/* Badges / Status Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background-color: var(--warning-bg);
  color: #B45309;
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-neutral {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* POS Screen Split Layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  height: calc(100vh - var(--topbar-height) - 72px);
}

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

.pos-catalog-search-box {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

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

.pos-item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  user-select: none;
}

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

.pos-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.pos-item-generic {
  font-size: 11.5px;
  color: var(--text-muted);
}

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

.pos-item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.pos-item-stock {
  font-size: 11.5px;
}

/* POS Cart Panel */
.pos-cart-panel {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.pos-cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}

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

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

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

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
}

.qty-input {
  width: 44px;
  height: 26px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

.cart-item-subtotal {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 60px;
  text-align: right;
}

.cart-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.cart-remove-btn:hover {
  background-color: var(--danger-bg);
}

/* POS Summary & Checkout */
.pos-cart-summary {
  padding: 16px 20px;
  background-color: #F8FAFC;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.summary-row.total-row {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.discount-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discount-input-wrapper input {
  width: 70px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
}

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

.payment-method-btn {
  padding: 8px 4px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.payment-method-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background-color: white;
  transition: border-color 0.15s;
}

.form-group textarea {
  height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.filter-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  outline: none;
  background: white;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

.modal-dialog.modal-lg {
  max-width: 800px;
}

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

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #F8FAFC;
}

/* Printable Bill / Invoice Styles */
.receipt-wrapper {
  background: white;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-width: 480px;
  margin: 0 auto;
  font-family: monospace, -apple-system, sans-serif;
  color: #000;
}

.receipt-header {
  text-align: center;
  margin-bottom: 16px;
}

.receipt-pharmacy-name {
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
}

.receipt-pharmacy-info {
  font-size: 12px;
  color: #333;
  margin-top: 4px;
}

.receipt-divider {
  border-top: 1px dashed #444;
  margin: 12px 0;
}

.receipt-meta {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.receipt-items-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin: 12px 0;
}

.receipt-items-table th {
  border-bottom: 1px dashed #444;
  padding: 6px 0;
  text-align: left;
}

.receipt-items-table td {
  padding: 5px 0;
  vertical-align: top;
}

.receipt-totals {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.receipt-total-main {
  font-size: 16px;
  font-weight: bold;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 6px 0;
  margin-top: 4px;
}

.receipt-footer-text {
  text-align: center;
  font-size: 11px;
  margin-top: 16px;
  color: #555;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  animation: toastIn 0.25s ease-out;
  transition: all 0.2s ease;
}

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

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

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

.toast.toast-info {
  border-left: 4px solid var(--primary);
}

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

/* Offline Indicator */
.offline-pill {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--warning-bg);
  color: #B45309;
  border: 1px solid var(--warning-border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.offline-pill.active {
  display: flex;
}

/* Login Modal / Screen */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #0B5450;
  background: radial-gradient(circle at top right, #0F766E, #0B5450);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.login-logo {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.3);
}

.login-brand h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

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

.demo-credentials-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-creds-pills {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.demo-pill {
  padding: 2px 8px;
  background: #E2E8F0;
  border-radius: var(--radius-pill);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
}

.demo-pill:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* PRINT MEDIA STYLESHEET */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }

  .sidebar,
  .topbar,
  .alerts-dropdown,
  #toast-container,
  .modal-overlay:not(#invoice-modal),
  .modal-header,
  .modal-footer,
  .header-actions,
  .no-print {
    display: none !important;
  }

  .app-container {
    display: block !important;
    width: 100% !important;
    min-height: auto !important;
  }

  .main-wrapper {
    height: auto !important;
    overflow: visible !important;
  }

  .content-area {
    padding: 0 !important;
    overflow: visible !important;
  }

  #invoice-modal {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
  }

  #invoice-modal .modal-dialog {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .receipt-wrapper {
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .pos-catalog-panel, .pos-cart-panel {
    height: 520px;
  }
}

@media (max-width: 768px) {
  .menu-toggle-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    padding: 0 16px;
  }

  .content-area {
    padding: 16px;
  }

  .user-name, .sync-indicator {
    display: none;
  }
}
