/* ============================================================
   BuildQuote Pro - Main Stylesheet
   Dark navy theme + amber/orange accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #161b27;
  --bg-card: #1a2035;
  --bg-card-hover: #1e2640;
  --bg-input: #0d1120;
  --border: #2a3355;
  --border-light: #334070;

  --amber: #F59E0B;
  --amber-light: #FCD34D;
  --amber-dark: #D97706;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --amber-glow-strong: rgba(245, 158, 11, 0.3);

  --text-primary: #f0f4ff;
  --text-secondary: #8892b0;
  --text-muted: #4a5580;

  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --status-draft: #6b7280;
  --status-sent: #3b82f6;
  --status-accepted: #10b981;
  --status-rejected: #ef4444;
  --status-expired: #f59e0b;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-amber: 0 0 30px rgba(245, 158, 11, 0.2);

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--amber);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--amber-light);
}

img {
  max-width: 100%;
  display: block;
}

input,
textarea,
select,
button {
  font-family: var(--font);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--amber);
}

/* ── Typography ────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1rem;
}

.text-amber {
  color: var(--amber);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ── Spacing ───────────────────────────────────────────────── */
.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.py-20 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ── Navbar ────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.navbar-logo span.brand-pro {
  color: var(--amber);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--amber-glow);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language Selector */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn:hover {
  border-color: var(--amber);
  background: var(--amber-glow);
}

.lang-btn .flag {
  font-size: 1.1rem;
}

.lang-btn .chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.lang-btn.open .chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 200;
}

.lang-dropdown.open {
  display: block;
  animation: fadeInDown 0.15s ease;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.875rem;
}

.lang-option:hover {
  background: var(--amber-glow);
}

.lang-option.active {
  color: var(--amber);
  font-weight: 600;
}

.lang-option .flag {
  font-size: 1.1rem;
}

/* Mobile menu toggle */
.mob-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.mob-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.mob-menu.open {
  display: flex;
}

.mob-menu .nav-link {
  width: 100%;
  text-align: left;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #000;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  color: #000;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--amber);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-xs {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  padding: 0.5rem;
  min-width: 36px;
  min-height: 36px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-hoverable:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  display: none;
}

.form-error.visible {
  display: block;
}

.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
}

.toggle input:checked+.toggle-slider {
  background: var(--amber);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(20px);
}

/* ── Page wrapper ──────────────────────────────────────────── */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

#app-wrapper {
  padding-top: 68px;
}

/* ── Section ───────────────────────────────────────────────── */
.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--amber-glow);
  color: var(--amber);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 580px;
  margin: 0 auto;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--amber);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.75rem;
  animation: fadeInDown 0.6s ease;
}

.hero h1 {
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.3s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-top: 4rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
}

.hero-stat .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ── Features ──────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}

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

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  margin-bottom: 0.625rem;
  font-size: 1.0625rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* ── Pricing ───────────────────────────────────────────────── */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.billing-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.billing-label.active {
  color: var(--text-primary);
}

.annual-badge {
  background: var(--amber-glow);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  position: relative;
  transition: all var(--transition);
}

.pricing-card:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
}

.pricing-card.featured {
  border-color: var(--amber);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.15);
  transform: scale(1.03);
}

.pricing-card.featured:hover {
  transform: scale(1.03) translateY(-3px);
}

.pricing-badge-recommended {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-plan-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 1rem 0;
}

.price-currency {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.price-amount {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.price-period {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.price-original {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 0.5rem;
}

.pricing-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features li .check {
  width: 22px;
  height: 22px;
  background: var(--amber-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.rate-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Dashboard / App pages ─────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 68px);
}

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.sidebar-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--amber-glow);
  color: var(--amber);
  font-weight: 600;
}

.sidebar-nav-item .icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 1rem;
}

.app-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow: hidden;
}

/* ── Stats cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  background: var(--amber-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(42, 51, 85, 0.5);
  font-size: 0.9375rem;
}

.data-table tr:hover td {
  background: rgba(245, 158, 11, 0.03);
}

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

/* ── Status badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.badge-draft {
  background: rgba(107, 114, 128, 0.15);
  color: var(--status-draft);
}

.badge-sent {
  background: rgba(59, 130, 246, 0.15);
  color: var(--status-sent);
}

.badge-accepted {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-accepted);
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-rejected);
}

.badge-expired {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-expired);
}

/* ── Invoice status badges ─────────────────────────────────── */
.badge-borrador {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
}

.badge-enviada {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-pagada {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-vencida {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── Botón convertir factura ───────────────────────────────── */
.btn-invoice {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
}

.btn-invoice:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.15));
  border-color: var(--amber);
}

/* ── Invoice stats ─────────────────────────────────────────── */
.invoice-stat-overdue {
  border-color: var(--danger) !important;
}

.invoice-stat-overdue .stat-value {
  color: var(--danger);
}

/* ── Quote Builder ─────────────────────────────────────────── */
.quote-builder {
  max-width: 860px;
  margin: 0 auto;
}

.steps-header {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
  gap: 0;
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-slow);
  z-index: 1;
  position: relative;
}

.step-line {
  height: 2px;
  flex: 1;
  background: var(--border);
  transition: background var(--transition-slow);
}

.step-item.active .step-dot {
  background: var(--amber);
  border-color: var(--amber);
  color: #000;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.step-item.completed .step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-item.completed .step-line {
  background: var(--success);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.step-item.active .step-label {
  color: var(--amber);
}

.step-item.completed .step-label {
  color: var(--success);
}

.steps-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

.step-nav-label {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
}

.step-nav-label.active {
  color: var(--amber);
}

.step-nav-label.completed {
  color: var(--success);
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: fadeInUp 0.25s ease;
}

/* Materials table */
.materials-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.materials-table th {
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-input);
  text-align: left;
}

.materials-table td {
  padding: 0.5rem 0.375rem;
  vertical-align: middle;
}

.materials-table .form-input,
.materials-table .form-select {
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
}

.total-cell {
  font-weight: 600;
  color: var(--amber);
  font-size: 0.9375rem;
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

.subtotal-row {
  border-top: 2px solid var(--border);
  background: var(--bg-secondary);
}

.subtotal-row td {
  padding: 1rem 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Summary totals */
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.summary-line:last-child {
  border-bottom: none;
}

.summary-line .label {
  color: var(--text-secondary);
}

.summary-line .value {
  font-weight: 600;
  white-space: nowrap;
}

.grand-total-line {
  background: var(--amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grand-total-line .label {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
}

.grand-total-line .amount {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--amber);
  white-space: nowrap;
}

/* Totals summary — new structured layout */
.totals-divider {
  height: 2px;
  background: var(--border);
  margin: 0.75rem 0;
  position: relative;
}

.totals-divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 40%;
  height: 100%;
  background: var(--amber);
  opacity: 0.4;
}

.total-with-tax-line {
  border-bottom: none !important;
  padding: 0.75rem 0 0 !important;
}

.total-with-tax-line .label {
  font-size: 1.0625rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.total-with-tax-line .amount {
  font-size: 2rem !important;
  font-weight: 900 !important;
  color: var(--amber) !important;
  white-space: nowrap !important;
}

/* PDF totals preview box */
.pdf-totals-box {
  border: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  background: var(--amber-glow);
}

.pdf-totals-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--amber), transparent);
  margin: 0.75rem 0;
  opacity: 0.6;
}

/* Discount toggle */
.discount-type-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.discount-type-btn {
  flex: 1;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.discount-type-btn.active {
  background: var(--amber);
  color: #000;
}

/* PDF preview */
.pdf-preview {
  background: white;
  color: #111;
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', sans-serif;
}

/* ── Auth pages ────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.625rem;
  font-weight: 800;
  margin-bottom: 0.375rem;
}

.auth-sub {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Search + filter bar */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9375rem;
  pointer-events: none;
}

.search-input-wrap .form-input {
  padding-left: 2.5rem;
}

/* ── Toast notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 300px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--info);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-msg {
  font-size: 0.9375rem;
  flex: 1;
}

.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  background: none;
  border: none;
  padding: 0 0.25rem;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInUp 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

/* ── Profile ───────────────────────────────────────────────── */
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.logo-upload-area:hover {
  border-color: var(--amber);
  background: var(--amber-glow);
}

.logo-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  object-fit: contain;
  border: 1px solid var(--border);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

.visible {
  display: block !important;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.relative {
  position: relative;
}

.overflow-hidden {
  overflow: hidden;
}

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

.italic {
  font-style: italic;
}

.opacity-50 {
  opacity: 0.5;
}

.divide-y>*+* {
  border-top: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ── Loading spinner ───────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

/* ── Quote number display ──────────────────────────────────── */
.quote-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--amber);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
}

/* ── Step nav buttons ──────────────────────────────────────── */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    width: 230px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pricing-card.featured {
    transform: none;
  }
}

@media (max-width: 768px) {
  .navbar-links {
    display: none;
  }

  .mob-menu-btn {
    display: block;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .app-main {
    padding: 1.5rem 1rem;
  }

  .sidebar-divider {
    display: none;
  }

  .sidebar-label {
    display: none;
  }

  .sidebar-nav-item {
    flex: 0 0 auto;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  .materials-table {
    font-size: 0.8125rem;
  }

  .modal {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .btn-lg {
    font-size: 0.9375rem;
    padding: 0.75rem 1.5rem;
  }
}

/* ── CTA Section ───────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 5rem 0;
}

.cta-glow {
  position: relative;
  display: inline-block;
}

.cta-glow::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 70%);
  pointer-events: none;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.875rem;
  max-width: 280px;
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.625rem;
}

.footer-col ul li a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: color var(--transition);
  cursor: pointer;
}

.footer-col ul li a:hover {
  color: var(--amber);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}