:root {
  --brand: #0b5fff;
  --text: #0b1221;
  --muted: #6b7280;
  --bg: #f7f8fb;
  --card: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html, body { height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.hidden { display: none !important; }

.landing {
  display: grid;
  gap: 3rem;
  padding: 2.5rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}
.landing.is-hidden { display: none !important; }
.landing-mode #app { display: none; }
.has-session .landing { display: none; }
.landing-hero {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  background: linear-gradient(135deg, rgba(11,95,255,0.08), rgba(14,165,233,0.08));
  border: 1px solid rgba(14, 116, 233, 0.15);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.landing-hero-text h1 {
  font-size: clamp(2.25rem, 5vw, 3.2rem);
  margin: 0.35rem 0;
}
.landing-hero-text p {
  font-size: 1.05rem;
  color: #475569;
}
.landing-social-proof {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
  color: #334155;
  margin-top: 0.85rem;
}
.social-proof-label {
  font-weight: 600;
}
.landing-social-proof a {
  color: #0b5fff;
  font-weight: 600;
  text-decoration: none;
}
.landing-social-proof a:hover {
  text-decoration: underline;
}
.facebook-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.facebook-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.global-loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 200;
}
.global-loading-indicator.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}
.global-loading-indicator .loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: loading-spin 0.75s linear infinite;
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
.landing-hero-panel {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.5rem;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.landing-hero-panel ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #475569;
}
.landing-hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.landing-section-header { text-align: center; max-width: 720px; margin: 0 auto 1.5rem; }
.landing-section-header h2 { margin: 0.35rem 0; font-size: 2rem; }
.landing-section-header p { color: #475569; }
.landing-section { display: grid; gap: 1.5rem; }
.landing-hero, .landing-section { scroll-margin-top: 80px; }
.landing-grid, .pricing-grid, .faq-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.landing-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem;
  background: #fff;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}
.landing-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #475569;
}
.landing-card.highlight {
  border-color: rgba(11, 95, 255, 0.25);
  box-shadow: 0 16px 40px rgba(11, 95, 255, 0.15);
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(11, 95, 255, 0.1);
  color: #0b5fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 1rem 0.5rem;
  display: grid;
  gap: 0.75rem;
}
.top-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.quick-action {
  white-space: nowrap;
}
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.drawer-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.drawer-open .nav-toggle span:nth-child(2) { opacity: 0; }
.drawer-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.logo { width: 28px; height: 28px; }
.brand h1 { font-size: 1.05rem; margin: 0; }
.session-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  flex-wrap: wrap;
}
.plan-usage {
  display: grid;
  gap: 0.2rem;
}
.plan-label {
  font-weight: 600;
  color: #111827;
}
.usage-metrics {
  font-size: 0.85rem;
  color: var(--muted);
}
.session-user { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end; }
.session-user .user-email { font-weight: 600; font-size: 0.9rem; }
.session-actions { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }
.marketing-links { display: none; align-items: center; gap: 1rem; font-size: 0.95rem; }
.marketing-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.marketing-links a:hover { color: var(--text); }
.top-bar-cta { display: flex; align-items: center; gap: 0.5rem; }
.landing-mode .session-chip { display: none; }
.landing-mode .top-bar-cta .quick-action { display: none; }
.nav-drawer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
.landing-mode .nav-drawer,
.landing-mode .nav-toggle {
  display: none !important;
}
.nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.nav-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--card);
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.25);
  transform: translateX(-105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.25rem;
}
.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.drawer-marketing-links {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.landing-mode .drawer-marketing-links { display: flex; }
.drawer-marketing-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.drawer-open .nav-drawer { pointer-events: auto; }
.drawer-open .nav-drawer-backdrop { opacity: 1; }
.drawer-open .nav-drawer-panel { transform: translateX(0); }
.nav { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-link {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
}
.nav-link.active { border-color: var(--brand); color: var(--brand); }
.nav-link.primary { background: var(--brand); color: white; border-color: var(--brand); }
#logout-btn { font-size: 0.8rem; padding: 0.35rem 0.65rem; }
.upgrade-btn { font-size: 0.8rem; padding: 0.35rem 0.65rem; background: var(--brand); color: #fff; border-color: var(--brand); }
.usage-metrics.warn { color: #ea580c; font-weight: 600; }
.usage-metrics.limit { color: var(--danger); font-weight: 600; }

#app { max-width: 1100px; margin: 1rem auto; padding: 0 1rem; }
.view { display: none; }
.view.active { display: block; }

.card { background: var(--card); border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.col { flex: 1 1 300px; }
.muted { color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.45rem 0.75rem; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.success { background: var(--success); color: #fff; border-color: var(--success); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.link { border: none; background: none; color: var(--brand); padding: 0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.nav .nav-link.disabled,
.btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.admin-panel { display: grid; gap: 1.5rem; }
.admin-summary {
  display: grid;
  gap: 1rem;
}
.admin-summary-heading h3 { margin: 0; }
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.admin-summary-placeholder,
.admin-summary-empty { grid-column: 1 / -1; }
.admin-summary-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 90px;
}
.admin-summary-item .label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.admin-summary-item strong { font-size: 1.25rem; }
.admin-account-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.admin-account-table thead tr { background: #f8fafc; }
.admin-account-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding: 0.85rem;
}
.admin-account-table td {
  padding: 0.85rem;
  vertical-align: top;
  border-top: 1px solid #f1f5f9;
}
.admin-row-placeholder td {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}
.admin-account-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 1rem;
}
.admin-account-id { font-size: 0.8rem; }
.admin-account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.admin-plan-current { display: flex; flex-direction: column; gap: 0.1rem; }
.admin-control-group { display: grid; gap: 0.3rem; margin-top: 0.5rem; font-size: 0.85rem; }
.admin-control-group select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}
.admin-usage-cell { font-size: 0.85rem; }
.admin-usage-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed #e5e7eb;
}
.admin-usage-row:last-child { border-bottom: none; }
.admin-status-badge-wrapper { margin-bottom: 0.4rem; }
.admin-status-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.admin-status-badge.status-active { background: #dcfce7; color: #166534; }
.admin-status-badge.status-trialing { background: #e0f2fe; color: #0c4a6e; }
.admin-status-badge.status-suspended { background: #fee2e2; color: #b91c1c; }
.admin-status-badge.status-cancelled { background: #fef3c7; color: #92400e; }
.admin-status-cell .admin-control-group select { width: 100%; }
.admin-delete-wrap { margin-top: 0.5rem; }
.admin-delete-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}
.admin-feedback { font-size: 0.75rem; min-height: 1rem; margin-top: 0.35rem; }
.admin-error { border: 1px solid var(--danger); border-radius: 12px; padding: 1rem; background: #fef2f2; }
.admin-upgrade-hint { font-size: 0.85rem; color: #6b7280; margin-top: 0.35rem; }
.usage-banner { border: 1px solid #fcd34d; border-radius: 12px; padding: 1rem; background: #fef9c3; display: grid; gap: 0.5rem; }
.usage-banner h3 { margin: 0; }
.usage-banner ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.usage-banner-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem; border-bottom: 1px solid #eee; text-align: left; }
th { color: #111827; }
.responsive-table { width: 100%; }
.responsive-table tbody tr:nth-child(odd) { background: #fcfdff; }
.responsive-table td { vertical-align: top; }
.line-items-table { width: 100%; margin-top: 0.5rem; }
.line-items-table thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #475569; }

label { display: block; font-size: 0.9rem; margin-bottom: 0.25rem; }
input, select, textarea { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid #e5e7eb; border-radius: 8px; font: inherit; background: #fff; }
input[type="color"] { padding: 0; height: 2rem; }

.form-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.75rem; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-12 { grid-column: span 12; }

.app-footer { text-align: center; padding: 1rem; color: var(--muted); }

/* Invoice templates container */
.invoice-surface {
  background: white;
  color: #111827;
  width: min(100%, 880px);
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}
.invoice-content {
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  gap: 1.5rem;
}
.invoice-content section {
  display: grid;
  gap: 0.75rem;
}
.bank-details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 1rem 1.25rem;
  display: grid;
  gap: 1rem;
}
.bank-details-heading {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}
.bank-details-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.bank-details-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: white;
  border: 1px solid #e2e8f0;
}
.bank-details-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0b1221;
}
.bank-detail-row {
  display: grid;
  gap: 0.15rem;
}
.bank-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.bank-detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

/* Print styles */
.preview-card { display: grid; gap: 0.75rem; }
.preview-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.preview-actions .spacer { flex: 1 1 auto; }

.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.dashboard-stat h2 { margin: 0; font-size: 2rem; }
.stat-values { margin-top: 0.35rem; display: grid; gap: 0.35rem; }
.stat-value { display: flex; justify-content: space-between; font-size: 0.95rem; }
.stat-value-code { color: var(--muted); font-size: 0.85rem; margin-left: 0.35rem; }

.customers-page { display: grid; gap: 1rem; }
.customer-form-card { max-width: 640px; }
.customer-list-card { display: grid; gap: 1rem; }
.customer-card-list { display: grid; gap: 1rem; }
.customer-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem; display: grid; gap: 0.75rem; background: white; }
.customer-card-header { display: grid; gap: 0.25rem; }
.customer-card-body { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.customer-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.customer-card-actions .btn { flex: 0 0 auto; }
.stat-label { font-weight: 600; margin-bottom: 0.25rem; }
.customer-cell { display: grid; gap: 0.25rem; }
.customer-name { font-weight: 600; font-size: 1rem; }
.customer-contact { color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.contact-sep { opacity: 0.5; }
.customer-stat-cell { display: grid; gap: 0.35rem; font-size: 0.9rem; }
.stat-count { font-weight: 600; }
.stat-amount-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.currency-row { display: flex; justify-content: space-between; gap: 0.5rem; }
.currency-code { color: var(--muted); }
.overdue-pill { display: inline-flex; align-items: center; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(220, 38, 38, 0.1); color: var(--danger); font-size: 0.8rem; width: fit-content; }

.payments-panel { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem; display: grid; gap: 0.75rem; }
.payments-summary { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font-size: 0.95rem; }
.payments-summary strong { font-weight: 700; margin-right: 0.25rem; }
.status-pill { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.status-pill.partial { background: rgba(234, 179, 8, 0.15); color: #b45309; }
.status-pill.received { background: rgba(22, 163, 74, 0.15); color: var(--success); }
.payments-list { display: grid; gap: 0.5rem; }
.payment-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px dashed #d1d5db; border-radius: 10px; background: #fff; }
.payment-row .btn { justify-self: end; }
.payment-form { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.payment-form label { font-size: 0.8rem; margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; }

.reports-page { display: grid; gap: 1rem; }
.report-filters { display: grid; gap: 1rem; }
.report-filter-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.report-quick-range { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.report-summary { display: grid; gap: 0.75rem; }
.report-summary-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.report-tile { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; padding: 0.75rem; display: grid; gap: 0.35rem; }
.report-tile-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.report-tile-value { font-size: 1.6rem; font-weight: 700; }
.report-totals-table { width: 100%; border-collapse: collapse; }
.report-totals-table th, .report-totals-table td { padding: 0.5rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
.report-list-card { overflow-x: auto; }
.report-list { width: 100%; border-collapse: collapse; min-width: 680px; }
.report-list thead th { background: #f1f5f9; }
.report-list tbody tr:nth-child(odd) { background: #f9fafb; }
.report-list th, .report-list td { padding: 0.5rem; border-bottom: 1px solid #e5e7eb; text-align: left; }

body.auth-mode .nav-toggle,
body.auth-mode .nav-drawer,
body.auth-mode .app-footer,
body.auth-mode .landing { display: none !important; }
body.auth-mode #app { max-width: 520px; }
body.auth-mode .app-header { align-items: center; }
body.auth-mode .top-bar { justify-content: center; }
body.auth-mode .session-chip { display: none !important; }
body.auth-mode .quick-action { display: none !important; }
#view-auth { min-height: calc(100vh - 160px); padding: 2rem 1rem; }
.auth-secondary-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}
.auth-secondary-actions .btn {
  min-width: 180px;
  justify-content: center;
}
.video-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.video-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}
.video-card.upcoming {
  cursor: default;
  opacity: 0.7;
  box-shadow: none;
}
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-placeholder {
  color: #cbd5f5;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.play-badge {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transform: scale(1);
  transition: transform 0.2s ease, background 0.2s ease;
}
.video-card:not(.upcoming):hover .play-badge {
  transform: scale(1.08);
  background: rgba(11, 95, 255, 0.9);
}
.play-badge::before {
  content: '';
  border-style: solid;
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.video-card.upcoming .play-badge {
  display: none;
}
.video-card-body {
  padding: 1rem 1.25rem 1.3rem;
  display: grid;
  gap: 0.4rem;
}
.video-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 210;
}
.video-modal.open {
  display: flex;
}
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}
.video-modal-panel {
  position: relative;
  width: min(960px, 90vw);
  border-radius: 18px;
  background: #0f172a;
  padding: 1rem;
  box-shadow: 0 45px 100px rgba(15, 23, 42, 0.5);
  animation: modal-in 0.25s ease;
}
.video-wrapper {
  position: relative;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.video-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  .customers-page { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .session-chip { flex-direction: column; align-items: flex-start; }
  .session-actions { width: 100%; justify-content: flex-start; }
  .quick-action { display: none; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-drawer { position: static; pointer-events: auto; }
  .nav-drawer-backdrop { display: none !important; }
  .nav-drawer-panel {
    position: static;
    width: 100%;
    transform: none !important;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    flex-direction: column;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-link { text-align: center; }
  .landing-mode .marketing-links { display: flex; }
  .top-bar-cta { gap: 0.75rem; }
}

@media (max-width: 720px) {
  .responsive-table thead { display: none; }
  .responsive-table tbody { display: grid; gap: 0.75rem; }
  .responsive-table tr {
    display: grid;
    gap: 0.4rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: #fff;
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    border: none;
    padding: 0.1rem 0;
    font-size: 0.92rem;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #475569;
  }
  .form-row { grid-template-columns: repeat(1, 1fr); }
  .span-6,
  .span-4,
  .span-3,
  .span-12 { grid-column: span 1; }
  .line-items-table thead { display: none; }
  .line-items-table tbody { display: grid; gap: 0.75rem; }
  .line-items-table tr {
    display: grid;
    gap: 0.45rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
  }
  .line-items-table td {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0;
    border: none;
  }
  .line-items-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
  }
}

@media print {
  body { background: white; }
  .app-header, .app-footer, .nav, #view-dashboard, #view-customers, #view-invoices, #view-new-invoice, #view-quotes, #view-new-quote, #view-settings, #view-reports, .preview-actions { display: none !important; }
  #view-invoice-preview { display: block !important; }
  #view-invoice-preview .card { border: none; box-shadow: none; padding: 0; background: transparent; }
  #view-invoice-preview .payments-panel { display: none !important; }
  .invoice-surface { border: none; box-shadow: none; width: 210mm; min-height: auto; margin: 0 auto; border-radius: 0; }
  .invoice-content { padding: 16mm; gap: 12mm; }
  @page { size: A4; margin: 12mm; }
}
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
  background: #f7f8fb;
}
.legal-page main { background: #fff; border-radius: 18px; border: 1px solid #e5e7eb; padding: 2rem; box-shadow: 0 15px 40px rgba(15,23,42,0.08); }
.legal-page h1 { margin-top: 0; }
.legal-page a { color: var(--brand); }
