/* ============ Digital Bill Book — global styles ============ */
:root {
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #cffafe;
  --accent: #06b6d4;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .06);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, .14);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.95); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Public nav ---------- */
.site-header {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 92px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none !important; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 17px;
}
.brand img.logo { background: none; display: block; height: 40px; width: 40px; object-fit: contain; border-radius: 8px; }
.brand-wordmark { gap: 11px; }.brand.brand-wordmark img.logo { width: 80px; height: 70px; padding: 2px; object-fit: contain; border-radius: 0; }.brand-name { display: flex; flex-direction: column; justify-content: center; height: 70px; line-height: .88; font-size: 26px; letter-spacing: 0; font-weight: 800; }.brand-name span { display: block; }.brand-bill-book { white-space: nowrap; }.brand-bill-book .brand-bill, .brand-bill-book .brand-book { display: inline; }.brand-digital, .brand-book { color: #0b2d5c; }.brand-bill { color: #fe8017; }
.app-sidebar .brand-wordmark, .site-footer .brand-wordmark { width: max-content; padding: 5px 9px; background: transparent; border-radius: 6px; }.app-sidebar .brand-wordmark { min-height: 64px; margin: 12px 12px 0; }.app-sidebar .brand.brand-wordmark img.logo { width: 48px; height: 42px; }.app-sidebar .brand-name { font-size: 18px; height: 42px; color: #fff; }.app-sidebar .brand-name .brand-digital, .app-sidebar .brand-name .brand-book { color: #e8f0ff; }.app-sidebar .brand-name .brand-bill { color: #ffd166; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none !important; }
.main-nav a:hover { color: var(--ink); }
.nav-cta { background: var(--primary); color: #fff !important; padding: 8px 16px; border-radius: 8px; }
.nav-cta:hover { background: var(--primary-dark); }
.menu-toggle { display: none; background: none; border: 0; font-size: 24px; cursor: pointer; }
@media (max-width: 820px) {
  .main-nav { display: none; position: absolute; top: 92px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
}

/* ---------- Hero / landing ---------- */
.hero {
  background:
    radial-gradient(800px 400px at 85% -10%, rgba(124, 58, 237, .18), transparent 60%),
    radial-gradient(700px 380px at 5% 20%, rgba(37, 99, 235, .15), transparent 60%),
    linear-gradient(160deg, #0f172a, #1e3a8a);
  color: #fff;
  padding: 84px 0 96px;
}
.hero h1 { font-size: 2.6rem; max-width: 640px; }
.hero p.lead { font-size: 1.15rem; color: #cbd5e1; max-width: 560px; margin-bottom: 26px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .num { font-size: 1.7rem; font-weight: 800; }
.hero-stats .lbl { color: #94a3b8; font-size: 13.5px; }

.home-hero { background: linear-gradient(135deg, #063b44 0%, #0f766e 56%, #0891b2 100%); padding: 76px 0 44px; overflow: hidden; }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 54px; align-items: center; }
.home-hero h1 { max-width: 660px; font-size: 3rem; }
.home-hero .lead { color: #d1fae5; max-width: 620px; }
.home-hero-kicker { display: inline-block; margin-bottom: 14px; padding: 5px 10px; color: #064e3b; background: #d1fae5; border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: 0; }
.home-hero .btn-primary { background: #fbbf24; color: #422006; border-color: #fbbf24; }
.home-hero .btn-primary:hover { background: #f59e0b; }
.home-hero-note { margin: 14px 0 0; color: #ccfbf1; font-size: 13px; }
.business-preview { padding: 18px; background: #f8fafc; color: #0f172a; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; box-shadow: 16px 18px 0 rgba(4, 47, 46, .28); }
.preview-topbar { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid #dbeafe; color: #334155; font-size: 13px; font-weight: 700; }
.preview-topbar img { width: 82px; height: 25px; object-fit: contain; object-position: left center; }.preview-topbar strong { margin-left: auto; color: #047857; font-size: 10px; letter-spacing: 0; }
.preview-total { padding: 18px 0 14px; }.preview-total span, .preview-grid span { display: block; color: #64748b; font-size: 12px; }.preview-total b { display: inline-block; margin-top: 4px; font-size: 28px; }.preview-total em { margin-left: 8px; color: #047857; font-size: 12px; font-style: normal; font-weight: 700; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.preview-grid div { padding: 12px; border: 1px solid #dbeafe; border-radius: 6px; background: #fff; }.preview-grid b { display: block; margin: 2px 0; font-size: 21px; }.preview-grid small { color: #64748b; font-size: 11px; }
.preview-list { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; padding-top: 11px; border-top: 1px solid #e2e8f0; color: #334155; font-size: 12px; }.preview-list i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #14b8a6; }.preview-list time { color: #64748b; white-space: nowrap; }
.home-hero-stats { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.24); }.home-hero-stats .lbl { color: #ccfbf1; }

.about-hero { padding: 72px 0; background: #f0fdfa; overflow: hidden; }.about-hero-grid, .about-intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr); gap: 58px; align-items: center; }.about-hero h1 { max-width: 600px; font-size: 3rem; color: #134e4a; }.about-hero p { max-width: 560px; color: #365f5b; font-size: 1.1rem; margin-bottom: 24px; }.about-kicker { color: #0f766e; font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; margin-bottom: 12px; }.about-image-stack { position: relative; padding: 0 0 28px 28px; }.about-image-main { display: block; width: 100%; min-height: 350px; object-fit: cover; border-radius: 8px; box-shadow: 18px 18px 0 #99f6e4; }.about-image-card { position: absolute; left: 0; bottom: 0; display: flex; align-items: center; gap: 10px; max-width: 225px; padding: 11px; color: #134e4a; background: #fff; border: 1px solid #ccfbf1; border-radius: 6px; box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 700; }.about-image-card img { width: 37px; height: 37px; object-fit: contain; }.about-intro-grid { grid-template-columns: minmax(280px, .8fr) minmax(0, 1fr); }.about-photo-wrap img { display: block; width: 100%; height: 310px; object-fit: cover; border-radius: 8px; }.about-intro h2, .about-commitment h2 { color: #134e4a; font-size: 2.1rem; }.about-intro p { color: var(--muted); max-width: 600px; }.about-principles { background: #ecfeff; }.about-principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }.about-principle-grid article { padding: 24px; background: #fff; border-top: 4px solid #f59e0b; border-radius: 6px; box-shadow: var(--shadow); }.about-principle-grid span { color: #b45309; font-size: 12px; font-weight: 800; }.about-principle-grid h3 { margin-top: 14px; color: #78350f; }.about-principle-grid p { margin: 0; color: #6b7280; font-size: 14px; }.about-commitment { background: #134e4a; }.about-commitment-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }.about-commitment .about-kicker { color: #fbbf24; }.about-commitment h2 { color: #fff; margin: 0; }.about-commitment p { margin: 0; color: #ccfbf1; font-size: 1.05rem; }

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--muted); }

/* Feature cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card .icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 14px;
}
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; align-items: stretch; }
.plan-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.plan-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); position: relative; }
.plan-card.featured::before {
  content: "POPULAR"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 12px; border-radius: 20px;
}
.plan-card .pname { font-weight: 800; font-size: 1.1rem; }
.plan-card .pprice { margin: 14px 0 4px; }
.plan-card .pprice .amt { font-size: 2rem; font-weight: 800; }
.plan-card .pprice .per { color: var(--muted); font-size: 13px; }
.plan-card ul { list-style: none; margin: 14px 0 20px; padding: 0; flex: 1; }
.plan-card ul li { padding: 5px 0 5px 26px; position: relative; color: var(--ink); font-size: 14px; }
.plan-card ul li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.plan-card .badge { font-size: 11.5px; font-weight: 700; color: var(--accent); background: #ede9fe; padding: 2px 8px; border-radius: 20px; display: inline-block; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: step; }
.step { position: relative; padding-top: 46px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.step h3 { font-size: 1.02rem; }
.step p { color: var(--muted); font-size: 14px; }

/* ---------- Forms ---------- */
.auth-wrap { max-width: 440px; margin: 60px auto; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.form-card h1 { font-size: 1.5rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--ink);
}
.product-picker { position: relative; z-index: 20; }
.product-options {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 9999;
  display: none; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); max-height: 220px; overflow-y: auto;
  min-width: 100%;
}
.product-options.show { display: block; }
.product-options .product-option.empty { color: var(--muted); padding: 10px; }
.product-option {
  display: block; width: 100%; text-align: left; border: 0; background: #fff; color: var(--ink);
  padding: 8px 10px; font: inherit; cursor: pointer;
}
.product-option:hover, .product-option:focus {
  background: #f8fafc; outline: none;
}
.product-option.empty { color: var(--muted); cursor: default; }
.password-toggle-wrap { position: relative; }
.password-toggle-wrap input { padding-right: 42px; }
.password-toggle-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}
.password-toggle-btn:hover { background: rgba(15, 23, 42, .04); color: var(--ink); }
.password-toggle-btn:focus { outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { min-height: 90px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row-2, .row-3 { grid-template-columns: 1fr; } }
.form-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* Password requirements checklist */
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.pw-rules li { padding: 1px 0 1px 20px; position: relative; transition: color .15s; }
.pw-rules li::before { content: "○"; position: absolute; left: 2px; color: #94a3b8; }
.pw-rules li.ok { color: #166534; }
.pw-rules li.ok::before { content: "✓"; left: 0; color: var(--success); font-weight: 800; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; font-size: 14px; }
.flash-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }
.flash-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }

/* ---------- Tables ---------- */
.coupon-input-wrap {
  display: flex; gap: 8px; align-items: center;
}
.coupon-input-wrap input { flex: 1; }
.coupon-input-wrap .btn { white-space: nowrap; }
.coupon-success-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(135deg, #dcfce7, #f0fdf4); border: 1px solid #bbf7d0;
  color: #166534; font-size: 14px; margin-bottom: 16px; animation: couponCelebration 0.8s ease;
}
.coupon-success-icon {
  width: 34px; height: 34px; border-radius: 50%; background: #16a34a; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 10px 25px rgba(22, 163, 74, 0.25);
}
.coupon-error-banner {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; margin-bottom: 16px;
}
@keyframes couponCelebration {
  0% { transform: scale(0.96); opacity: 0; }
  40% { transform: scale(1.02); opacity: 1; }
  65% { transform: scale(0.98); }
  100% { transform: scale(1); opacity: 1; }
}
.table-wrap { overflow: visible; overflow-x: visible; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: #f1f5f9; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f8fafc; }
.pager { margin-top: 18px; }
.pager ul { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pager a { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; color: var(--ink); }
.pager a.active, .pager a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* Badges / status */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-green { background: var(--success-light); color: #166534; }
.badge-red { background: var(--danger-light); color: #991b1b; }
.badge-amber { background: var(--warning-light); color: #92400e; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: var(--primary-light); color: #1e40af; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-gray { background: #e2e8f0; color: #475569; }

/* Actions bar */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; }
.search-wrap { display: flex; gap: 8px; }

/* ---------- App layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 240px; background: #0f172a; color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar .brand { color: #fff; padding: 18px 18px 12px; }
.app-sidebar .brand .logo { background: linear-gradient(135deg, #fdfdff, #ffffff); }
.side-label { padding: 14px 20px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #64748b; font-weight: 800; }
.side-logo { display: block; width: 40px; height: 40px; object-fit: contain; margin: 12px 20px 0; padding: 3px; border-radius: 8px; background: #fff; border: 1px solid rgba(255,255,255,.12); }
.app-sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 20px; color: #cbd5e1;
  font-weight: 600; font-size: 14px; text-decoration: none !important; border-left: 3px solid transparent;
}
.app-sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar nav a.active { background: rgba(37, 99, 235, .18); color: #fff; border-left-color: var(--primary); }
.side-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.side-foot a { color: #94a3b8; display: block; padding: 3px 0; }
.side-foot a:hover { color: #fff; text-decoration: none; }
.app-main { flex: 1; min-width: 0; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 26px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.app-topbar h1 { font-size: 1.25rem; margin: 0; }
.app-topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.app-content { padding: 26px; }

/* App drawer toggle (hidden on desktop) */
.menu-toggle-app { display: none; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px 6px; }
.sidebar-backdrop { display: none; }

/* ---------- Mobile / tablet ---------- */
@media (max-width: 860px) {
  .menu-toggle-app { display: inline-block; }

  /* Sidebar becomes an off-canvas drawer */
  .app-shell { display: block; min-height: 100vh; }
  .app-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    width: 264px; max-width: 84vw; height: 100vh; height: 100dvh;
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: none;
  }
  .app-sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(15, 23, 42, .5); opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .app-main { width: 100%; }

  .app-topbar { padding: 10px 14px; gap: 10px; position: sticky; }
  .app-topbar h1 { font-size: 1.05rem; }
  .user-chip span[style] { font-size: 11.5px !important; }
  .avatar { width: 30px; height: 30px; font-size: 13px; }
  .app-content { padding: 14px; }

.item-desc, .item-hsn, .item-qty, .item-unit, .item-price, .item-gst { padding: 8px 6px; }

  /* Tables scroll instead of crushing */
  th, td { padding: 9px 10px; }
  table { font-size: 13.5px; }
  #itemsTable { min-width: 780px; }
  #itemsTable input[type="number"] { min-width: 0; }

  /* Toolbars and filters go full width, stacked */
  .toolbar { align-items: stretch; }
  .toolbar .filters { flex-direction: column; align-items: stretch; }
  .search-wrap { flex-wrap: wrap; }
  .search-wrap > * { flex: 1 1 auto; }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
  .search-wrap .btn, .toolbar .btn { flex: 0 0 auto; }

  /* Cards & stats tighten up */
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .v { font-size: 1.3rem; }
  .panel { padding: 16px; }
  .card-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.55rem; } h2 { font-size: 1.3rem; }
  .hero { padding: 52px 0 60px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p.lead { font-size: 1.02rem; }
  .hero-stats { gap: 24px; margin-top: 28px; }
  .section { padding: 42px 0; }
  .section-head h2 { font-size: 1.45rem; }
  .form-card { padding: 20px; }
  .invoice-doc { padding: 18px; }
  .inv-totals { width: 100%; margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 760px) {
  .home-hero { padding: 52px 0 34px; }.home-hero-grid { grid-template-columns: 1fr; gap: 32px; }.home-hero h1 { font-size: 2.15rem; }.business-preview { box-shadow: 8px 10px 0 rgba(4, 47, 46, .22); }.home-hero-stats { gap: 22px; margin-top: 34px; }
  .about-hero { padding: 52px 0; }.about-hero-grid, .about-intro-grid, .about-commitment-inner { grid-template-columns: 1fr; gap: 30px; }.about-hero h1 { font-size: 2.2rem; }.about-image-stack { padding: 0 0 20px 18px; }.about-image-main { min-height: 260px; box-shadow: 10px 10px 0 #99f6e4; }.about-photo-wrap img { height: 240px; }.about-intro h2, .about-commitment h2 { font-size: 1.75rem; }.about-principle-grid { grid-template-columns: 1fr; }
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .14);
  flex-wrap: wrap;
}
.welcome-banner h2 { color: #ffffff !important; margin: 0 0 8px 0; }
.welcome-banner p { color: rgba(255, 255, 255, 0.9) !important; margin: 0; }
.welcome-banner * { color: #ffffff; }
.welcome-content { color: #ffffff; }
.subscription-badge { display: flex; flex-direction: column; align-items: flex-end; text-align: right; color: #ffffff; }
.subscription-badge * { color: #ffffff !important; }
.subscription-badge .plan-badge { background: #ecfdf5; color: #166534 !important; border: 1px solid #a7f3d0; }
.subscription-badge .plan-badge-trial { background: #fef3c7; color: #92400e !important; border-color: #fcd34d; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .06); color: #0f172a; }
.stat-card .k { font-size: 13px; color: #64748b; font-weight: 600; }
.stat-card .v { font-size: 1.7rem; font-weight: 800; margin-top: 4px; color: #0f172a; }
.stat-card .sub { font-size: 12.5px; color: #64748b; }

/* Misc */
.muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.panel { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .06); padding: 22px; color: #0f172a; }
.panel h2 { font-size: 1.1rem; color: #0f172a; }
.panel * { color: inherit; }
.panel .muted { color: #64748b; }
.inline-form { display: inline; }
.kbd { background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; font-size: 12px; }
.code { background: #0f172a; color: #7dd3fc; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; }

/* Footer */
.site-footer { background: #0f172a; color: #94a3b8; padding: 44px 0 26px; margin-top: 20px; }
.site-footer h4 { color: #fff; font-size: 14px; }
.site-footer a { color: #94a3b8; display: block; padding: 3px 0; font-size: 13.5px; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 18px; font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Invoice preview */
.invoice-doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 34px; box-shadow: var(--shadow); max-width: 800px; margin: 0 auto; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.inv-totals { width: 280px; margin-left: auto; }
.inv-totals .tr { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.inv-totals .tr.grand { border-top: 2px solid var(--ink); font-weight: 800; margin-top: 8px; padding-top: 10px; font-size: 16px; }

/* Alert strip for subscription gate */
.gate-banner { background: var(--warning-light); border: 1px solid #fde68a; color: #92400e; padding: 10px 16px; border-radius: 8px; font-weight: 600; margin-bottom: 18px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Chatbot widget */
.chatbot-widget { position: fixed; right: 20px; bottom: 20px; z-index: 200; font-size: 14px; }
.chatbot-toggle { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-lg); }
.chatbot-toggle:hover { background: var(--primary-dark); }
.chatbot-toggle-icon { font-size: 22px; line-height: 1; }
.chatbot-panel { position: absolute; right: 0; bottom: calc(100% + 12px); width: 340px; max-width: calc(100vw - 40px); height: 440px; max-height: 70vh; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.chatbot-panel[hidden] { display: none; }
.chatbot-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--primary); color: #fff; }
.chatbot-close { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.chatbot-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.chatbot-msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; line-height: 1.4; font-size: 13.5px; white-space: pre-wrap; }
.chatbot-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.chatbot-msg-bot-typing { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--muted); font-style: italic; }
.chatbot-msg-user { align-self: flex-end; background: var(--primary); color: #fff; }
.chatbot-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chatbot-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
@media (max-width: 480px) {
  .chatbot-widget { right: 12px; bottom: 12px; }
  .chatbot-toggle-label { display: none; }
  .chatbot-panel { width: calc(100vw - 24px); right: -8px; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .invoice-doc { border: 0; box-shadow: none; padding: 0; }
}
