:root {
    --navy: #12213E;
    --navy-light: #1B3060;
    --marigold: #F4A522;
    --marigold-dark: #D98C0F;
    --cream: #F7F5EF;
    --white: #FFFFFF;
    --green: #1F7A5C;
    --red: #C1443D;
    --text-dark: #1A2233;
    --text-muted: #64708A;
    --border: #E4E1D8;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    margin: 0;
}

a { text-decoration: none; color: inherit; }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 55%, var(--navy) 100%);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius);
    padding: 34px 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.auth-card h1 {
    font-size: 22px;
    margin: 0 0 6px;
    color: var(--navy);
}

.auth-card p.sub {
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 14px;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.brand-mark .dot {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--marigold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--navy); font-size: 16px;
}

.brand-mark span.name {
    font-weight: 700; font-size: 17px; color: var(--navy);
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--marigold);
    box-shadow: 0 0 0 3px rgba(244,165,34,0.18);
}

.mobile-input-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.mobile-input-group .prefix {
    background: #EFEDE4;
    padding: 11px 12px;
    font-size: 15px;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}
.mobile-input-group input {
    border: none;
    flex: 1;
    padding: 11px 13px;
    font-size: 15px;
}
.mobile-input-group input:focus { outline: none; }

.otp-boxes {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}
.otp-boxes input {
    width: 100%;
    text-align: center;
    font-size: 20px;
    padding: 10px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.otp-boxes input:focus {
    outline: none;
    border-color: var(--marigold);
    box-shadow: 0 0 0 3px rgba(244,165,34,0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--marigold); color: var(--navy); width: 100%; }
.btn-primary:hover { background: var(--marigold-dark); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-dark); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: var(--red); color: white; }
.btn-block { width: 100%; }

.helper-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}
.helper-text a { color: var(--marigold-dark); font-weight: 600; }

.debug-otp-banner {
    background: #FFF6E5;
    border: 1px dashed var(--marigold);
    color: #7A5300;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
}

.otp-timer-box {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
    background: #F3F6FA;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 16px;
}
.otp-timer-box strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.otp-timer-box.warning { background: #FFF6E5; border-color: var(--marigold); }
.otp-timer-box.warning strong { color: var(--marigold-dark); }
.otp-timer-box.expired { background: #FBEAE9; border-color: var(--red); }
.otp-timer-box.expired strong { color: var(--red); }

.alert {
    padding: 10px 13px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 16px;
}
.alert-error { background: #FBEAE9; color: var(--red); border: 1px solid #F3CFCD; }
.alert-success { background: #E7F5EF; color: var(--green); border: 1px solid #C7E7D9; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: var(--navy);
    color: var(--white);
    padding: 22px 14px;
    flex-shrink: 0;
}
.sidebar .brand-mark span.name { color: var(--white); }
.sidebar nav { margin-top: 26px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14.5px;
    color: #C7CEE0;
    font-weight: 500;
}
.sidebar nav a.active, .sidebar nav a:hover {
    background: var(--navy-light);
    color: var(--white);
}
.sidebar .biz-name {
    font-size: 12px;
    color: #8792AC;
    margin-top: 4px;
}

.main {
    flex: 1;
    padding: 26px 32px;
    max-width: 1100px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.topbar h1 { font-size: 22px; margin: 0; color: var(--navy); }
.topbar .user-chip {
    font-size: 13.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-card.accent .value { color: var(--marigold-dark); }
.stat-card.danger .value { color: var(--red); }
.stat-card.success .value { color: var(--green); }

.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.panel-header h2 { font-size: 17px; margin: 0; color: var(--navy); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    padding: 10px 10px;
    border-bottom: 2px solid var(--border);
}
td { padding: 12px 10px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-paid { background: #E7F5EF; color: var(--green); }
.badge-partial { background: #FFF6E5; color: var(--marigold-dark); }
.badge-unpaid { background: #FBEAE9; color: var(--red); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(18,33,62,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 26px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box h3 { margin-top: 0; color: var(--navy); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.invoice-items-table input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13.5px;
}
.totals-box {
    margin-left: auto;
    max-width: 280px;
    margin-top: 16px;
}
.totals-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totals-box .row.grand { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 16px; color: var(--navy); }

/* ---------- Pricing card (billing page) ---------- */
.pricing-card {
    border: 2px solid var(--marigold);
    border-radius: 14px;
    overflow: hidden;
    margin: 22px 0;
    box-shadow: 0 8px 24px rgba(244,165,34,0.12);
}
.pricing-card-head {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 22px 24px 20px;
    text-align: center;
    position: relative;
}
.pricing-card-head::before {
    content: "⭐ MOST POPULAR";
    display: inline-block;
    background: var(--marigold);
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.pricing-card-head .label {
    font-size: 13px;
    color: #C7CEE0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.pricing-card-head .value {
    font-size: 34px;
    font-weight: 700;
    color: var(--white);
}
.pricing-card-head .value span {
    font-size: 15px;
    color: #C7CEE0;
    font-weight: 400;
}
.pricing-card-head .per-month {
    font-size: 12.5px;
    color: var(--marigold);
    font-weight: 600;
    margin-top: 6px;
}
.pricing-feature-list {
    list-style: none;
    margin: 0;
    padding: 20px 24px 22px;
    background: var(--white);
}
.pricing-feature-list li {
    position: relative;
    padding: 8px 0 8px 30px;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    border-bottom: 1px solid #F3F1E9;
}
.pricing-feature-list li:last-child { border-bottom: none; }
.pricing-feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 8px;
    width: 20px;
    height: 20px;
    background: var(--green);
    color: var(--white);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 780px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; padding: 14px 16px; }
    .sidebar nav { flex-direction: row; overflow-x: auto; margin-top: 14px; }
    .sidebar nav a { white-space: nowrap; }
    .main { padding: 18px; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media print {
    .sidebar, .topbar .user-chip, .no-print { display: none !important; }
    .app-shell { display: block; }
    .main { padding: 0; max-width: 100%; }
}

/* ================= Landing Page ================= */
.lp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 6vw;
    background: var(--navy);
}
.lp-nav .brand-mark span.name { color: var(--white); }
.lp-nav .lp-nav-links { display: flex; align-items: center; gap: 22px; }
.lp-nav .lp-nav-links a.link { color: #C7CEE0; font-size: 14.5px; font-weight: 500; }
.lp-nav .lp-nav-links a.link:hover { color: var(--white); }

.lp-hero {
    background: radial-gradient(circle at 15% 20%, #1B3060 0%, var(--navy) 55%, #0C1830 100%);
    color: var(--white);
    padding: 64px 6vw 80px;
    text-align: center;
}
.lp-hero .badge-pill {
    display: inline-block;
    background: rgba(244,165,34,0.15);
    color: var(--marigold);
    border: 1px solid rgba(244,165,34,0.35);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 22px;
}
.lp-hero h1 {
    font-size: clamp(28px, 4.5vw, 46px);
    line-height: 1.2;
    margin: 0 0 18px;
    max-width: 780px;
    margin-left: auto; margin-right: auto;
}
.lp-hero h1 span { color: var(--marigold); }
.lp-hero p.lead {
    font-size: 17px;
    color: #C7CEE0;
    max-width: 560px;
    margin: 0 auto 34px;
}
.lp-hero .lp-cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.lp-hero .lp-cta-row .btn { width: auto; padding-left: 26px; padding-right: 26px; }

.lp-stats {
    display: flex;
    justify-content: center;
    gap: 44px;
    flex-wrap: wrap;
    margin-top: 30px;
}
.lp-stats .stat { text-align: center; }
.lp-stats .stat .num { font-size: 26px; font-weight: 700; color: var(--marigold); }
.lp-stats .stat .lbl { font-size: 12.5px; color: #9DA8C7; margin-top: 2px; }

.lp-section { padding: 70px 6vw; max-width: 1180px; margin: 0 auto; }
.lp-section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.lp-section-head .eyebrow {
    color: var(--marigold-dark);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.lp-section-head h2 { font-size: clamp(22px, 3vw, 30px); color: var(--navy); margin: 8px 0 10px; }
.lp-section-head p { color: var(--text-muted); font-size: 15px; }

.lp-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
}
.lp-feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
}
.lp-feature-card .icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: #FFF6E5;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}
.lp-feature-card h3 { font-size: 16px; color: var(--navy); margin: 0 0 8px; }
.lp-feature-card p { font-size: 13.8px; color: var(--text-muted); margin: 0; line-height: 1.55; }

.lp-otp-highlight {
    background: var(--navy);
    border-radius: 18px;
    padding: 50px 6vw;
    color: var(--white);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
    margin: 0 6vw;
}
.lp-otp-highlight h2 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 14px; }
.lp-otp-highlight h2 span { color: var(--marigold); }
.lp-otp-highlight p { color: #C7CEE0; font-size: 14.5px; margin-bottom: 22px; line-height: 1.6; }
.lp-otp-highlight ul { list-style: none; padding: 0; margin: 0; }
.lp-otp-highlight ul li {
    padding: 8px 0 8px 26px;
    position: relative;
    font-size: 14px;
    color: #DCE1F0;
}
.lp-otp-highlight ul li::before {
    content: "✓";
    position: absolute; left: 0; top: 8px;
    color: var(--marigold);
    font-weight: 700;
}
.lp-otp-demo {
    background: var(--white);
    border-radius: 14px;
    padding: 26px;
    color: var(--text-dark);
}
.lp-otp-demo .mobile-input-group, .lp-otp-demo .otp-boxes { margin-bottom: 14px; }

.lp-compare table { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.lp-compare th:first-child, .lp-compare td:first-child { text-align: left; }
.lp-compare th, .lp-compare td { text-align: center; }
.lp-compare th.us-col { color: var(--marigold-dark); }
.lp-compare td.us-col { font-weight: 700; color: var(--green); }
.lp-compare td.check { color: var(--green); font-weight: 700; }
.lp-compare td.cross { color: var(--red); }

.lp-final-cta {
    text-align: center;
    background: linear-gradient(135deg, var(--marigold) 0%, var(--marigold-dark) 100%);
    border-radius: 18px;
    padding: 54px 6vw;
    margin: 0 6vw 70px;
    color: var(--navy);
}
.lp-final-cta h2 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 12px; }
.lp-final-cta p { margin: 0 0 26px; font-size: 15px; }
.lp-final-cta .btn-secondary { background: var(--navy); }

.lp-footer {
    background: var(--navy);
    color: #9DA8C7;
    text-align: center;
    padding: 28px 6vw;
    font-size: 13px;
}

@media (max-width: 820px) {
    .lp-otp-highlight { grid-template-columns: 1fr; }
    .lp-nav .lp-nav-links .link { display: none; }
    .lp-nav .lp-nav-links .pricing-link { display: inline-block; }
}

