/* === Brand Colors - Orange/White/Green/Black Theme === */
:root {
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-light: #fff7ed;
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #f0fdf4;
  --black: #0f172a;
  --black-soft: #1e293b;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

/* === Card === */
.card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.25s;
}
.card:hover {
  box-shadow: 0 8px 30px rgba(249,115,22,0.08);
  border-color: rgba(249,115,22,0.15);
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: var(--white);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(249,115,22,0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(249,115,22,0.4);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--white);
  color: var(--black-soft);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  justify-content: center;
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--orange); color: var(--orange-dark); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: var(--white);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.4); transform: translateY(-1px); }

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

/* === Inputs === */
.input-field {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 14px;
  color: var(--black);
  transition: all 0.2s;
  outline: none;
}
.input-field:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }
.input-field::placeholder { color: var(--gray-400); }

.label { display: block; font-size: 13px; font-weight: 600; color: var(--black-soft); margin-bottom: 4px; }
.error-text { font-size: 12px; color: #ef4444; margin-top: 4px; }

/* === Badges === */
.badge-paid { background: var(--green-light); color: var(--green-dark); padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }
.badge-unpaid { background: #fef2f2; color: #dc2626; padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }
.badge-trial { background: var(--orange-light); color: var(--orange-dark); padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }
.badge-active { background: var(--green-light); color: var(--green-dark); padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }
.badge-expired { background: #fef2f2; color: #dc2626; padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }
.badge-yes { background: var(--green-light); color: var(--green-dark); padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }
.badge-no { background: #fef2f2; color: #dc2626; padding: 2px 10px; border-radius: 999px; font-weight: 500; font-size: 12px; }

/* === Table === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.data-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--orange-light); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table .actions { display: flex; gap: 4px; }

/* === Toast === */
.toast { padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,0.12); animation: slideIn 0.25s ease; min-width: 200px; max-width: 400px; backdrop-filter: blur(8px); }
.toast-success { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: white; }
.toast-error { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.toast-info { background: linear-gradient(135deg, var(--orange-dark), var(--orange)); color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === Modal === */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-content { background: var(--white); border-radius: 20px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.15); animation: fadeIn 0.2s ease; }
.modal-header { padding: 24px 24px 0; font-size: 18px; font-weight: 700; color: var(--black); }
.modal-body { padding: 16px 24px; }
.modal-footer { padding: 0 24px 24px; display: flex; gap: 8px; justify-content: flex-end; }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.25s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* === Skeleton === */
.skeleton { background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === Empty state === */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; text-align: center; }
.empty-state-icon { width: 64px; height: 64px; background: var(--orange-light); border-radius: 999px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 24px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--black); margin-bottom: 4px; }
.empty-state p { font-size: 14px; color: var(--gray-400); margin-bottom: 16px; }

/* === Nav === */
.nav-link { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all 0.15s; white-space: nowrap; text-decoration: none; color: var(--gray-500); }
.nav-link:hover { background: var(--orange-light); color: var(--orange-dark); }
.nav-link.active { background: var(--orange-light); color: var(--orange-dark); font-weight: 600; }

/* === Pagination === */
.pagination { display: flex; gap: 4px; justify-content: center; align-items: center; margin-top: 16px; }
.pagination button { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--gray-200); background: white; font-size: 13px; cursor: pointer; color: var(--gray-500); transition: all 0.15s; }
.pagination button:hover { background: var(--orange-light); border-color: var(--orange); color: var(--orange-dark); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: var(--gray-500); padding: 0px 8px; }

/* === Stat Cards === */
.stat-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  padding: 20px;
  transition: all 0.25s;
  text-decoration: none;
  display: block;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), #fbbf24);
  opacity: 0;
  transition: opacity 0.25s;
}
.stat-card:hover {
  box-shadow: 0 12px 40px rgba(249,115,22,0.12);
  border-color: var(--orange);
  transform: translateY(-3px);
}
.stat-card:hover::after { opacity: 1; }
.stat-card .icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 18px; }
.stat-card .value { font-size: 26px; font-weight: 800; color: var(--black); line-height: 1.2; }
.stat-card .label { font-size: 12px; color: var(--gray-400); font-weight: 500; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.03em; }

/* === Welcome section === */
.welcome-section {
  background: linear-gradient(135deg, var(--black) 0%, #1e293b 100%);
  border-radius: 20px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.welcome-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.15) 0%, transparent 70%);
}
.welcome-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.1) 0%, transparent 70%);
}
.welcome-content { position: relative; z-index: 1; }
.welcome-section h1 { font-size: 28px; font-weight: 800; color: var(--white); }
.welcome-section p { color: rgba(255,255,255,0.6); font-size: 15px; margin-top: 4px; }
.welcome-section .btn-primary { background: var(--orange); box-shadow: 0 4px 14px rgba(249,115,22,0.4); }
.welcome-section .btn-primary:hover { background: var(--orange-dark); }

/* === Dashboard cards === */
.dash-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  padding: 24px;
  transition: all 0.25s;
}
.dash-card:hover {
  box-shadow: 0 8px 30px rgba(249,115,22,0.08);
  border-color: rgba(249,115,22,0.15);
}
.dash-card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-card h2 .accent { color: var(--orange); }

.quick-action-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  transition: all 0.15s;
}
.quick-action-link:hover {
  background: var(--orange-light);
  color: var(--orange-dark);
  transform: translateX(4px);
}

/* === Invoice list item === */
.invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  border-radius: 8px;
  margin: 0 -8px;
  transition: all 0.15s;
}
.invoice-item:hover { background: var(--orange-light); }
.invoice-item:last-child { border-bottom: none; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* === Invoice export === */
#invoice-export-content { background: var(--white); color: var(--black); font-size: 14px; line-height: 1.6; }
#invoice-export-content table th { background: var(--gray-50); font-weight: 600; color: var(--black-soft); }
