/* Tech Plus - AM Digital */

@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
    --tp-primary: #0284c7;
    --tp-primary-dark: #0369a1;
    --tp-side: #0f172a;
    --tp-side-2: #1e293b;
    --tp-side-text: #94a3b8;
    --tp-bg: #f1f5f9;
    --tp-border: #e2e8f0;
    --tp-text: #0f172a;
    --tp-muted: #64748b;
    --tp-radius: 14px;
    --sidebar-w: 240px;

    --bs-primary: var(--tp-primary);
    --bs-primary-rgb: 37, 99, 235;
    --bs-body-font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    --bs-body-color: var(--tp-text);
    --bs-body-bg: var(--tp-bg);
    --bs-border-color: var(--tp-border);
}

html { font-size: 14px; }
@media (min-width: 1680px) { html { font-size: 15px; } }
body { font-size: 1rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
kbd { font-family: inherit; font-size: .7rem; padding: .1rem .35rem; background: rgba(255,255,255,.2); }

.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--tp-primary); --bs-btn-border-color: var(--tp-primary); --bs-btn-hover-bg: var(--tp-primary-dark); --bs-btn-hover-border-color: var(--tp-primary-dark); }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; padding: 0; }
.form-control, .form-select, .input-group-text { border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: #93c5fd; box-shadow: 0 0 0 .2rem rgba(37,99,235,.15); }
.form-label { font-weight: 500; font-size: .9rem; margin-bottom: .3rem; }
.form-control, .form-select { padding-top: .45rem; padding-bottom: .45rem; }
.form-control-lg, .input-group-lg > .form-control, .input-group-lg > .btn, .input-group-lg > .input-group-text { font-size: 1.1rem; padding-top: .55rem; padding-bottom: .55rem; }

/* ---------- layout ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--tp-side); color: var(--tp-side-text);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 1040;
    transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-name { color: #fff; font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.brand-shop { font-size: .78rem; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar .nav-link { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 10px; color: var(--tp-side-text); font-weight: 500; margin-bottom: 2px; }
.sidebar .nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.sidebar .nav-link:hover { background: var(--tp-side-2); color: #e2e8f0; }
.sidebar .nav-link.active { background: var(--tp-primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(37,99,235,.6); }
.sidebar-foot { font-size: .72rem; padding: .85rem 1.25rem; border-top: 1px solid rgba(255,255,255,.06); color: #64748b; }

.main { flex: 1; min-width: 0; margin-inline-start: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    height: 58px; padding: 0 1.5rem;
    background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--tp-border);
}
.page-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.lang-btn { min-width: 52px; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: .5rem; background: none; border: 0; padding: .25rem .5rem; border-radius: 10px; color: var(--tp-text); font-weight: 500; }
.user-chip:hover { background: var(--tp-bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #dbeafe; color: var(--tp-primary); display: inline-grid; place-items: center; font-weight: 700; }
.avatar-xl { width: 84px; height: 84px; font-size: 2rem; display: grid; }

.content { padding: 1.5rem; flex: 1; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: none; }
    .main { margin-inline-start: 0; }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
    .content { padding: 1rem; }
    .topbar { padding: 0 1rem; }
}

/* ---------- cards & panels ---------- */

.panel { background: #fff; border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.panel-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }

.stat-card { background: #fff; border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 1.1rem 1.25rem; height: 100%; position: relative; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: .75rem; }
.stat-label { color: var(--tp-muted); font-size: .82rem; font-weight: 500; }
.stat-value { font-size: 1.3rem; font-weight: 700; margin: .15rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-note { font-size: .78rem; color: var(--tp-muted); }

.table { --bs-table-bg: transparent; }
.table > thead th { font-size: .78rem; font-weight: 600; color: var(--tp-muted); background: #f8fafc; border-bottom: 1px solid var(--tp-border); white-space: nowrap; }
.table td { border-color: #f1f5f9; }

/* Soft badges: the tinted background comes from Bootstrap's -subtle
   classes, which leave the text white. Every colour in use needs its own
   dark text here, or the badge reads white-on-white. */
.badge-soft-success   { color: #0f5132 !important; }
.badge-soft-warning   { color: #b45309 !important; }
.badge-soft-info      { color: #0369a1 !important; }
.badge-soft-danger    { color: #b91c1c !important; }
.badge-soft-primary   { color: #0369a1 !important; }
.badge-soft-secondary { color: #475569 !important; }
.badge-soft-dark      { color: #1f2937 !important; }

.empty-state { text-align: center; color: var(--tp-muted); padding: 2rem 1rem; }
.empty-state > i, .empty-icon { font-size: 2.5rem; opacity: .5; }
.empty-state p { margin: .5rem 0 0; }

/* bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: .75rem; height: 230px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.bar-value { font-size: .7rem; color: var(--tp-muted); height: 1.1rem; white-space: nowrap; }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: #f8fafc; border-radius: 8px; }
.bar { width: 100%; background: #bfdbfe; border-radius: 8px; transition: height .4s ease; }
.bar-col.is-today .bar { background: var(--tp-primary); }
.bar-col:hover .bar { background: #60a5fa; }
.bar-label { font-size: .75rem; color: var(--tp-muted); text-align: center; margin-top: .4rem; line-height: 1.2; }
.bar-col.is-today .bar-label { color: var(--tp-primary); font-weight: 600; }

/* quick actions */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.quick-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 1rem .5rem; border: 1px solid var(--tp-border); border-radius: 12px; color: var(--tp-text); font-weight: 500; font-size: .85rem; transition: all .15s; }
.quick-item i { font-size: 1.5rem; color: var(--tp-primary); }
.quick-item:hover { border-color: var(--tp-primary); background: #eff6ff; color: var(--tp-primary); }

.mini-stats { margin-top: 1rem; border-top: 1px dashed var(--tp-border); }
.mini-stats > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--tp-border); font-size: .875rem; }
.mini-stats > div:last-child { border-bottom: 0; }
.mini-stats span { color: var(--tp-muted); }

/* ---------- login ---------- */

.login-page { background: #fff; }
.login-wrap { display: flex; min-height: 100vh; }
.login-side {
    width: 44%; flex-direction: column; justify-content: space-between;
    padding: 3rem; color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(99,102,241,.55), transparent 50%),
                radial-gradient(circle at 80% 90%, rgba(37,99,235,.6), transparent 45%),
                var(--tp-side);
}
.login-side h1 { font-size: 2.4rem; font-weight: 700; margin: 1rem 0 .25rem; }
.login-side p { color: #cbd5e1; font-size: 1.05rem; }
.login-logo { width: 132px; height: 132px; border-radius: 20px; background: #fff; padding: 10px; display: grid; place-items: center; }
.login-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-logo.sm { width: 52px; height: 52px; border-radius: 14px; background: none; padding: 0; }
.login-points { list-style: none; padding: 0; margin: 0; }
.login-points li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; color: #e2e8f0; font-size: 1rem; }
.login-points i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.login-form-area { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--tp-bg); }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--tp-border); border-radius: 18px; padding: 2rem; box-shadow: 0 20px 45px -25px rgba(15,23,42,.25); }

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
}

@media (max-width: 575.98px) {
    .stat-card { padding: .9rem 1rem; }
    .stat-value { font-size: 1.05rem; white-space: normal; }
    .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .bar-chart { gap: .35rem; height: 190px; }
    .bar-value { visibility: hidden; }
    .bar-label { font-size: .65rem; }
}

/* ---------- list pages ---------- */

.min-w-0 { min-width: 0; }
.page-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.code-chip { background: #e0e7ff; color: #3730a3; font-weight: 600; padding: .3rem .75rem; border-radius: 8px; font-size: .85rem; direction: ltr; }

.stat-link { display: block; color: inherit; transition: border-color .15s, transform .15s; }
.stat-link:hover { border-color: #93c5fd; transform: translateY(-1px); color: inherit; }

.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tp-border); }
.list-toolbar .form-select { width: auto; min-width: 120px; max-width: 175px; }
.search-box { position: relative; flex: 1 1 220px; max-width: 380px; }
.search-box > i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .85rem; color: var(--tp-muted); }
.search-box .form-control { padding-inline-start: 2.4rem; padding-inline-end: 2.2rem; background: #f8fafc; }
.search-box .form-control:focus { background: #fff; }
.search-box kbd { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: .6rem; background: #e2e8f0; color: var(--tp-muted); }

.cat-tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .65rem 1.25rem; border-bottom: 1px solid var(--tp-border); scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a { white-space: nowrap; padding: .3rem .85rem; border-radius: 999px; color: var(--tp-muted); font-size: .85rem; font-weight: 500; border: 1px solid transparent; }
.cat-tabs a:hover { background: #f1f5f9; color: var(--tp-text); }
.cat-tabs a.active { background: #eff6ff; color: var(--tp-primary); border-color: #bfdbfe; }

.list-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--tp-border); }
.pagination { --bs-pagination-border-radius: 8px; }

.product-table tbody tr { cursor: pointer; }
.product-table td { padding-top: .65rem; padding-bottom: .65rem; }
.thumb { width: 44px; height: 44px; border-radius: 10px; background: #f1f5f9; display: grid; place-items: center; overflow: hidden; color: #94a3b8; font-size: 1.2rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-inactive { opacity: .55; }

.stock-pill { display: inline-block; min-width: 2.6rem; padding: .2rem .6rem; border-radius: 999px; font-weight: 700; font-size: .82rem; text-align: center; }
.stock-pill.ok  { background: #dcfce7; color: #15803d; }
.stock-pill.low { background: #fef3c7; color: #b45309; }
.stock-pill.out { background: #fee2e2; color: #b91c1c; }

/* ---------- product form ---------- */

.condition-toggle .btn { min-width: 130px; }
.spec-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.spec-chip { border: 1px dashed #cbd5e1; background: #fff; color: var(--tp-muted); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; }
.spec-chip:hover { border-color: var(--tp-primary); color: var(--tp-primary); background: #eff6ff; }
.spec-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; margin-bottom: .5rem; }
.spec-row .btn-icon { width: 38px; height: 38px; font-size: 1rem; }

.image-drop { display: grid; place-items: center; width: 100%; max-width: 320px; margin: 0 auto; aspect-ratio: 1; border: 2px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; cursor: pointer; overflow: hidden; transition: border-color .15s; }
.image-drop:hover { border-color: var(--tp-primary); }
.image-drop img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.image-drop-text { text-align: center; color: var(--tp-muted); font-size: .82rem; padding: 1rem; }
.image-drop-text i { display: block; font-size: 2.2rem; color: #94a3b8; margin-bottom: .25rem; }

.margin-note { font-size: .78rem; margin-top: .3rem; font-weight: 500; min-height: 1.1rem; }
.stock-box { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.stock-box > div { background: #f8fafc; border-radius: 10px; padding: .65rem .8rem; }
.stock-box span { display: block; font-size: .75rem; color: var(--tp-muted); }
.stock-box strong { font-size: 1.25rem; }

/* ---------- product view ---------- */

.product-photo { aspect-ratio: 1; border-radius: 14px; background: #f8fafc; display: grid; place-items: center; overflow: hidden; }
.product-photo img { width: 100%; height: 100%; object-fit: contain; }
.product-photo i { font-size: 4rem; color: #cbd5e1; }
.price-big { font-size: 1.6rem; font-weight: 700; color: var(--tp-primary); }
.info-grid, .spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .65rem; }
.info-grid > div, .spec-grid > div { background: #f8fafc; border-radius: 10px; padding: .6rem .8rem; }
.info-grid span, .spec-grid span { display: block; font-size: .75rem; color: var(--tp-muted); }
.info-grid strong, .spec-grid strong { font-weight: 600; }
.spec-grid > div { border-inline-start: 3px solid #93c5fd; }

/* ---------- categories & brands ---------- */

.ps-sub { padding-inline-start: 2rem !important; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; padding: 1.25rem; }
.brand-card { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--tp-border); border-radius: 12px; padding: .75rem; transition: border-color .15s, box-shadow .15s; }
.brand-card:hover { border-color: #bfdbfe; box-shadow: 0 6px 18px -12px rgba(37,99,235,.5); }
.brand-letter { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, #eff6ff, #e0e7ff); color: var(--tp-primary); display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }

.modal-content { border: 0; border-radius: 16px; }
.modal-header, .modal-footer { border-color: var(--tp-border); }

@media (max-width: 767.98px) {
    .list-toolbar .form-select { flex: 1 1 45%; max-width: none; }
    .spec-row { grid-template-columns: 1fr 1fr auto; }
}

/* ---------- parties (suppliers / customers) ---------- */

.party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .85rem; padding: 1.25rem; }
.party-card { display: block; border: 1px solid var(--tp-border); border-radius: 14px; padding: 1rem; color: var(--tp-text); transition: all .15s; background: #fff; }
.party-card:hover { border-color: #93c5fd; box-shadow: 0 10px 24px -16px rgba(37,99,235,.55); transform: translateY(-2px); color: var(--tp-text); }
.party-avatar { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #dbeafe, #e0e7ff); color: var(--tp-primary); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; flex-shrink: 0; }
.party-avatar.sm { width: 44px; height: 44px; border-radius: 12px; font-size: 1.1rem; }
.party-meta { display: flex; justify-content: space-between; gap: .5rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px dashed var(--tp-border); font-size: .78rem; color: var(--tp-muted); }
.bal { font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 8px; white-space: nowrap; }
.bal-owe { background: #fee2e2; color: #b91c1c; }
.bal-adv { background: #dbeafe; color: #1d4ed8; }
.bal-zero { background: #dcfce7; color: #15803d; }

.contact-list > * { display: flex; align-items: center; gap: .65rem; padding: .5rem 0; color: var(--tp-text); border-bottom: 1px dashed var(--tp-border); }
.contact-list > *:last-child { border-bottom: 0; }
.contact-list i { width: 30px; height: 30px; border-radius: 8px; background: #f1f5f9; display: grid; place-items: center; color: var(--tp-muted); flex-shrink: 0; }
.balance-card { background: #f0fdf4; border-color: #bbf7d0; }
.balance-card .stat-icon { background: #dcfce7; color: #15803d; }
.balance-card.is-owe { background: #fef2f2; border-color: #fecaca; }
.balance-card.is-owe .stat-icon { background: #fee2e2; color: #b91c1c; }
.balance-card.is-owe .stat-value { color: #b91c1c; }

.khata-table td { font-size: .88rem; }
.khata-table tfoot th { background: #f8fafc; font-weight: 700; }
.ktype { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; margin-inline-end: .35rem; font-size: .8rem; }
.ktype-purchase { background: #dbeafe; color: #1d4ed8; }
.ktype-payment { background: #dcfce7; color: #15803d; }
.ktype-return { background: #fee2e2; color: #b91c1c; }
.ktype-opening, .ktype-adjustment { background: #f1f5f9; color: #475569; }
.pay-balance { display: flex; justify-content: space-between; align-items: center; background: #fef2f2; border-radius: 12px; padding: .85rem 1rem; }
.pay-balance span { color: #991b1b; }
.pay-balance strong { font-size: 1.3rem; color: #b91c1c; }

/* ---------- purchase entry ---------- */

.item-search { position: relative; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tp-border); background: linear-gradient(180deg, #f8fafc, #fff); border-radius: var(--tp-radius) var(--tp-radius) 0 0; }
.item-search > i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 2.1rem; font-size: 1.3rem; color: var(--tp-primary); }
.item-search .form-control { padding-inline-start: 3rem; border: 2px solid #bfdbfe; font-size: 1rem; }
.item-search .form-control:focus { border-color: var(--tp-primary); }
.item-search .hint { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 2.1rem; font-size: .75rem; color: var(--tp-muted); }
.search-results { display: none; position: absolute; z-index: 30; inset-inline: 1.25rem; top: calc(100% - .5rem); background: #fff; border: 1px solid var(--tp-border); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(15,23,42,.35); max-height: 360px; overflow-y: auto; }
.search-results.show { display: block; }
.sr-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; border: 0; background: none; padding: .65rem 1rem; text-align: start; border-bottom: 1px solid #f1f5f9; }
.sr-item:hover, .sr-item.active { background: #eff6ff; }
.sr-name { font-weight: 600; min-width: 0; }
.sr-name small { display: block; font-weight: 400; color: var(--tp-muted); }
.sr-stock { background: #dcfce7; color: #15803d; border-radius: 999px; padding: .1rem .6rem; font-weight: 700; font-size: .8rem; }
.sr-stock.low { background: #fef3c7; color: #b45309; }
.sr-stock.out { background: #fee2e2; color: #b91c1c; }
.sr-empty { padding: 1rem; text-align: center; color: var(--tp-muted); }

.items-head, .item-row { display: grid; grid-template-columns: minmax(180px, 2.2fr) .8fr 1.1fr 1.1fr 1.1fr 1fr 44px; gap: .6rem; align-items: center; padding: .6rem 1.25rem; }
.items-head { font-size: .75rem; font-weight: 600; color: var(--tp-muted); background: #f8fafc; border-bottom: 1px solid var(--tp-border); }
.item-row { border-bottom: 1px solid #f1f5f9; animation: rowIn .25s ease; }
.item-row:hover { background: #fafcff; }
.item-row .form-control { padding: .35rem .5rem; font-size: .95rem; }
.item-row > div { position: relative; }
.item-row .btn-icon { width: 36px; height: 36px; font-size: 1rem; }
.afn-note { position: absolute; inset-inline-start: .2rem; top: 100%; font-size: .68rem; color: var(--tp-primary); white-space: nowrap; }
.item-row { padding-bottom: .95rem !important; }
.items-note { font-size: .78rem; color: var(--tp-muted); padding: .75rem 1.25rem; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.totals-panel { position: sticky; top: 80px; }
.tot-row { display: flex; justify-content: space-between; padding: .45rem 0; font-size: .9rem; }
.tot-row span { color: var(--tp-muted); }
.grand-box { background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; border-radius: 14px; padding: 1rem 1.1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.grand-box span { width: 100%; font-size: .8rem; opacity: .85; }
.grand-box strong { font-size: 1.55rem; line-height: 1; }
.grand-box small { opacity: .8; }
.grand-box.danger { background: linear-gradient(135deg, #dc2626, #e11d48); }
.due-row { border-top: 1px dashed var(--tp-border); padding-top: .7rem; font-size: 1.05rem; }
.due-row strong { font-size: 1.15rem; }

.stat-cta { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff !important; border: 0; }
.stat-cta .stat-icon { background: rgba(255,255,255,.18); color: #fff; }
.stat-cta:hover { color: #fff; box-shadow: 0 12px 26px -14px rgba(37,99,235,.8); }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choice-cards input { display: none; }
.choice-cards span { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; border: 2px solid var(--tp-border); border-radius: 12px; padding: .75rem .5rem; cursor: pointer; font-size: .85rem; font-weight: 500; }
.choice-cards span i { font-size: 1.3rem; color: var(--tp-muted); }
.choice-cards input:checked + span { border-color: var(--tp-primary); background: #eff6ff; color: var(--tp-primary); }
.choice-cards input:checked + span i { color: var(--tp-primary); }

.print-head { display: none; }

@media (max-width: 767.98px) {
    .item-row { grid-template-columns: 1fr 1fr; padding: .85rem 1rem; gap: .5rem .6rem; }
    .item-row .item-name { grid-column: 1 / -1; }
    .item-row label { font-size: .72rem; color: var(--tp-muted); margin-bottom: .1rem; }
    .item-row .r-line { grid-column: 1 / 2; font-size: 1.05rem; text-align: start !important; align-self: center; }
    .item-search > i { inset-inline-start: 1.85rem; }
    .party-grid { padding: 1rem; grid-template-columns: 1fr; }
    .totals-panel { position: static; }
}

@media print {
    body { background: #fff; }
    .doc-card, .panel { border: 0; padding: 0; }
    .print-head { display: block; text-align: center; margin-bottom: 1rem; }
    .print-head h2 { font-size: 1.3rem; margin: 0; }
    .stat-card { border: 1px solid #ddd; }
    a { color: inherit !important; }
}

.btn-qa { border-color: var(--tp-border); color: var(--tp-primary); background: #fff; min-width: 42px; }
.btn-qa:hover { background: #eff6ff; border-color: #93c5fd; color: var(--tp-primary-dark); }
.input-group > .form-select { min-width: 0; }

/* image cropper */
.crop-stage { height: min(60vh, 460px); background: #0f172a; }
.crop-stage img { display: block; max-width: 100%; }
.crop-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; padding: .75rem; border-top: 1px solid var(--tp-border); background: #f8fafc; }
.crop-tools .btn { min-width: 42px; }
.ratio-group .btn.active { background: var(--tp-primary); color: #fff; }
.cropper-view-box { outline-color: #60a5fa; }
.cropper-line, .cropper-point { background-color: #60a5fa; }

/* totals panel next to the items on wide screens, as a compact grid below them on smaller screens */
@media (max-width: 1199.98px) {
    .totals-panel { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem 1rem; align-items: end; }
    .totals-panel > * { margin: 0 !important; }
    .totals-panel .grand-box { align-self: stretch; }
    .totals-panel .btn-lg { grid-column: 1 / -1; }
    .totals-panel .due-row { border-top: 0; padding-top: .45rem; }
}
.sidebar .nav-link { padding: .5rem .75rem; }
.nav-group { padding: .85rem .75rem .3rem; }


/* ---------- printed documents ---------- */

.doc-card { background: #fff; border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 2.25rem 2.5rem; max-width: 900px; margin: 0 auto; color: #111827; }
.doc-head { display: flex; justify-content: space-between; align-items: stretch; gap: 1.5rem; padding-bottom: 1.25rem; border-bottom: 3px solid #1e293b; }
.doc-brand { display: flex; gap: .9rem; align-items: center; }
.doc-logo { width: 58px; height: 58px; border-radius: 14px; background: #1e293b; color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; flex-shrink: 0; }
.doc-logo-img { width: 64px; height: 64px; object-fit: contain; }
.doc-shop { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.doc-sub { font-size: .82rem; color: #4b5563; }
.doc-titlebox { min-width: 210px; border-radius: 12px; padding: .75rem 1rem; background: #eff6ff; border: 1px solid #bfdbfe; }
.doc-titlebox.doc-danger { background: #fef2f2; border-color: #fecaca; }
.doc-title { font-size: 1.05rem; font-weight: 700; color: #1d4ed8; margin-bottom: .35rem; }
.doc-danger .doc-title { color: #b91c1c; }
.doc-kv { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; }
.doc-kv span { color: #4b5563; }

.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; }
.doc-box { border: 1px solid #e5e7eb; border-radius: 10px; padding: .8rem 1rem; font-size: .88rem; }
.doc-box-title { font-size: .72rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.doc-party { font-size: 1.05rem; font-weight: 700; color: #111827; display: block; }
.doc-tag { display: inline-block; font-size: .68rem; font-weight: 600; vertical-align: middle;
           background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; border-radius: 5px; padding: .05rem .3rem; }
.doc-line { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; }
.doc-line span { color: #6b7280; }
.doc-ltr { text-align: start; unicode-bidi: plaintext; }

.doc-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 1.25rem; }
.doc-table th { background: #1e293b; color: #fff; font-weight: 600; font-size: .8rem; padding: .6rem .75rem; text-align: start; }
.doc-table th:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.doc-table th:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.doc-table td { padding: .65rem .75rem; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.doc-table tbody tr:nth-child(even) td { background: #f9fafb; }
.doc-table .c-no { width: 42px; text-align: center; color: #6b7280; }
.doc-table .c-num { text-align: end; white-space: nowrap; }
.doc-code { font-size: .75rem; color: #6b7280; unicode-bidi: plaintext; text-align: start; }
.doc-ret { font-size: .72rem; color: #b91c1c; }

.doc-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.doc-mini { width: 100%; border-collapse: collapse; font-size: .8rem; }
.doc-mini th { text-align: start; color: #6b7280; font-weight: 600; border-bottom: 1px solid #d1d5db; padding: .35rem .4rem; }
.doc-mini td { padding: .35rem .4rem; border-bottom: 1px dashed #e5e7eb; }
.doc-mini .c-num { text-align: end; }
.doc-note { margin-top: .75rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: .55rem .75rem; font-size: .82rem; }
.doc-totals { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; font-size: .9rem; }
.doc-totals > div { display: flex; justify-content: space-between; padding: .5rem .9rem; border-bottom: 1px solid #f3f4f6; }
.doc-totals > div:last-child { border-bottom: 0; }
.doc-totals span { color: #4b5563; }
.doc-totals .grand { background: #1e293b; color: #fff; font-size: 1.05rem; padding: .7rem .9rem; }
.doc-totals .grand span { color: #fff; font-weight: 600; }
.doc-totals .grand.danger { background: #b91c1c; }
.doc-totals .due strong { color: #b91c1c; }

.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3.5rem; }
.doc-sign > div { border-top: 1px solid #9ca3af; padding-top: .4rem; text-align: center; font-size: .8rem; color: #4b5563; }
.doc-foot { display: flex; justify-content: space-between; margin-top: 1.75rem; padding-top: .6rem; border-top: 1px dashed #d1d5db; font-size: .72rem; color: #9ca3af; }

@media screen and (max-width: 767.98px) {
    .doc-card { padding: 1.1rem; }
    .doc-head { flex-direction: column; }
    .doc-parties, .doc-bottom { grid-template-columns: 1fr; }
    .doc-table { font-size: .82rem; }
    .doc-table th, .doc-table td { padding: .5rem .4rem; }
}

@page { size: A4; margin: 12mm; }
@media print {
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    html { font-size: 12px; }
    .doc-card { border: 0; border-radius: 0; padding: 0; max-width: none; }
    .doc-table tr { page-break-inside: avoid; }
    .doc-bottom, .doc-sign { page-break-inside: avoid; }
    .alert { display: none !important; }
}

/* ------------------------------------------------------------------
   Installed app
   When Tech Plus runs from its own icon there is no browser bar, so
   the layout takes the whole screen and keeps clear of the notch and
   the home indicator on phones that have them.
------------------------------------------------------------------ */
html.is-app body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-inline-start: env(safe-area-inset-left);
    padding-inline-end: env(safe-area-inset-right);
    overscroll-behavior-y: none;   /* no pull-to-refresh mid-sale */
}

/* The browser's own install bar is hidden there, so neither button
   has anything to offer. */
html.is-app #installBtn,
html.is-app #fsBtn { display: none !important; }

#installBtn:not(.d-none) { display: inline-flex !important; }

/* ------------------------------------------------------------------
   Settings
   One card per group, each saving on its own.
------------------------------------------------------------------ */
.set-wrap { display: grid; gap: 1rem; max-width: 900px; }
.set-card { padding: 1.1rem 1.2rem 1rem; }
.set-head { margin-bottom: 1rem; }
.set-head h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .15rem; display: flex; align-items: center; gap: .45rem; }
.set-head p { font-size: .8rem; color: var(--tp-muted); margin: 0; }
.set-foot { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--tp-border); display: flex; justify-content: flex-end; }

.logo-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.logo-frame { width: 132px; height: 132px; flex-shrink: 0; border: 1px dashed var(--tp-border);
              border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; padding: 6px; }
.logo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-empty { font-size: 2rem; color: #cbd5e1; }

/* Activity log: a coloured dot makes the important rows findable at a glance */
.log-dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
           background: currentColor; }
.log-dot i { color: #fff; font-size: .8rem; }
.log-table td { padding-top: .55rem; padding-bottom: .55rem; }

/* ------------------------------------------------------------------
   Compact figure
   A small label-over-value box, for the summary strip above a sheet or
   a form where a full stat card would be too heavy.
------------------------------------------------------------------ */
.mini-stat { background: #fff; border: 1px solid var(--tp-border); border-radius: var(--tp-radius);
             padding: .6rem .8rem; height: 100%; display: flex; flex-direction: column; gap: .1rem; }
.mini-stat > span { color: var(--tp-muted); font-size: .76rem; font-weight: 500; }
.mini-stat > b { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }

/* ==================================================================
   Stock pages
================================================================== */

/* How full a product is against its minimum, at a glance. */
.level { height: 6px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-top: .35rem; min-width: 70px; }
.level > i { display: block; height: 100%; border-radius: 99px; background: #16a34a; transition: width .2s; }
.level.is-low > i  { background: #f59e0b; }
.level.is-out > i  { background: #dc2626; }

.qty-pill { display: inline-flex; align-items: baseline; gap: .2rem; font-weight: 700; font-size: 1rem; }
.qty-pill small { font-weight: 500; font-size: .72rem; color: var(--tp-muted); }

/* The two quick buttons that sit beside a stock figure. */
.qstep { display: inline-flex; gap: .25rem; }
.qstep .btn { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .8rem; line-height: 1.2; }

/* ---------- counting sheet ---------- */
.count-bar { display: flex; align-items: center; gap: .75rem; }
.count-track { flex: 1; height: 10px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.count-track > i { display: block; height: 100%; background: linear-gradient(90deg, #0284c7, #0ea5e9); border-radius: 99px; transition: width .25s; }
.count-pct { font-weight: 700; font-size: .9rem; min-width: 3.2rem; text-align: end; }

.sheet-row.is-done   { background: #f0fdf4; }
.sheet-row.is-diff   { background: #fffbeb; }
.sheet-row.is-active { box-shadow: inset 0 0 0 2px var(--tp-primary); }
.sheet-in { font-size: 1.05rem; font-weight: 700; text-align: center; }
.sheet-in::-webkit-outer-spin-button, .sheet-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet-in { -moz-appearance: textfield; }

.sticky-head { position: sticky; top: 0; z-index: 5; background: #fff; }
.sticky-foot { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--tp-border); }

/* ---------- returns ---------- */
.ret-row.is-on { background: #eff6ff; }
.ret-row td { vertical-align: middle; }
.pick-card { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border: 1px solid var(--tp-border);
             border-radius: var(--tp-radius); background: #fff; text-decoration: none; color: inherit; transition: .15s; }
.pick-card:hover { border-color: var(--tp-primary); box-shadow: 0 2px 10px rgba(2,132,199,.12); color: inherit; }
.pick-inv { font-weight: 700; font-family: inherit; }

@media (max-width: 575.98px) {
    .qstep .btn { --bs-btn-padding-x: .6rem; }
}

/* Autosave indicator on the count sheet */
.save-state { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem;
              padding: .25rem .6rem; border-radius: 999px; align-self: center; }
.save-state.is-saving { background: #eff6ff; color: #1d4ed8; }
.save-state.is-saved  { background: #ecfdf5; color: #047857; }
.save-state.is-error  { background: #fef2f2; color: #b91c1c; }
.spin { animation: tp-spin 1s linear infinite; display: inline-block; }
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* Horizontal bars in the reports tables. The vertical .bar-track above is a
   column chart with a fixed narrow width, so these need rules of their own. */
.rbar { width: 100%; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.rbar-fill { height: 100%; background: var(--tp-primary); border-radius: 999px; min-width: 2px; }

/* ---------- dashboard ---------- */
/* Values the owner can hide at the counter. Each figure carries its own ***
   twin in the markup, so screen readers and copy-paste see the stars too,
   not an empty box. */
.mval-h { display: none; letter-spacing: .12em; }
.values-hidden .mval-v { display: none; }
.values-hidden .mval-h { display: inline; }

/* net profit is the bottom line, so it gets the strong card */
.stat-net { background: linear-gradient(135deg, #0369a1, #0284c7); border: 0; color: #fff; }
.stat-net .stat-icon { background: rgba(255,255,255,.18); color: #fff; }
.stat-net .stat-label, .stat-net .stat-note, .stat-net .text-muted { color: rgba(255,255,255,.82) !important; }
.stat-net.is-loss { background: linear-gradient(135deg, #b91c1c, #dc2626); }
.stat-net .trend-good, .stat-net .trend-bad { color: #fff; background: rgba(255,255,255,.18); }

.trend { display: inline-flex; align-items: center; gap: .1rem; font-weight: 600; border-radius: 999px; padding: 0 .4rem 0 .15rem; }
.trend-good { color: #15803d; background: #dcfce7; }
.trend-bad  { color: #b91c1c; background: #fee2e2; }

/* the profit-and-loss sheet: each line takes from the one above */
.statement > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: .9rem; border-bottom: 1px dashed var(--tp-border); }
.statement > div:last-child { border-bottom: 0; }
.statement span { color: var(--tp-muted); }
.statement .st-sum { font-weight: 700; border-bottom-style: solid; }
.statement .st-sum span { color: inherit; }
.statement .st-total { font-weight: 700; font-size: 1.05rem; border-top: 2px solid #1e293b; border-bottom: 0; padding-top: .65rem; margin-top: .15rem; }
.statement .st-total span { color: inherit; }
.statement-cash { background: #f8fafc; border-radius: 10px; padding: .25rem .85rem; }
/* while hidden, the arrow and its colour would still tell up from down */
.values-hidden .trend i { display: none; }
.values-hidden .trend { color: var(--tp-muted); background: #f1f5f9; }
.values-hidden .stat-net .trend { color: #fff; background: rgba(255,255,255,.18); }

/* ---------- returns: the money choice and what it will do ---------- */
.settle-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.settle-choice .btn { padding: .6rem .5rem; font-weight: 600; }
.money-preview { border: 1px solid var(--tp-border); border-radius: 12px; padding: .75rem 1rem; background: #f8fafc; }
.money-preview .mp-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.money-preview .mp-total strong { font-size: 1.35rem; }
.money-preview .mp-line { margin-top: .45rem; padding: .45rem .6rem; border-radius: 8px; background: #e0f2fe; color: #075985; font-weight: 600; font-size: .9rem; }
.money-preview .mp-cash { background: #fef3c7; color: #92400e; }
.js-reason.active { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff; }

/* ---------- the printed report sheet ---------- */
.rep-period { display: flex; justify-content: space-between; gap: 1rem; margin: 1.1rem 0 .4rem;
              padding: .55rem .9rem; background: #f1f5f9; border-radius: 8px; font-size: .9rem; }
.rep-period span { color: #4b5563; }
.rep-h { font-size: 1rem; font-weight: 700; margin: 1.4rem 0 .5rem; padding-bottom: .3rem;
         border-bottom: 2px solid #1e293b; }
.rep-walk td:first-child { color: #374151; }
.rep-walk .rep-sum td { font-weight: 700; border-top: 1px solid #cbd5e1; }
.rep-walk .rep-total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid #1e293b; }
.rep-walk .rep-total.is-loss td { color: #b91c1c; }
.rep-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .9rem; }
.rep-facts > div { border: 1px solid #e5e7eb; border-radius: 8px; padding: .5rem .7rem; }
.rep-facts span { display: block; color: #6b7280; font-size: .76rem; }
.rep-facts strong { font-size: .98rem; }

@media print {
    .report-sheet .rep-h { page-break-after: avoid; }
    .report-sheet table { page-break-inside: auto; }
    .report-sheet thead { display: table-header-group; }
    .report-sheet .rep-facts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575.98px) {
    .rep-facts { grid-template-columns: repeat(2, 1fr); }
}

/* exchange panel on the return screen */
.settle-choice:has(#stExchange) { grid-template-columns: 1fr 1fr 1fr; }
.ex-panel { border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .75rem; background: var(--bs-tertiary-bg); }
.ex-results { position: absolute; z-index: 20; inset-inline: 0; top: 100%; max-height: 14rem; overflow: auto;
              background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ex-hit { display: block; width: 100%; text-align: start; padding: .45rem .7rem; border: 0; background: none; font-size: .88rem; }
.ex-hit:hover:not(:disabled), .ex-hit:focus { background: var(--bs-secondary-bg); }
.ex-hit:disabled { opacity: .5; }

/* day / month / year pickers that replace date fields in Pashto */
.solar-date { display: grid; grid-template-columns: .8fr 1.4fr 1fr; gap: .35rem; min-width: 11rem; }
.solar-date .form-select { padding-inline: .5rem; }
.list-toolbar .solar-date { min-width: 13rem; width: auto; }

.usd-note{display:block;font-size:.72em;font-weight:400;opacity:.7;line-height:1.25;letter-spacing:0}
.badge .usd-note{opacity:.8}

/* backup page */
.bk-status { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-inline-start: 5px solid var(--bk-c, #94a3b8); flex-wrap: wrap; }
.bk-status.bk-success { --bk-c: #16a34a; } .bk-status.bk-warning { --bk-c: #f59e0b; } .bk-status.bk-danger { --bk-c: #dc2626; }
.bk-status-icon { font-size: 1.9rem; color: var(--bk-c); }
.bk-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.bk-card { padding: 1.25rem; display: flex; flex-direction: column; }
.bk-card h3 { font-size: 1.05rem; font-weight: 700; margin: .75rem 0 .25rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bk-card p { font-size: .88rem; color: var(--tp-muted); flex: 1; margin-bottom: 1rem; }
.bk-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; }
.bk-ico.sm { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; }
.bk-extra { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.bk-extra .form-control { max-width: 340px; }
.bk-fname { font-size: .72rem; opacity: .8; }
.bk-acc .accordion-button { font-weight: 600; }

/* daily exchange-rate reminder */
.rate-nudge { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: 1rem; padding: .9rem 1.1rem;
  border-radius: 14px; color: #fff; background: linear-gradient(120deg, #1d4ed8, #2563eb 55%, #0ea5e9);
  box-shadow: 0 10px 24px -12px rgba(37,99,235,.65); }
.rate-nudge-ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }

/* money colours: red = money the customer pays us / owes us, green = money we pay out */
:root { --money-in: #c62828; --money-out: #1b8a3a; }
.amt-in, .amt-in * { color: var(--money-in) !important; }
.amt-out, .amt-out * { color: var(--money-out) !important; }
.amt-in .usd-note, .amt-out .usd-note { opacity: .8; }
.money-legend { display: inline-flex; gap: .9rem; align-items: center; font-size: .78rem; color: var(--bs-secondary-color, #6c757d); }
.money-legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-inline-end: .3rem; }
.money-legend .l-in i { background: var(--money-in); }
.money-legend .l-out i { background: var(--money-out); }
.select-find { margin-bottom: .35rem; }

/* product price panel */
.cur-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.cur-chip { border: 1.5px solid var(--bs-border-color, #dfe5ee); background: #fff; border-radius: 2rem; padding: .35rem 1rem; font-weight: 600; font-size: .85rem; cursor: pointer; transition: .15s; }
.cur-chip:hover { border-color: #0a6cff; }
.cur-chip.on { background: #0a6cff; border-color: #0a6cff; color: #fff; box-shadow: 0 4px 12px rgba(10,108,255,.25); }
.cur-rate { font-size: .8rem; color: #6b7a90; margin-bottom: 1rem; min-height: 1.2rem; }
.pr-row { margin-bottom: .9rem; }
.pr-pair { display: flex; flex-direction: column; gap: .35rem; }
.pr-pair .input-group { flex-wrap: nowrap; }
.mode-fc .in-fc { order: 1; }
.mode-fc .in-afn { order: 2; }
.mode-fc .in-afn .form-control, .mode-fc .in-afn .input-group-text { padding-top: .3rem; padding-bottom: .3rem; font-size: .88rem; }
.mode-fc .in-afn .form-control { background: #f3f6fb; color: #36516f; font-weight: 600; }
.mode-fc .in-afn .calc-eq { display: flex; }
.mode-afn .in-fc { display: none; }
.mode-afn .in-afn { flex: 1; }
.mode-afn .in-afn .calc-eq { display: none; }
.pr-foot { display: flex; justify-content: space-between; gap: .5rem; min-height: 1.1rem; }
.alt-note { font-size: .78rem; color: #6b7a90; margin-inline-start: auto; }
.quick-margin { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding-top: .6rem; border-top: 1px dashed #dfe5ee; }
.qm-chip { border: 1px solid #cfe0ff; background: #eef4ff; color: #0a52c7; border-radius: 2rem; padding: .2rem .7rem; font-size: .8rem; font-weight: 600; cursor: pointer; }
.qm-chip:hover, .qm-chip.on { background: #0a6cff; color: #fff; border-color: #0a6cff; }
.price-hint { margin-top: .6rem; }

/* developer desk */
.dv-hero { background: linear-gradient(120deg, #0b1220, #13294b 60%, #0a4a8f); color: #fff; border-radius: 1.1rem; padding: 1.3rem 1.4rem; margin-bottom: 1rem; box-shadow: 0 10px 30px rgba(15,35,70,.15); }
.dv-hero-main { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.dv-mark { width: 2.8rem; height: 2.8rem; border-radius: .8rem; display: grid; place-items: center; font-size: 1.3rem; background: linear-gradient(135deg, #0a6cff, #06b6d4); box-shadow: 0 6px 18px rgba(6,182,212,.35); }
.dv-title { font-weight: 700; font-size: 1.2rem; }
.dv-sub { font-size: .82rem; opacity: .7; }
.dv-sid { margin-inline-start: auto; text-align: end; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: .7rem; padding: .35rem .8rem; }
.dv-sid small { display: block; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.dv-sid strong { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.dv-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; margin-top: 1rem; }
.dv-pill { display: flex; align-items: center; gap: .55rem; background: rgba(255,255,255,.07); border-radius: .7rem; padding: .5rem .7rem; font-size: .85rem; font-weight: 600; }
.dv-pill small { display: block; font-size: .68rem; font-weight: 500; opacity: .7; }
.dv-pill.ok i { color: #4ade80; } .dv-pill.bad i { color: #fb7185; } .dv-pill.bad { background: rgba(251,113,133,.15); }
.dv-tabs { display: flex; gap: .3rem; overflow-x: auto; background: #fff; border: 1px solid var(--bs-border-color, #e3e9f1); border-radius: .9rem; padding: .3rem; margin-bottom: 1rem; }
.dv-tab { display: flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: .65rem; color: #4a5a70; text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.dv-tab:hover { background: #f1f5fa; color: #0e1a2b; }
.dv-tab.on { background: #0a6cff; color: #fff; box-shadow: 0 4px 12px rgba(10,108,255,.25); }
.dv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; }
.dv-facts > div { background: #f6f8fc; border-radius: .6rem; padding: .55rem .7rem; }
.dv-facts span { display: block; font-size: .72rem; color: #6b7a90; }
.dv-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.dv-links a { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border-radius: 2rem; background: #eef4ff; color: #0a52c7; text-decoration: none; font-size: .82rem; font-weight: 600; }
.dv-links a.danger { background: #fff1f2; color: #be123c; }
.dv-checks { list-style: none; padding: 0; margin: 0; }
.dv-checks li { display: flex; gap: .55rem; padding: .45rem 0; border-bottom: 1px dashed #edf1f6; font-size: .9rem; }
.dv-checks li i { color: #16a34a; } .dv-checks li.bad { color: #b91c1c; font-weight: 600; } .dv-checks li.bad i { color: #dc2626; }
.dv-lic { display: flex; justify-content: space-between; align-items: center; border-radius: .9rem; padding: 1rem 1.2rem; margin-bottom: .8rem; color: #fff; background: linear-gradient(120deg, #0d9488, #14b8a6); }
.dv-lic.bad { background: linear-gradient(120deg, #be123c, #f43f5e); }
.dv-lic-type { font-size: 1.3rem; font-weight: 700; }
.dv-lic-left { font-size: 2rem; font-weight: 800; text-align: end; line-height: 1; } .dv-lic-left small { display: block; font-size: .7rem; font-weight: 500; opacity: .85; }
.dv-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; }
.dv-opt input { position: absolute; opacity: 0; }
.dv-opt span { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .8rem .5rem; border: 1.5px solid #e3e9f1; border-radius: .8rem; cursor: pointer; font-weight: 600; font-size: .88rem; }
.dv-opt span i { font-size: 1.3rem; color: #0a6cff; }
.dv-opt input:checked + span { border-color: #0a6cff; background: #eef4ff; box-shadow: 0 0 0 3px rgba(10,108,255,.12); }
.dv-code-head { display: flex; gap: .8rem; margin-bottom: 1rem; }
.dv-code-head h3 { font-size: 1.05rem; margin: 0 0 .2rem; } .dv-code-head p { font-size: .82rem; color: #6b7a90; margin: 0; }
.dv-code-head .ic { flex: 0 0 2.4rem; height: 2.4rem; border-radius: .7rem; display: grid; place-items: center; color: #fff; }
.dv-code-head .ic.a { background: linear-gradient(135deg, #0a6cff, #4f9bff); } .dv-code-head .ic.b { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; text-transform: uppercase; }
.dv-out { margin-top: 1rem; border: 1.5px dashed #b7c6dc; border-radius: .9rem; padding: .9rem; text-align: center; background: #f6f9fe; }
.dv-out small { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #6b7a90; }
.dv-out .code { font-family: ui-monospace, Consolas, monospace; font-size: 1.8rem; font-weight: 700; letter-spacing: .12em; margin: .3rem 0 .5rem; word-break: break-all; }
.dv-switch { background: #f6f8fc; border-radius: .8rem; padding: .8rem 1rem; margin-bottom: 1rem; }
.dv-h4 { font-size: .9rem; font-weight: 700; margin: .4rem 0 .2rem; }
.dv-list { max-height: 120px; overflow: auto; }
.dev-switch-mark { width: 3rem; height: 3rem; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, #0b1220, #0a4a8f); }

/* developer contact card (sign-in / locked screen) */
.dev-contact { border: 1px solid #e3e9f1; border-radius: .9rem; padding: .9rem 1rem; background: #fff; }
.dev-contact-head { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #6b7a90; font-weight: 600; }
.dev-contact-name { font-weight: 700; font-size: 1.05rem; margin: .15rem 0 .5rem; }
.dev-contact-rows { display: grid; gap: .35rem; }
.dev-contact-row { display: flex; align-items: center; gap: .55rem; padding: .45rem .7rem; border-radius: .6rem; background: #f3f6fb; color: #0e1a2b; text-decoration: none; font-weight: 600; font-size: .9rem; }
.dev-contact-row:hover { background: #e8f0fe; }
.dev-contact-row .bi-whatsapp { color: #16a34a; } .dev-contact-row .bi-telephone-fill { color: #0a6cff; } .dev-contact-row .bi-envelope-fill { color: #e11d48; }

.fs-tip { position: absolute; top: calc(100% + .5rem); inset-inline-end: 0; z-index: 1060; width: 15rem; background: #0e1a2b; color: #fff; font-size: .8rem; line-height: 1.4; padding: .55rem .7rem; border-radius: .6rem; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.fs-tip kbd { background: #fff; color: #0e1a2b; font-weight: 700; }
html.is-app .fs-tip { display: none !important; }

/* barcode label preview */
.bc-prev { margin: 0 auto; background: #fff; border: 1px dashed #b7c6dc; border-radius: 4px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; color: #000; max-width: 100%; }
.bc-prev .shop { font-size: 11px; font-weight: 600; }
.bc-prev .nm { font-size: 13px; font-weight: 700; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.bc-prev .bars { width: 100%; zoom: 0.9; }
.bc-prev .num { font-size: 11px; letter-spacing: .08em; }
.bc-prev .pr { font-size: 15px; font-weight: 800; }
.bc-prev .code { font-size: 10px; color: #444; }

/* daily exchange rate box */
.rate-box { border: 0; border-radius: 1rem; overflow: hidden; }
.rate-box-head { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.25rem; color: #fff; background: linear-gradient(120deg, #0b1730, #13294b 60%, #0a4a8f); }
.rate-box-ico { width: 2.8rem; height: 2.8rem; border-radius: .8rem; display: grid; place-items: center; font-size: 1.35rem; background: linear-gradient(135deg, #0284c7, #22b8e8); box-shadow: 0 6px 16px rgba(34,184,232,.35); }
.rate-box-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .8rem; border: 1px solid var(--bs-border-color, #e3e9f1); border-radius: .8rem; margin-bottom: .55rem; }
.rate-box-cur { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.rate-box-code { flex: 0 0 auto; font-weight: 800; font-size: .8rem; letter-spacing: .05em; padding: .35rem .55rem; border-radius: .5rem; background: #eef4ff; color: #0a52c7; }
.rate-box-in { max-width: 15rem; flex-wrap: nowrap; }
.rate-box-in .form-control { font-size: 1.1rem; text-align: center; }
@media (max-width: 480px) { .rate-box-row { flex-direction: column; align-items: stretch; } .rate-box-in { max-width: none; } }

/* reports */
.rp-chip { display: inline-block; padding: .35rem .85rem; border-radius: 2rem; border: 1px solid var(--bs-border-color, #dfe5ee); background: #fff; color: #334155; text-decoration: none; font-size: .85rem; font-weight: 600; }
.rp-chip:hover { border-color: #0284c7; color: #0284c7; }
.rp-chip.on { background: #0284c7; border-color: #0284c7; color: #fff; }
.rp-hero { display: flex; gap: 1.25rem; align-items: stretch; flex-wrap: wrap; background: linear-gradient(120deg, #0b1730, #13294b 60%, #0a4a8f); color: #fff; border-radius: 1rem; padding: 1.25rem 1.4rem; margin-bottom: 1rem; }
.rp-hero-text { flex: 1 1 22rem; }
.rp-hero-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-bottom: .4rem; }
.rp-hero p { font-size: 1.05rem; line-height: 1.8; margin: 0; }
.rp-hero-num { flex: 0 0 auto; min-width: 13rem; background: rgba(255,255,255,.08); border-radius: .8rem; padding: .9rem 1.1rem; display: flex; flex-direction: column; justify-content: center; }
.rp-hero-num span { font-size: .8rem; opacity: .75; } .rp-hero-num strong { font-size: 1.7rem; line-height: 1.2; } .rp-hero-num small { font-size: .72rem; opacity: .6; }
.rp-hero.is-loss .rp-hero-num { background: rgba(251,146,60,.2); }
.rp-card { background: #fff; border: 1px solid var(--bs-border-color, #e3e9f1); border-radius: .9rem; padding: 1rem 1.1rem; height: 100%; }
.rp-card-top { display: flex; align-items: center; gap: .55rem; font-size: .85rem; font-weight: 600; color: #475569; }
.rp-ic { width: 2rem; height: 2rem; border-radius: .6rem; display: grid; place-items: center; }
.rp-ic.b { background: #e0f2fe; color: #0369a1; } .rp-ic.g { background: #f1f5f9; color: #475569; } .rp-ic.p { background: #ede9fe; color: #6d28d9; } .rp-ic.o { background: #ffedd5; color: #c2410c; }
.rp-card-num { font-size: 1.45rem; font-weight: 800; margin: .45rem 0 .2rem; }
.rp-card-help { font-size: .78rem; color: #64748b; line-height: 1.5; }
.rp-steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.rp-steps li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem .3rem; border-bottom: 1px dashed #e5eaf1; }
.rp-steps li div b { display: block; font-weight: 600; font-size: .92rem; } .rp-steps li div small { color: #64748b; font-size: .76rem; }
.rp-steps li > span { font-weight: 700; white-space: nowrap; }
.rp-steps li.minus > span { color: #64748b; }
.rp-steps li.sum { background: #f6f8fc; border-radius: .5rem; border-bottom: 0; margin: .2rem 0; padding: .55rem .6rem; }
.rp-steps li.total { background: #0b1730; color: #fff; border-radius: .6rem; border: 0; margin-top: .4rem; padding: .75rem .8rem; }
.rp-steps li.total > span { font-size: 1.15rem; } .rp-steps li.total.loss { background: #9a3412; }
.rp-split { display: flex; height: .8rem; border-radius: 1rem; overflow: hidden; background: #eef2f7; margin-bottom: .8rem; }
.rp-split .cash { background: #16a34a; } .rp-split .credit { background: #f59e0b; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-inline-end: .4rem; } .dot.cash { background: #16a34a; } .dot.credit { background: #f59e0b; }
.rp-rows > div { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .5rem 0; border-bottom: 1px dashed #e5eaf1; font-size: .9rem; }
.rp-rows > div:last-child { border-bottom: 0; } .rp-rows b { white-space: nowrap; }
.rp-bars > div { margin-bottom: .6rem; }
.rp-bar-top { display: flex; justify-content: space-between; gap: .6rem; font-size: .88rem; margin-bottom: .25rem; }
.rbar-fill.out { background: #f59e0b; }
.rp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; }
.rp-facts > div { background: #fff; border: 1px solid var(--bs-border-color, #e3e9f1); border-radius: .8rem; padding: .7rem .9rem; }
.rp-facts span { display: block; font-size: .75rem; color: #64748b; } .rp-facts b { font-size: 1.05rem; }
.rp-words { margin-top: 1rem; } .rp-words summary { cursor: pointer; font-weight: 700; }
.rp-words dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .6rem 1.4rem; margin: 1rem 0 0; }
.rp-words dt { font-weight: 700; font-size: .9rem; } .rp-words dd { margin: 0; color: #475569; font-size: .85rem; line-height: 1.6; }

.rp-facts small { display: block; font-size: .7rem; color: #94a3b8; line-height: 1.35; margin-top: .15rem; }
.rp-steps li.sum div small, .rp-steps li.total div small { display: block; color: inherit; opacity: .7; font-size: .74rem; }
.rp-rows small { font-size: .74rem; font-weight: 400; }

/* backup page */
.bk-hero { border-radius: 1rem; padding: 1.1rem 1.25rem; color: #fff; background: linear-gradient(120deg, #065f46, #047857); }
.bk-hero.bk-warning { background: linear-gradient(120deg, #92400e, #b45309); }
.bk-hero.bk-danger { background: linear-gradient(120deg, #9f1239, #be123c); }
.bk-hero-main { display: flex; align-items: center; gap: .9rem; }
.bk-hero-icon { font-size: 2.2rem; }
.bk-hero-title { font-size: 1.2rem; font-weight: 700; }
.bk-hero-sub { font-size: .85rem; opacity: .85; }
.bk-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem; margin-top: 1rem; }
.bk-checks > div { display: flex; gap: .55rem; align-items: flex-start; background: rgba(255,255,255,.12); border-radius: .7rem; padding: .6rem .75rem; }
.bk-checks > div.warn { background: rgba(0,0,0,.18); }
.bk-checks i { font-size: 1.05rem; margin-top: .1rem; } .bk-checks .warn i { color: #fde68a; }
.bk-checks b { display: block; font-size: .88rem; } .bk-checks small { display: block; font-size: .74rem; opacity: .85; line-height: 1.4; }
.bk-pick { display: grid; gap: .7rem; }
.bk-opt { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: start; padding: .9rem 1rem; border: 1.5px solid var(--bs-border-color, #e3e9f1); border-radius: .9rem; background: #fff; cursor: pointer; transition: .15s; }
.bk-opt:hover:not([disabled]) { border-color: #0284c7; box-shadow: 0 6px 16px rgba(2,132,199,.12); }
.bk-opt.best { border-color: #86efac; background: #f0fdf4; }
.bk-opt[disabled] { opacity: .55; cursor: not-allowed; }
.bk-opt-text { flex: 1; } .bk-opt-text b { display: block; font-size: .98rem; } .bk-opt-text small { display: block; color: #64748b; font-size: .8rem; line-height: 1.5; }
.bk-opt-go { flex: 0 0 auto; font-weight: 700; font-size: .85rem; padding: .5rem .9rem; border-radius: .6rem; background: #0284c7; color: #fff; white-space: nowrap; }
.bk-opt.best .bk-opt-go { background: #16a34a; }
.bk-extra { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .8rem; }
.bk-extra .form-control { flex: 1 1 14rem; max-width: 28rem; }
.bk-group td { background: #f6f8fc !important; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; padding: .4rem 1rem !important; }
.bk-acts .btn { margin-inline-start: .15rem; }
.bk-side .panel-head { display: flex; justify-content: space-between; align-items: center; }
.bk-tips ol { margin: 0; padding-inline-start: 1.1rem; font-size: .85rem; color: #475569; line-height: 1.7; }

/* ---- supplier khata in several currencies ---- */
.kchips { display: flex; flex-wrap: wrap; gap: .3rem; }
.kchip { display: inline-block; font-size: .8rem; font-weight: 700; padding: .22rem .55rem; border-radius: 8px; white-space: nowrap; }
.kchip-owe { background: #fee2e2; color: #b91c1c; }
.kchip-adv { background: #dbeafe; color: #1d4ed8; }
.kchip-lg { font-size: .95rem; padding: .3rem .7rem; }
.kcomb { font-size: .75rem; font-weight: 600; color: var(--tp-muted); white-space: nowrap; }
.kcard { padding-bottom: .85rem; }
.kcard-link, .kcard-link:hover { display: block; color: inherit; text-decoration: none; }
.kcard-bal { margin-top: .85rem; min-height: 2rem; display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; }
.kcur-table .kcode { color: var(--tp-primary-dark); }
.khata-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; color: var(--tp-muted); }

/* payment dialog: one big button per khata */
.cur-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.2rem, 1fr)); gap: .5rem; }
.cur-pill { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .55rem .4rem; border: 2px solid var(--tp-border); border-radius: 12px; cursor: pointer; background: #fff; transition: all .12s; user-select: none; }
.cur-pill:hover { border-color: #93c5fd; }
.cur-pill .cp-code { font-weight: 800; font-size: 1rem; }
.cur-pill .cp-bal { font-size: .78rem; font-weight: 600; color: var(--tp-muted); }
.cur-pill.is-owe .cp-bal { color: #b91c1c; }
.cur-pill.is-adv .cp-bal { color: #1d4ed8; }
.cur-pill.is-zero { opacity: .7; }
.btn-check:checked + .cur-pill { border-color: var(--tp-primary); background: #e0f2fe; box-shadow: 0 0 0 3px rgba(2,132,199,.15); opacity: 1; }
.btn-check:focus-visible + .cur-pill { outline: 2px solid var(--tp-primary); outline-offset: 2px; }

/* quick-add supplier: default currency buttons */
.cur-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .5rem; }
.cur-chip { display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .45rem .3rem; border: 2px solid var(--tp-border); border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer; transition: all .12s; }
.cur-chip small { font-weight: 500; font-size: .7rem; color: var(--tp-muted); }
.cur-chip:hover { border-color: #93c5fd; }
.cur-chip.active { border-color: var(--tp-primary); background: #e0f2fe; box-shadow: 0 0 0 3px rgba(2,132,199,.15); }

/* the specs line under a product (RAM, SSD, generation ...) */
.prod-specs { font-size: .74rem; line-height: 1.35; color: #475569; margin-top: .1rem; max-width: 46rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-name .sr-specs { font-size: .72rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.item-name .r-specs { color: #475569; font-size: .72rem; }
.doc-table .prod-specs { font-size: .7rem; }

/* ---- expenses page ---- */
.exp-quick { border-inline-start: 4px solid var(--bs-primary, #0284c7); }
.exp-quick-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.exp-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.exp-chip { cursor: pointer; padding: .35rem .85rem; border-radius: 999px; font-weight: 600; font-size: .92rem; border: 1.5px solid hsl(var(--h) 55% 55% / .45); background: hsl(var(--h) 80% 96%); color: hsl(var(--h) 55% 28%); user-select: none; transition: transform .08s; }
.exp-chip:hover { transform: translateY(-1px); }
.btn-check:checked + .exp-chip { background: hsl(var(--h) 60% 42%); border-color: hsl(var(--h) 60% 42%); color: #fff; box-shadow: 0 2px 8px hsl(var(--h) 60% 42% / .35); }
.btn-check:focus-visible + .exp-chip { outline: 2px solid #0284c7; outline-offset: 2px; }
.exp-quick-row { display: grid; grid-template-columns: 11rem 1fr 11rem auto; gap: .6rem; }
.exp-amt { font-weight: 800; }
@media (max-width: 767px) { .exp-quick-row { grid-template-columns: 1fr 1fr; } .exp-quick-row .exp-amt, .exp-quick-row input[name=description] { grid-column: 1 / -1; } .exp-quick-row .btn { grid-column: 1 / -1; } }
.exp-split { display: grid; gap: .35rem; }
.exp-split-row { display: grid; grid-template-columns: 9rem 1fr 6.5rem 2.6rem; gap: .6rem; align-items: center; text-decoration: none; color: inherit; padding: .2rem .3rem; border-radius: .5rem; }
.exp-split-row:hover { background: rgba(2, 132, 199, .06); }
.exp-split-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-split-row .bar { height: .7rem; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.exp-split-row .bar i { display: block; height: 100%; background: hsl(var(--h) 60% 50%); border-radius: 99px; }
.exp-split-row .am { text-align: end; font-weight: 700; }
.exp-split-row .pc { text-align: end; color: #64748b; font-size: .85rem; }
@media (max-width: 575px) { .exp-split-row { grid-template-columns: 6rem 1fr 5rem; } .exp-split-row .pc { display: none; } }
.exp-ranges { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1rem 0; }
.exp-range { padding: .3rem .8rem; border-radius: 999px; background: #f1f5f9; color: #334155; text-decoration: none; font-weight: 600; font-size: .88rem; }
.exp-range:hover { background: #e2e8f0; }
.exp-range.on { background: #0284c7; color: #fff; }
.exp-table .exp-day td { background: #f1f5f9; font-weight: 800; font-size: .9rem; padding-top: .45rem; padding-bottom: .45rem; color: #334155; }
.exp-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: hsl(var(--h) 60% 50%); margin-inline-end: .45rem; }

/* ---------- login: developer | sign in | shop ---------- */
.lg3 { background: #eaf1f8; }
.lg3-wrap { display: flex; min-height: 100vh; direction: ltr; }
.lg3-dev, .lg3-shop { flex: 0 0 380px; box-sizing: border-box; padding: 2.4rem 2.1rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.lg3-grow { flex: 1 1 auto; min-height: 1.5rem; }
.lg3-dev { color: #fff; gap: 1.2rem; background: radial-gradient(circle at 0 0, #0f4c81 0, transparent 55%), radial-gradient(circle at 100% 100%, #0a3a63 0, transparent 50%), #071a2e; }
.lg3-dev::before { content: ""; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(125,211,252,.18); }
.lg3-brand { display: flex; align-items: center; gap: 1rem; position: relative; }
.lg3-sys.login-logo { width: 76px; height: 76px; border-radius: 22px; padding: 6px; background: #fff; box-shadow: 0 16px 34px -12px rgba(14,165,233,.8); flex: 0 0 76px; cursor: default; }
.lg3-sysname { font-size: 2.1rem; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.lg3-syssub { font-size: .8rem; color: #7dd3fc; font-weight: 600; margin-top: .4rem; letter-spacing: .04em; }
.lg3-tags { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; }
.lg3-tags span { padding: .3rem .75rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: .78rem; font-weight: 600; }
.lg3-by { font-size: .7rem; font-weight: 800; letter-spacing: .22em; color: #7dd3fc; text-transform: uppercase; position: relative; }
.lg3-devrow { display: flex; align-items: center; gap: .9rem; position: relative; }
.lg3-devlogo { width: 74px; height: auto; display: block; }
.lg3-devname { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.lg3-devsub { font-size: .82rem; color: #94a3b8; margin-top: .2rem; }
.lg3-contact { border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); padding: .4rem; position: relative; }
.lg3-contact-h { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .16em; color: #e2e8f0; text-transform: uppercase; }
.lg3-contact-h i { color: #7dd3fc; }
.lg3-crow { display: flex; align-items: center; gap: .8rem; padding: .55rem .8rem; border-radius: 12px; text-decoration: none; color: #fff; }
.lg3-crow:hover { background: rgba(255,255,255,.08); color: #fff; }
.lg3-crow .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: 0 0 34px; }
.lg3-crow small, .lg3-irow small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }
.lg3-crow small { color: #94a3b8; }
.lg3-crow b { display: block; font-size: .95rem; font-weight: 700; word-break: break-all; line-height: 1.25; }
.ic-phone { background: #0ea5e9; } .ic-wa { background: #22c55e; } .ic-mail { background: #f59e0b; } .ic-web { background: #8b5cf6; }

.lg3-main { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
    background: radial-gradient(circle at 20% 15%, #cfe8fb 0, transparent 40%), radial-gradient(circle at 85% 90%, #d9e4f2 0, transparent 45%), #f4f8fc; }
.lg3-card { width: 100%; max-width: 400px; position: relative; background: #fff; border: 1px solid #dbe5ef; border-radius: 24px; padding: 2rem 2rem 1.6rem; box-shadow: 0 40px 70px -35px rgba(7,26,46,.45); }
.lg3-card::before { content: ""; position: absolute; top: 0; left: 2rem; right: 2rem; height: 4px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, #38bdf8, #0284c7); }
.lg3-lock { width: 48px; height: 48px; border-radius: 14px; background: #e0f2fe; color: #0284c7; display: grid; place-items: center; font-size: 1.4rem; }
.lg3-title { font-size: 1.75rem; font-weight: 900; letter-spacing: -.01em; margin: 0 0 .2rem; }
.lg3-card .form-control, .lg3-card .input-group-text { border-width: 1.5px; }
.lg3-go { height: 52px; font-weight: 800; border-radius: 12px; background: linear-gradient(180deg, #0ea5e9, #0284c7); border: 0; box-shadow: 0 12px 24px -10px rgba(2,132,199,.8); }

.lg3-shop { background: linear-gradient(180deg, #fff 0, #f1f7fd 100%); border-inline-start: 1px solid #dbe5ef; }
.lg3-shop::after { content: ""; position: absolute; left: -80px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, #dbeeff 0, transparent 65%); pointer-events: none; }
.lg3-belongs { display: inline-flex; align-self: flex-start; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; position: relative; z-index: 1; }
.lg3-shopmain { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; z-index: 1; }
.lg3-ring { width: 150px; height: 150px; border-radius: 50%; padding: 7px; background: conic-gradient(from 200deg, #0284c7, #38bdf8, #0284c7); box-shadow: 0 24px 44px -20px rgba(2,132,199,.7); }
.lg3-ring > * { width: 100%; height: 100%; border-radius: 50%; background: #fff; display: grid; place-items: center; object-fit: contain; }
.lg3-ring img { padding: 10px; }
.lg3-ring span { font-weight: 900; font-size: 3rem; color: #0284c7; letter-spacing: -.03em; }
.lg3-shopname { font-size: 2rem; font-weight: 900; margin-top: 1.4rem; line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lg3-bar { width: 46px; height: 4px; border-radius: 4px; background: #0284c7; margin-top: 1rem; }
.lg3-info { display: flex; flex-direction: column; gap: .75rem; position: relative; z-index: 1; }
.lg3-irow { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; border-radius: 16px; background: #fff; border: 1px solid #dbe5ef; box-shadow: 0 10px 24px -18px rgba(7,26,46,.5); }
.lg3-irow .ic { width: 40px; height: 40px; border-radius: 12px; background: #e0f2fe; color: #0284c7; display: grid; place-items: center; font-size: 1.1rem; flex: 0 0 40px; }
.lg3-irow small { color: #64748b; }
.lg3-irow b { display: block; font-size: .98rem; font-weight: 800; line-height: 1.3; }

@media (max-width: 1099px) { .lg3-dev, .lg3-shop { flex-basis: 320px; padding: 2rem 1.5rem; } .lg3-shopname { font-size: 1.6rem; } }
@media (max-width: 899px) {
    .lg3-wrap { flex-direction: column; }
    .lg3-shop { order: 1; flex-basis: auto; align-items: center; border-inline-start: 0; border-bottom: 1px solid #dbe5ef; padding: 1.4rem 1.2rem; }
    .lg3-shopmain { margin-top: 1rem; } .lg3-ring { width: 104px; height: 104px; } .lg3-shopname { font-size: 1.5rem; margin-top: .9rem; }
    .lg3-shop .lg3-grow { display: none; } .lg3-info { width: 100%; max-width: 420px; margin-top: 1rem; }
    .lg3-main { order: 2; padding: 1.5rem 1rem; }
    .lg3-dev { order: 3; flex-basis: auto; padding: 1.6rem 1.2rem; }
    .lg3-dev .lg3-grow { display: none; }
}

/* login: fit one screen on desktop, no page scroll */
.lg3 .lg3-card .dev-contact { display: none; }               /* the developer contact is already on the left */
@media (min-width: 900px) {
    .lg3, .lg3 body { overflow: hidden; }
    .lg3-wrap { height: 100vh; min-height: 560px; }
    .lg3-dev, .lg3-shop, .lg3-main { overflow-y: auto; scrollbar-width: none; }
    .lg3-dev::-webkit-scrollbar, .lg3-shop::-webkit-scrollbar, .lg3-main::-webkit-scrollbar { display: none; }
    .lg3-main { align-items: safe center; }
}
@media (min-width: 900px) and (max-height: 960px) {
    .lg3-dev, .lg3-shop { padding: 1.5rem 1.6rem; gap: .9rem; }
    .lg3-sys.login-logo { width: 62px; height: 62px; flex-basis: 62px; border-radius: 18px; }
    .lg3-sysname { font-size: 1.7rem; }
    .lg3-devlogo { width: 58px; } .lg3-devname { font-size: 1.2rem; }
    .lg3-contact { padding: .25rem; } .lg3-contact-h { padding: .4rem .7rem .15rem; }
    .lg3-crow { padding: .32rem .7rem; gap: .65rem; } .lg3-crow .ic { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
    .lg3-crow b { font-size: .88rem; }
    .lg3-ring { width: 112px; height: 112px; padding: 6px; } .lg3-ring span { font-size: 2.2rem; }
    .lg3-shopmain { margin-top: 1.2rem; } .lg3-shopname { font-size: 1.55rem; margin-top: 1rem; }
    .lg3-irow { padding: .6rem .85rem; } .lg3-irow .ic { width: 34px; height: 34px; flex-basis: 34px; }
    .lg3-main { padding: 1rem; }
    .lg3-card { padding: 1.3rem 1.6rem 1.1rem; }
    .lg3-lock { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 12px; }
    .lg3-title { font-size: 1.5rem; }
    .lg3-card .input-group-lg > .form-control, .lg3-card .input-group-lg > .input-group-text, .lg3-card .input-group-lg > .btn { padding-top: .5rem; padding-bottom: .5rem; font-size: 1rem; }
    .lg3-go { height: 46px; }
    .lg3-card .alert { padding: .55rem .75rem; margin-bottom: .75rem !important; font-size: .8rem; }
}

/* shop logo: shown as it is (square, wide or tall), never cut into a circle */
.lg3-logobox { max-width: 100%; padding: 14px 18px; border-radius: 22px; background: #fff; border: 1px solid #dbe5ef; box-shadow: 0 24px 44px -26px rgba(2,132,199,.55); display: flex; align-items: center; justify-content: center; }
.lg3-logobox img { display: block; width: auto; height: auto; max-width: 270px; max-height: 150px; object-fit: contain; }
@media (min-width: 900px) and (max-height: 960px) { .lg3-logobox { padding: 10px 14px; } .lg3-logobox img { max-width: 230px; max-height: 110px; } }
@media (max-width: 899px) { .lg3-logobox img { max-width: 200px; max-height: 100px; } }

/* login left panel: logo and name are the centre piece */
.lg3-hero { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .9rem; position: relative; min-height: 0; }
.lg3-hero .lg3-sys.login-logo { width: 132px; height: 132px; flex-basis: 132px; border-radius: 34px; padding: 12px; }
.lg3-hero .lg3-sysname { font-size: 3rem; }
.lg3-hero .lg3-syssub { font-size: .95rem; margin-top: 0; }
.lg3-hero .lg3-tags { justify-content: center; margin-top: .6rem; }
.lg3-hero .lg3-tags span { font-size: .82rem; padding: .35rem .85rem; }
@media (min-width: 900px) and (max-height: 960px) {
    .lg3-hero .lg3-sys.login-logo { width: 104px; height: 104px; flex-basis: 104px; border-radius: 28px; }
    .lg3-hero .lg3-sysname { font-size: 2.4rem; }
}

/* ---------- phone / small screen ---------- */
@media (max-width: 899px) {
    .lg3 { overflow: auto; }
    .lg3-wrap { height: auto; min-height: 100vh; background: #eaf1f8; }
    /* 1. the shop */
    .lg3-shop { order: 1; padding: 1.3rem 1.1rem 3.2rem; background: linear-gradient(160deg, #0a3a63 0, #0f4c81 60%, #0284c7 100%); border: 0; align-items: center; text-align: center; color: #fff; }
    .lg3-shop::after { display: none; }
    .lg3-belongs { background: rgba(255,255,255,.14); color: #e0f2fe; align-self: center; font-size: .66rem; }
    .lg3-shopmain { margin-top: 1rem; }
    .lg3-logobox { padding: 10px 14px; border-radius: 18px; }
    .lg3-logobox img { max-width: 170px; max-height: 84px; }
    .lg3-ring { width: 92px; height: 92px; }
    .lg3-ring span { font-size: 1.9rem; }
    .lg3-shopname { font-size: 1.55rem; margin-top: .9rem; color: #fff; }
    .lg3-bar { display: none; }
    .lg3-shop .lg3-info { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .9rem; width: 100%; max-width: none; }
    .lg3-shop .lg3-irow { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); box-shadow: none; color: #fff; padding: .45rem .8rem; border-radius: 999px; gap: .55rem; text-align: start; }
    .lg3-shop .lg3-irow .ic { width: 26px; height: 26px; flex-basis: 26px; background: rgba(255,255,255,.2); color: #fff; border-radius: 50%; font-size: .8rem; }
    .lg3-shop .lg3-irow small { display: none; }
    .lg3-shop .lg3-irow b { font-size: .84rem; font-weight: 700; }
    /* 2. sign in: the card rises over the blue header */
    .lg3-main { order: 2; padding: 0 .9rem 1.2rem; margin-top: -2.2rem; background: transparent; align-items: flex-start; }
    .lg3-card { max-width: 460px; border-radius: 22px; padding: 1.5rem 1.3rem 1.2rem; box-shadow: 0 24px 44px -26px rgba(7,26,46,.55); }
    .lg3-card::before { left: 1.3rem; right: 1.3rem; }
    .lg3-title { font-size: 1.5rem; }
    .lg3-lock { width: 42px; height: 42px; font-size: 1.2rem; }
    /* 3. the system and its developer */
    .lg3-dev { order: 3; padding: 1.6rem 1.1rem 1.8rem; gap: 1rem; border-radius: 26px 26px 0 0; }
    .lg3-hero { display: grid; grid-template-columns: 64px 1fr; grid-template-areas: "logo name" "logo sub" "tags tags"; align-items: center; justify-items: start; text-align: start; gap: .05rem .9rem; }
    .lg3-hero .lg3-sys.login-logo { grid-area: logo; width: 64px; height: 64px; border-radius: 18px; padding: 7px; }
    .lg3-hero .lg3-sysname { grid-area: name; font-size: 1.7rem; align-self: end; }
    .lg3-hero .lg3-syssub { grid-area: sub; align-self: start; }
    .lg3-hero .lg3-tags { grid-area: tags; justify-content: flex-start; margin-top: .7rem; }
    .lg3-dev .lg3-grow { display: none; }
    .lg3-contact { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem; padding: .35rem; }
    .lg3-contact-h { grid-column: 1 / -1; }
    .lg3-crow { padding: .55rem .6rem; gap: .55rem; background: rgba(255,255,255,.05); }
    .lg3-crow .ic { width: 30px; height: 30px; flex-basis: 30px; }
    .lg3-crow b { font-size: .8rem; }
    .lg3-crow small { font-size: .62rem; }
}
@media (max-width: 400px) { .lg3-contact { grid-template-columns: 1fr; } }

/* phone: the simple sign-in card only (as before); the developer and shop panels are for wide screens */
@media (max-width: 899px) {
    .lg3-dev, .lg3-shop { display: none !important; }
    .lg3-wrap { min-height: 100vh; background: var(--tp-bg); }
    .lg3-main { margin-top: 0; padding: 1.5rem 1rem; align-items: center; background: var(--tp-bg); }
    .lg3-card { max-width: 420px; padding: 1.6rem 1.4rem 1.3rem; }
    .lg3-card::before { left: 1.4rem; right: 1.4rem; }
    .lg3-card .login-logo.sm { width: 52px; height: 52px; border-radius: 14px; background: none; padding: 0; }
}
