/* VWInvoicer design system on top of Bootstrap 5.3 (light + dark). Same look as VPack/VPass: indigo + slate, dark sidebar. */
:root {
  --brand: #4f46e5; --brand-600: #4338ca; --brand-700: #3730a3; --brand-50: #eef2ff; --brand-100: #c7d2fe;
  --ink: #0f172a; --muted: #64748b; --line: #e6eaf0; --surface: #ffffff; --canvas: #f1f5f9;
  --radius: 14px; --radius-sm: 10px; --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05); --shadow: 0 6px 24px -8px rgba(15, 23, 42, .12);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-primary: var(--brand); --bs-primary-rgb: 79, 70, 229; --bs-success: #16a34a; --bs-success-rgb: 22, 163, 74;
  --bs-link-color: var(--brand-600); --bs-link-color-rgb: 67, 56, 202; --bs-link-hover-color: var(--brand-700);
  --bs-border-radius: var(--radius-sm); --bs-border-color: var(--line); --bs-body-color: #1e293b; --bs-body-bg: var(--canvas);
}
[data-bs-theme=dark] {
  --ink: #e2e8f0; --muted: #94a3b8; --line: #243042; --surface: #111827; --canvas: #0b1220; --brand-50: rgba(79, 70, 229, .12); --brand-100: rgba(79, 70, 229, .25);
  --bs-body-bg: var(--canvas); --bs-body-color: #cbd5e1; --bs-border-color: var(--line); --bs-tertiary-bg: #0f1726; --shadow: 0 6px 24px -8px rgba(0, 0, 0, .6);
}
body { background: var(--canvas); font-feature-settings: "cv02", "cv03", "cv04", "cv11"; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); font-weight: 650; letter-spacing: -.02em; }
a { text-decoration: none; }
.text-muted, .text-body-secondary { color: var(--muted) !important; }
code { color: #be185d; background: rgba(190, 24, 93, .06); padding: .1em .35em; border-radius: 6px; font-size: .85em; }

/* ---------- buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 550; padding: .5rem 1rem; transition: all .15s ease; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.4rem; }
.btn-success, .btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(79, 70, 229, .25), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-success:hover, .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6); }
.btn-outline-success, .btn-outline-primary { --bs-btn-color: var(--brand-600); --bs-btn-border-color: var(--brand-100); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); }
.btn-check:checked + .btn-outline-success { background: var(--brand); border-color: var(--brand); }
.btn-dark { --bs-btn-bg: #0f172a; --bs-btn-border-color: #0f172a; --bs-btn-hover-bg: #1e293b; }
.btn-outline-secondary { --bs-btn-border-color: var(--line); --bs-btn-color: var(--muted); --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-color: var(--brand-700); --bs-btn-hover-border-color: var(--brand-100); }

/* ---------- cards / surfaces ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; padding: .9rem 1.25rem; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .15s ease, box-shadow .15s ease; } .card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .card-body { display: flex; gap: .9rem; align-items: center; }
.stat .bi, .icon-bubble { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); font-size: 1.25rem; }
.icon-bubble-lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.6rem; border-radius: 16px; }
.stat .fs-3, .stat .fs-5 { line-height: 1.1; color: var(--ink); }
.stat .card-body > div { min-width: 0; }

/* ---------- forms ---------- */
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line); padding: .55rem .8rem; background-color: var(--surface); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.form-control-sm, .form-select-sm { padding: .3rem .6rem; border-radius: 8px; }
.form-label { font-weight: 550; font-size: .875rem; color: var(--ink); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { background: var(--canvas); border-color: var(--line); color: var(--muted); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--canvas); border-bottom: 1px solid var(--line); padding: .7rem .9rem; white-space: nowrap; }
.table > tbody td { padding: .75rem .9rem; border-color: var(--line); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--brand-50); }
.table-responsive { border-radius: var(--radius); }
td, th { vertical-align: middle; }

/* ---------- badges / alerts ---------- */
.badge { font-weight: 600; letter-spacing: .01em; padding: .38em .65em; border-radius: 999px; text-transform: capitalize; }
.text-bg-success { background: #dcfce7 !important; color: #166534 !important; } .text-bg-danger { background: #fee2e2 !important; color: #991b1b !important; }
.text-bg-warning { background: #fef3c7 !important; color: #92400e !important; } .text-bg-primary { background: #dbeafe !important; color: #1e40af !important; }
.text-bg-info { background: #ccfbf1 !important; color: #115e59 !important; } .text-bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.text-bg-dark { background: #e2e8f0 !important; color: #1e293b !important; }
[data-bs-theme=dark] .text-bg-success { background: rgba(34, 197, 94, .15) !important; color: #86efac !important; } [data-bs-theme=dark] .text-bg-danger { background: rgba(239, 68, 68, .15) !important; color: #fca5a5 !important; }
[data-bs-theme=dark] .text-bg-warning { background: rgba(245, 158, 11, .15) !important; color: #fcd34d !important; } [data-bs-theme=dark] .text-bg-primary { background: rgba(59, 130, 246, .15) !important; color: #93c5fd !important; }
[data-bs-theme=dark] .text-bg-info { background: rgba(20, 184, 166, .15) !important; color: #5eead4 !important; } [data-bs-theme=dark] .text-bg-secondary, [data-bs-theme=dark] .text-bg-dark { background: rgba(148, 163, 184, .15) !important; color: #cbd5e1 !important; }
.alert { border-radius: var(--radius); border: 1px solid transparent; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; } .alert-info { background: #f0fdfa; border-color: #99f6e4; color: #134e4a; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; } .alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
[data-bs-theme=dark] .alert-warning, [data-bs-theme=dark] .alert-info, [data-bs-theme=dark] .alert-danger, [data-bs-theme=dark] .alert-success { background: var(--surface); color: var(--bs-body-color); border-color: var(--line); }
.progress { height: .55rem; border-radius: 999px; background: var(--line); } .progress-bar { border-radius: 999px; transition: width .6s ease; }
.progress-bar.bg-success { background: linear-gradient(90deg, #6366f1, var(--brand)) !important; }

/* ---------- app shell (VPack / VPass layout: dark sidebar, white topbar) ---------- */
:root { --side: #0f172a; --side-text: #cbd5e1; --side-muted: #64748b; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 0; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; } }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .06); min-height: 60px; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-size: 20px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #94a3b8; font-size: 11px; font-weight: 500; }
.sidebar nav { padding: 8px 10px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 12px 12px 4px; }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 8px; color: var(--side-text); font-weight: 500; margin-bottom: 2px; font-size: 14px; }
.sidebar .nav-link .bi { font-size: 17px; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 12px; color: #94a3b8; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .btn-ghost { color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .15); background: transparent; }
.sidebar-foot .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-foot small { color: var(--side-muted); }
.sidebar.offcanvas-lg .offcanvas-header { display: none; }
.sidebar, .sidebar.offcanvas-lg { background-color: var(--side) !important; }
@media (max-width: 991.98px) { .sidebar.offcanvas-lg { background: var(--side); width: 260px; } }
.topbar { position: sticky; top: 0; z-index: 1020; height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 1.1rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 20px; max-width: 1600px; width: 100%; margin: 0 auto; }
@media (min-width: 1200px) { .main { padding: 24px; } }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 8px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.user-btn:hover { background: var(--canvas); }
.user-btn .bi-chevron-down { font-size: 12px; color: var(--muted); }
.dropdown-head { padding: .5rem .75rem; display: flex; flex-direction: column; }
.dropdown-head small { color: var(--muted); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); position: relative; padding: 0; }
.icon-btn:hover { color: var(--brand-700); border-color: var(--brand-100); background: var(--brand-50); }
.dot-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--canvas); }
.dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; }
.notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; color: var(--muted); font-weight: 550; padding: .6rem .9rem; border-bottom: 2px solid transparent; border-radius: 0; }
.nav-tabs .nav-link.active { color: var(--brand-700); border-bottom-color: var(--brand); background: transparent; }
.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--line); color: var(--ink); }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); }

/* ---------- checklist / onboarding ---------- */
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.checklist a { display: flex; gap: .55rem; align-items: center; padding: .65rem .8rem; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-weight: 550; font-size: .88rem; }
.checklist a.done { border-style: solid; border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.checklist a:hover { border-color: var(--brand); color: var(--brand-700); }

/* ---------- help ---------- */
.help-nav { top: 84px; } .help-nav .list-group-item { border: 0; border-radius: 10px !important; margin-bottom: 2px; color: var(--bs-body-color); font-size: .9rem; }
.help-nav .list-group-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.tutorial-steps { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: s; }
.tutorial-steps li { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px dashed var(--line); }
.tutorial-steps li:last-child { border-bottom: 0; }
.step-num { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem; box-shadow: 0 0 0 5px var(--brand-50); }
.tip-box { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--radius); padding: 1rem 1.25rem; }

/* ---------- public / auth ---------- */
.site-nav { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hero { background: radial-gradient(1200px 500px at 10% -10%, rgba(129, 140, 248, .18), transparent 60%), radial-gradient(900px 400px at 100% 0%, rgba(59, 130, 246, .10), transparent 60%); }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.gradient-text { background: linear-gradient(120deg, #6366f1, #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.feature .icon-bubble { margin-bottom: .75rem; }
.price-card.popular { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.auth-wrap { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.auth-card.narrow { max-width: 460px; grid-template-columns: 1fr; }
.auth-side { background: linear-gradient(160deg, #1e1b4b, #4f46e5 55%, #818cf8); color: #ecfdf5; padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.auth-side::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 200px at 80% 10%, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none; }
.auth-side h2 { color: #fff; font-weight: 750; } .auth-side li { margin-bottom: .55rem; }
.auth-form { padding: 2.5rem; }
@media (max-width: 767.98px) { .auth-card { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { padding: 1.75rem; } }
.footer { border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- misc ---------- */
.wa-preview { background: #e5ddd5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d6cdc4'/%3E%3C/svg%3E"); border-radius: var(--radius); padding: 14px; }
[data-bs-theme=dark] .wa-preview { background: #0b141a; }
.wa-preview > div { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); color: #111; max-width: 92%; }
[data-bs-theme=dark] .wa-preview > div { background: #1f2c34; color: #e9edef; }
.wa-doc { font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.policy h2, .policy h3 { margin-top: 1.5rem; }
.btn .spinner-border { width: 1rem; height: 1rem; }
.toast { border-radius: 12px; box-shadow: var(--shadow); }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); } .empty-state .bi { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: var(--brand-100); }
.modal-content { border-radius: 18px; border: 1px solid var(--line); }
::selection { background: var(--brand-100); }

/* ---------- subscription plans ---------- */
.plan-card { transition: box-shadow .15s ease, transform .15s ease; }
.plan-card:hover { box-shadow: var(--shadow); }
.plan-card.popular { border: 2px solid var(--brand); }
.plan-card.disabled { opacity: .75; }
.plan-limits { display: grid; gap: .35rem; font-size: .85rem; padding: .75rem; border-radius: var(--radius-sm); background: var(--canvas); }
.plan-limits .bi { color: var(--brand); margin-right: .45rem; }
.plan-card .dropdown-menu form { margin: 0; }

/* ---------- guided setup (settings) ---------- */
.setup-status { display: flex; gap: .75rem; align-items: center; padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.setup-status > .bi { font-size: 1.5rem; }
.setup-status.ok > .bi { color: var(--bs-success); } .setup-status.todo > .bi { color: #d97706; }
.setup-status.todo { border-color: #fde68a; }
.setup-steps { list-style: none; padding: 0; margin: 0; }
.setup-steps > li { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px dashed var(--line); }
.setup-steps > li:first-child { padding-top: 0; } .setup-steps > li:last-child { border-bottom: 0; padding-bottom: 0; }
.setup-steps h6 { margin-bottom: .25rem; }
.copy-row { display: grid; grid-template-columns: 230px 1fr; gap: .75rem; align-items: center; padding: .45rem 0; }
.copy-row-label { display: flex; flex-direction: column; line-height: 1.25; }
.copy-row-label small { color: var(--muted); font-size: .78rem; }
@media (max-width: 767.98px) { .copy-row { grid-template-columns: 1fr; gap: .3rem; } }
.step-shot { position: relative; display: block; max-width: 720px; margin: .25rem 0 .75rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.step-shot img { display: block; width: 100%; height: auto; }
.step-shot span { position: absolute; right: 8px; bottom: 8px; background: rgba(15, 23, 42, .7); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: .8rem; opacity: 0; transition: opacity .15s; }
.step-shot:hover span { opacity: 1; }
