/* ==========================================================================
   MEDICARE PHARMACY POS & MANAGEMENT SYSTEM — INLINE SVG ICON EDITION
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

.icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}


:root {
  --primary: #0284c7;       /* Ocean Sky Blue */
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-dark: #075985;
  --secondary: #0d9488;     /* Clinical Teal */
  --secondary-hover: #0f766e;
  --dark-sidebar: #0f172a;   /* Slate 900 */
  --sidebar-active: #1e293b;
  --bg-light: #f8fafc;       /* Slate 50 background */
  --surface-white: #ffffff;
  --text-main: #0f172a;     /* Slate 900 */
  --text-muted: #64748b;    /* Slate 500 */
  --border-color: #e2e8f0;   /* Slate 200 */
  
  /* Status Colors */
  --status-instock: #10b981;    /* Emerald 500 */
  --status-instock-bg: #d1fae5;
  --status-lowstock: #f59e0b;   /* Amber 500 */
  --status-lowstock-bg: #fef3c7;
  --status-outstock: #ef4444;   /* Red 500 */
  --status-outstock-bg: #fee2e2;
  --status-expired: #dc2626;    /* Red 600 */
  --status-expired-bg: #fecaca;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
}

/* GPU Acceleration & Smooth Rendering Optimization */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sidebar, .cart-panel, .cart-items-wrapper, .modal-box, .data-table {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Fast Scrollbar Rendering */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f8fafc; /* White/very light grey track */
  border-left: 1px solid #e2e8f0;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1; /* Solid visible grey/white-ish */
  border-radius: 6px;
  border: 2px solid #f8fafc; /* Padding around thumb */
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8; /* Darker on hover for visibility */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* ==========================================================================
   APP LAYOUT: COLLAPSIBLE & HOVER-REVEAL SIDEBAR
   ========================================================================== */

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

/* Sidebar Base Styling */
.sidebar {
  width: 250px;
  background-color: var(--dark-sidebar);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  position: relative;
}

/* COLLAPSED STATE (Slim Icon Bar) */
.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .brand-info,
.sidebar.collapsed .menu-category,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-meta {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* HOVER REVEAL EFFECT ON CURSOR MOVEMENT TO MEDICARE SIDEBAR */
.sidebar.collapsed:hover,
.sidebar.collapsed.hover-expanded {
  width: 250px !important;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.35);
}

.sidebar.collapsed:hover .brand-info,
.sidebar.collapsed:hover .menu-category,
.sidebar.collapsed:hover .nav-text,
.sidebar.collapsed:hover .user-meta,
.sidebar.collapsed.hover-expanded .brand-info,
.sidebar.collapsed.hover-expanded .menu-category,
.sidebar.collapsed.hover-expanded .nav-text,
.sidebar.collapsed.hover-expanded .user-meta {
  display: block !important;
  opacity: 1 !important;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  background: #ffffff;
  padding: 2px;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-info p {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.65rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
  white-space: nowrap;
}

.menu-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 800;
  padding: 0.65rem 0.65rem 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-meta h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

.user-meta span {
  font-size: 0.68rem;
  color: #38bdf8;
  font-weight: 600;
}

.btn-logout-icon {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-logout-icon:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.15);
}

/* Main Content Wrapper */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.top-header {
  height: 54px;
  background-color: var(--surface-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  flex-shrink: 0;
}

.btn-toggle-sidebar {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: var(--transition);
  margin-right: 0.75rem;
}

.btn-toggle-sidebar:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.header-title-wrapper {
  display: flex;
  align-items: center;
}

.header-title h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.header-title p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

.session-chip {
  background-color: #f1f5f9;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.content-body {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  background-color: var(--bg-light);
}

/* ==========================================================================
   POS BILLING LAYOUT — 85%+ MAXIMIZED TABLE & ULTRA-COMPACT MICRO FOOTER
   ========================================================================== */

.pos-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0.85rem;
  height: calc(100vh - 54px - 1.5rem);
}

.pos-left {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  overflow: hidden;
}

.pos-right {
  background-color: var(--surface-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* POS Search Bar & Controls */
.search-card {
  background-color: var(--surface-white);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.search-input-group {
  flex-grow: 1;
  position: relative;
}

.search-input-group input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.2rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.search-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-icon-inside {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.select-filter {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background-color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* Medicine Results Grid */
.medicine-results-container {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.medicine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.65rem;
}

.med-card {
  background-color: var(--surface-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.med-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f1f5f9;
}

.med-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-color);
}

.med-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.med-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.med-generic {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.35rem;
}

.med-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.med-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-instock { background-color: var(--status-instock-bg); color: #047857; }
.badge-lowstock { background-color: var(--status-lowstock-bg); color: #b45309; }
.badge-outstock { background-color: var(--status-outstock-bg); color: #b91c1c; }
.badge-expired { background-color: var(--status-expired-bg); color: #991b1b; }

/* Right Billing Cart Panel */
.cart-header {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cart-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* MAXIMIZED MEDICINE ITEMS TABLE AREA (OCCUPIES OVER 85% HEIGHT) */
.cart-items-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0.2rem 0.4rem;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cart-table th {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  z-index: 5;
  text-align: left;
  padding: 0.5rem 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-color);
  font-weight: 800;
}

.cart-table td {
  padding: 0.55rem 0.35rem;
  border-bottom: 1px dashed var(--border-color);
  vertical-align: middle;
}

.cart-item-name {
  font-weight: 800;
  color: #0284c7;
  display: block;
  font-size: 0.9rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.12);
}

.qty-btn {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.95rem;
  transition: var(--transition);
}

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

.qty-val {
  width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  outline: none;
}

.btn-remove-item {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-remove-item:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

/* ULTRA-COMPACT MICRO FOOTER PANEL */
.cart-footer {
  border-top: 1.5px solid var(--border-color);
  background-color: #ffffff;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Row 1: Compact Inline Customer Inputs & Discount Inputs */
.cart-footer-row1 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.cart-footer-row1 input,
.cart-footer-row1 select {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  width: 100%;
}

/* Row 2: Compact Inline Subtotal, Discount & Grand Total Summary Bar */
.cart-footer-row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
}

.summary-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Row 3: Slim Payment Method & Checkout Action Bar */
.cart-footer-row3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.4rem;
  align-items: center;
}

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

.pay-btn {
  padding: 0.3rem 0.2rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.pay-btn.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
}

.cash-received-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.cash-received-box input {
  width: 75px;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.btn-complete-sale {
  width: 100%;
  padding: 0.6rem;
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3) !important;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-complete-sale:hover {
  background: linear-gradient(135deg, #0369a1, #075985) !important;
  box-shadow: 0 5px 14px rgba(2, 132, 199, 0.4) !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   CARDS & STATS (ADMIN & WORKER DASHBOARD)
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--surface-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-blue { background-color: #e0f2fe; color: #0284c7; }
.icon-teal { background-color: #ccfbf1; color: #0d9488; }
.icon-green { background-color: #d1fae5; color: #10b981; }
.icon-amber { background-color: #fef3c7; color: #f59e0b; }
.icon-red { background-color: #fee2e2; color: #ef4444; }

.stat-info h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-info .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background-color: var(--surface-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

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

.chart-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   MODERN TABLES (INVENTORY, HISTORY, USERS, REPORTS)
   ========================================================================== */

.table-card {
  background-color: var(--surface-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.table-header-title h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

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

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

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary { background: linear-gradient(135deg, #0284c7, #0369a1); color: white; box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25); }
.btn-primary:hover { background: linear-gradient(135deg, #0369a1, #075985); transform: translateY(-1px); }

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

.btn-success { background-color: #10b981; color: white; }
.btn-success:hover { background-color: #059669; }

.btn-danger { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; }

.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.78rem; }

/* ==========================================================================
   MODAL DIALOGS & OVERLAYS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: var(--surface-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-box.modal-lg { max-width: 850px; }

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

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

.modal-box form {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  max-height: calc(90vh - 65px);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  max-height: calc(90vh - 135px);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-group input, .form-group select, .form-group textarea {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  font-weight: 500;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background-color: var(--dark-sidebar);
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; }

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

/* Invoice Receipt Layout & Styling for PDF & Print */
.invoice-preview-container {
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  padding: 1.5rem !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.invoice-header {
  text-align: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.invoice-header p {
  margin: 0.15rem 0;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.invoice-meta-grid {
  display: flex;
  justify-content: space-between;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.invoice-meta-grid p {
  margin: 0.2rem 0;
  color: #334155;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.invoice-table th {
  background-color: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  padding: 0.6rem 0.5rem;
  border-bottom: 2px solid #cbd5e1;
}

.invoice-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.invoice-totals {
  margin-left: auto;
  width: 260px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.invoice-totals div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.invoice-totals .grand-row {
  border-top: 1.5px solid #cbd5e1;
  padding-top: 0.4rem;
  margin-top: 0.4rem;
  font-weight: 900;
  font-size: 0.95rem;
  color: #0284c7;
}

.invoice-footer {
  text-align: center;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
}

/* Print Media Optimizations */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-area, .printable-area * {
    visibility: visible;
  }
  .printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
  }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (FLUID TYPOGRAPHY, FLEX/GRID ADAPTABILITY)
   ========================================================================== */

/* Fluid Typography Base Scaling */
html {
  font-size: clamp(14px, 0.4vw + 12px, 16px);
}

/* Mobile Sidebar Drawer Overlay & Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  #app-container {
    height: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    flex-direction: column;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: 270px !important;
    z-index: 1100 !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar.collapsed {
    width: 270px !important;
  }

  .sidebar.collapsed .brand-info,
  .sidebar.collapsed .menu-category,
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .user-meta {
    display: block !important;
    opacity: 1 !important;
  }

  .main-wrapper {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    overflow-y: auto;
  }

  .top-header {
    padding: 0 0.85rem;
    height: 52px;
  }

  .header-title h2 {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
  }

  .header-title p {
    font-size: 0.65rem;
  }

  .session-chip {
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
  }

  .content-body {
    padding: 0.6rem;
    height: auto;
    overflow-y: visible;
  }
}

/* POS Billing Page Responsiveness */
@media (max-width: 1024px) {
  .pos-grid {
    grid-template-columns: 1fr;
    height: auto;
    gap: 0.85rem;
  }

  .pos-left {
    height: auto;
  }

  .pos-right {
    height: auto;
  }

  .medicine-results-container {
    max-height: 380px;
  }

  .cart-items-wrapper {
    max-height: 300px;
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .search-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .search-input-group input {
    font-size: 0.82rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .select-filter {
    width: 100%;
    font-size: 0.8rem;
  }

  .medicine-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
  }

  .med-card {
    padding: 0.55rem;
  }

  .med-name {
    font-size: 0.82rem;
  }

  .med-generic {
    font-size: 0.65rem;
  }

  .med-price {
    font-size: 0.9rem;
  }

  /* Cart Footer Responsive Layout */
  .cart-footer-row1 {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .cart-footer-row2 {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    font-size: 0.75rem;
  }

  .summary-pill {
    justify-content: space-between;
    width: 100%;
  }

  .cart-footer-row3 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

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

  .cash-received-box {
    justify-content: space-between;
  }

  .btn-complete-sale {
    padding: 0.65rem;
    font-size: 0.85rem !important;
  }
}

/* Dashboard Stats & Charts Responsiveness */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .stat-info h3 {
    font-size: 0.68rem;
  }

  .stat-info .stat-value {
    font-size: 1.2rem;
  }

  .chart-card {
    padding: 0.85rem;
  }

  .chart-header h3 {
    font-size: 0.95rem;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Data Tables & Table Cards Responsive Horizontal Scrolling */
.table-card {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

@media (max-width: 768px) {
  .table-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .table-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .table-controls input,
  .table-controls select,
  .table-controls button,
  .table-controls .btn {
    width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem 0.65rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

/* Form Grids & Modal Dialogs Responsiveness */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-box {
    max-width: 100% !important;
    max-height: 94vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 0.85rem 1rem;
  }

  .modal-header h3 {
    font-size: 1rem;
  }

  .modal-body {
    padding: 0.85rem 1rem;
    max-height: calc(94vh - 120px);
  }

  .modal-footer {
    padding: 0.75rem 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
  }
}

/* Login Page Mobile Optimization */
@media (max-width: 1024px) {
  body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
  }

  .login-wrapper {
    max-width: 480px;
    margin: 1rem auto;
    border-radius: 1.25rem;
  }

  .login-form-container {
    order: 1 !important;
    padding: 1.5rem 1.25rem !important;
  }

  .login-hero {
    order: 2 !important;
    padding: 1.25rem !important;
  }

  .login-hero .hero-content {
    margin: 0.75rem 0 !important;
  }

  .login-hero .feature-list {
    display: none !important;
  }

  .form-header h3 {
    font-size: 1.3rem !important;
  }
}

/* Application Footer Styling */
.app-footer {
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

@media (max-width: 640px) {
  .app-footer {
    padding: 0.5rem 1rem !important;
    gap: 0.35rem;
    justify-content: center !important;
    text-align: center;
  }
}



@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --primary-teal: #0d9488;
  --primary-teal-hover: #0f766e;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
}

html {
  font-size: clamp(14px, 0.4vw + 12px, 16px);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #0b132b;
  color: #f1f5f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Fluid Heading & Typography Scaling */
.fluid-hero-title {
  font-size: clamp(1.35rem, 3.5vw + 0.8rem, 2.25rem);
  line-height: 1.25;
}

.fluid-page-title {
  font-size: clamp(1.2rem, 2.5vw + 0.7rem, 1.75rem);
  line-height: 1.3;
}

.fluid-token-badge {
  font-size: clamp(2.25rem, 6vw + 0.8rem, 3.75rem);
  line-height: 1.1;
}

/* Glassmorphism Card Effects */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.37);
}

.glass-card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(20, 184, 166, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(13, 148, 136, 0.15);
}

/* Glowing Token Badge */
.token-badge-pulse {
  position: relative;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  box-shadow: 0 0 25px rgba(13, 148, 136, 0.5);
  animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 15px rgba(13, 148, 136, 0.4);
  }
  100% {
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.7);
  }
}

/* Input Fields Styling */
.form-input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  transition: all 0.2s ease-in-out;
  min-height: 42px;
}

.form-input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.form-input.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.field-error-msg {
  color: #f87171;
  font-size: 0.8125rem;
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Mobile Responsive Toast Container */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
}

@media (max-width: 640px) {
  #toast-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
}

.toast {
  min-width: 280px;
  max-width: 100%;
  padding: 0.875rem 1.125rem;
  border-radius: 0.75rem;
  background: #1e293b;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-left: 4px solid #14b8a6;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-success {
  border-left-color: #10b981;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Table Custom Styling & Touch Scroll */
.table-responsive-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 680px;
}

.custom-table th {
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-table tbody tr {
  transition: background-color 0.2s ease;
}

.custom-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.5);
}

/* Font Mono for Tokens */
.font-mono-token {
  font-family: 'JetBrains Mono', monospace;
}

/* Mobile Menu Animation */
#mobile-menu {
  transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
}

#mobile-menu.hidden {
  display: none;
}

/* Touch Friendly Targets */
button, a, input, select, textarea {
  touch-action: manipulation;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
