/* ============================================================
   InvoiceHome - Main Stylesheet
   ============================================================ */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --secondary: #64748B;
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --dark: #111827;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
}

/* Base */
* { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dashboard-body {
  background: #F1F5F9;
}

.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-name { font-size: 15px; font-weight: 700; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-500);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-item.create-btn {
  background: rgba(37,99,235,0.15);
  color: #93C5FD;
  border: 1px solid rgba(37,99,235,0.3);
}

.nav-item.create-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.user-details { overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

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

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.sidebar-toggle-btn:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.topbar-user .user-avatar-sm {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
  cursor: pointer;
}

/* Breadcrumb */
.breadcrumb-item a {
  color: var(--gray-500);
  font-size: 13px;
}
.breadcrumb-item.active {
  color: var(--gray-800);
  font-size: 13px;
}
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--gray-300);
}

/* Page Content */
.page-content {
  padding: 28px 28px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin: 4px 0 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   CARDS
   ============================================================ */

.card-modern {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-modern .card-body {
  padding: 24px;
}

.card-title-sm {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

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

/* ============================================================
   STAT CARDS
   ============================================================ */

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

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

.stat-card-blue .stat-icon { background: #EFF6FF; color: var(--primary); }
.stat-card-green .stat-icon { background: #F0FDF4; color: var(--success); }
.stat-card-teal .stat-icon { background: #F0FDFA; color: #0D9488; }
.stat-card-orange .stat-icon { background: #FFF7ED; color: var(--warning); }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.stat-change {
  margin-top: 6px;
  font-size: 12px;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-modern {
  margin: 0;
}

.table-modern thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 20px;
  white-space: nowrap;
}

.table-modern tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr:hover {
  background: var(--gray-50);
}

/* Invoice number link */
.invoice-number-link {
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
}

.invoice-number-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Client info in table */
.client-name {
  font-weight: 500;
  color: var(--gray-800);
  font-size: 13px;
}

.client-company {
  font-size: 12px;
  color: var(--gray-400);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge-lg {
  padding: 6px 16px;
  font-size: 13px;
}

.status-draft { background: #F3F4F6; color: #6B7280; }
.status-sent { background: #DBEAFE; color: #1E40AF; }
.status-paid { background: #D1FAE5; color: #065F46; }
.status-overdue { background: #FEE2E2; color: #991B1B; }
.status-cancelled { background: #F3F4F6; color: #374151; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
  font-size: 14px;
  padding: 8px 16px;
  transition: all 0.15s;
}

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

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

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 13px;
}

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

/* ============================================================
   FORMS
   ============================================================ */

.form-control, .form-select {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  padding: 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: white;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  outline: none;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label-sm {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.form-text {
  font-size: 12px;
  color: var(--gray-400);
}

/* ============================================================
   SEARCH
   ============================================================ */

.search-input-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  padding-left: 36px !important;
}

/* Filter tabs */
.status-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-tab:hover { color: var(--gray-800); background: white; }
.filter-tab.active { background: white; color: var(--gray-900); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ============================================================
   QUICK ACTIONS BAR
   ============================================================ */

.quick-actions-bar {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.qa-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  transition: all 0.15s;
}

.qa-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #BFDBFE;
}

.qa-btn-danger:hover {
  background: #FEF2F2;
  color: var(--danger);
  border-color: #FECACA;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  width: 72px;
  height: 72px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  color: var(--gray-400);
}

.empty-state h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--gray-400);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ============================================================
   DELETE CONFIRM
   ============================================================ */

.delete-icon-wrap {
  width: 80px;
  height: 80px;
  background: #FEF2F2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 32px;
  color: var(--danger);
}

/* ============================================================
   CHECKLIST
   ============================================================ */

.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-600);
}
.checklist-item.completed { color: var(--gray-800); }
.checklist-item i { font-size: 16px; }

/* Progress */
.progress-sm { height: 6px; border-radius: 3px; background: var(--gray-100); }

/* ============================================================
   TOTALS SUMMARY
   ============================================================ */

.totals-summary { }
.sum-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.sum-row:last-child { border-bottom: none; }
.sum-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--gray-200) !important;
}

/* ============================================================
   INVOICE DETAIL
   ============================================================ */

.invoice-preview-card { }

.invoice-document {
  padding: 48px;
  min-height: 600px;
}

/* Classic Template Styles */
.template-classic .inv-classic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 3px solid var(--primary);
}
.template-classic .inv-brand-name { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.template-classic .inv-brand-person { font-size: 13px; color: var(--gray-500); }
.template-classic .inv-document-title { font-size: 40px; font-weight: 800; color: var(--primary); letter-spacing: 2px; text-align: right; }
.template-classic .inv-document-number { font-size: 14px; color: var(--gray-500); text-align: right; }

/* Modern Template */
.template-modern .inv-modern-header {
  background: var(--gray-900);
  color: white;
  padding: 36px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: -48px -48px 0 -48px;
}
.template-modern .inv-company-name { font-size: 20px; font-weight: 700; color: white; }
.template-modern .inv-from-name { font-size: 13px; color: var(--gray-400); margin-top: 2px; }
.template-modern .inv-address { font-size: 12px; color: var(--gray-500); margin-top: 8px; line-height: 1.6; }
.template-modern .inv-title-large { font-size: 40px; font-weight: 800; color: var(--primary); letter-spacing: 3px; text-align: right; }
.template-modern .inv-number-lg { font-size: 14px; color: var(--gray-400); text-align: right; margin-top: 4px; }
.template-modern .inv-modern-accent {
  height: 5px;
  background: linear-gradient(to right, var(--primary), #7C3AED, #EC4899);
  margin: 0 -48px 32px;
}

/* Minimal Template */
.template-minimal .inv-minimal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}
.template-minimal .inv-minimal-title {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--gray-400);
  text-transform: lowercase;
}
.template-minimal .inv-minimal-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

/* Common invoice body styles */
.inv-body { padding-top: 24px; }
.inv-meta-section {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}
.inv-from, .inv-to { flex: 1; }
.inv-dates { min-width: 180px; }
.inv-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.inv-meta-company { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.inv-meta-name { font-size: 13px; color: var(--gray-700); margin-top: 2px; }
.inv-meta-text { font-size: 12px; color: var(--gray-500); line-height: 1.6; margin-top: 4px; }
.inv-date-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.inv-date-label { font-size: 12px; color: var(--gray-500); }
.inv-date-value { font-size: 12px; font-weight: 600; color: var(--gray-700); }

/* Invoice items table */
.inv-items-table { margin-bottom: 32px; overflow: hidden; }
.inv-items-table table { width: 100%; border-collapse: collapse; }
.inv-table-header {
  background: var(--primary);
  color: white;
}
.inv-table-header th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}
.inv-th-qty, .inv-th-price, .inv-th-tax, .inv-th-total { text-align: right; }
.inv-th-qty { text-align: center; }
.inv-table-row td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.inv-table-row:last-child td { border-bottom: none; }
.inv-table-row:nth-child(even) { background: var(--gray-50); }
.inv-td-qty, .inv-td-price, .inv-td-tax, .inv-td-total { text-align: right; }
.inv-td-qty { text-align: center; }

/* Invoice totals */
.inv-totals-section { display: flex; justify-content: flex-end; margin-bottom: 32px; }
.inv-totals-table { width: 280px; }
.inv-total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.inv-total-row:last-child { border-bottom: none; }
.inv-total-final {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  border-top: 2px solid var(--gray-200) !important;
  padding-top: 12px !important;
  margin-top: 4px;
}

/* Notes section */
.inv-notes-section {
  display: flex;
  gap: 32px;
  border-top: 1px solid var(--gray-200);
  padding-top: 24px;
  margin-top: 24px;
}
.inv-notes, .inv-terms { flex: 1; }
.inv-notes-section p { font-size: 13px; color: var(--gray-500); line-height: 1.6; }

/* ============================================================
   STICKY SIDEBAR
   ============================================================ */

.sticky-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
}

/* ============================================================
   CLIENT CARDS
   ============================================================ */

.client-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.client-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 12px;
}

.client-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.client-card-name { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.client-card-company { font-size: 13px; color: var(--gray-500); }

.client-card-body {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.client-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.client-detail i {
  width: 14px;
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

.client-card-footer {
  padding: 12px 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 8px;
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */

.profile-avatar-section { text-align: center; }

.profile-avatar-large {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 32px;
  color: white;
  margin: 0 auto;
}

.company-logo-preview {
  max-width: 120px;
  max-height: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  padding: 4px;
}

/* ============================================================
   PUBLIC NAVBAR
   ============================================================ */

.public-navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  padding: 12px 0;
}

.public-navbar .navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.public-navbar .nav-link {
  color: var(--gray-600);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px !important;
  transition: color 0.15s;
}

.public-navbar .nav-link:hover { color: var(--primary); }

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero-section {
  background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 40%, #2563EB 70%, #3B82F6 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 0 100px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.min-vh-85 { min-height: 85vh; }

.hero-content { position: relative; z-index: 1; color: white; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #34D399;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  color: white;
  margin-bottom: 20px;
}

.text-gradient {
  background: linear-gradient(to right, #93C5FD, #C4B5FD);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 12px; margin-bottom: 48px; flex-wrap: wrap; }

.btn-hero {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  border: none;
}
.btn-hero:hover { background: #F0F9FF; color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

.btn-hero-outline {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}
.btn-hero-outline:hover { background: rgba(255,255,255,0.2); color: white; transform: translateY(-2px); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: inline-flex;
}

.stat-item { text-align: center; padding: 0 20px; }
.stat-number { display: block; font-size: 24px; font-weight: 800; color: white; }
.stat-label { display: block; font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.2); }

/* Hero Invoice Mockup */
.hero-invoice-preview {
  position: relative;
  z-index: 1;
  padding: 24px;
}

.invoice-mockup {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.25);
  position: relative;
}

.mockup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}

.mockup-logo { display: flex; align-items: center; gap: 10px; }
.logo-box { width: 32px; height: 32px; background: var(--primary); border-radius: 6px; }
.mockup-company { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.mockup-subtitle { font-size: 11px; color: var(--gray-400); }
.mockup-invoice-title .inv-title { font-size: 18px; font-weight: 800; color: var(--primary); text-align: right; }
.mockup-invoice-title .inv-number { font-size: 11px; color: var(--gray-400); text-align: right; }

.mockup-dates { display: flex; gap: 20px; margin-bottom: 14px; }
.date-row { display: flex; gap: 6px; align-items: center; }
.date-label { font-size: 11px; color: var(--gray-400); }
.date-value { font-size: 11px; font-weight: 600; color: var(--gray-700); }

.mockup-bill { margin-bottom: 16px; }
.bill-to { }
.bill-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray-400); margin-bottom: 4px; }
.bill-name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.bill-company { font-size: 11px; color: var(--gray-500); }

.mockup-table { background: var(--gray-50); border-radius: 8px; padding: 8px; margin-bottom: 14px; }
.table-header {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--primary);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
}
.table-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}

.mockup-totals { margin-bottom: 16px; }
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
  color: var(--gray-600);
}
.total-final {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  border-top: 2px solid var(--gray-200);
  padding-top: 8px;
  margin-top: 4px;
}

.mockup-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.paid-badge { background: #D1FAE5; color: #065F46; }

/* Float cards on mockup */
.float-card {
  position: absolute;
  background: white;
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  border: 1px solid var(--gray-100);
  animation: float 3s ease-in-out infinite;
}

.float-card-1 { top: 10px; right: 0; animation-delay: 0s; }
.float-card-2 { bottom: 40px; left: -10px; animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================================
   TRUSTED BY
   ============================================================ */

.section-trusted {
  background: white;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.trusted-label {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.trusted-logos {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.trusted-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
}

.trusted-item i { font-size: 18px; }

/* ============================================================
   SECTION COMMON
   ============================================================ */

.section-header { margin-bottom: 56px; }
.section-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.section-title { font-size: 36px; font-weight: 800; color: var(--gray-900); margin-bottom: 16px; }
.section-subtitle { font-size: 18px; color: var(--gray-500); max-width: 600px; margin: 0 auto; }

/* ============================================================
   FEATURES SECTION
   ============================================================ */

.features-section {
  padding: 96px 0;
  background: var(--gray-50);
}

.feature-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  height: 100%;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.feature-title { font-size: 17px; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
.feature-desc { font-size: 14px; color: var(--gray-500); line-height: 1.6; margin: 0; }

/* ============================================================
   HOW IT WORKS
   ============================================================ */

.how-it-works-section {
  padding: 96px 0;
  background: white;
}

.steps-list { }

.step-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-number {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h3 { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.step-content p { font-size: 15px; color: var(--gray-500); line-height: 1.6; margin: 0; }

.step-connector {
  width: 2px;
  height: 40px;
  background: var(--gray-200);
  margin: 8px 0 8px 21px;
}

.hiw-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--gray-50);
  border-radius: var(--radius-xl);
}

.hiw-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  box-shadow: var(--shadow-sm);
}

.hiw-card i { font-size: 22px; }
.hiw-card-1 i { color: var(--primary); }
.hiw-card-2 i { color: var(--warning); }
.hiw-card-3 i { color: var(--success); }

/* ============================================================
   TEMPLATE SHOWCASE
   ============================================================ */

.templates-section {
  padding: 96px 0;
  background: var(--gray-50);
}

.template-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.template-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.template-card-featured {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.template-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-preview {
  height: 220px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.template-preview-1 { background: #FAFCFF; }
.template-preview-2 { background: #0F172A; }
.template-preview-3 { background: white; }

/* Template preview mockup elements */
.tp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.tp-logo-box {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 6px;
}

.tp-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
}

.modern-header { }
.tp-title-modern { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: 3px; }
.tp-logo-modern { width: 28px; height: 28px; background: rgba(255,255,255,0.2); border-radius: 4px; }
.tp-accent-bar { height: 4px; background: linear-gradient(to right, var(--primary), #7C3AED); margin: -8px 0 12px; }

.tp-minimal-title { font-size: 12px; letter-spacing: 4px; color: var(--gray-400); text-transform: lowercase; }
.minimal-header { align-items: flex-end; }

.tp-line { height: 8px; background: var(--gray-200); border-radius: 4px; }
.tp-line.wide { width: 60%; }
.tp-line.medium { width: 40%; }

.tp-body { display: flex; flex-direction: column; gap: 6px; }

.tp-table { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.tp-row { height: 10px; background: var(--gray-100); border-radius: 3px; }
.tp-row.header { background: var(--primary); height: 14px; }
.modern-table .tp-row.header, .modern-header-row { background: rgba(255,255,255,0.15) !important; }
.minimal-table .tp-row { background: var(--gray-100); }
.tp-total { height: 14px; background: #DBEAFE; border-radius: 4px; width: 40%; align-self: flex-end; margin-top: 4px; }
.modern-total { background: rgba(37,99,235,0.3); }
.minimal-total { background: var(--gray-200); }

.template-info {
  padding: 20px 24px 24px;
  text-align: center;
  border-top: 1px solid var(--gray-100);
}

.template-info h4 { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.template-info p { font-size: 13px; color: var(--gray-400); margin-bottom: 16px; }

/* Mini template in form */
.tp-mini { height: 80px; border-radius: 4px; padding: 8px; overflow: hidden; }
.tp-mini-1 { background: #FAFCFF; border: 1px solid var(--gray-200); }
.tp-mini-2 { background: #0F172A; }
.tp-mini-3 { background: white; border: 1px solid var(--gray-200); }
.tpm-header { height: 16px; background: var(--primary); border-radius: 3px; margin-bottom: 6px; }
.tpm-header.modern { background: rgba(255,255,255,0.15); }
.tpm-accent { height: 3px; background: linear-gradient(to right, var(--primary), #7C3AED); margin: -4px 0 6px; }
.tpm-minimal-title { height: 8px; background: var(--gray-200); border-radius: 3px; width: 50%; margin-bottom: 8px; }
.tpm-line { height: 5px; background: var(--gray-200); border-radius: 3px; margin-bottom: 4px; }
.tpm-line.short { width: 60%; }
.tpm-table { height: 20px; background: var(--gray-100); border-radius: 3px; }
.tpm-table.minimal { background: var(--gray-100); }

/* ============================================================
   TESTIMONIALS
   ============================================================ */

.testimonials-section {
  padding: 96px 0;
  background: white;
}

.testimonial-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 32px;
  height: 100%;
  transition: box-shadow 0.2s;
}

.testimonial-card:hover { box-shadow: var(--shadow-md); }

.stars { color: #F59E0B; margin-bottom: 16px; }
.testimonial-text { font-size: 15px; color: var(--gray-600); line-height: 1.7; margin-bottom: 24px; font-style: italic; }

.testimonial-author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}
.author-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.author-role { font-size: 12px; color: var(--gray-400); }

/* ============================================================
   CTA SECTION
   ============================================================ */

.cta-section {
  padding: 96px 0;
  background: var(--gray-50);
}

.cta-card {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-title { font-size: 36px; font-weight: 800; color: white; margin-bottom: 12px; }
.cta-subtitle { font-size: 17px; color: rgba(255,255,255,0.7); line-height: 1.5; margin: 0; }

.cta-btn {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  background: white;
  color: var(--primary-dark);
}

.cta-note { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 10px; margin-bottom: 0; }

/* ============================================================
   FOOTER
   ============================================================ */

.footer-main {
  background: var(--gray-900);
  color: white;
  padding: 64px 0 32px;
}

.footer-brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-desc { font-size: 14px; color: var(--gray-400); line-height: 1.6; }
.footer-heading { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-300); margin-bottom: 16px; }

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--gray-400); font-size: 14px; transition: color 0.15s; }
.footer-links a:hover { color: white; }

.footer-divider { border-color: rgba(255,255,255,0.08); margin: 40px 0 24px; }
.footer-bottom { text-align: center; font-size: 13px; color: var(--gray-500); }

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-page {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%);
  min-height: 100vh;
}

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-100);
}

.auth-header { text-align: center; margin-bottom: 32px; }

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 24px;
}

.auth-logo i { color: var(--primary); font-size: 24px; }

.auth-title { font-size: 26px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--gray-400); }

.auth-form { }

.btn-auth {
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--gray-500);
}
.auth-footer a { color: var(--primary); font-weight: 600; }

.forgot-link {
  font-size: 13px;
  color: var(--primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
  .section-title { font-size: 28px; }
  .inv-meta-section { flex-direction: column; gap: 20px; }
  .invoice-document { padding: 24px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .hero-stats { flex-direction: column; }
  .stat-divider { width: 60px; height: 1px; }
  .cta-card { padding: 40px 28px; }
  .cta-title { font-size: 26px; }
  .status-filter-tabs { display: none; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .hero-actions { flex-direction: column; }
  .btn-hero, .btn-hero-outline { width: 100%; text-align: center; }
  .auth-card { padding: 28px 24px; margin: 16px; }
}
