/* ============================================================
   Free Khata Book — Design System
   Signature: pages read like real ruled accounting-ledger paper.
   Red margin rule + pale blue horizontal ruling on warm paper.
   Debit = red ink, Credit = green ink (traditional bahi-khata
   convention), amounts set in tabular mono for scan-ability.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Bangla:ital@0;1&family=Hind+Siliguri:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --paper: #F3ECDA;
    --paper-card: #FBF8F0;
    --ink: #1E2A38;
    --ink-soft: #5B6B7A;
    --rule-blue: #B9CBDD;
    --rule-red: #A6352B;
    --credit: #1F7A5C;
    --debit: #A6352B;
    --gold: #A9791F;
    --gold-soft: #F1E3C2;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(30, 42, 56, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Hind Siliguri', 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3, .display {
    font-family: 'Tiro Bangla', serif;
    color: var(--ink);
    margin: 0 0 .4em;
    letter-spacing: 0.2px;
}

a { color: var(--ink); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.amount { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-variant-numeric: tabular-nums; }
.amount.debit { color: var(--debit); }
.amount.credit { color: var(--credit); }

/* ---------- Layout shell ---------- */
.topbar {
    background: var(--ink);
    color: var(--paper-card);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--rule-red);
}
.topbar .brand { font-family: 'Tiro Bangla', serif; font-size: 1.25rem; color: #fff; }
.topbar nav a {
    color: var(--paper-card);
    margin-left: 16px;
    font-size: .92rem;
    opacity: .9;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 14px 0 0;
}
.nav-close { display: none; }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 26, 33, .5);
    z-index: 999;
    opacity: 0;
    transition: opacity .2s ease;
}
.nav-overlay.open { display: block; opacity: 1; }

@media (max-width: 780px) {
    .hamburger-btn { display: inline-block; }
    .topbar .brand { flex: 1; }

    .site-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 78vw;
        max-width: 300px;
        background: var(--ink);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 60px 22px 24px;
        transform: translateX(-105%);
        transition: transform .25s ease;
        border-right: 3px solid var(--rule-red);
        box-shadow: 6px 0 18px rgba(0,0,0,.25);
    }
    .site-nav.open { transform: translateX(0); }
    .site-nav a { margin-left: 0; padding: 10px 0; font-size: 1rem; width: 100%; }
    .site-nav .lang-switch { margin-top: 10px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2); width: 100%; }

    .nav-close {
        display: block;
        position: absolute;
        top: 14px;
        right: 16px;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.8rem;
        line-height: 1;
        cursor: pointer;
        padding: 4px 8px;
    }
}

.wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ---------- Ledger card: the signature element ----------
   Ruled horizontal lines + a red margin rule on the left,
   like a physical accounting ledger page. */
.ledger-card {
    background:
        repeating-linear-gradient(
            var(--paper-card),
            var(--paper-card) 37px,
            var(--rule-blue) 38px
        );
    border: 1px solid #E1D6B8;
    border-left: 4px solid var(--rule-red);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px 18px 26px;
    margin-bottom: 20px;
}
.ledger-card.plain { background: var(--paper-card); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #14202C; }
.btn-credit { background: var(--credit); color: #fff; }
.btn-debit { background: var(--debit); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-whatsapp { background: #1F7A5C; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Forms ---------- */
label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=email], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D2C6A6;
    border-radius: 7px;
    background: #fff;
    font-family: inherit;
    font-size: .95rem;
    margin-bottom: 14px;
}
.field-row { display: flex; gap: 12px; }
.field-row > div { flex: 1; }
.error-box {
    background: #FBE6E2;
    border: 1px solid var(--debit);
    color: var(--debit);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}

/* ---------- Dashboard summary ---------- */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.summary-tile { background: var(--paper-card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); text-align: center; }
.summary-tile .label { font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }
.summary-tile .value { font-family: 'JetBrains Mono', monospace; font-size: 1.6rem; font-weight: 700; margin-top: 4px; }

/* ---------- Lists ---------- */
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule-blue);
}
.row-list li:last-child { border-bottom: none; }
.row-meta { font-size: .8rem; color: var(--ink-soft); }

/* ---------- Perforated header (notebook edge) ---------- */
.torn-edge {
    height: 10px;
    background:
        radial-gradient(circle at 8px 0, transparent 6px, var(--paper) 7px) repeat-x;
    background-size: 16px 10px;
}

/* ---------- Landing / donate ---------- */
.hero { text-align: center; padding: 50px 16px 30px; }
.hero h1 { font-size: 2.1rem; }
.hero p { color: var(--ink-soft); max-width: 520px; margin: 10px auto 26px; }
.stamp {
    display: inline-block;
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transform: rotate(-3deg);
}

.support-box { background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: var(--radius); padding: 18px; }

footer.site-footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: .82rem;
    padding: 30px 16px;
}

@media (max-width: 560px) {
    .summary-grid { grid-template-columns: 1fr; }
    .field-row { flex-direction: column; gap: 0; }
}

/* ============================================================
   Guide / User Manual page
   ============================================================ */
.toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.toc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 78vw;
    max-width: 280px;
    background: var(--ink);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 60px 22px 24px;
    transform: translateX(105%);
    transition: transform .25s ease;
    border-left: 3px solid var(--gold);
    box-shadow: -6px 0 18px rgba(0,0,0,.25);
}
.toc-drawer.open { transform: translateX(0); }
.toc-drawer a { color: var(--paper-card); padding: 10px 0; font-size: 1rem; width: 100%; opacity: .9; }
.toc-drawer a:hover { opacity: 1; text-decoration: underline; }
.toc-drawer .nav-close { position: absolute; top: 14px; right: 16px; }

.guide-steps { padding-left: 22px; margin: 10px 0; }
.guide-steps li { margin-bottom: 12px; line-height: 1.6; }

.faq-item {
    border-bottom: 1px solid var(--rule-blue);
    padding: 12px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: '▸ '; color: var(--gold); }
.faq-item[open] summary::before { content: '▾ '; }
.faq-item p { margin: 8px 0 0; color: var(--ink-soft); line-height: 1.6; }

.dev-card { text-align: center; padding: 8px 0; }
.dev-name { font-family: 'Tiro Bangla', serif; font-size: 1.3rem; color: var(--ink); }
.dev-title { color: var(--ink-soft); font-size: .9rem; margin-bottom: 14px; }
.dev-links { list-style: none; padding: 0; margin: 0 0 16px; }
.dev-links li { padding: 5px 0; font-size: .95rem; }
.dev-links a { color: var(--ink); font-weight: 600; }
.dev-links a:hover { color: var(--gold); }
.dev-social { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dev-social a {
    background: var(--gold-soft);
    color: var(--gold);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
}
.dev-social a:hover { background: var(--gold); color: #fff; }

.code-block {
    background: var(--ink);
    color: #DCEFE6;
    font-family: 'JetBrains Mono', monospace;
    font-size: .82rem;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

/* ============================================================
   Super Admin Panel — denser, dashboard-style chrome. Same token
   palette as the shop-facing app, but no ruled-ledger texture:
   this is a control room, not a notebook page.
   ============================================================ */
.admin-body { background: #EDE7D6; }
.admin-topbar {
    background: var(--ink);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--gold);
}
.admin-topbar .brand { font-family: 'Tiro Bangla', serif; font-size: 1.15rem; }
.admin-topbar nav a { color: #fff; margin-left: 16px; font-size: .88rem; opacity: .85; }
.admin-topbar nav a:hover { opacity: 1; text-decoration: underline; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.stat-box {
    background: var(--paper-card);
    border-radius: var(--radius);
    border-top: 3px solid var(--gold);
    box-shadow: var(--shadow);
    padding: 14px 16px;
}
.stat-box .label { font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.stat-box .value { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700; margin-top: 4px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: .88rem;
}
.data-table th, .data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--rule-blue);
}
.data-table th { background: #EEE6CC; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; }
.data-table tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.badge-free { background: #E4E9EF; color: var(--ink-soft); }
.badge-premium { background: var(--gold-soft); color: var(--gold); }
.badge-pending { background: #FBE6E2; color: var(--debit); }
.badge-confirmed { background: #DCEFE6; color: var(--credit); }
.badge-rejected { background: #E4E9EF; color: var(--ink-soft); }

@media (max-width: 700px) {
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}
