/* ============================================================
   VMS Solar Suite — Marketing Site
   Design tokens: Cell/Panel/Marigold/Sky/Seal — drawn from the
   product itself (solar cells + official document stamps).
   ============================================================ */

:root {
  --cell: #10151C;
  --panel: #1C3D5A;
  --panel-soft: #274a6b;
  --marigold: #F2A93B;
  --marigold-deep: #D6901F;
  --sky: #EEF2F1;
  --sky-dim: #E2E8E6;
  --seal: #C4432E;
  --white: #FFFFFF;
  --ink-muted: #4B5A63;

  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --radius: 3px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--cell);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; color: var(--ink-muted); }

.mono { font-family: var(--font-mono); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--marigold); color: var(--cell); }
.btn-primary:hover { background: var(--marigold-deep); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: var(--white); }
.btn-outline { background: transparent; color: var(--panel); border-color: var(--panel); }
.btn-outline:hover { background: var(--panel); color: var(--white); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Nav ---------- */

.site-header {
  background: var(--cell);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 22px; height: 22px;
  background: var(--marigold);
  border-radius: 2px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
}
.brand-mark span { background: var(--cell); border-radius: 1px; }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 0.93rem; color: rgba(255,255,255,0.82); }
.nav-links a:hover { color: var(--white); }
.nav-cta { display: flex; gap: 12px; align-items: center; }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.6rem; cursor: pointer; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--cell);
    padding: 20px 24px;
    gap: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--cell);
  color: var(--white);
  padding: 72px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  /* Subtle solar-cell grid texture in the background */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--marigold);
  margin-bottom: 14px;
  display: inline-block;
}
.hero h1 { color: var(--white); }
.hero p.lead { color: rgba(255,255,255,0.72); font-size: 1.1rem; max-width: 480px; }
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Signature element: the animated quotation card ---------- */

.doc-card {
  background: var(--white);
  color: var(--cell);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  position: relative;
  transform: rotate(1.2deg);
}
.doc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--cell);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.doc-card-head .doc-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.doc-card-head .doc-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-muted); }
.doc-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 7px 0;
  border-bottom: 1px dashed var(--sky-dim);
}
.doc-line span:first-child { color: var(--ink-muted); }
.doc-fill {
  font-family: var(--font-mono);
  font-weight: 600;
}
.doc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--cell);
}
.doc-total .amt { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; }

.stamp {
  position: absolute;
  right: 18px; bottom: 18px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--seal);
  border: 3px solid var(--seal);
  border-radius: 6px;
  padding: 6px 14px;
  transform: rotate(-9deg) scale(1.8);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(.2,1.4,.4,1), opacity 0.25s ease;
}
.stamp.show {
  opacity: 1;
  transform: rotate(-9deg) scale(1);
}

/* ---------- Sections ---------- */

section { padding: 88px 0; }
.section-sky { background: var(--sky); }
.section-head { max-width: 620px; margin-bottom: 48px; }
.section-head .eyebrow { color: var(--seal); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--sky-dim);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.feature-card .glyph {
  width: 40px; height: 40px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: 18px;
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { margin: 0; font-size: 0.94rem; }

/* Workflow — genuinely sequential, numbers earn their place here */
.workflow { display: flex; flex-direction: column; gap: 0; }
.workflow-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--sky-dim);
}
.workflow-step:first-child { border-top: none; }
.workflow-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--marigold-deep);
}
.workflow-step h3 { margin-bottom: 4px; }
.workflow-step p { margin: 0; font-size: 0.94rem; }

/* Benefits: two-column contrast list */
.benefits-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--sky-dim); border-radius: var(--radius); overflow: hidden; }
.benefits-col { padding: 32px; }
.benefits-col.before { background: var(--sky); }
.benefits-col.after { background: var(--panel); color: var(--white); }
.benefits-col h4 { font-family: var(--font-mono); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; margin-bottom: 18px; color: var(--ink-muted); }
.benefits-col.after h4 { color: rgba(255,255,255,0.65); }
.benefits-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.benefits-col li { font-size: 0.95rem; padding-left: 22px; position: relative; }
.benefits-col.before li::before { content: "—"; position: absolute; left: 0; color: var(--ink-muted); }
.benefits-col.after li::before { content: "✓"; position: absolute; left: 0; color: var(--marigold); font-weight: 700; }
@media (max-width: 860px) { .benefits-compare { grid-template-columns: 1fr; } }

/* Testimonials */
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--sky-dim);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.testimonial-card blockquote { margin: 0; font-size: 1rem; color: var(--cell); font-style: normal; }
.testimonial-attrib { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem;
}
.testimonial-meta { font-size: 0.85rem; color: var(--ink-muted); }
.testimonial-meta strong { color: var(--cell); display: block; font-size: 0.9rem; }

/* Pricing */
.plan-card {
  background: var(--white);
  border: 1px solid var(--sky-dim);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}
.plan-card.featured {
  border: 2px solid var(--marigold);
  box-shadow: 0 20px 40px -20px rgba(242,169,59,0.4);
  position: relative;
}
.plan-badge {
  position: absolute; top: -13px; left: 28px;
  background: var(--marigold); color: var(--cell);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 3px; text-transform: uppercase;
  font-weight: 700;
}
.plan-name { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 10px; }
.plan-price { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; margin-bottom: 4px; }
.plan-price .period { font-size: 0.9rem; color: var(--ink-muted); font-weight: 400; }
.plan-features { list-style: none; padding: 0; margin: 24px 0 28px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.plan-features li { font-size: 0.92rem; padding-left: 22px; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--marigold-deep); font-weight: 700; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--sky-dim); }
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cell);
}
.faq-question .icon { font-family: var(--font-mono); color: var(--marigold-deep); font-size: 1.2rem; transition: transform 0.2s ease; }
.faq-question[aria-expanded="true"] .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-answer p { padding-bottom: 20px; margin: 0; }

/* Forms */
.form-card {
  background: var(--white);
  border: 1px solid var(--sky-dim);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 480px;
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--cell); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--sky-dim);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--sky);
}
.field textarea { resize: vertical; min-height: 100px; }
.form-msg { font-size: 0.9rem; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; display: none; }
.form-msg.success { background: #e5f3ea; color: #1c6b3a; display: block; }
.form-msg.error { background: #fbe7e3; color: var(--seal); display: block; }
.form-foot { font-size: 0.88rem; color: var(--ink-muted); margin-top: 18px; text-align: center; }

/* CTA band */
.cta-band {
  background: var(--panel);
  color: var(--white);
  text-align: center;
  padding: 72px 0;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.75); max-width: 480px; margin: 0 auto 28px; }

/* Blog */
.blog-card { border-bottom: 1px solid var(--sky-dim); padding: 28px 0; }
.blog-card:first-child { padding-top: 0; }
.blog-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 8px; }
.blog-content { max-width: 680px; }
.blog-content p { color: var(--cell); font-size: 1.02rem; line-height: 1.7; }

/* Footer */
.site-footer { background: var(--cell); color: rgba(255,255,255,0.65); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.4); margin-bottom: 16px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { font-size: 0.9rem; }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 24px; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge-pending { background: #fdf1de; color: var(--marigold-deep); padding: 3px 10px; border-radius: 10px; font-size: 0.78rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Dashboard shell (vendor + admin) — sidebar layout, data tables,
   status badges, inline forms. Shares tokens with the marketing
   site above but is a distinct visual register: denser, quieter,
   built for repeated daily use rather than persuasion.
   ============================================================ */

.dash {
  display: block;      /* sidebar is position:fixed, so no grid needed */
  min-height: 100vh;
}

.dash-sidebar {
  background: var(--cell);
  color: rgba(255,255,255,0.82);
  padding: 24px 18px;
  position: fixed;     /* always frozen — stays put while content scrolls */
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

/* Push main content to the right of the fixed sidebar */
.dash-main {
  margin-left: 240px;
}
.dash-sidebar .brand { color: var(--white); margin-bottom: 8px; padding: 0 6px; }
.dash-sidebar .role-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--marigold);
  padding: 0 6px 20px;
}
.dash-nav { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.dash-nav a {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-nav a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.dash-nav a.active { background: var(--panel); color: var(--white); font-weight: 600; }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.32);
  padding: 12px 12px 2px;
  margin-top: 2px;
}
.dash-sidebar .logout-link {
  margin-top: 16px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 18px;
}
.dash-sidebar .logout-link:hover { color: var(--white); }

.dash-main { padding: 32px 40px; background: var(--sky); min-height: 100vh; }
@media (max-width: 640px) { .dash-main { padding: 24px 18px; } }

.dash-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.dash-header h1 { font-size: 1.6rem; margin: 0; }
.dash-header p { margin: 4px 0 0; font-size: 0.92rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 32px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--white); border: 1px solid var(--sky-dim); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; color: var(--cell); }

.panel {
  background: var(--white);
  border: 1px solid var(--sky-dim);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--sky-dim); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.05rem; margin: 0; }
.panel-body { padding: 22px; }
.panel-body.tight { padding: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: #fff; }
table.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  padding: 12px 22px;
  border-bottom: 2px solid var(--panel-soft);
  background: var(--cell);
  white-space: nowrap;
}
table.data-table td { padding: 12px 22px; border-bottom: 1px solid var(--sky-dim); color: var(--cell); vertical-align: middle; background: #fff; }
table.data-table tbody tr:hover td { background: #f4f7fa; }
table.data-table tbody tr:nth-child(even) td { background: #f9fbfc; }
table.data-table tbody tr:nth-child(even):hover td { background: #eef2f6; }
/* sticky first-column must also respond to row hover */
table.data-table tbody tr:hover td[style*="position:sticky"],
table.data-table tbody tr:hover td[style*="position: sticky"] { background: #f4f7fa !important; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table .num { font-family: var(--font-mono); }
table.data-table .empty-row td { text-align: center; color: var(--ink-muted); padding: 32px; background: #fff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 0.76rem; font-weight: 600; font-family: var(--font-mono); }
.badge-pending { background: #fdf1de; color: var(--marigold-deep); }
.badge-approved, .badge-complete { background: #e5f3ea; color: #1c6b3a; }
.badge-rejected, .badge-suspended, .badge-cancelled { background: #fbe7e3; color: var(--seal); }
.badge-draft { background: var(--sky-dim); color: var(--ink-muted); }
.badge-sent { background: #e4edf5; color: var(--panel); }
.badge-accepted { background: #e5f3ea; color: #1c6b3a; }

/* ── Customer Tracking status pills ─────────────────────────── */
.ct-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.ct-badge-done      { background: #e5f3ea; color: #1c6b3a; }
.ct-badge-verified  { background: #d4edda; color: #155724; }
.ct-badge-pending   { background: #fff3cd; color: #856404; }
.ct-badge-progress  { background: #cfe2ff; color: #0a3678; }
.ct-badge-dispatched{ background: #d1ecf1; color: #0c5460; }
.ct-badge-fitting   { background: #fce8b2; color: #7a4f00; }
.ct-badge-completed { background: #c3e6cb; color: #155724; }
.ct-badge-no        { background: #f0f0f0; color: #666; }
.ct-badge-yes       { background: #d6f5d6; color: #1a6b1a; }
.ct-badge-na        { background: #ebebeb; color: #888; }
.ct-badge-disbursed { background: #d4edda; color: #0d5e0d; }
.ct-badge-surveydone{ background: #d1ecf1; color: #0c5460; }
.ct-badge-default   { background: #e8eaf6; color: #3949ab; }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-danger { background: transparent; color: var(--seal); border: 1px solid var(--seal); }
.btn-danger:hover { background: var(--seal); color: var(--white); }

.inline-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.inline-form .field { margin-bottom: 0; min-width: 0; }
.inline-form .field-action { display: flex; }

.toggle-panel { display: none; }
.toggle-panel.open { display: block; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 18px; }
.alert-success { background: #e5f3ea; color: #1c6b3a; }
.alert-error { background: #fbe7e3; color: var(--seal); }
.alert-info { background: #e4edf5; color: var(--panel); }

.line-items-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; min-width: 0; }
@media (max-width: 700px) { .line-items-row { grid-template-columns: 1fr 1fr; } }

.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-muted); }
.empty-state p { margin-bottom: 16px; }

.tab-bar { display: flex; gap: 6px; border-bottom: 1px solid var(--sky-dim); margin-bottom: 22px; }
.tab-btn { background: none; border: none; padding: 10px 16px; font-size: 0.9rem; font-weight: 600; color: var(--ink-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--panel); border-bottom-color: var(--panel); }

.spinner-text { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-muted); padding: 20px; }


/* ============================================================
   RESPONSIVE DASHBOARD — Mobile / Tablet / Desktop
   ============================================================ */

/* Hamburger button (mobile only) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: var(--cell);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}

@media (max-width: 900px) {
  .sidebar-toggle { display: block; }

  .dash-sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 240px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.25s ease;
  }

  .dash-sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }

  /* On mobile, remove desktop margin-left (sidebar is overlaid) */
  .dash-main {
    margin-left: 0;
    padding: 70px 16px 24px;   /* top padding for hamburger */
  }

  /* Stack inline-form vertically on mobile */
  .inline-form {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .inline-form .field { min-width: 100% !important; }

  /* Make data tables scroll horizontally */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 560px; }

  /* Stat cards: 2 columns on mobile */
  .stats-row { grid-template-columns: 1fr 1fr !important; }

  /* Dash header stack */
  .dash-header { flex-direction: column; align-items: flex-start; }
  .dash-header > div:last-child { width: 100%; }
  .dash-header > div:last-child .btn { width: 100%; text-align: center; }

  /* Invoice stats */
  #invStats { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr !important; }
  #invStats { grid-template-columns: 1fr !important; }
  .dash-main { padding: 64px 12px 20px; }
  .panel-body { padding: 14px; }
  .data-table { font-size: 0.8rem; }
  .btn { font-size: 0.85rem; }
}

/* Wrap data tables in scrollable container by default */
.panel-body.tight { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Horizontal scrollbar styling for data tables ──────────────── */
.panel-body.tight::-webkit-scrollbar { height: 6px; }
.panel-body.tight::-webkit-scrollbar-track { background: var(--sky-dim); border-radius: 0 0 8px 8px; }
.panel-body.tight::-webkit-scrollbar-thumb { background: var(--panel); border-radius: 3px; }
.panel-body.tight::-webkit-scrollbar-thumb:hover { background: var(--cell); }

/* ── Custom file upload row ─────────────────────────────────────── */
.upload-row { display:flex;gap:10px;align-items:center;flex-wrap:wrap; }
.upload-label { display:flex;align-items:center;gap:8px;cursor:pointer;min-width:0; }
.upload-label input[type="file"] { position:absolute;width:1px;height:1px;opacity:0;pointer-events:none; }
.upload-choose-btn { display:inline-block;padding:6px 14px;border:1px solid var(--sky-dim);border-radius:6px;background:var(--sky);font-size:0.83rem;color:var(--cell);white-space:nowrap;cursor:pointer;transition:background 0.15s; }
.upload-choose-btn:hover { background:var(--sky-dim); }
.upload-filename { font-size:0.83rem;color:var(--ink-muted);max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
