/* Shop-bot panel — brass/ledger look; no CDN, no glass/neon clichés */
:root {
    --ink: #182230;
    --ink-soft: #3d4a5c;
    --paper: #f3efe6;
    --paper-2: #ebe4d6;
    --brass: #a67c3d;
    --brass-deep: #7a5a28;
    --copper: #8c4a2f;
    --line: #cfc3ae;
    --debt: #8e2a2a;
    --paid: #1e5c40;
    --warn: #8a5a12;
    --white: #fffdf8;
    --radius: 3px;
    --font: "Vazirmatn", Tahoma, sans-serif;
    --num: "Vazirmatn", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
    min-height: 100vh;
    line-height: 1.65;
}
a { color: var(--brass-deep); text-decoration: none; }
a:hover { color: var(--copper); text-decoration: underline; }
.money, .num, td.num, .fs-5, .badge { font-variant-numeric: tabular-nums; font-family: var(--num); }

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.pb-5 { padding-bottom: 3rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.25rem; }
.small, .form-text, .text-muted { font-size: .86rem; color: var(--ink-soft); }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-danger { color: var(--debt) !important; }
.text-success { color: var(--paid) !important; }
.text-primary { color: var(--brass-deep) !important; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.align-items-end { align-items: end; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }

.row { display: flex; flex-wrap: wrap; margin: 0 -.5rem; }
.row > [class*="col"] { padding: 0 .5rem; }
.g-2 { --g: .5rem; }
.g-3 { --g: .75rem; }
.row.g-2, .row.g-3 { margin: 0 calc(var(--g, .75rem) / -2); }
.row.g-2 > [class*="col"], .row.g-3 > [class*="col"] { padding: calc(var(--g, .75rem) / 2); }
.col, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-6, .col-lg-3, .col-lg-6, .col-xl-3 { width: 100%; }
@media (min-width: 768px) {
    .col-6 { width: 50%; }
    .col-md-1 { width: 8.33%; } .col-md-2 { width: 16.66%; } .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.33%; } .col-md-5 { width: 41.66%; } .col-md-6 { width: 50%; }
}
@media (min-width: 992px) {
    .col-lg-3 { width: 25%; } .col-lg-6 { width: 50%; }
}
@media (min-width: 1200px) {
    .col-xl-3 { width: 25%; }
}

/* Shell */
.site-header {
    background: var(--ink);
    color: var(--white);
    border-bottom: 3px solid var(--brass);
    margin-bottom: 1.75rem;
}
.site-header .brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--white);
    text-decoration: none;
    white-space: nowrap;
    max-width: 100%;
}
.brand-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}
.brand-text { color: var(--white); }
.brand-shop { color: var(--brass); font-weight: 500; font-size: .9rem; }
.nav-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.login-logo { max-height: 56px; max-width: 200px; object-fit: contain; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .85rem 0; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem .85rem; flex: 1; }
.site-nav a {
    color: #d7dce5;
    text-decoration: none;
    font-size: .92rem;
    padding: .2rem 0;
    border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--white); border-bottom-color: var(--brass); text-decoration: none; }
.site-nav .shop-name { color: #aeb6c4; font-size: .85rem; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--brass);
    color: var(--brass);
    padding: .35rem .7rem;
    cursor: pointer;
    font-family: inherit;
}
@media (max-width: 900px) {
    .nav-toggle { display: inline-block; margin-right: auto; }
    .site-nav ul { display: none; width: 100%; flex-direction: column; }
    .site-nav.is-open ul { display: flex; }
}

.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    inset-inline-start: 0;
    top: 100%;
    min-width: 11rem;
    background: var(--ink);
    border: 1px solid var(--brass-deep);
    border-top: 2px solid var(--brass);
    padding: .35rem 0;
    z-index: 40;
    box-shadow: none;
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: .45rem .9rem;
    color: #e8ecf2;
    border: 0 !important;
}
.dropdown-menu a:hover { background: #243041; color: var(--brass); }

/* Surfaces — solid, not glass */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    margin-bottom: 1rem;
}
.card-header, .card-body { padding: .85rem 1rem; }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}
.bg-white { background: var(--white) !important; }

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--brass);
    display: inline-block;
}

/* Ledger metrics (not icon-stat cards) */
.ledger {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--line);
    background: var(--white);
    margin-bottom: 1.25rem;
}
@media (min-width: 900px) { .ledger { grid-template-columns: repeat(4, 1fr); } }
.ledger__cell {
    padding: 1rem 1.1rem;
    border-left: 1px solid var(--line);
}
.ledger__cell:nth-child(2n) { border-left: 0; }
@media (min-width: 900px) {
    .ledger__cell { border-left: 1px solid var(--line); }
    .ledger__cell:last-child { border-left: 0; }
}
.ledger__label { font-size: .78rem; color: var(--ink-soft); margin-bottom: .35rem; }
.ledger__value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger__value.is-debt { color: var(--debt); }
.ledger__value.is-paid { color: var(--paid); }
.ledger__value.is-brass { color: var(--brass-deep); }

.alert {
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--white);
}
.alert-success { border-color: #9bbfad; background: #f0f7f3; color: var(--paid); }
.alert-danger { border-color: #d4a3a3; background: #faf2f2; color: var(--debt); }
.alert-info { border-color: #c9b896; background: #f8f3e8; color: var(--ink); }

.btn, button.btn {
    display: inline-block;
    font-family: inherit;
    font-size: .92rem;
    padding: .45rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--brass-deep);
    background: var(--brass);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: var(--brass-deep); color: #fff; text-decoration: none; }
.btn-primary { background: var(--brass); border-color: var(--brass-deep); color: #fff; }
.btn-success { background: var(--paid); border-color: #164632; color: #fff; }
.btn-outline-primary, .btn-outline-danger, .btn-outline-light, .btn-sm {
    background: transparent;
    color: var(--brass-deep);
}
.btn-outline-danger { border-color: var(--debt); color: var(--debt); }
.btn-outline-light { border-color: var(--brass); color: var(--brass); }
.btn-outline-light:hover { background: var(--brass); color: #fff; }
.btn-sm { padding: .25rem .55rem; font-size: .82rem; }

.form-label { display: block; margin-bottom: .3rem; font-weight: 500; }
.form-control, .form-select, input.form-control, select.form-select, textarea.form-control {
    width: 100%;
    font-family: inherit;
    font-size: .95rem;
    padding: .45rem .65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: inset 0 0 0 1px var(--brass);
}
.form-check { display: flex; align-items: center; gap: .4rem; }
.form-check-input { width: auto; }
.is-invalid { border-color: var(--debt) !important; }
.invalid-feedback { color: var(--debt); font-size: .85rem; margin-top: .25rem; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.table thead th { font-size: .8rem; color: var(--ink-soft); font-weight: 500; border-bottom: 2px solid var(--brass); }
.table-sm th, .table-sm td { padding: .4rem .5rem; }
.table-responsive { overflow-x: auto; }

.badge {
    display: inline-block;
    padding: .15rem .45rem;
    font-size: .75rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper);
}
.text-bg-danger, .badge.text-bg-danger { color: var(--debt); border-color: #d4a3a3; background: #faf2f2; }
.text-bg-success, .badge.text-bg-success { color: var(--paid); border-color: #9bbfad; background: #f0f7f3; }
.text-bg-secondary, .badge.text-bg-secondary { color: var(--ink-soft); }
.text-bg-dark, .badge.text-bg-dark { color: var(--white); background: var(--ink); border-color: var(--ink); }
.text-bg-primary { color: var(--brass-deep); background: #f3ead8; border-color: #d4c09a; }

code { font-size: .85em; background: var(--paper-2); padding: .1rem .3rem; border-radius: 2px; }
.border { border: 1px solid var(--line) !important; }
.rounded { border-radius: var(--radius) !important; }
.bg-light { background: var(--paper) !important; }
.hr, hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(166,124,61,.12), transparent 45%),
        linear-gradient(165deg, #1a2330 0%, #2a3342 45%, #3d3428 100%);
}
.login-box {
    width: min(400px, 100%);
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brass);
    padding: 1.75rem 1.5rem;
}
.login-box h1 {
    margin: 0 0 .25rem;
    font-size: 1.25rem;
    text-align: center;
}
.login-box .sub {
    text-align: center;
    color: var(--ink-soft);
    font-size: .85rem;
    margin-bottom: 1.25rem;
}
