/* ============================================================
   Invoice Generator clone — stylesheet
   ============================================================ */

:root {
    --green:        #3aa757;
    --green-dark:   #2f8c49;
    --green-bright: #22b35e;
    --green-muted:  #8fc7a1;
    --ink:          #1f2733;
    --ink-2:        #11151c;   /* dark item header / dark button */
    --text:         #2c3340;
    --text-soft:    #5b6573;
    --muted:        #9aa3af;
    --line:         #e3e6ea;
    --line-soft:    #eceef1;
    --bg:           #f3f4f5;
    --card:         #ffffff;
    --field-bg:     #ffffff;
    --field-line:   #d7dbe0;
    --shadow:       0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
    --radius:       7px;
}

[data-theme="dark"] {
    --ink:          #e8ebef;
    --ink-2:        #0c0f14;
    --text:         #d3d8de;
    --text-soft:    #9aa3af;
    --muted:        #6b7480;
    --line:         #2a313b;
    --line-soft:    #232932;
    --bg:           #15191f;
    --card:         #1c2128;
    --field-bg:     #20262e;
    --field-line:   #333b46;
    --shadow:       0 1px 3px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: Helvetica, Arial, "Liberation Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--green); }
button { font-family: inherit; cursor: pointer; }

/* ============ NAVBAR ============ */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0 22px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 19px;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-icon { display: inline-flex; }
.brand-dim { color: var(--muted); font-weight: 600; }

.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--text); font-size: 15px; }

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.icon-btn {
    background: none;
    border: none;
    color: var(--text-soft);
    padding: 4px;
    display: inline-flex;
    border-radius: 6px;
}
.icon-btn:hover { color: var(--green); }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: inline; }

.nav-signin { font-weight: 600; color: var(--ink); }
.btn-signup {
    background: var(--green-bright);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
}
.btn-signup:hover { background: var(--green-dark); }

/* ============ HERO ============ */
.page { max-width: 1280px; margin: 0 auto; padding: 0 22px; }

.hero {
    position: relative;
    padding: 38px 0 30px;
    border-bottom: 1px solid var(--line);
    max-width: 1010px;
}
.hero h1 {
    font-size: 44px;
    line-height: 1.08;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 10px;
    letter-spacing: -.5px;
}
.hero-sub {
    font-size: 25px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 22px;
}
.hero p { color: var(--text); max-width: 950px; margin: 0 0 18px; }
.hero p:last-child { margin-bottom: 0; }
.hero-close {
    position: absolute;
    top: 34px;
    right: 0;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 8px;
    font-size: 22px;
    color: var(--text-soft);
    line-height: 1;
}
.hero-close:hover { background: var(--bg); color: var(--ink); }

/* ============ WORKSPACE LAYOUT ============ */
.workspace {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 26px;
    align-items: start;
    padding: 34px 0 60px;
}

/* ============ DOCUMENT CARD ============ */
.doc-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 38px;
}

.doc-card input,
.doc-card textarea,
.doc-card select {
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--field-bg);
    border: 1px solid var(--field-line);
    border-radius: 6px;
    padding: 10px 11px;
    width: 100%;
    resize: none;
    transition: border-color .12s, box-shadow .12s;
}
.doc-card input::placeholder,
.doc-card textarea::placeholder { color: var(--muted); }
.doc-card input:hover,
.doc-card textarea:hover { border-color: var(--text-soft); }
.doc-card input:focus,
.doc-card textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(58,167,87,.15);
    background: var(--card);
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 5px;
}

/* --- top: logo + heading --- */
.doc-top {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 26px;
}
.logo-box {
    width: 200px;
    height: 130px;
    border: 1px solid transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-soft);
    background: #eceef0;
    overflow: hidden;
}
.logo-box:hover { background: #e3e6e9; color: var(--text); }
[data-theme="dark"] .logo-box { background: #262c34; }
[data-theme="dark"] .logo-box:hover { background: #2d343d; }
.logo-placeholder {
    display: flex; align-items: center; gap: 7px;
    font-size: 15px; font-weight: 500;
}
#logoPreview { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-box.has-img { background: var(--card); border-color: var(--field-line); }
.logo-box.has-img .logo-placeholder { display: none; }
.logo-box.has-img #logoPreview { display: block; }

.doc-meta { text-align: right; min-width: 240px; }
.doc-heading {
    font-size: 38px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 12px;
    letter-spacing: -.5px;
    white-space: nowrap;
}
.meta-row {
    display: flex; align-items: center; gap: 8px;
    justify-content: flex-end;
}
.meta-row .hash { color: var(--muted); font-size: 15px; }
.num-input { max-width: 180px; text-align: right; }
.meta-row .num-input { border: 1px solid var(--field-line); }

/* --- parties --- */
.doc-parties {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 22px;
}
.party-left { flex: 1; max-width: 470px; }
.from-input { margin-bottom: 18px; }
.party-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.party-right { width: 320px; }
.dr { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dr .field-label { margin-bottom: 0; width: 120px; text-align: right; }
.bill-to .field-label, .ship-to .field-label { margin-bottom: 5px; }

/* --- items table --- */
.items { margin: 8px 0 4px; }
.items-head {
    display: grid;
    grid-template-columns: 1fr 90px 130px 120px;
    gap: 12px;
    background: var(--ink-2);
    color: #fff;
    padding: 9px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
}
.items-head .col-qty { text-align: center; }
.items-head .col-rate { text-align: left; }
.items-head .col-amount { text-align: right; }

.item-row {
    display: grid;
    grid-template-columns: 1fr 90px 130px 120px;
    gap: 12px;
    align-items: center;
    padding: 7px 14px 7px 0;
    position: relative;
    border-bottom: 1px solid var(--line-soft);
}
.item-row .drag {
    position: absolute; left: -16px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); cursor: grab;
    opacity: 0; transition: opacity .12s;
    font-size: 14px;
}
.item-row:hover .drag { opacity: 1; }
.item-qty { text-align: center; }

/* rate cell: currency prefix inside a single bordered box */
.rate-cell {
    display: flex;
    align-items: center;
    border: 1px solid var(--field-line);
    border-radius: 6px;
    background: var(--field-bg);
    overflow: hidden;
    transition: border-color .12s, box-shadow .12s;
}
.rate-cell:hover { border-color: var(--text-soft); }
.rate-cell:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(58,167,87,.15);
    background: var(--card);
}
.rate-cur { padding: 0 2px 0 10px; color: var(--green); font-size: 14px; }
.rate-cell .item-rate {
    border: none !important;
    box-shadow: none !important;
    text-align: right;
    padding: 10px 10px 10px 4px;
    background: transparent;
}
.item-amount-wrap {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; position: relative;
}
.item-amount { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.item-remove {
    position: absolute; right: -22px;
    background: none; border: none; color: var(--muted);
    font-size: 18px; line-height: 1; padding: 2px;
    opacity: 0; transition: opacity .12s, color .12s;
}
.item-row:hover .item-remove { opacity: 1; }
.item-remove:hover { color: #e5484d; }

.add-line {
    margin-top: 14px;
    background: none;
    border: 1px solid var(--green);
    color: var(--green);
    border-radius: 6px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.add-line:hover { background: rgba(58,167,87,.08); }

/* --- bottom: notes + totals --- */
.doc-bottom {
    display: flex;
    justify-content: space-between;
    gap: 50px;
    margin-top: 30px;
}
.bottom-left { flex: 1; max-width: 460px; }
.nt { margin-bottom: 18px; }
.nt textarea { border: 1px solid var(--field-line); }

.bottom-right { width: 320px; }
.sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    min-height: 38px;
}
.sum-label { color: var(--text-soft); font-size: 14px; }
.sum-val { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }

.add-link {
    background: none; border: none; color: var(--green);
    font-size: 13px; font-weight: 600; padding: 4px 0;
}
.add-link:hover { text-decoration: underline; }

/* inline "+ Discount   + Shipping" row */
.opt-links { justify-content: flex-start; gap: 22px; min-height: 28px; padding: 2px 0; }

/* tax row with %/flat toggle */
.tax-row { align-items: center; }
.tax-control {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.tax-control input {
    width: 80px;
    text-align: right;
    border: 1px solid var(--field-line);
    border-radius: 6px;
    background: var(--field-bg);
    color: var(--text);
    font-size: 14px;
    padding: 8px 9px;
    font-family: inherit;
}
.tax-control input:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(58,167,87,.15);
}
.tax-unit { display: flex; align-items: center; color: var(--text-soft); font-size: 14px; min-width: 18px; }
.tax-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px;
    border: 1px solid var(--field-line);
    background: var(--field-bg);
    color: var(--text-soft);
    border-radius: 6px;
}
.tax-toggle:hover { color: var(--green); border-color: var(--green); }

.opt-field { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.opt-input { display: flex; align-items: center; gap: 4px; }
.opt-input input { width: 110px; text-align: right; }
.opt-input .cur { color: var(--text-soft); font-size: 14px; }
.rm-link {
    background: none; border: none; color: var(--muted);
    font-size: 16px; padding: 0 2px;
}
.rm-link:hover { color: #e5484d; }

.total-row {
    border-top: 1px solid var(--line);
    margin-top: 4px;
}
.total-row .sum-label { font-weight: 700; color: var(--text); }
.total-row .sum-val { font-weight: 700; font-size: 15px; }
.paid-row .opt-input input { width: 130px; }

.balance-row {
    border-top: 2px solid var(--ink);
    margin-top: 2px;
    padding-top: 12px;
}
.balance-row .sum-label { font-weight: 800; color: var(--ink); font-size: 16px; }
.balance-row .sum-val { font-weight: 800; color: var(--ink); font-size: 18px; }

/* ============ SIDEBAR ============ */
.sidebar { position: sticky; top: 76px; }
.btn-savesend {
    width: 100%;
    background: var(--green-muted);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 22px;
    font-size: 18px;
    font-weight: 700;
    transition: background .15s, transform .05s;
}
.btn-savesend:hover { background: var(--green); }
.btn-savesend:active { transform: translateY(1px); }
.btn-savesend.busy { opacity: .7; pointer-events: none; }

.download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--green);
    font-weight: 600;
    font-size: 14px;
    margin: 16px 0 26px;
}
.download-link:hover { color: var(--green-dark); }

.settings-card { }
.settings-toggle {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
    font-size: 14px;
}
.settings-toggle:hover { border-color: var(--field-line); }
.settings-toggle svg { transition: transform .2s; }
.settings-toggle.open svg { transform: rotate(180deg); }
.settings-body {
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 14px 16px;
    background: var(--card);
    margin-top: -2px;
}
.set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-soft);
}
.set-row:last-child { margin-bottom: 0; }
.set-row select {
    border: 1px solid var(--field-line);
    border-radius: 5px;
    padding: 5px 7px;
    background: var(--field-bg);
    color: var(--text);
    font-size: 13px;
}
.set-row input[type="color"] {
    width: 36px; height: 26px; padding: 0; border: 1px solid var(--field-line);
    border-radius: 5px; background: none;
}

/* ============ FOOTER ============ */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--line);
    margin-top: 20px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 22px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 40px;
}
.footer-col h4 {
    font-size: 12px;
    letter-spacing: .5px;
    color: var(--text-soft);
    margin: 0 0 14px;
    font-weight: 700;
}
.footer-col a {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 9px;
}
.footer-col a:hover { color: var(--green); }
.footer-social { text-align: left; }
.copyright { color: var(--text-soft); font-size: 13px; margin: 0 0 14px; }
.social-row { display: flex; gap: 16px; margin-bottom: 22px; }
.social-row a { color: var(--text-soft); }
.social-row a:hover { color: var(--green); }

.trustpilot { }
.tp-star { color: #00b67a; font-size: 18px; vertical-align: middle; }
.tp-name { font-weight: 700; font-size: 17px; color: var(--ink); vertical-align: middle; margin-left: 2px; }
.tp-stars { display: inline-flex; gap: 2px; margin: 8px 0; }
.tp-stars span {
    background: #00b67a; color: #fff; padding: 3px 5px;
    font-size: 15px; line-height: 1; border-radius: 2px;
}
.tp-stars span.half { background: linear-gradient(90deg, #00b67a 55%, #dcdce6 55%); }
.tp-score { font-size: 13px; color: var(--text-soft); margin: 6px 0 0; }
.tp-score strong { color: var(--ink); }
.tp-score a { color: var(--text-soft); text-decoration: underline; }

.footer-legal {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 22px 40px;
    text-align: right;
}
.footer-legal a {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    margin-bottom: 8px;
}
.footer-legal a:hover { color: var(--green); }

/* ============ PRIVACY MODAL ============ */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(20,25,32,.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-backdrop.show { display: flex; }
.privacy-modal {
    background: #fff;
    color: #2c3340;
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.pm-head {
    display: flex; align-items: center; gap: 8px;
    padding: 24px; border-bottom: 1px solid #eceef1;
    justify-content: center;
    font-weight: 700; font-size: 18px; color: var(--ink);
}
.pm-body { padding: 22px 26px; overflow-y: auto; font-size: 13px; color: #4a525f; }
.pm-body h2 { font-size: 22px; color: #1f2733; margin: 0 0 14px; }
.pm-body h3 { font-size: 15px; color: #1f2733; margin: 18px 0 8px; }
.pm-body p { margin: 0 0 12px; line-height: 1.55; }
.pm-body a { color: #1f2733; text-decoration: underline; font-weight: 600; }
.pm-list { margin: 0 0 12px; padding-left: 0; list-style: none; }
.pm-list li { font-weight: 700; color: #1f2733; margin-bottom: 8px; line-height: 1.4; }
.pm-actions {
    display: flex; gap: 14px; padding: 16px 26px 22px;
}
.btn-outline {
    flex: 1; background: #fff; border: 1px solid #cfd4da;
    border-radius: 4px; padding: 14px; font-weight: 600; color: #2c3340;
}
.btn-outline:hover { background: #f6f7f8; }
.btn-dark {
    flex: 1; background: var(--ink-2); border: none; color: #fff;
    border-radius: 4px; padding: 14px; font-weight: 600;
}
.btn-dark:hover { background: #000; }

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 26px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink-2);
    color: #fff;
    padding: 13px 22px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
    .workspace { grid-template-columns: 1fr; }
    .sidebar { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
    .btn-savesend { width: auto; flex: 1; padding: 16px 30px; }
    .download-link { margin: 0; }
    .settings-card { width: 100%; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-legal { text-align: left; }
}
@media (max-width: 720px) {
    .hero h1 { font-size: 32px; }
    .hero-sub { font-size: 20px; }
    .doc-card { padding: 22px; }
    .doc-top, .doc-parties, .doc-bottom { flex-direction: column; }
    .party-right, .bottom-right, .bottom-left, .party-left { width: 100%; max-width: none; }
    .doc-meta { text-align: left; }
    .meta-row { justify-content: flex-start; }
    .dr .field-label { text-align: left; width: auto; }
    .items-head, .item-row { grid-template-columns: 1fr 60px 70px 80px; gap: 6px; font-size: 12px; }
    .item-remove { position: static; opacity: 1; }
    .footer-inner { grid-template-columns: 1fr; }
}

/* ============ HISTORY PAGE ============ */
.hist-head { padding: 38px 0 22px; }
.hist-head h1 { font-size: 34px; font-weight: 800; color: var(--ink); margin: 0 0 8px; letter-spacing: -.5px; }
.hist-head p { color: var(--text-soft); margin: 0; }
.hist-wrap { padding-bottom: 60px; }
.hist-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hist-table thead th {
    text-align: left;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-soft);
    background: var(--bg);
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}
.hist-table tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--text); }
.hist-table tbody tr:last-child td { border-bottom: none; }
.hist-table tbody tr:hover { background: var(--bg); }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-soft); }
.hist-link { color: var(--green); font-weight: 600; }
.hist-link:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    white-space: nowrap;
}
.badge-invoice { background: #3aa757; }
.badge-credit_note { background: #d98324; }
.badge-purchase_order { background: #2f6fed; }
.badge-quote { background: #8a5cf6; }

.hist-empty { text-align: center; padding: 80px 20px; color: var(--text-soft); }
.hist-empty p { margin: 0 0 18px; font-size: 16px; }
.hist-empty .btn-signup { display: inline-block; }

/* ============ DETAIL (read-only paper) ============ */
.detail-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 26px 0 14px; gap: 16px; flex-wrap: wrap;
}
.back-link { color: var(--text-soft); font-weight: 600; font-size: 14px; }
.back-link:hover { color: var(--green); }
.detail-actions { display: flex; gap: 12px; }
.btn-edit {
    border: 1px solid var(--line); background: var(--card); color: var(--text);
    padding: 9px 16px; border-radius: 7px; font-weight: 600; font-size: 14px;
}
.btn-edit:hover { border-color: var(--green); color: var(--green); }
.btn-print {
    background: var(--green); color: #fff; border: none;
    padding: 9px 18px; border-radius: 7px; font-weight: 600; font-size: 14px;
}
.btn-print:hover { background: var(--green-dark); }
.detail-workspace { display: block; padding-top: 6px; }
.paper { max-width: 860px; margin: 0 auto; }
.paper-from { white-space: pre-line; color: var(--text); font-size: 14px; max-width: 320px; }
.paper-num { color: var(--text-soft); font-size: 15px; }
.paper-text { white-space: pre-line; color: var(--text); font-size: 14px; }
.paper-val { color: var(--text); font-size: 14px; }
.paper-row { grid-template-columns: 1fr 90px 130px 120px; padding: 11px 14px 11px 0; }
.detail-bar + .detail-workspace .dr { justify-content: flex-end; }
.detail-workspace .dr .field-label { width: auto; }

/* ============ PRINT ============ */
@media print {
    .navbar, .hero, .sidebar, .footer, .footer-legal,
    .modal-backdrop, .toast, .detail-bar, .add-line,
    .item-remove, .hero-close { display: none !important; }
    body { background: #fff; }
    .page { max-width: none; padding: 0; }
    .workspace, .detail-workspace { display: block; padding: 0; }
    .doc-card { border: none; box-shadow: none; padding: 0; margin: 0; max-width: none; }
}

.toast-link { color: #7fd6a0; font-weight: 700; text-decoration: underline; margin-left: 4px; }
.toast-link:hover { color: #a5e6bd; }

/* ============================================================
   AUTH PAGES (light, centered)
   ============================================================ */
.auth-body { background: #f7f8fa; min-height: 100vh; }
[data-theme="dark"] .auth-body, .auth-body[data-theme="dark"] { background: #0f1620; }
.auth-shell { max-width: 680px; margin: 0 auto; padding: 56px 20px 60px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 26px; font-weight: 800; color: var(--ink); margin-bottom: 30px; }
.auth-brand-text { letter-spacing: -.5px; }
.auth-card {
    background: #fff; border: 1px solid #eceef1; border-radius: 14px;
    padding: 40px 44px; box-shadow: 0 4px 24px rgba(16,24,40,.05); max-width: 650px; margin: 0 auto;
}
.auth-card h1 { font-size: 28px; font-weight: 800; color: var(--ink); margin: 0 0 8px; text-align: center; }
.auth-sub { color: var(--text-soft); text-align: center; margin: 0 0 28px; }
.auth-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; font-size: 14px; color: var(--text); margin-bottom: 7px; }
.auth-field-head { display: flex; justify-content: space-between; align-items: center; }
.auth-link-sm { font-size: 13px; color: var(--green); }
.auth-field input, .auth-field select {
    width: 100%; padding: 12px 13px; border: 1px solid #d7dbe0; border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.auth-field input:focus, .auth-field select:focus {
    outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(58,167,87,.15);
}
.auth-check { display: flex; align-items: center; gap: 9px; margin: 6px 0 22px; font-size: 14px; color: var(--text); }
.auth-check input { width: 16px; height: 16px; accent-color: var(--green); }
.auth-submit {
    width: 100%; border: none; border-radius: 9px; padding: 15px;
    background: linear-gradient(90deg, #0a8f4e, #18b866); color: #fff;
    font-size: 16px; font-weight: 700; cursor: pointer;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-or { text-align: center; margin: 22px 0 16px; position: relative; color: var(--text-soft); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: #e6e8eb; }
.auth-or::before { left: 0; } .auth-or::after { right: 0; }
.auth-oauth {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    border: 1px solid #d7dbe0; border-radius: 9px; padding: 12px; margin-bottom: 12px;
    font-weight: 600; color: var(--text); background: #fff;
}
.auth-oauth:hover { background: #f7f8fa; color: var(--text); }
.auth-foot { text-align: center; color: var(--text-soft); margin-top: 26px; }
.auth-foot a { color: var(--green); font-weight: 600; }
.auth-msgs { max-width: 650px; margin: 0 auto 16px; }
.auth-msg { padding: 11px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; }
.auth-msg.error { background: #fdecec; color: #c0392b; border: 1px solid #f5c6c6; }
.auth-msg.success { background: #eafaf0; color: #1d7a46; border: 1px solid #c2ecd2; }

/* ============================================================
   DASHBOARD (dark)
   ============================================================ */
.dash-body {
    --d-bg: #0e1620; --d-card: #16202d; --d-card2: #1b2735; --d-line: #25303f;
    --d-text: #e6eaf0; --d-soft: #93a1b3; --d-green: #18b866; --d-green-d: #0f9d57;
    background: var(--d-bg); color: var(--d-text); min-height: 100vh; margin: 0;
}
.dash-nav { background: #111b27; border-bottom: 1px solid var(--d-line); }
.dash-nav-inner { max-width: 1180px; margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 28px; padding: 0 22px; }
.dash-brand { color: #fff; font-size: 18px; font-weight: 700; }
.dash-brand:hover { color: #fff; }
.dash-links { display: flex; align-items: center; gap: 26px; height: 100%; }
.dash-links a { color: var(--d-soft); font-size: 15px; height: 100%; display: flex; align-items: center; border-bottom: 2px solid transparent; }
.dash-links a:hover { color: #fff; }
.dash-links a.active { color: #fff; border-bottom-color: var(--d-green); }
.dash-upgrade { background: var(--d-green); color: #062b18 !important; padding: 7px 14px !important; border-radius: 7px;
    font-weight: 700; height: auto !important; border: none !important; }
.dash-upgrade:hover { background: var(--d-green-d); }
.dash-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.dash-right .icon-btn { color: var(--d-soft); }
.dash-right .icon-btn:hover { color: #fff; }
.dash-user { position: relative; display: flex; align-items: center; gap: 7px; color: var(--d-text); cursor: pointer; font-size: 14px; }
.dash-menu { position: absolute; top: 130%; right: 0; background: var(--d-card2); border: 1px solid var(--d-line);
    border-radius: 9px; min-width: 170px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 30; }
.dash-menu a { display: block; padding: 9px 12px; color: var(--d-text); border-radius: 6px; font-size: 14px; }
.dash-menu a:hover { background: var(--d-card); color: #fff; }

.dash-main { max-width: 1180px; margin: 0 auto; padding: 28px 22px 70px; }
.dash-msgs { margin-bottom: 18px; }
.dash-msg { padding: 11px 16px; border-radius: 9px; font-size: 14px; margin-bottom: 8px; }
.dash-msg.success { background: rgba(24,184,102,.14); color: #62d99b; border: 1px solid rgba(24,184,102,.3); }
.dash-msg.error { background: rgba(229,72,77,.14); color: #f08a8d; border: 1px solid rgba(229,72,77,.3); }

.dash-card { background: var(--d-card); border: 1px solid var(--d-line); border-radius: 14px; padding: 30px 32px; }
.dash-card.narrow { max-width: 620px; margin: 0 auto; }
.dash-card.panel { padding: 20px 22px; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.dash-card-head h1 { font-size: 30px; font-weight: 800; color: #fff; margin: 0; }
.dash-actions { display: flex; gap: 10px; }

.btn-primary { background: var(--d-green); color: #052915; border: none; border-radius: 8px; padding: 10px 16px;
    font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--d-green-d); color: #052915; }
.btn-ghost { background: #283340; color: var(--d-text); border: 1px solid var(--d-line); border-radius: 8px;
    padding: 10px 14px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover { background: #313e4d; color: #fff; }
.btn-ghost.icon-only { padding: 10px 12px; }
.muted2 { color: var(--d-soft); }
.green-link { color: var(--d-green); font-weight: 600; }
.green-link:hover { color: #3ed98a; }

.promo-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px;
    background: rgba(24,184,102,.08); border: 1px solid rgba(24,184,102,.22); border-radius: 11px;
    padding: 18px 22px; margin-bottom: 24px; flex-wrap: wrap; }
.promo-banner strong { color: #fff; font-size: 16px; }
.promo-banner p { color: var(--d-soft); margin: 4px 0 0; font-size: 14px; }
.promo-actions { display: flex; align-items: center; gap: 14px; }

.dash-table { width: 100%; border-collapse: collapse; }
.dash-table thead th { text-align: left; color: #fff; font-size: 14px; font-weight: 700;
    padding: 12px 14px; border-bottom: 1px solid var(--d-line); }
.dash-table tbody td { padding: 16px 14px; border-bottom: 1px solid var(--d-line); font-size: 14px; color: var(--d-text); }
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover { background: rgba(255,255,255,.02); }
.dash-table.flush thead th, .dash-table.flush tbody td { padding-left: 0; padding-right: 0; }
.ref-link { color: var(--d-green); font-weight: 600; }
.ref-link:hover { color: #3ed98a; }
.kebab { display: inline-flex; padding: 4px 10px; border: 1px solid var(--d-line); border-radius: 7px; color: var(--d-soft); }
.kebab:hover { color: #fff; background: #283340; }
.mono { font-variant-numeric: tabular-nums; }
.dash-empty { text-align: center; color: var(--d-soft); padding: 40px 0; }
.dash-empty a { color: var(--d-green); }
.dot-status { font-size: 13px; font-weight: 600; }
.status-open { color: #8b8bf6; } .status-paid { color: #3ed98a; } .status-sent { color: #4aa8ff; }
.dash-table-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 10px; font-size: 13px; }
.mini-select { background: #283340; color: var(--d-text); border: 1px solid var(--d-line); border-radius: 6px; padding: 3px 6px; }

/* invoice detail (dark) */
.inv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.inv-title { font-size: 28px; font-weight: 800; color: #fff; margin: 0 0 8px; display: flex; align-items: center; gap: 12px; }
.inv-title .dot-status { font-size: 13px; }
.inv-meta { display: flex; gap: 18px; color: var(--d-soft); font-size: 14px; }
.inv-head-actions { display: flex; gap: 10px; }
.pay-banner { background: var(--d-card2); border: 1px solid var(--d-line); border-radius: 11px; padding: 20px 24px; margin-bottom: 26px; }
.pay-banner strong { color: #fff; font-size: 16px; }
.pay-banner p { color: var(--d-soft); margin: 4px 0 12px; font-size: 14px; }
.pay-banner ul { margin: 0 0 16px; padding-left: 18px; color: var(--d-soft); font-size: 14px; }
.pay-banner li { margin-bottom: 4px; }
.inv-paper { border-top: 1px solid var(--d-line); padding-top: 30px; }
.inv-paper-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.paper-from-d { color: var(--d-text); font-size: 14px; white-space: pre-line; }
.inv-paper-title h2 { font-size: 34px; font-weight: 800; color: #fff; margin: 0; text-align: right; }
.inv-paper-title .muted2 { text-align: right; }
.inv-paper-parties { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 26px; font-size: 14px; }
.inv-paper-parties .lbl, .lbl { color: var(--d-soft); font-size: 12px; margin-bottom: 4px; }
.inv-paper-items { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.inv-paper-items thead th { background: var(--d-card2); color: var(--d-soft); font-size: 13px; font-weight: 600;
    padding: 10px 12px; text-align: left; }
.inv-paper-items tbody td { padding: 12px; border-bottom: 1px solid var(--d-line); color: var(--d-text); font-size: 14px; }
.inv-paper-sums { margin-left: auto; width: 320px; margin-top: 14px; }
.inv-paper-sums .r { display: flex; justify-content: space-between; padding: 8px 0; color: var(--d-soft); font-size: 14px; }
.inv-paper-sums .r.grand { color: #fff; font-weight: 800; border-top: 1px solid var(--d-line); margin-top: 4px; padding-top: 12px; font-size: 16px; }
.inv-paper-foot { margin-top: 20px; font-size: 14px; }
.inv-paper-foot div:last-child { color: var(--d-text); }

/* send email */
.send-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.send-icon { width: 46px; height: 46px; border-radius: 50%; background: rgba(24,184,102,.16); color: var(--d-green);
    display: flex; align-items: center; justify-content: center; font-size: 18px; }
.send-head h1 { font-size: 26px; font-weight: 800; color: #fff; margin: 0; }
.send-summary { background: var(--d-card2); border: 1px solid var(--d-line); border-radius: 10px; padding: 16px 20px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-bottom: 24px; font-size: 14px; }
.send-summary strong { color: #fff; }
.send-field { margin-bottom: 18px; }
.send-field label { display: block; color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.send-field input, .send-field textarea { width: 100%; background: #283340; border: 1px solid var(--d-line);
    border-radius: 8px; padding: 11px 13px; color: var(--d-text); font-family: inherit; font-size: 14px; resize: vertical; }
.send-field input:focus, .send-field textarea:focus { outline: none; border-color: var(--d-green); box-shadow: 0 0 0 3px rgba(24,184,102,.18); }
.send-field small { color: var(--d-soft); font-size: 12px; display: block; margin-top: 5px; }
.send-include { background: var(--d-card2); border: 1px solid var(--d-line); border-radius: 10px; padding: 16px 20px; margin-bottom: 22px; }
.send-include strong { color: #fff; font-size: 14px; }
.send-include ul { list-style: none; margin: 10px 0 0; padding: 0; }
.send-include li { color: var(--d-soft); font-size: 14px; margin-bottom: 6px; }
.send-actions { display: flex; gap: 12px; margin-bottom: 18px; }
.send-note { background: rgba(74,168,255,.1); border: 1px solid rgba(74,168,255,.3); color: #8cc6ff;
    border-radius: 9px; padding: 12px 16px; font-size: 14px; }

/* customer form */
.cust-form-title { font-size: 30px; font-weight: 800; color: #fff; margin: 0 0 26px; }
.cust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 6px; }
.cust-sep { border: none; border-top: 1px solid var(--d-line); margin: 22px 0; }

/* customer detail */
.cust-hero { background: var(--d-card); border: 1px solid var(--d-line); border-radius: 14px; padding: 24px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.cust-hero-left { display: flex; align-items: center; gap: 16px; }
.cust-avatar { width: 56px; height: 56px; border-radius: 12px; background: var(--d-green); color: #062b18;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.cust-hero h1 { font-size: 26px; color: #fff; margin: 0 0 2px; }
.cust-hero-actions { display: flex; gap: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--d-card); border: 1px solid var(--d-line); border-radius: 12px; padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between; }
.stat-num { font-size: 26px; font-weight: 800; color: #fff; margin-top: 4px; }
.stat-ico { width: 40px; height: 40px; border-radius: 9px; background: var(--d-card2); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.cust-cols { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.cust-side { display: flex; flex-direction: column; gap: 16px; }
.panel h3 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.kv { margin-bottom: 14px; }
.kv-l { display: block; color: var(--d-soft); font-size: 11px; letter-spacing: .5px; margin-bottom: 3px; }
.panel p { color: var(--d-text); margin: 0; font-size: 14px; }
.cust-mainpanel { display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.count-pill { background: var(--d-card2); color: var(--d-soft); font-size: 12px; padding: 2px 9px; border-radius: 20px; margin-left: 4px; }
.empty-block { text-align: center; padding: 40px 0; }
.empty-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--d-card2); color: var(--d-soft);
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.empty-block p { margin: 0 0 16px; }

/* ============================================================
   CONTENT PAGES (privacy / terms / help / guide)
   ============================================================ */
.content-page { max-width: 820px; margin: 0 auto; padding: 30px 0 70px; }
.content-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 26px; }
.content-head h1 { font-size: 38px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -.5px; }
.content-updated { color: var(--text-soft); margin: 10px 0 0; font-size: 14px; }
.content-body { color: var(--text); line-height: 1.7; }
.content-body h2 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 32px 0 12px; }
.content-body h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 22px 0 8px; }
.content-body p { margin: 0 0 16px; }
.content-body ul { margin: 0 0 16px; padding-left: 22px; }
.content-body li { margin-bottom: 7px; }
.content-body a { color: var(--green); font-weight: 600; }
.content-note { background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--green);
    padding: 12px 16px; border-radius: 6px; font-size: 13px; color: var(--text-soft); margin-top: 30px; }

@media (max-width: 860px) {
    .auth-row.two, .cust-grid, .send-summary { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .cust-cols { grid-template-columns: 1fr; }
    .inv-paper-parties { grid-template-columns: 1fr; }
}

/* ============ DATE PICKER MODAL ============ */
.dp-backdrop { position: fixed; inset: 0; background: rgba(20,25,32,.45); display: none;
    align-items: center; justify-content: center; z-index: 150; padding: 20px; }
.dp-backdrop.show { display: flex; }
.dp { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    width: 320px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dp-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.dp-nav { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--card);
    border-radius: 8px; color: var(--text); font-size: 18px; line-height: 1; }
.dp-nav:hover { border-color: var(--green); color: var(--green); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow { margin-bottom: 4px; }
.dp-dowcell { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.dp-cell { height: 36px; border: none; background: none; border-radius: 8px; color: var(--text);
    font-size: 13px; cursor: pointer; }
.dp-cell:hover:not(.empty) { background: rgba(58,167,87,.12); color: var(--green); }
.dp-cell.is-today { border: 1px solid var(--green); color: var(--green); font-weight: 700; }
.dp-cell.empty { cursor: default; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-today, .dp-clear { background: none; border: none; color: var(--green); font-weight: 600; font-size: 13px; }
.dp-clear { color: var(--muted); }
.dp-today:hover, .dp-clear:hover { text-decoration: underline; }

/* ============================================================
   BLOG
   ============================================================ */
.blog-hero { max-width: 760px; margin: 0 auto; text-align: center; padding: 44px 0 30px; }
.blog-eyebrow { color: var(--green); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: 13px; margin: 0 0 10px; }
.blog-hero h1 { font-size: 40px; font-weight: 800; color: var(--ink); margin: 0 0 14px; letter-spacing: -.5px; line-height: 1.1; }
.blog-lead { color: var(--text-soft); font-size: 17px; margin: 0; }

.blog-featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; background: var(--card);
    border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 24px 0 36px;
    box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.blog-featured:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(16,24,40,.1); }
.bf-media, .bc-media { background: linear-gradient(135deg, #1f2733, #2f8c49); color: #fff;
    display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px;
    font-weight: 700; font-size: 18px; text-transform: capitalize; min-height: 180px; }
.bf-body { padding: 30px 32px; }
.blog-tag { display: inline-block; background: rgba(58,167,87,.12); color: var(--green);
    font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 20px; margin-bottom: 12px; }
.bf-body h2 { font-size: 26px; color: var(--ink); margin: 0 0 10px; line-height: 1.2; }
.bf-body p { color: var(--text-soft); margin: 0 0 16px; }
.bf-meta, .bc-meta { color: var(--muted); font-size: 13px; }

.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 30px; }
.blog-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16,24,40,.1); }
.bc-media { min-height: 140px; font-size: 15px; }
.bc-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.bc-body h3 { font-size: 17px; color: var(--ink); margin: 0 0 8px; line-height: 1.3; }
.bc-body p { color: var(--text-soft); font-size: 14px; margin: 0 0 14px; flex: 1; }

.blog-cta, .post-cta { text-align: center; background: var(--card); border: 1px solid var(--line);
    border-radius: 16px; padding: 40px 24px; margin: 30px 0 60px; }
.blog-cta h2, .post-cta h2 { font-size: 24px; color: var(--ink); margin: 0 0 8px; }
.blog-cta p, .post-cta p { color: var(--text-soft); margin: 0 0 18px; }
.blog-cta .btn-signup, .post-cta .btn-signup { display: inline-block; padding: 12px 24px; font-size: 15px; }

/* blog detail */
.post { max-width: 760px; margin: 0 auto; padding: 30px 0 20px; }
.post-crumbs { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.post-crumbs a { color: var(--green); }
.post-crumbs span { margin: 0 6px; }
.post-head h1 { font-size: 38px; font-weight: 800; color: var(--ink); margin: 0 0 12px; line-height: 1.12; letter-spacing: -.5px; }
.post-meta { color: var(--text-soft); font-size: 14px; margin: 0 0 8px; }
.post-body { color: var(--text); line-height: 1.75; font-size: 16px; padding-top: 14px; }
.post-body h2 { font-size: 25px; color: var(--ink); margin: 34px 0 12px; }
.post-body h3 { font-size: 19px; color: var(--ink); margin: 24px 0 8px; }
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body a { color: var(--green); font-weight: 600; }
.post-body blockquote { border-left: 3px solid var(--green); padding: 4px 18px; margin: 0 0 18px;
    color: var(--text-soft); font-style: italic; background: var(--bg); border-radius: 0 8px 8px 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.post-body th { background: var(--bg); }

.post-faq { margin: 40px 0; }
.post-faq h2 { font-size: 25px; color: var(--ink); margin: 0 0 16px; }
.faq-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; background: var(--card); }
.faq-item summary { font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; color: var(--green); font-weight: 800; margin-right: 10px; }
.faq-item[open] summary::before { content: "\2212"; }
.faq-item p { margin: 12px 0 0; color: var(--text-soft); line-height: 1.6; }

.post-related { max-width: 1000px; margin: 0 auto; padding-bottom: 60px; }
.post-related h2 { font-size: 24px; color: var(--ink); margin: 0 0 18px; text-align: center; }

@media (max-width: 860px) {
    .blog-featured { grid-template-columns: 1fr; }
    .blog-grid { grid-template-columns: 1fr 1fr; }
    .blog-hero h1 { font-size: 30px; }
    .post-head h1 { font-size: 28px; }
}
@media (max-width: 560px) { .blog-grid { grid-template-columns: 1fr; } }

/* settings extra */
.set-card { max-width: 1000px; margin: 0 auto; }
.set-head { text-align: center; margin-bottom: 26px; }
.set-head h1 { font-size: 34px; color: #fff; margin: 0 0 8px; }
.set-tabs { display: flex; gap: 6px; background: var(--d-card2); border: 1px solid var(--d-line);
    border-radius: 12px; padding: 6px; margin-bottom: 28px; flex-wrap: wrap; }
.set-tab { flex: 1; text-align: center; padding: 10px 14px; border-radius: 8px; color: var(--d-soft);
    font-weight: 600; font-size: 14px; white-space: nowrap; }
.set-tab:hover { color: #fff; }
.set-tab.active { background: var(--d-card); color: #fff; border: 1px solid var(--d-line); }
.set-h2 { color: #fff; font-size: 20px; margin: 0 0 6px; }
.set-h3 { color: #fff; font-size: 16px; margin: 0 0 6px; }
.set-sub { margin: 0 0 20px; }
.set-panel { background: var(--d-card2); border: 1px solid var(--d-line); border-radius: 11px; padding: 8px 22px; }
.set-panel .set-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--d-line); }
.set-panel .set-row:last-child { border-bottom: none; }
.set-panel.readonly strong { color: #fff; font-size: 15px; }
.set-panel label { color: var(--d-soft); font-size: 14px; }
.set-panel input, .set-panel select { background: var(--d-bg); border: 1px solid var(--d-line); color: var(--d-text);
    border-radius: 7px; padding: 8px 11px; max-width: 220px; }
.set-actions { display: flex; gap: 10px; padding: 16px 0; }
.set-footer-right { display: flex; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--d-line); }
.set-hr { border: none; border-top: 1px solid var(--d-line); margin: 26px 0; }
.usage-bar-wrap { background: var(--d-card2); border: 1px solid var(--d-line); border-radius: 10px; padding: 18px 20px; margin-bottom: 22px; }
.usage-text { color: var(--d-soft); margin-bottom: 10px; }
.usage-text strong { color: #fff; }
.usage-bar { height: 8px; background: var(--d-bg); border-radius: 5px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--d-green); }
.plan-banner { display: flex; gap: 14px; background: rgba(216,131,36,.08); border: 1px solid rgba(216,131,36,.3);
    border-radius: 11px; padding: 18px 20px; margin-bottom: 8px; }
.plan-banner .plan-ico { color: #e0a23a; font-size: 18px; }
.plan-banner p { color: #e9c386; margin: 0 0 12px; font-size: 14px; }
.set-keys-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.newkey-form { display: flex; gap: 10px; margin-bottom: 18px; }
.newkey-form input { flex: 1; background: var(--d-bg); border: 1px solid var(--d-line); color: var(--d-text); border-radius: 8px; padding: 10px 12px; }
.g-signin { display: flex; justify-content: center; margin-bottom: 12px; min-height: 44px; }

/* ============================================================
   MOBILE HEADERS (hamburger menus) — added
   ============================================================ */
/* hamburger button: hidden on desktop, shown on mobile */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px;
    color: var(--ink);
    cursor: pointer;
    line-height: 0;
}
.nav-toggle .ico-close { display: none; }
.nav-toggle.open .ico-burger { display: none; }
.nav-toggle.open .ico-close { display: inline; }
.dash-toggle { color: #fff; border-color: var(--d-line); }

/* desktop: collapse wrapper is transparent — children flow exactly as before */
.nav-collapse, .dash-collapse { display: contents; }

/* ---- public header on mobile: slide-in sidebar ---- */
@media (max-width: 820px) {
    .nav-inner { position: relative; }
    .nav-toggle { display: inline-flex; }

    .nav-collapse {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 290px; max-width: 86vw;
        background: var(--card);
        border-right: 1px solid var(--line);
        box-shadow: 6px 0 28px rgba(16,24,40,.18);
        padding: 74px 18px 22px;
        overflow-y: auto;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .28s ease;
    }
    .nav-collapse.open { transform: translateX(0); }
    .nav-collapse .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
    }
    .nav-collapse .nav-links a {
        padding: 13px 8px;
        border-bottom: 1px solid var(--line-soft);
        font-size: 16px;
    }
    .nav-collapse .nav-right {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 16px;
        justify-content: flex-start;
    }
    .nav-collapse .nav-signin { padding: 8px 0; }
    .nav-collapse .btn-signup { margin-left: auto; }
}

/* ---- dashboard header on mobile: slide-in sidebar ---- */
@media (max-width: 860px) {
    .dash-nav-inner { position: relative; }
    .dash-toggle { display: inline-flex; }

    .dash-collapse {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 290px; max-width: 86vw;
        background: #111b27;
        border-right: 1px solid var(--d-line);
        box-shadow: 6px 0 30px rgba(0,0,0,.5);
        padding: 74px 18px 22px;
        overflow-y: auto;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .28s ease;
    }
    .dash-collapse.open { transform: translateX(0); }
    .dash-collapse .dash-links {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        gap: 0;
    }
    .dash-collapse .dash-links a {
        height: auto;
        padding: 13px 8px;
        border-bottom: 1px solid var(--d-line);
        border-left: 2px solid transparent;
    }
    .dash-collapse .dash-links a.active { border-bottom-color: var(--d-line); border-left-color: var(--d-green); }
    .dash-collapse .dash-upgrade { margin: 12px 0; text-align: center; }
    .dash-collapse .dash-right {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        gap: 16px;
        padding-top: 12px;
        flex-wrap: wrap;
    }
    .dash-user { width: 100%; justify-content: space-between; }
    .dash-menu { position: static; box-shadow: none; margin-top: 8px; width: 100%; }
}

/* small-phone polish */
@media (max-width: 480px) {
    .nav-inner { padding: 0 14px; }
    .brand-text { font-size: 17px; }
    .page { padding: 0 14px; }
    .dash-main { padding: 20px 14px 60px; }
    .dash-card { padding: 20px 16px; }
    .dash-card-head { flex-direction: column; align-items: flex-start; }
    .dash-actions { flex-wrap: wrap; }
    .stat-row { grid-template-columns: 1fr; }
    .set-tabs { flex-direction: column; }
    .set-tab { text-align: left; }
    .inv-head-actions { flex-wrap: wrap; }
    .auth-shell { padding: 36px 14px 50px; }
    .auth-card { padding: 28px 20px; }
    .dash-table thead { display: none; }
    .dash-table tbody td { padding: 8px 0; }
    .dp { width: 100%; max-width: 320px; }
}

/* ============ MOBILE SIDEBAR BACKDROP ============ */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 28, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 55;
}
.nav-backdrop.open { opacity: 1; visibility: visible; }
/* while the drawer is open: lock scroll and lift the header above the backdrop
   so its close (X) button stays tappable */
body.nav-open { overflow: hidden; }
body.nav-open .navbar,
body.nav-open .dash-nav { z-index: 70; }
@media (min-width: 861px) { .nav-backdrop { display: none; } }
