/* =========================================================
   MarginPH — 2026 PH Seller Fintech Design System
   Zero inline styles • Light & Dark themes • Print-ready
   ========================================================= */

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    --bg-hover: #e2e8f0;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --brand: #059669;
    --brand-hover: #047857;
    --brand-soft: rgba(5, 150, 105, 0.1);
    --brand-border: rgba(5, 150, 105, 0.3);

    --shopee: #ee4d2d;
    --tiktok: #111827;

    --amber: #d97706;
    --amber-soft: rgba(245, 158, 11, 0.12);
    --amber-border: rgba(245, 158, 11, 0.35);

    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.09);
    --danger-border: rgba(220, 38, 38, 0.3);

    --sky: #0284c7;
    --sky-soft: rgba(2, 132, 199, 0.1);

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

[data-theme="dark"] {
    --bg-page: #0b1120;
    --bg-card: #111827;
    --bg-surface: #1e293b;
    --bg-hover: #283548;
    --border: #1f2937;
    --border-strong: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --brand: #10b981;
    --brand-hover: #34d399;
    --brand-soft: rgba(16, 185, 129, 0.14);
    --brand-border: rgba(16, 185, 129, 0.35);

    --tiktok: #f8fafc;

    --amber: #fbbf24;
    --amber-soft: rgba(245, 158, 11, 0.15);
    --amber-border: rgba(245, 158, 11, 0.35);

    --danger: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --danger-border: rgba(239, 68, 68, 0.35);

    --sky: #38bdf8;
    --sky-soft: rgba(56, 189, 248, 0.14);

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.num, .num-col {
    font-variant-numeric: tabular-nums;
}

.num-col {
    text-align: right;
    white-space: nowrap;
}

.is-hidden {
    display: none !important;
}

/* Top Navigation */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.topbar-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 900;
    font-size: 19px;
    letter-spacing: -0.4px;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #059669, #0284c7);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
}

.brand-accent {
    color: var(--brand);
}

.badge-year {
    font-size: 11px;
    font-weight: 800;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid var(--brand-border);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.privacy-pill {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.main-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.tab-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.is-active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

.btn-pro {
    border: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.25);
    transition: transform 0.12s, filter 0.15s;
    white-space: nowrap;
}

.btn-pro:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-pro.is-pro-active {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}

/* Mobile Bottom Nav */
.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.mob-tab-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.mob-tab-btn.is-active {
    background: var(--brand-soft);
    color: var(--brand);
}

/* Shell & Hero */
.app-shell {
    max-width: 1260px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.hero-compact {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.hero-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.hero-sub {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 720px;
}

/* Platform Switcher */
.platform-switch {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.plat-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 9px 16px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
}

.plat-btn.is-active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px var(--border-strong);
}

.dot-shopee, .dot-tiktok {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.dot-shopee { background: var(--shopee); }
.dot-tiktok { background: var(--tiktok); }

/* Cards & Buttons */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.card-sticky {
    position: sticky;
    top: 74px;
}

.card-emerald-soft {
    background: var(--brand-soft);
    border-color: var(--brand-border);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-primary);
}

.card-sub {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-primary, .btn-secondary, .btn-outline {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    border: none;
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-hover);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
}

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

.btn-outline:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

.btn-link {
    border: none;
    background: transparent;
    color: var(--sky);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Forms */
.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.hint-inline {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
}

.input {
    width: 100%;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.input-lg {
    font-size: 15px;
    font-weight: 800;
    padding: 10px 12px;
}

.input-cell {
    width: 82px;
    padding: 5px 7px;
    font-size: 12.5px;
    text-align: right;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

/* Program Toggle Chips */
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.chip-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.chip-toggle input {
    accent-color: var(--brand);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.chip-bir {
    border-color: var(--amber-border);
    background: var(--amber-soft);
}

/* Reverse Pricing Box */
.reverse-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.reverse-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.reverse-title {
    font-size: 14px;
    font-weight: 800;
}

.reverse-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.reverse-target-wrap {
    font-size: 13px;
    white-space: nowrap;
}

.num-accent {
    color: var(--brand);
    font-size: 16px;
    margin-left: 4px;
}

.range-slider {
    width: 100%;
    accent-color: var(--brand);
    margin-bottom: 10px;
    cursor: pointer;
}

.reverse-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.reverse-output {
    font-size: 13.5px;
    color: var(--text-primary);
}

/* Calculator Layout & Receipt */
.calc-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 20px;
    align-items: start;
}

.profit-hero {
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.profit-hero.is-loss {
    background: var(--danger-soft);
    border-color: var(--danger-border);
}

.profit-hero-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.profit-hero-value {
    font-size: 34px;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: -1px;
    margin: 4px 0 10px;
    font-variant-numeric: tabular-nums;
}

.profit-hero.is-loss .profit-hero-value {
    color: var(--danger);
}

.profit-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.metric-pill {
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.metric-pill-warn {
    color: var(--amber);
    border-color: var(--amber-border);
}

.receipt-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    margin-bottom: 14px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.receipt-strong {
    font-weight: 800;
    color: var(--text-primary);
}

.receipt-deduct .num {
    color: var(--danger);
    font-weight: 600;
}

.receipt-bir {
    color: var(--amber);
    font-weight: 600;
}

.receipt-subtotal {
    padding: 8px 0;
    border-top: 1px dashed var(--border-strong);
    border-bottom: 1px dashed var(--border-strong);
    font-weight: 800;
    color: var(--text-primary);
}

.receipt-meta {
    padding-top: 6px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    color: var(--sky);
}

.chart-wrap-sm {
    position: relative;
    height: 170px;
    margin-bottom: 14px;
}

.chart-wrap-md {
    position: relative;
    height: 230px;
}

.cta-bridge {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.cta-bridge-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Dropzone & Analyzer */
.analyzer-top-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dropzone {
    background: var(--bg-card);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 38px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.dropzone.is-dragover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.dropzone-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.dropzone-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 6px;
}

.dropzone-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.dropzone-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.dropzone-trust {
    font-size: 12px;
    color: var(--brand);
}

.file-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.file-bar-left, .file-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-platform {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--shopee);
    color: #fff;
}

.badge-platform.is-tiktok {
    background: #111827;
}

.file-meta {
    font-size: 12.5px;
    color: var(--text-muted);
}

.mapper-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.shock-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: var(--text-primary);
}

.shock-banner.is-healthy {
    background: var(--brand-soft);
    border-color: var(--brand-border);
}

.shock-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.kpi-card.kpi-warn {
    border-left: 4px solid var(--amber);
}

.kpi-card.kpi-profit {
    border-left: 4px solid var(--brand);
}

.kpi-card.kpi-loss {
    border-left: 4px solid var(--danger);
}

.kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.kpi-hint {
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.analytics-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr.row-loss {
    background: var(--danger-soft);
}

.table-empty-cell {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.val-pos {
    color: var(--brand);
    font-weight: 800;
}

.val-neg {
    color: var(--danger);
    font-weight: 800;
}

.badge-free-limit {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--amber-soft);
    color: var(--amber);
    border: 1px solid var(--amber-border);
}

.badge-free-limit.is-pro {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand-border);
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
}

.filter-pill.is-active {
    background: var(--text-primary);
    color: var(--bg-card);
    border-color: var(--text-primary);
}

.pro-gate-bar {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--amber-soft);
    border: 1px solid var(--amber-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}

/* BIR Tax Section */
.badge-sync {
    font-size: 11.5px;
    font-weight: 800;
    background: var(--brand-soft);
    color: var(--brand);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.info-callout {
    background: var(--sky-soft);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--text-primary);
    margin: 14px 0;
}

.gauge-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-top: 10px;
}

.gauge-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.gauge-title {
    font-size: 12.5px;
    font-weight: 700;
}

.gauge-badge {
    font-size: 12px;
    color: var(--brand);
}

.gauge-badge.is-warn {
    color: var(--amber);
}

.gauge-badge.is-danger {
    color: var(--danger);
}

.progress-track {
    height: 10px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--brand);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-fill-sky {
    background: var(--sky);
}

.progress-fill.is-warn {
    background: var(--amber);
}

.progress-fill.is-danger {
    background: var(--danger);
}

.gauge-foot {
    font-size: 12px;
    color: var(--text-secondary);
}

.tax-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.tax-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    transition: border-color 0.2s;
}

.tax-card.is-best {
    border: 2px solid var(--brand);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12);
}

.tax-card-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tax-card.is-best .tax-card-tag {
    background: var(--brand);
    color: #fff;
}

.tax-card-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.tax-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    min-height: 36px;
}

.tax-amount {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.6px;
    margin-bottom: 4px;
}

.tax-payable {
    font-size: 12.5px;
    color: var(--brand);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.tax-breakdown {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tax-rec-body {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 12px;
}

.disclaimer-note {
    font-size: 11.5px;
    color: var(--text-muted);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.cal-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cal-q {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--brand);
    text-transform: uppercase;
}

.cal-item strong {
    font-size: 14px;
}

.cal-item small {
    font-size: 10.5px;
    color: var(--text-muted);
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: 16px 20px;
    margin-top: 24px;
}

.footer-inner {
    max-width: 1260px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-md);
    max-height: 92vh;
    overflow-y: auto;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.badge-pro-tag {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--amber);
    background: var(--amber-soft);
    border: 1px solid var(--amber-border);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 6px;
}

.modal-title {
    font-size: 20px;
    font-weight: 900;
}

.btn-close {
    border: none;
    background: var(--bg-surface);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
}

.pricing-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.price-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
    background: var(--bg-surface);
}

.price-box-featured {
    border: 2px solid var(--brand);
    background: var(--brand-soft);
}

.price-tier {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.price-amt {
    font-size: 21px;
    font-weight: 900;
    margin: 4px 0;
}

.price-amt span {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.price-note {
    font-size: 11px;
    color: var(--text-muted);
}

.pro-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 18px;
}

.license-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
}

.license-box label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

.license-input-row {
    display: flex;
    gap: 8px;
}

.license-feedback {
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
    min-height: 16px;
}

.license-feedback.is-ok { color: var(--brand); }
.license-feedback.is-err { color: var(--danger); }

.demo-hint-text {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

.pro-active-bar {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
    .privacy-pill, .main-tabs {
        display: none;
    }
    .mobile-tabs {
        display: grid;
    }
    .app-shell {
        padding: 16px 14px 96px;
    }
    .calc-grid,
    .analytics-2col,
    .tax-compare-grid {
        grid-template-columns: 1fr;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mapper-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 20px;
    }
    .form-row-2, .form-row-3, .form-row-4, .toggle-grid, .pricing-row {
        grid-template-columns: 1fr;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .badge-year {
        display: none;
    }
}

/* Print Stylesheet for BIR Summary PDF */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    .card, .tax-card {
        box-shadow: none;
        break-inside: avoid;
        border-color: #cbd5e1;
    }
}
