/* Modern Glassmorphic Dark Design System for Mobile Repair POS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 12px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glass-backdrop: blur(16px);
}

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

body {
  background: radial-gradient(circle at top left, #1e1b4b, #0f172a, #090d16);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
.header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  font-size: 1.5rem;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.role-badge {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-manager {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Main Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
  flex: 1;
}

/* Tabs Bar */
.main-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Action Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.search-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  min-width: 280px;
  flex: 1;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

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

.select-dropdown {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.6);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(71, 85, 105, 0.8);
}

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

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

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Table Container */
.table-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.data-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

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

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

.product-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #1e293b;
  border: 1px solid var(--border-color);
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-category {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
}

.badge-retail {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-wholesale {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.stock-in {
  color: var(--success);
  font-weight: 600;
}

.stock-low {
  color: var(--warning);
  font-weight: 600;
}

.stock-out {
  color: var(--danger);
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
}

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

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

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

.close-btn:hover {
  color: var(--text-main);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Multi-select Category Pills */
.category-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  max-height: 120px;
  overflow-y: auto;
}

.category-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(51, 65, 85, 0.6);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.category-checkbox-label input {
  accent-color: var(--primary);
}

/* Thermal Barcode Sticker Print Modal & Preview */
.sticker-preview-box {
  background: white;
  color: black;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  border: 2px dashed #cbd5e1;
  text-align: center;
}

.sticker-50x30 {
  width: 250px;
  height: 150px;
}

.sticker-40x20 {
  width: 200px;
  height: 100px;
}

.sticker-title {
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sticker-price {
  font-size: 0.85rem;
  font-weight: 700;
}

.sticker-img {
  max-height: 55px;
  max-width: 100%;
  object-fit: contain;
  margin: 4px 0;
}

/* Hidden container for printing */
#thermal-print-area {
  display: none;
}

/* PRINT STYLESHEET FOR THERMAL STICKER PRINTERS */
@media print {
  body * {
    visibility: hidden;
  }
  #thermal-print-area, #thermal-print-area * {
    visibility: visible;
  }
  #thermal-print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .thermal-sticker-page {
    page-break-after: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: white !important;
    color: black !important;
    font-family: monospace, Arial, sans-serif;
  }

  .thermal-sticker-page.size-50x30 {
    width: 50mm;
    height: 30mm;
    padding: 2mm;
  }

  .thermal-sticker-page.size-40x20 {
    width: 40mm;
    height: 20mm;
    padding: 1.5mm;
  }

  .thermal-sticker-page .p-name {
    font-size: 9pt;
    font-weight: bold;
    line-height: 1.1;
    max-height: 2.2em;
    overflow: hidden;
  }

  .thermal-sticker-page .p-price {
    font-size: 8pt;
    font-weight: bold;
  }

  .thermal-sticker-page img.p-barcode {
    max-height: 14mm;
    width: 90%;
    object-fit: contain;
    margin: 1mm 0;
  }
}

/* ==========================================================================
   POS & CARTS & INVOICE MODULE STYLES (Phase 5)
   ========================================================================== */

/* POS Layout 2-Column System */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
}

/* Product Grid */
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.pos-product-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pos-product-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
  background: var(--bg-card-hover);
}

.pos-product-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
}

.pos-product-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.35rem;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-product-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.pos-product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}

.pos-price-retail {
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
}

.pos-price-wholesale {
  font-size: 0.8rem;
  color: var(--accent-purple);
  font-weight: 500;
}

.pos-add-btn {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-product-card:hover .pos-add-btn {
  background: var(--primary);
  color: white;
}

/* Right Cart Panel */
.cart-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
  position: sticky;
  top: 90px;
  overflow-y: auto;
}

.cart-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 0.75rem;
}

.customer-select-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

/* Pricing Tier Toggle Switch */
.tier-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.tier-toggle-group {
  display: flex;
  background: rgba(30, 41, 59, 0.9);
  padding: 2px;
  border-radius: 6px;
}

.tier-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Cart Items Container */
.cart-items-container {
  min-height: 180px;
  max-height: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-right: 0.35rem;
}

.cart-items-container::-webkit-scrollbar,
.cart-card::-webkit-scrollbar {
  width: 6px;
}

.cart-items-container::-webkit-scrollbar-thumb,
.cart-card::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

.cart-items-container::-webkit-scrollbar-thumb:hover,
.cart-card::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

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

.cart-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.cart-table td {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.cart-item-name {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  font-size: 0.85rem;
}

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

.cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.cart-qty-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cart-qty-input {
  width: 32px;
  background: transparent;
  border: none;
  color: var(--text-main);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-empty-box {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* Cart Summary Box */
.cart-summary-box {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 8px;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
}

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

.summary-line-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.summary-line-input input {
  width: 90px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  text-align: right;
  font-size: 0.85rem;
}

.payment-options-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.payment-options-row select {
  font-size: 0.75rem;
  padding: 0.35rem;
}

.grand-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.grand-total-price {
  font-size: 1.3rem;
  color: #10b981;
  font-weight: 800;
}

.btn-checkout {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-checkout:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

/* Invoice Modal & Print Container */
.invoice-container {
  background: #ffffff;
  color: #0f172a;
  padding: 1.5rem;
  border-radius: 8px;
  font-family: 'Inter', Arial, sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.inv-brand h2 {
  font-size: 1.3rem;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.inv-brand p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.inv-meta {
  text-align: right;
}

.inv-meta h3 {
  font-size: 1.1rem;
  color: #2563eb;
  margin-bottom: 0.2rem;
}

.inv-meta p {
  font-size: 0.8rem;
  color: #475569;
  margin: 0;
}

.invoice-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  padding: 0.85rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.inv-box {
  font-size: 0.82rem;
  color: #334155;
}

.invoice-details-grid .inv-box:last-child {
  text-align: right;
}

.inv-box strong {
  display: block;
  font-size: 0.85rem;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.inv-box p {
  margin: 0.15rem 0;
}

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

.invoice-table th {
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.6rem;
  text-align: left;
  border-bottom: 1px solid #cbd5e1;
  font-weight: 600;
}

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

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.inv-barcode-wrapper img {
  max-height: 50px;
}

.inv-totals-box {
  width: 220px;
}

.tot-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.3rem;
}

.tot-line.grand {
  font-size: 1.05rem;
  font-weight: bold;
  color: #0f172a;
  border-top: 2px solid #0f172a;
  padding-top: 0.4rem;
  margin-top: 0.4rem;
}

.inv-footer {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #cbd5e1;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Printable PDF/Browser View */
@media print {
  body * {
    visibility: hidden;
  }
  #invoice-printable-area, #invoice-printable-area * {
    visibility: visible;
  }
  #invoice-printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

/* ==========================================================================
   RMA MODULE STYLES (Phase 6)
   ========================================================================== */

.badge-scrapped {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-restocked {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.rma-lookup-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.rma-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border-color);
}

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

/* ==========================================================================
   REPORTS & ANALYTICS MODULE STYLES (Phase 7)
   ========================================================================== */

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

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.kpi-icon {
  font-size: 2.2rem;
  background: rgba(15, 23, 42, 0.6);
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}



