/* ============================================
   ZATCA E-Invoice System - Modern Dark Theme
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Tajawal:wght@300;400;500;700;800&display=swap");

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(17, 24, 39, 0.6);
  --bg-input: rgba(30, 41, 59, 0.8);
  --border-color: rgba(99, 102, 241, 0.2);
  --border-hover: rgba(99, 102, 241, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --info: #06b6d4;
  --info-glow: rgba(6, 182, 212, 0.3);
  --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-2: linear-gradient(135deg, #06b6d4, #6366f1);
  --gradient-3: linear-gradient(135deg, #10b981, #06b6d4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Tajawal", "Inter", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(99, 102, 241, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(139, 92, 246, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 60% 80%,
      rgba(6, 182, 212, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.navbar-brand .logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  box-shadow: var(--shadow-glow);
}

.navbar-brand h1 {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-brand span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: -4px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: var(--shadow-glow);
}

.nav-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px var(--accent-glow);
}

.nav-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.nav-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.05);
}

/* ---- Main Container ---- */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* ---- Page Header ---- */
.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ---- Stats Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 50%;
  opacity: 0.1;
}

.stat-card:nth-child(1)::before {
  background: var(--accent);
}
.stat-card:nth-child(2)::before {
  background: var(--success);
}
.stat-card:nth-child(3)::before {
  background: var(--warning);
}
.stat-card:nth-child(4)::before {
  background: var(--info);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.stat-card:nth-child(1) .stat-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
}
.stat-card:nth-child(2) .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.stat-card:nth-child(3) .stat-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.stat-card:nth-child(4) .stat-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--info);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---- Cards / Panels ---- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 1.5rem;
}

/* ---- Table ---- */
.table-wrapper {
  overflow-x: auto;
}

.invoice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.invoice-table th {
  padding: 14px 16px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.4);
  white-space: nowrap;
}

.invoice-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  vertical-align: middle;
}

.invoice-table tbody tr {
  transition: var(--transition);
}

.invoice-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* Generic table used across management pages */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}
.table th {
  padding: 12px 14px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.35);
}
.table td {
  padding: 12px 14px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
}
.table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.table-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.table-search input {
  width: 320px;
  max-width: 100%;
}

.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}
.pagination .page-btn {
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}
.pagination .page-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}
.pagination .page-info {
  color: var(--text-secondary);
  margin-right: auto;
}

.no-results {
  padding: 1rem;
  color: var(--text-secondary);
}

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
  background: rgba(6, 182, 212, 0.12);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--success-glow);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-right: 2px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  direction: rtl;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---- Invoice Form: Line Items ---- */
.line-items-section {
  margin-top: 1.5rem;
}

.line-item-header {
  display: grid;
  grid-template-columns: 40px 2fr 1fr 1fr 1fr 1fr 1fr 50px;
  gap: 8px;
  padding: 0 12px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.line-item-row {
  display: grid;
  grid-template-columns: 40px 2fr 1fr 1fr 1fr 1fr 1fr 50px;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(30, 41, 59, 0.3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.08);
  align-items: center;
  transition: var(--transition);
  animation: slideInUp 0.3s ease;
}

.line-item-row:hover {
  background: rgba(30, 41, 59, 0.5);
  border-color: var(--border-color);
}

.line-item-row .item-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.line-item-row .form-control {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.line-item-row .calculated-field {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  text-align: center;
  padding: 8px;
}

.remove-item-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.remove-item-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  transform: scale(1.1);
}

.add-item-btn {
  margin-top: 8px;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border-color);
  background: transparent;
  color: var(--accent-light);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.add-item-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

/* ---- Invoice Totals ---- */
.invoice-totals {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
}

.totals-row.total-main {
  font-size: 1.2rem;
  font-weight: 800;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid var(--border-color);
  color: var(--accent-light);
}

.totals-row .label {
  color: var(--text-secondary);
}

.totals-row .value {
  font-weight: 600;
  direction: ltr;
}

/* ---- Invoice View ---- */
.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.detail-section {
  padding: 1.25rem;
  background: rgba(30, 41, 59, 0.3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.08);
}

.detail-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
}

.detail-row .label {
  color: var(--text-secondary);
}

.detail-row .value {
  font-weight: 600;
}

/* ---- QR Code Display ---- */
.qr-code-container {
  text-align: center;
  padding: 2rem;
}

.qr-code-container img {
  max-width: 250px;
  border-radius: var(--radius-md);
  border: 3px solid var(--border-color);
  padding: 8px;
  background: white;
}

.qr-code-container p {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---- Alerts ---- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  animation: slideInUp 0.3s ease;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.alert-info {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--info);
}

/* ---- Loading ---- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 1.5rem;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ---- Animations ---- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-in {
  animation: slideInUp 0.4s ease;
}

/* ---- ZATCA Status Panel ---- */
.zatca-status-panel {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.zatca-status-panel.status-cleared {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.zatca-status-panel.status-reported {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.15);
}

.zatca-status-panel.status-pending {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.zatca-status-panel.status-error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.status-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }
  .main-container {
    padding: 1rem;
  }
  .line-item-header {
    display: none;
  }
  .line-item-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .line-item-row .item-num {
    display: none;
  }
  .form-row,
  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  * {
    color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: white !important;
    color: #1a1a1a !important;
    direction: rtl;
    font-size: 12pt;
    padding: 0;
    margin: 0;
  }

  body::before {
    display: none;
  }

  .navbar,
  .no-print,
  .btn-group,
  .loading-overlay {
    display: none !important;
  }

  .main-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }
}

/* ---- Print Invoice Specific ---- */
.print-invoice {
  background: white;
  color: #1a1a1a;
  padding: 30px;
  max-width: 800px;
  margin: 2rem auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  direction: rtl;
}

.print-invoice * {
  color: #1a1a1a;
}

.print-invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #6366f1;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.print-invoice-header .company-info h2 {
  font-size: 1.4rem;
  color: #1a1a1a;
  font-weight: 800;
}

.print-invoice-header .company-info p {
  font-size: 0.85rem;
  color: #555;
  margin-top: 2px;
}

.print-invoice-header .invoice-meta {
  text-align: left;
}

.print-invoice-header .invoice-meta h3 {
  font-size: 1.6rem;
  color: #6366f1;
  font-weight: 800;
  margin-bottom: 5px;
}

.print-invoice-header .invoice-meta .meta-row {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 2px;
}

.print-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.print-party {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-right: 4px solid #6366f1;
}

.print-party h4 {
  font-size: 0.85rem;
  color: #6366f1;
  margin-bottom: 8px;
  font-weight: 700;
}

.print-party p {
  font-size: 0.85rem;
  color: #333;
  margin-bottom: 2px;
}

.print-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.print-items-table th {
  background: #6366f1;
  color: white;
  padding: 10px 12px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
}

.print-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.print-items-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.print-totals {
  margin-right: auto;
  width: 300px;
  margin-bottom: 20px;
}

.print-totals .totals-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
}

.print-totals .totals-row.total-main {
  font-size: 1.1rem;
  font-weight: 800;
  border-top: 2px solid #6366f1;
  padding-top: 10px;
  margin-top: 6px;
  color: #6366f1;
}

.print-qr-section {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-top: 20px;
}

.print-qr-section img {
  width: 180px;
  height: 180px;
}

.print-qr-info h4 {
  font-size: 0.9rem;
  color: #6366f1;
  margin-bottom: 5px;
}

.print-qr-info p {
  font-size: 0.75rem;
  color: #666;
}

.print-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.75rem;
  color: #999;
}

@media print {
  .print-invoice {
    margin: 0;
    padding: 20px;
    box-shadow: none;
    border-radius: 0;
  }
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  animation: slideInUp 0.3s ease;
}

.modal-content h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
  justify-content: flex-start;
}
