:root {
  --pt-sidebar: #14213d;
  --pt-sidebar-hover: #1f3263;
  --pt-accent: #2f6fde;
  --pt-bg: #f4f6fa;
}
body { background: var(--pt-bg); font-size: .9rem; }
body.bare .main { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; background: var(--pt-sidebar); color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1030; }
.sidebar .brand { display: block; padding: 1rem 1rem .75rem; color: #fff; font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.sidebar .brand i { color: #8fb4ff; }
.sidebar .nav-section { padding: .9rem 1rem .25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.45); }
.sidebar .nav-link { color: rgba(255,255,255,.85); padding: .45rem 1rem; display: flex; gap: .6rem; align-items: center; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: var(--pt-sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--pt-sidebar-hover); color: #fff; border-left-color: #8fb4ff; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid #e3e7ef; position: sticky; top: 0; z-index: 1020; }
.topbar .form-select-sm { min-width: 150px; }
.content { flex: 1 1 auto; }
.card { border-color: #e3e7ef; }
.card-header { background: #fff; }
.table > :not(caption) > * > * { padding-top: .4rem; padding-bottom: .4rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; white-space: nowrap; }
.stat .card-body { padding: .9rem 1rem; }
.auth-card { max-width: 420px; width: 100%; margin: 2rem auto; }
.auth-card-wide { max-width: 860px; }
.form-panel { top: 64px; }
.user-card.inactive { opacity: .6; }
.user-card .avatar { width: 38px; height: 38px; border-radius: 50%; background: #e8efff; color: var(--pt-accent); display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 38px; }
.min-w-0 { min-width: 0; }
.master-types .list-group-item { padding: .4rem .75rem; font-size: .85rem; }
.perm-table td:first-child { min-width: 240px; }
.logo-preview { max-height: 80px; max-width: 240px; border: 1px solid #e3e7ef; border-radius: .25rem; padding: .25rem; background: #fff; }
.qr { width: 200px; height: 200px; }
.toast-host { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -240px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
}
@media print {
  .sidebar, .topbar, .btn, form .form-control { display: none !important; }
}

/* ---- Purchase entry (M2) ---- */
.purchase-form .form-label { font-size: .75rem; margin-bottom: .1rem; color: #495057; }
.purchase-form fieldset[disabled] .form-control, .purchase-form fieldset[disabled] .form-select { background-color: #f8f9fa; }
.price-block { border: 1px solid #e3e7ef; border-radius: .375rem; padding: .5rem .75rem .6rem; position: relative; }
.price-block.cost { background: #fbfcff; }
.price-block.market { background: #fcfdf9; }
.price-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; font-weight: 600; margin-bottom: .25rem; }
.calc-line { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.lines-table td, .stock-table td { white-space: nowrap; }
.lines-table tbody tr { cursor: default; }
.stock-table { font-size: .82rem; }
/* Payment voucher: cash and bank on one line (DEC-21). */
.payment-modes { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.payment-modes .mode-amount { width: 15rem; flex: 0 0 auto; }
.payment-modes .mode-remarks { flex: 1 1 16rem; max-width: 28rem; }
/* Reports shown on screen with the print template (ledger, due date). */
.report-screen { overflow-x: auto; }
.report-screen .doc { font-size: .8rem; min-width: 900px; }

/* ---- Dashboard ---- */
.kpi .card-body { position: relative; padding: 1rem 3.8rem 1rem 1.1rem; }
.kpi .kpi-icon { position: absolute; top: 1rem; right: 1rem; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; }
.kpi .kpi-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; font-weight: 600; }
.kpi .kpi-value { font-size: 1.55rem; font-weight: 600; margin-top: .2rem; line-height: 1.2; }
.kpi .kpi-sub { font-size: .8rem; color: #6c757d; margin-top: .25rem; }
.kpi { border-radius: .6rem; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); }
.chart-box { position: relative; height: 280px; }
.chart-box-sm { height: 200px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; vertical-align: baseline; }
