/* ============================================
   SK Engineering Invoice Management System
   Global Styles - Blue & White Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800;900&display=swap');

:root {
  --primary: #1e5fbf;
  --primary-dark: #154a99;
  --primary-light: #2d7ff9;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --accent: #3b82f6;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --text-dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg: #f4f7fb;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding-bottom: 90px;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   App Header
   ============================================ */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.app-header .logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .logo-wrap img {
  height: 40px;
  width: auto;
  background: white;
  padding: 4px 10px;
  border-radius: 8px;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.app-header .subtitle {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 18px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ============================================
   Page Container
   ============================================ */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  margin-top: 10px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
}

.section-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   Filter Tabs
   ============================================ */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  transition: var(--transition);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 95, 191, 0.3);
}

/* ============================================
   Invoice Cards
   ============================================ */
.invoice-list {
  display: grid;
  gap: 12px;
}

.invoice-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.invoice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-200);
}

.invoice-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.invoice-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invoice-info {
  flex: 1;
  min-width: 0;
}

.invoice-number {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}

.invoice-client {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-paid {
  background: var(--success-light);
  color: var(--success);
}

.badge-unpaid {
  background: var(--warning-light);
  color: #b45309;
}

.invoice-arrow {
  color: var(--text-light);
  font-size: 18px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 18px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ============================================
   Forms
   ============================================ */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 95, 191, 0.1);
}

.form-input[readonly] {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 700;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  display: none;
}

.form-error.show {
  display: block;
}

/* File Upload (PDF) */
.file-upload { position: relative; }

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
}

.upload-area:hover { border-color: var(--primary); background: var(--primary-50); }
.upload-area.dragging { border-color: var(--primary); background: var(--primary-50); }

.upload-area.has-file {
  padding: 10px;
  border-style: solid;
  border-color: var(--success);
  background: var(--success-light);
}

.upload-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}

.upload-text { color: var(--text-dark); font-weight: 700; margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-muted); }

.upload-preview { display: none; position: relative; }
.upload-preview.show { display: block; }

.pdf-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: white;
  border-radius: var(--radius-sm);
}

.pdf-preview i {
  font-size: 40px;
  color: #dc2626;
  flex-shrink: 0;
}

.pdf-info { flex: 1; min-width: 0; text-align: left; }

.pdf-name {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.pdf-size {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}

.upload-remove:hover { background: var(--danger); transform: scale(1.1); }

.upload-progress { display: none; margin-top: 12px; }
.upload-progress.show { display: block; }

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text { font-size: 12px; color: var(--text-muted); text-align: center; font-weight: 600; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 95, 191, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(30, 95, 191, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-dark);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, var(--success) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, var(--warning) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  font-weight: 700;
  font-size: 11px;
}

.nav-item .nav-icon {
  font-size: 22px;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.nav-item.add-btn {
  position: relative;
}

.nav-item.add-btn .nav-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-top: -20px;
  box-shadow: 0 6px 16px rgba(30, 95, 191, 0.4);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid var(--primary);
}

.toast.toast-out {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--primary); }

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: white;
}

.toast.success .toast-icon { background: var(--success); }
.toast.error .toast-icon { background: var(--danger); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.info .toast-icon { background: var(--primary); }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 800;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-muted);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ============================================
   Skeleton Loader
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.skeleton-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
}

.skeleton-content {
  flex: 1;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.h-lg { height: 18px; }

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.login-page::before {
  width: 400px;
  height: 400px;
  top: -150px;
  right: -100px;
}

.login-page::after {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: -80px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img {
  max-width: 180px;
  height: auto;
  margin: 0 auto 12px;
}

.login-logo h1 {
  color: var(--text-dark);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
   Invoice Detail Page
   ============================================ */
.detail-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 24px 20px 40px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin: -20px -20px 20px;
}

.detail-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.detail-hero h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-hero .client-email {
  font-size: 14px;
  opacity: 0.9;
}

.detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.detail-value {
  color: var(--text-dark);
  font-weight: 700;
  font-size: 15px;
  text-align: right;
}

.detail-value.amount {
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.invoice-image-container {
  margin-top: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.invoice-image-container img {
  width: 100%;
  display: block;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.action-buttons.single {
  grid-template-columns: 1fr;
}

/* ============================================
   Status Toggle
   ============================================ */
.status-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
}

.status-option {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 6px;
  transition: var(--transition);
  cursor: pointer;
}

.status-option.active.paid {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.status-option.active.unpaid {
  background: var(--warning);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* ============================================
   Modal / Overlay
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.modal-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.modal-message {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--primary-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-dark);
  font-weight: 700;
  font-size: 15px;
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 768px) {
  .page-container {
    padding: 30px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .invoice-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-card {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }

  .bottom-nav {
    max-width: 500px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
  }
}

@media (min-width: 1024px) {
  .invoice-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Hide scrollbar but keep functionality */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }


/* ============================================
   Uploadcare Widget Custom Styles
   ============================================ */

.uploadcare-wrapper {
  position: relative;
}

/* Style the Uploadcare widget button */
.uploadcare--widget {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 120px !important;
  border: 2px dashed var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--bg) !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  font-family: 'Nunito', sans-serif !important;
}

.uploadcare--widget:hover {
  border-color: var(--primary) !important;
  background: var(--primary-50) !important;
}

/* Widget open button */
.uploadcare--widget__button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  color: white !important;
  padding: 14px 28px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  border: none !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  box-shadow: 0 4px 12px rgba(30, 95, 191, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.uploadcare--widget__button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(30, 95, 191, 0.4) !important;
}

/* File name display */
.uploadcare--widget__file-name {
  margin-top: 12px !important;
  font-weight: 700 !important;
  color: var(--text-dark) !important;
  font-size: 14px !important;
  font-family: 'Nunito', sans-serif !important;
}

/* Progress bar */
.uploadcare--progressbar {
  width: 80% !important;
  max-width: 300px !important;
  margin-top: 12px !important;
}

.uploadcare--progressbar__bar {
  height: 6px !important;
  background: var(--border) !important;
  border-radius: 3px !important;
  overflow: hidden !important;
}

.uploadcare--progressbar__fill {
  height: 100% !important;
  background: linear-gradient(90deg, var(--primary), var(--primary-light)) !important;
  border-radius: 3px !important;
  transition: width 0.3s ease !important;
}

/* Clear button */
.uploadcare--widget__file-clear {
  margin-top: 8px !important;
  background: var(--danger) !important;
  color: white !important;
  border: none !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
}

.uploadcare--widget__file-clear:hover {
  background: #dc2626 !important;
}

/* Hide unwanted elements */
.uploadcare--widget__powered-by,
.uploadcare--widget__button_type_open .uploadcare--widget__button-icon {
  display: none !important;
}

/* Custom upload icon (added via CSS) */
.uploadcare-wrapper::before {
  content: '📄 Upload PDF';
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--primary);
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  text-align: center;
}

.uploadcare-wrapper .uploadcare--widget::before {
  display: none !important;
}

/* When file is uploaded, change wrapper style */
.uploadcare-wrapper.has-file .uploadcare--widget {
  border-color: var(--success) !important;
  border-style: solid !important;
  background: var(--success-light) !important;
}

/* Upload status text */
#uploadStatus {
  text-align: center;
  font-size: 13px;
  transition: all 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .uploadcare--widget {
    min-height: 100px !important;
    padding: 16px !important;
  }
  
  .uploadcare--widget__button {
    padding: 12px 20px !important;
    font-size: 14px !important;
  }
}
