/* ==========================================
   ASHEN SriLanka - CSS DESIGN SYSTEM
   ========================================== */

/* Design Tokens & Variables */
:root {
  --font-family-sans: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
  --font-family-display: 'Outfit', sans-serif;
  
  /* Color Palette - Premium Dark Theme */
  --bg-app: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --border-color: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accent Colors */
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --accent: #06b6d4; /* Cyan */
  --accent-hover: #0891b2;
  
  --success: #10b981; /* Emerald */
  --success-hover: #059669;
  
  --error: #ef4444; /* Red */
  --error-bg: rgba(239, 68, 68, 0.1);
  
  /* Interface Metrics */
  --sidebar-width: 300px;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, textarea, select, button {
  font-family: inherit;
  color: inherit;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Hidden Utility */
.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-accent {
  background-color: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--success);
  color: #fff;
}
.btn-success:hover {
  background-color: var(--success-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: transparent;
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background-color: var(--error-bg);
  border-color: var(--error);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-only:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

/* ==========================================
   AUTHENTICATION LAYOUT
   ========================================== */
.auth-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
              #070a13;
}

.auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 40px;
  width: 420px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-premium);
}

.brand-header {
  text-align: center;
  margin-bottom: 35px;
}

.logo-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-family: var(--font-family-display);
  font-size: 1.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  margin-bottom: 15px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.brand-header h1 {
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.brand-header p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-top: 4px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

/* Inputs & Form Groups */
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

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

.input-wrapper input,
.input-wrapper textarea {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  outline: none;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-wrapper textarea {
  padding-left: 14px;
}

.input-wrapper.readonly input {
  background: rgba(15, 23, 42, 0.3);
  color: var(--text-muted);
  border-style: dashed;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(15, 23, 42, 0.8);
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Error Alert */
.error-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--error-bg);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  font-size: 0.85rem;
}
.error-alert svg {
  width: 18px;
  height: 18px;
}

/* ==========================================
   MAIN APP DASHBOARD LAYOUT
   ========================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-box {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo h3 {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  line-height: 1.1;
}

.sidebar-logo span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.sidebar-actions {
  padding: 20px 24px 10px 24px;
}

.sidebar-search {
  padding: 10px 24px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 8px 12px 8px 36px;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}
.search-box input:focus {
  border-color: var(--primary);
  background-color: rgba(15, 23, 42, 0.8);
}
.search-box svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

/* History List */
.invoice-list-wrapper {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.invoice-list-wrapper h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.invoice-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}
.history-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateX(2px);
}
.history-item.active {
  background: var(--primary-glow);
  border-color: var(--primary);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.history-item-num {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.history-item-total {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.history-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.history-item-client {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.btn-delete-invoice {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}
.btn-delete-invoice:hover {
  color: var(--error);
  background: var(--error-bg);
}
.btn-delete-invoice svg {
  width: 14px;
  height: 14px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

.username-display {
  font-size: 0.85rem;
  font-weight: 600;
}

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

/* Main Area Layout */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title h2 {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.8rem;
}
.header-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.workspace-container {
  max-width: 1100px;
  width: 100%;
}

.card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-premium);
}

/* Editor Form Styling */
.form-section {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-family-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.section-title svg {
  width: 18px;
  height: 18px;
}

/* Form Helper Grid layout */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.gap-sm {
  gap: 12px;
}

.items-end {
  align-items: flex-end;
}

/* Items Table Layout */
.items-section {
  padding-bottom: 12px;
}

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.table-container {
  overflow-x: auto;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.items-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color);
}

.items-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.items-table input {
  background-color: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}
.items-table input:focus {
  border-color: var(--primary);
  background-color: rgba(15, 23, 42, 0.7);
}

.text-right {
  text-align: right !important;
}

.w-120 { width: 120px; }
.w-150 { width: 150px; }
.w-60 { width: 60px; }

.item-row-total {
  font-weight: 600;
  color: var(--text-primary);
}

/* Summary Box */
.summary-box {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  width: 100%;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.discount-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}
.discount-inputs input {
  width: 50px;
  text-align: center;
  padding: 4px 6px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
}
.discount-inputs input:focus {
  border-color: var(--primary);
}

.grand-total-row {
  border-top: 2px solid var(--border-color);
  padding-top: 14px;
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.grand-total-row span:last-child {
  color: var(--accent);
}

/* Micro-animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-fade-in { animation: fadeIn 0.6s ease forwards; }
.animate-slide-up-1 { animation: slideUp 0.4s ease forwards 0.1s; opacity: 0; }
.animate-slide-up-2 { animation: slideUp 0.4s ease forwards 0.2s; opacity: 0; }
.animate-slide-up-3 { animation: slideUp 0.4s ease forwards 0.3s; opacity: 0; }

/* Print Only Class (Default Hidden) */
.print-only {
  display: none;
}

/* ==========================================
   MOBILE RESPONSIVE STYLES
   ========================================== */

/* Toggle Buttons - Default hidden on desktop */
.menu-toggle-btn,
.sidebar-close-btn {
  display: none !important;
}

@media (max-width: 768px) {
  /* Toggle Buttons visible on mobile */
  .menu-toggle-btn {
    display: inline-flex !important;
    margin-right: 12px;
  }
  
  .sidebar-close-btn {
    display: inline-flex !important;
    background: transparent;
    border: none;
    color: var(--text-secondary);
  }

  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Sidebar behavior on mobile */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }

  .app-sidebar.active {
    transform: translateX(0);
  }

  /* Main Area on mobile */
  .app-main {
    margin-left: 0;
    padding: 20px 16px;
    gap: 20px;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }

  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions .btn {
    flex: 1 1 calc(50% - 5px);
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  #btn-save {
    flex: 2 1 100%; /* Save is full width */
  }

  .workspace-container {
    padding: 0;
  }

  .card {
    padding: 16px;
  }

  /* Grids to single column */
  .grid-2-col {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .form-section {
    padding: 16px;
    margin-bottom: 16px;
  }

  /* Tables scroll container */
  .items-table {
    min-width: 650px;
  }

  .summary-box {
    margin-top: 15px;
  }
}

/* Sidebar Settings Panel */
.sidebar-settings {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.2);
}

.settings-details summary {
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.settings-details summary::-webkit-details-marker {
  display: none;
}
.settings-details summary:hover {
  color: var(--text-primary);
}
.settings-details summary svg {
  width: 14px;
  height: 14px;
}

.settings-content {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group.sm {
  margin-bottom: 0px;
}

.form-group.sm label {
  font-size: 0.7rem;
  margin-bottom: 4px;
}

.form-group.sm input {
  padding: 6px 10px;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  outline: none;
  color: var(--text-primary);
  width: 100%;
}
.form-group.sm input:focus {
  border-color: var(--primary);
}

/* ==========================================
   PRINT MEDIA RULES (WINDOW.PRINT OVERRIDES)
   ========================================== */
@media print {
  /* Hide all other sections to prevent blank pages */
  body > *:not(#invoice-print-container) {
    display: none !important;
  }
  
  #invoice-print-container {
    display: block !important;
    width: 100%;
    background: #fff !important;
    color: #1e293b !important;
  }
  
  body {
    background: #fff !important;
    color: #1e293b !important;
  }
  
  /* Printable page size configuration */
  @page {
    size: A4;
    margin: 15mm;
  }

  /* Printable style rules */
  .print-invoice {
    font-family: 'Outfit', -apple-system, system-ui, sans-serif;
    color: #1e293b;
    background: #fff;
    padding: 0;
    width: 100%;
    border-top: 6px solid #eab308; /* Premium Yellow Accent Bar */
    padding-top: 24px;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 24px;
  }

  .print-brand {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .print-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    line-height: 1.1;
    color: #000000 !important; /* Bold Black */
  }

  .print-title .accent-text {
    color: #eab308 !important; /* Vibrant Yellow */
  }

  .print-doc-type {
    font-size: 2rem;
    font-weight: 800;
    color: #000000; /* Black */
    letter-spacing: 2px;
    text-align: right;
    margin-bottom: 10px;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 12px;
    row-gap: 4px;
    font-size: 0.85rem;
    text-align: right;
  }

  .print-meta-label {
    font-weight: 600;
    color: #64748b;
  }

  .print-meta-val {
    color: #0f172a;
    font-weight: 500;
  }

  .print-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
  }

  .print-address-col h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #000000; /* Black labels */
    letter-spacing: 1.5px;
    border-bottom: 2px solid #eab308; /* Yellow border line */
    padding-bottom: 6px;
    margin-bottom: 12px;
    font-weight: 700;
  }

  .print-company-name,
  .print-client-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 4px;
  }

  .print-company-details,
  .print-client-address {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
  }

  .print-table th {
    background-color: #000000; /* Solid Black Header background */
    border-bottom: 3px solid #eab308; /* Yellow accent border below headers */
    padding: 12px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff !important; /* White text for contrast */
    text-align: left;
  }

  .print-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #334155;
  }

  .print-table .text-right {
    text-align: right;
  }

  .print-totals-notes {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
  }

  .print-notes-section h3,
  .print-bank-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #000000; /* Black labels */
    letter-spacing: 1.5px;
    border-bottom: 2px solid #eab308; /* Yellow border line */
    padding-bottom: 6px;
    margin-bottom: 12px;
    font-weight: 700;
  }

  .print-notes {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
    white-space: pre-line;
  }

  .print-bank-details {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
  }

  .print-totals-section {
    background: #fcfcfc;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #eab308; /* Yellow accent border */
  }

  .print-totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 6px 0;
    color: #475569;
  }

  .print-totals-row span {
    white-space: nowrap;
  }

  .print-discount-row {
    color: #b91c1c;
    font-weight: 600;
  }

  .print-grand-total {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    border-top: 2px solid #000000; /* Black border for total */
    margin-top: 6px;
    padding-top: 10px;
    gap: 4px;
  }

  .print-grand-total span:first-child {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .print-grand-total span:last-child {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    color: #000000 !important;
  }

  .print-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
  }
}

/* ==========================================
   MOBILE SCREEN OPTIMIZATIONS (TABLE TO CARDS)
   ========================================== */
@media (max-width: 600px) {
  /* Table to Cards */
  .items-table, .items-table thead, .items-table tbody, .items-table tr, .items-table td {
    display: block;
    width: 100% !important;
  }
  
  .items-table thead {
    display: none;
  }
  
  .items-table tbody tr {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
  }
  
  .items-table td {
    padding: 6px 0 !important;
    border: none !important;
    text-align: left !important;
  }
  
  /* Description field full width */
  .items-table td:nth-child(1) {
    grid-column: span 2;
    margin-bottom: 8px;
  }
  
  /* Labels above fields in card mode */
  .items-table td:nth-child(2)::before {
    content: "Quantity";
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  .items-table td:nth-child(3)::before {
    content: "Price (LKR)";
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  
  /* Text align inputs inside cards */
  .items-table td input {
    text-align: left !important;
  }
  
  /* Row Total Row */
  .items-table td:nth-child(4) {
    grid-column: span 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-color) !important;
    margin-top: 12px;
    padding-top: 12px !important;
  }
  
  .items-table td:nth-child(4)::before {
    content: "Total Amount:";
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
  }
  
  .item-row-total {
    font-size: 0.95rem;
    color: var(--accent);
  }
  
  /* Delete button in card top corner */
  .items-table td:nth-child(5) {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto !important;
    padding: 0 !important;
  }
  
  .btn-remove-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
  }
  
  .btn-remove-item:hover {
    background: var(--error-bg);
  }

  /* Compact workspace padding on small screens */
  .app-main {
    padding: 16px 12px !important;
    gap: 16px !important;
  }

  .grid-2-col {
    gap: 12px !important;
  }
}
