/* ===== BMS theme ===== */
:root {
  --bms-primary: #1d4ed8;      /* blue */
  --bms-primary-dark: #1e3a8a;
  --bms-accent: #f59e0b;       /* amber (नवीन बिल) */
  --bms-sidebar: #0f172a;      /* navy */
  --bms-sidebar-2: #1e293b;
  --bms-bg: #f1f5f9;
  --bms-text: #0f172a;
  --bms-muted: #64748b;
  --bms-border: #e2e8f0;
  --bms-radius: 12px;
  --bs-primary: #1d4ed8; --bs-primary-rgb: 29,78,216;
  --bs-link-color: #1d4ed8; --bs-link-hover-color: #1e3a8a;
  --bs-body-font-family: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html { font-size: 15px; }
body { background: var(--bms-bg); color: var(--bms-text); font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; }
:lang(mr) body, html[lang="mr"] body { font-family: "Noto Sans Devanagari", "Inter", system-ui, sans-serif; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; letter-spacing: -.01em; }
a { text-decoration: none; } a:hover { text-decoration: underline; }

/* ----- layout ----- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 256px; flex: 0 0 256px; background: var(--bms-sidebar) !important; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.sidebar-logo { height: 40px; width: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.sidebar-logo-ph { height: 40px; width: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--bms-accent), #ef4444); display: grid; place-items: center; font-size: 20px; color: #fff; flex: 0 0 40px; }
.sidebar-brand-text { min-width: 0; line-height: 1.2; } .sidebar-brand-text small { color: #94a3b8; font-size: .75rem; }
.sidebar-nav { padding: 8px 10px; flex: 1; }
.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 14px 10px 4px; font-weight: 600; }
.sidebar .nav-link { display: flex; align-items: center; gap: 10px; color: #cbd5e1; padding: 8px 10px; border-radius: 8px; font-size: .93rem; margin-bottom: 2px; }
.sidebar .nav-link i { width: 18px; text-align: center; font-size: 1.05rem; opacity: .9; }
.sidebar .nav-link:hover { background: var(--bms-sidebar-2); color: #fff; text-decoration: none; }
.sidebar .nav-link.active { background: var(--bms-primary); color: #fff; box-shadow: 0 4px 12px rgba(29,78,216,.35); }
.sidebar-foot { padding: 8px 10px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--bms-border); padding: 10px 20px; display: flex; align-items: center; min-height: 58px; }
.topbar-title { font-weight: 600; font-size: 1.05rem; }
.user-chip { align-items: center; gap: 6px; background: var(--bms-bg); border-radius: 999px; padding: 4px 12px 4px 8px; font-size: .88rem; }
.user-chip i { font-size: 1.2rem; color: var(--bms-primary); } .user-chip small { color: var(--bms-muted); }
.content { padding: 20px; flex: 1; }
.app-foot { text-align: center; color: var(--bms-muted); font-size: .8rem; padding: 24px 0 4px; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; height: 100%; width: 280px; --bs-offcanvas-width: 280px; }
  .content { padding: 14px; }
  .topbar { padding: 8px 14px; }
}

/* ----- buttons ----- */
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--bms-primary); --bs-btn-border-color: var(--bms-primary); --bs-btn-hover-bg: var(--bms-primary-dark); --bs-btn-hover-border-color: var(--bms-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--bms-primary); --bs-btn-border-color: var(--bms-primary); --bs-btn-hover-bg: var(--bms-primary); --bs-btn-hover-border-color: var(--bms-primary); }
.btn-accent, .btn-warning { background: var(--bms-accent); border-color: var(--bms-accent); color: #1f2937; font-weight: 600; }
.btn-accent:hover, .btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }
.btn-success { --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a; --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d; }

/* ----- cards ----- */
.card { border: 1px solid var(--bms-border); border-radius: var(--bms-radius); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid var(--bms-border); padding: .7rem 1rem; border-radius: var(--bms-radius) var(--bms-radius) 0 0 !important; }
.card-header a.small { font-weight: 500; }
.card-stat { border-left: 0; position: relative; overflow: hidden; }
.card-stat .card-body { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.card-stat .stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: 0 0 46px; }
.card-stat h3 { font-size: 1.45rem; font-weight: 700; margin: 0; white-space: nowrap; letter-spacing: -.02em; }
.card-stat small { color: var(--bms-muted); }
.stat-blue { background: #dbeafe; color: #1d4ed8; } .stat-green { background: #dcfce7; color: #15803d; } .stat-red { background: #fee2e2; color: #b91c1c; } .stat-amber { background: #fef3c7; color: #b45309; }
@media (max-width: 575.98px) { .card-stat h3 { font-size: 1.15rem; } .card-stat .stat-icon { display: none; } }

/* ----- tables ----- */
.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bms-muted); font-weight: 600; background: #f8fafc; border-bottom: 1px solid var(--bms-border); white-space: nowrap; }
.table-sm > :not(caption) > * > * { padding: .5rem .65rem; }
.table tfoot th { background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.card > .table-responsive { border-radius: 0 0 var(--bms-radius) var(--bms-radius); }

/* ----- forms ----- */
.form-label { font-weight: 500; font-size: .86rem; color: #334155; margin-bottom: .25rem; }
.form-control, .form-select { border-radius: 8px; border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { border-color: var(--bms-primary); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.form-text { font-size: .78rem; }
.items-table input, .items-table select { min-width: 70px; }
.badge { font-weight: 600; border-radius: 6px; padding: .3em .55em; }
.badge-gst { background: #16a34a; } .badge-ch { background: #64748b; }
.nav-pills .nav-link { border-radius: 999px; color: #334155; background: #fff; border: 1px solid var(--bms-border); margin-right: 6px; margin-bottom: 6px; }
.nav-pills .nav-link.active { background: var(--bms-primary); border-color: var(--bms-primary); }
.alert { border-radius: 10px; }
.sticky-total { position: sticky; bottom: 0; background: #fff; border-top: 2px solid #dee2e6; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h4 { margin: 0; }

/* ----- login ----- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% 0%, #1e3a8a 0%, var(--bms-sidebar) 60%); padding: 20px; }
.login-card { width: 100%; max-width: 400px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }

@media print { .no-print, .sidebar, .topbar, .app-foot { display: none !important; } .content { padding: 0; } body { background: #fff; } .card { border: 0; box-shadow: none; } }

.page-h { font-weight: 600; color: var(--bms-muted); font-size: .95rem; }
