/* ============================================================
   JewelNexa — डिझाइन सिस्टीम (Luxury · Enterprise · Compact)
   Ink Navy + Antique Gold + Ivory Paper. एकच UI फॉन्ट: Noto Sans Devanagari
   (मराठी + English दोन्हीसाठी). Serif फक्त लॉगिन ब्रँड-हेडलाइनसाठी.

   रचना:  1 Tokens · 2 Base · 3 Forms · 4 Buttons · 5 Auth pages · 6 App shell
          (sidebar, topbar, menus) · 7 Content (cards, panels, tables, badges,
          alerts, empty/loading, pager, modal, chart) · 8 PWA · 9 Responsive
   ============================================================ */

/* ============ 1. TOKENS ============ */
:root {
  /* रंग — ब्रँड */
  --ink:          #142032;   /* primary dark: साइडबार, हेडिंग्ज */
  --ink-soft:     #1D2E47;
  --gold:         #B08D34;   /* primary accent */
  --gold-hover:   #9A7A2A;
  --gold-deep:    #8C6D22;
  --gold-pale:    #E9DCB8;
  --gold-wash:    #F6EFDD;
  /* रंग — पृष्ठभूमी */
  --paper:        #FAF6EE;   /* background */
  --surface:      #FFFDF9;   /* card */
  --surface-2:    #F5F0E6;   /* elevated/subtle fill, table head */
  --line:         #E8E0D0;   /* border */
  --line-strong:  #D9CDB5;
  /* रंग — मजकूर */
  --ink-text:     #2B2A25;   /* primary text */
  --text-2:       #4F4A3F;   /* secondary */
  --text-muted:   #756F60;   /* muted */
  /* रंग — स्टेटस (पार्श्वभूमी + मजकूर जोड्या) */
  --success: #3F6B4A;  --success-bg: #E7EFE8;
  --warning: #8C6D22;  --warning-bg: #F6EBCF;
  --danger:  #A8402F;  --danger-bg:  #F6E7E3;
  --info:    #2F5C7E;  --info-bg:    #E3ECF3;

  /* टायपोग्राफी */
  --font-ui:      'Noto Sans Devanagari', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Noto Serif Devanagari', Georgia, serif;
  --fs-xs:   11.5px;
  --fs-sm:   12.5px;   /* secondary */
  --fs-base: 14px;     /* body */
  --fs-md:   15px;     /* card heading */
  --fs-h2:   16px;     /* section heading */
  --fs-h1:   clamp(17px, 0.95rem + 0.55vw, 20px);  /* page title */
  --fs-stat: clamp(18px, 1rem + 0.6vw, 22px);
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --lh-tight: 1.3; --lh-base: 1.55;

  /* स्पेसिंग (4px स्केल) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* आकार */
  --radius-lg: 12px;  /* cards, panels, modals */
  --radius:    10px;
  --radius-sm: 8px;   /* inputs, buttons */
  --radius-xs: 6px;
  --control-h: 40px;
  --control-h-sm: 32px;
  --pad-card:  16px;
  --pad-panel: 20px;
  --gutter:    24px;
  --sidebar-w: 236px;
  --sidebar-w-collapsed: 68px;
  --topbar-h:  60px;
  --bottom-h:  58px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
  --safe-t:    env(safe-area-inset-top, 0px);

  /* छाया */
  --shadow-xs:   0 1px 2px rgba(20, 32, 50, 0.05);
  --shadow-card: 0 1px 2px rgba(20, 32, 50, 0.04), 0 4px 14px rgba(20, 32, 50, 0.045);
  --shadow-pop:  0 12px 32px rgba(20, 32, 50, 0.16), 0 2px 6px rgba(20, 32, 50, 0.06);
  --shadow-lift: 0 3px 10px rgba(176, 141, 52, 0.24);
  --focus-ring:  0 0 0 3px rgba(176, 141, 52, 0.28);

  /* हालचाल */
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: 120ms; --t-base: 180ms; --t-slow: 240ms;

  /* Z-index */
  --z-sticky: 30; --z-sidebar: 40; --z-banner: 60; --z-bottomnav: 1030;
  --z-backdrop: 1040; --z-drawer: 1050; --z-popover: 1080; --z-toast: 1090;

  /* जुन्या नावांचे alias (इनलाईन var(--navy) इ. संदर्भ चालू राहावेत) */
  --navy: var(--ink);
  --gold-light: var(--gold-pale);
  --gold-dark: var(--gold-deep);
}

/* ============ 2. BASE ============ */
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  background: var(--paper);
  color: var(--ink-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-ui); color: var(--ink); line-height: var(--lh-tight); }
.font-display { font-family: var(--font-display); }
h3, .h3 { font-size: 17px; font-weight: var(--fw-semibold); }
h4, .h4 { font-size: 16px; font-weight: var(--fw-semibold); }
h5, .h5 { font-size: 15px; font-weight: var(--fw-semibold); }
.small, small { font-size: var(--fs-sm); }
.fs-5 { font-size: 16px !important; }
.text-muted { color: var(--text-muted) !important; }
.min-w-0 { min-width: 0; }

a { text-decoration: none; color: var(--gold-deep); transition: color var(--t-fast); }
a:hover { color: var(--gold); }
::selection { background: var(--gold-pale); }
img { max-width: 100%; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.skip-link {
  position: absolute; left: var(--sp-3); top: -60px; z-index: var(--z-toast);
  background: var(--ink); color: #fff; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
  transition: top var(--t-base);
}
.skip-link:focus { top: var(--sp-3); color: #fff; }
#mainContent:focus { outline: none; box-shadow: none; }

/* ============ 3. FORMS ============ */
.form-control, .form-select, textarea.form-control {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: var(--fs-base);
  line-height: 1.45;
  color: var(--ink-text);
  background-color: #fff;
  min-height: var(--control-h);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control::placeholder { color: #A39C8C; }
.form-select { padding-right: 32px; background-position: right 10px center; }
.form-control:hover, .form-select:hover { border-color: #CBBD9F; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: var(--focus-ring); }
.form-control:disabled, .form-select:disabled, fieldset:disabled .form-control { background: var(--surface-2); color: var(--text-muted); }
.form-label { color: var(--ink); font-weight: var(--fw-semibold); font-size: 13px; margin-bottom: 6px; }
.form-text { font-size: var(--fs-sm); color: var(--text-muted); }
.form-control-sm, .form-select-sm { border-radius: var(--radius-xs); padding: 4px 9px; font-size: 13px; min-height: var(--control-h-sm); }
.form-select-sm { padding-right: 28px; }
.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.form-check-input:focus { border-color: var(--gold); box-shadow: var(--focus-ring); }
.input-group-text { font-size: 13px; background: var(--surface-2); border-color: var(--line-strong); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); }

/* इनलाइन व्हॅलिडेशन */
.was-validated .form-control:invalid, .form-control.is-invalid,
.was-validated .form-select:invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; padding-right: 12px; }
.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(168, 64, 47, 0.18); }
.was-validated .form-control:valid, .form-control.is-valid { border-color: var(--line-strong); background-image: none; padding-right: 12px; }
.invalid-feedback { font-size: var(--fs-sm); color: var(--danger); margin-top: 4px; }
.was-validated .form-check-input:invalid ~ .form-check-label { color: var(--danger); }
.was-validated .form-check-input:valid ~ .form-check-label { color: inherit; }
.was-validated .form-check-input:valid { border-color: var(--line-strong); }
.was-validated .form-check-input:valid:checked { background-color: var(--gold); border-color: var(--gold); }

/* पासवर्ड दाखवा/लपवा */
.input-password { position: relative; }
.input-password .form-control { padding-right: 42px; }
.pw-toggle {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-muted);
}
.pw-toggle:hover, .pw-toggle.on { color: var(--gold-deep); background: var(--gold-wash); }

.link-btn { border: 0; background: none; padding: 0; color: var(--gold-deep); font-weight: var(--fw-semibold); }
.link-btn:hover { color: var(--gold); text-decoration: underline; }

/* ============ 4. BUTTONS ============ */
.btn {
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  font-size: 13.5px;
  padding: 8px 16px;
  line-height: 1.4;
  min-height: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-sm { padding: 4px 11px; font-size: 12.5px; border-radius: var(--radius-xs); min-height: var(--control-h-sm); }
.btn:focus-visible { box-shadow: var(--focus-ring); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }

.btn-gold {
  background: linear-gradient(160deg, #C29E44 0%, var(--gold) 55%, var(--gold-deep) 100%);
  color: #fff; border: none; box-shadow: var(--shadow-lift);
}
.btn-gold:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(140, 109, 34, 0.32); }
.btn-gold:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn-gold:focus-visible { color: #fff; box-shadow: var(--shadow-lift), var(--focus-ring); }
.btn-gold:disabled { color: #fff; box-shadow: none; }

.btn-outline-secondary { border: 1px solid var(--line-strong); color: var(--ink); background: #fff; }
.btn-outline-secondary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-outline-secondary:active { background: var(--ink-soft) !important; color: #fff !important; }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline-success { border-color: var(--success); color: var(--success); background: #fff; }
.btn-outline-success:hover { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8E3526; border-color: #8E3526; color: #fff; }

/* लोडिंग: मजकूर जागेवर राहतो (लेआउट हलत नाही), वर स्पिनर */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; opacity: 1; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; top: 50%; left: 50%; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: jn-spin .7s linear infinite;
}
.btn-outline-secondary.is-loading::after, .btn-outline-danger.is-loading::after,
.btn-outline-success.is-loading::after, .btn-social.is-loading::after { border-color: rgba(20, 32, 50, .2); border-top-color: var(--ink); }
@keyframes jn-spin { to { transform: rotate(360deg); } }

.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  flex-shrink: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--gold-wash); border-color: var(--gold-pale); }

/* ============ 5. AUTH PAGES (login / signup / super admin login) ============ */
.login-wrapper { min-height: 100vh; min-height: 100dvh; display: flex; background: var(--paper); }
.login-brand-panel {
  width: 50%;
  background:
    radial-gradient(circle at 88% 8%, rgba(176, 141, 52, 0.22), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(176, 141, 52, 0.10), transparent 40%),
    linear-gradient(165deg, var(--ink) 0%, #0B1322 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-8);
  padding: var(--sp-12) clamp(32px, 5vw, 72px);
  position: relative;
}
.login-brand-panel::after {
  content: ""; position: absolute; inset: 16px;
  border: 1px solid rgba(233, 220, 184, 0.16); border-radius: 4px;
  pointer-events: none;
}
.login-brand-panel .brand-logo { height: 58px; }
.brand-panel-body { max-width: 500px; }
.brand-eyebrow {
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-pale); opacity: .85; margin-bottom: var(--sp-3);
}
.login-brand-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 1.1rem + 1.2vw, 34px);
  font-weight: var(--fw-semibold); line-height: 1.35; color: #fff; margin-bottom: var(--sp-3);
}
.login-brand-panel p { color: #C7CEDC; font-size: var(--fs-md); line-height: 1.7; margin-bottom: var(--sp-6); }
.brand-benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.brand-benefits li { display: flex; align-items: center; gap: var(--sp-3); color: #E4E8F0; font-size: 13.5px; }
.benefit-icon {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(176, 141, 52, 0.16); color: var(--gold-pale); border: 1px solid rgba(233, 220, 184, 0.18);
}
.brand-panel-foot { font-size: var(--fs-sm); color: #8492AC; position: relative; z-index: 1; }

.login-form-panel {
  flex: 1 1 50%;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-4) calc(var(--sp-8) + var(--safe-b));
  background: var(--paper);
}
.login-form-box { width: 100%; max-width: 400px; }
.signup-page .login-form-box, .login-form-box:has(.row) { max-width: 480px; }
.auth-form-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.auth-form-top .login-mobile-logo { display: none; height: 40px; }
.auth-title { font-size: 22px; font-weight: var(--fw-bold); color: var(--ink); margin-bottom: var(--sp-1); }
.auth-subtitle { color: var(--text-muted); margin-bottom: var(--sp-5); }
.auth-divider { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-3); color: var(--text-muted); font-size: var(--fs-sm); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-auth { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.btn-social { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); font-weight: var(--fw-semibold); }
.btn-social:hover { background: var(--surface-2); border-color: #CBBD9F; color: var(--ink); }
.btn-social:disabled { opacity: .5; }
.auth-switch { text-align: center; margin: var(--sp-5) 0 0; color: var(--text-muted); font-size: 13.5px; }
.auth-switch a { font-weight: var(--fw-semibold); }
.auth-demo-hint { text-align: center; margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
.auth-demo-hint code { color: var(--gold-deep); background: var(--gold-wash); padding: 1px 5px; border-radius: 4px; }

/* ============ 6. APP SHELL ============ */
.app-wrapper { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--paper); }

/* ---- साइडबार ---- */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ink) 0%, #0E1828 100%);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  z-index: var(--z-sidebar);
  transition: width var(--t-slow) var(--ease);
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  height: var(--topbar-h); padding: 0 var(--sp-4);
  border-bottom: 1px solid rgba(233, 220, 184, 0.10);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; min-width: 0; }
.sidebar-logo .logo-full { height: 36px; }
.sidebar-logo .logo-mark { display: none; width: 36px; height: 36px; border-radius: var(--radius-sm); background: #fff; padding: 2px; }
.sidebar-close {
  display: none;
  width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 22px; line-height: 1;
}
.brand-icon {
  width: 32px; height: 32px; color: #fff;
  background: linear-gradient(155deg, #C39F45, var(--gold-deep));
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(140, 109, 34, 0.4);
}
.brand-logo { height: 38px; width: auto; max-width: 100%; display: block; }
.brand-logo-onlight { background: #fff; padding: 4px 10px; border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.topbar-logo-mobile { display: none; }

.sidebar-nav {
  flex-grow: 1; padding: var(--sp-3) var(--sp-3) var(--sp-2);
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
/* overflow:hidden असलेले घटक flex मध्ये शून्यापर्यंत आकुंचतात — टाळा */
.sidebar-nav > *, .sidebar-footer > * { flex-shrink: 0; }
.nav-group-label {
  font-size: 10.5px; font-weight: var(--fw-bold); letter-spacing: .1em; text-transform: uppercase;
  color: #6E7A92; padding: var(--sp-3) var(--sp-3) 2px;
  white-space: nowrap; overflow: hidden;
}
/* उघडा/बंद होणारे मेनू-गट (includes/header.php + assets/js/app.js → initNavGroups) */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  width: 100%; min-height: 32px; margin-top: var(--sp-2);
  padding: 6px var(--sp-3);
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font-size: 10.5px; font-weight: var(--fw-bold); letter-spacing: .1em; text-transform: uppercase;
  color: #6E7A92; text-align: left; white-space: nowrap; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-group-toggle span { overflow: hidden; text-overflow: ellipsis; }
.nav-group-toggle:hover, .nav-group.is-open > .nav-group-toggle { color: #AEB7C9; }
.nav-group-toggle:hover { background: rgba(255, 255, 255, 0.04); }
.nav-group-toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gold); }
.nav-group-chev { flex-shrink: 0; transform: rotate(-90deg); transition: transform var(--t-base) var(--ease); }
.nav-group.is-open .nav-group-chev { transform: rotate(0deg); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; }
.nav-group-items[hidden] { display: none; }
.nav-link-item {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 38px;
  padding: 8px var(--sp-3);
  border: 0; border-radius: var(--radius-sm);
  background: transparent;
  color: #AEB7C9;
  font-size: 13.5px; font-weight: var(--fw-medium);
  text-align: left; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { overflow: hidden; text-overflow: ellipsis; transition: opacity var(--t-base); }
.nav-link-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link-item.active { background: rgba(176, 141, 52, 0.15); color: var(--gold-pale); font-weight: var(--fw-semibold); }
.nav-link-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav-link-item:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
.sidebar-footer { padding: var(--sp-2) var(--sp-3) var(--sp-3); border-top: 1px solid rgba(233, 220, 184, 0.10); display: grid; gap: 2px; }
.collapse-toggle svg { transition: transform var(--t-slow) var(--ease); }
.logout-link:hover { background: rgba(168, 64, 47, 0.2); color: #fff; }
.sidebar-backdrop { display: none; }

/* ---- Collapsed (फक्त डेस्कटॉप) ---- */
@media (min-width: 992px) {
  .sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
  .sidebar-collapsed .sidebar-logo .logo-full { display: none; }
  .sidebar-collapsed .sidebar-logo .logo-mark { display: block; }
  .sidebar-collapsed .sidebar-nav, .sidebar-collapsed .sidebar-footer { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .sidebar-collapsed .nav-group-label { height: 1px; padding: 0; margin: var(--sp-3) var(--sp-2); background: rgba(233, 220, 184, 0.12); }
  .sidebar-collapsed .nav-group-label span { display: none; }
  .sidebar-collapsed .nav-link-item { justify-content: center; padding: 10px 0; }
  .sidebar-collapsed .nav-link-item.active::before { left: -8px; }
  .sidebar-collapsed .nav-label { opacity: 0; width: 0; position: absolute; pointer-events: none; }
  .sidebar-collapsed .collapse-toggle svg { transform: rotate(180deg); }
  .sidebar-collapsed .sa-brand-text { display: none; }
  /* collapsed असताना tooltip */
  .sidebar-collapsed .nav-link-item[data-tip]:hover::after,
  .sidebar-collapsed .nav-link-item[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--ink); color: #fff; font-size: 12.5px; font-weight: var(--fw-medium);
    padding: 5px 10px; border-radius: var(--radius-xs); white-space: nowrap;
    box-shadow: var(--shadow-pop); border: 1px solid rgba(233, 220, 184, 0.18);
    z-index: var(--z-popover); pointer-events: none;
    animation: jn-fade var(--t-fast) ease-out;
  }
  .sidebar-collapsed .sidebar-nav { overflow: visible; }
  /* लहान साइडबार: गट-शीर्षके लपवा, सर्व गटांचे आयकॉन दाखवा, गटांमध्ये पातळ रेषा */
  .sidebar-collapsed .nav-group-toggle { display: none; }
  .sidebar-collapsed .nav-group-items[hidden] { display: flex; }
  .sidebar-collapsed .nav-group { padding-top: var(--sp-2); margin-top: var(--sp-2); border-top: 1px solid rgba(233, 220, 184, 0.12); }
}
.sidebar-footer .collapse-toggle { cursor: pointer; }

.app-main { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---- टॉपबार ---- */
.app-topbar {
  min-height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) var(--gutter) 0;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--sp-3);
  position: sticky; top: 0; z-index: var(--z-sticky);
}
.topbar-menu-btn { display: none; }
.topbar-heading { min-width: 0; flex: 1 1 auto; }
.topbar-title {
  font-size: var(--fs-h1); font-weight: var(--fw-semibold); color: var(--ink);
  margin: 0; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-context { font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.rate-pill {
  background: var(--gold-wash); border: 1px solid var(--gold-pale);
  border-radius: 999px; padding: 4px 12px;
  font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.rate-label { font-weight: var(--fw-bold); color: var(--gold-deep); }
.rate-value { color: var(--ink-text); font-weight: var(--fw-semibold); }
.lang-switch { display: flex; align-items: center; gap: 5px; font-size: var(--fs-sm); white-space: nowrap; }
.lang-switch a { color: var(--ink-text); opacity: 0.55; padding: 2px 2px; }
.lang-switch a:hover { opacity: .85; color: var(--ink); }
.lang-switch a.active { opacity: 1; font-weight: var(--fw-bold); color: var(--gold-deep); }
.lang-switch span { color: var(--ink-text); opacity: 0.35; }

/* ---- युजर चिप + प्रोफाइल मेनू ---- */
.user-chip {
  display: flex; align-items: center; gap: var(--sp-2);
  border: 1px solid transparent; background: transparent; border-radius: 999px;
  padding: 3px 8px 3px 3px; color: var(--ink); text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-name { font-weight: var(--fw-semibold); font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: var(--fs-xs); color: var(--text-muted); }
.user-chip .chev { color: var(--text-muted); transition: transform var(--t-base); }
.user-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(155deg, var(--ink-soft), var(--ink));
  color: var(--gold-pale);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold); font-size: 13px;
  border: 1.5px solid var(--gold-pale);
  flex-shrink: 0;
}
.user-avatar.lg { width: 40px; height: 40px; font-size: 15px; }

.menu-panel {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: var(--sp-2);
  background: var(--surface); font-size: 13.5px;
  margin-top: 6px !important;
  animation: jn-pop var(--t-base) var(--ease);
}
.menu-panel .dropdown-item {
  display: flex; align-items: center; gap: var(--sp-3);
  border-radius: var(--radius-sm); padding: 8px 10px; color: var(--ink-text); font-weight: var(--fw-medium);
}
.menu-panel .dropdown-item svg { color: var(--text-muted); }
.menu-panel .dropdown-item:hover, .menu-panel .dropdown-item:focus { background: var(--surface-2); color: var(--ink); }
.menu-panel .dropdown-item.text-danger svg { color: var(--danger); }
.menu-panel .dropdown-item.text-danger:hover { background: var(--danger-bg); }
.menu-panel .dropdown-divider { border-color: var(--line); margin: 6px 0; }
.profile-panel { width: 260px; }
.profile-head { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.profile-name { font-weight: var(--fw-semibold); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-sub { font-size: var(--fs-sm); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 6px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---- सूचना ---- */
.notify-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: var(--fw-bold); line-height: 18px; text-align: center;
  border: 2px solid var(--surface);
}
.notify-panel { width: 340px; max-width: calc(100vw - 24px); }
.notify-list { max-height: min(420px, 60vh); overflow-y: auto; }
.notify-item {
  display: flex; gap: var(--sp-3); padding: 10px; border-radius: var(--radius-sm);
  color: var(--ink-text); transition: background var(--t-fast);
}
a.notify-item:hover { background: var(--surface-2); color: var(--ink-text); }
.notify-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--line-strong); }
.notify-item.unread .notify-dot { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.notify-item.notify-danger.unread .notify-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.notify-item.notify-info.unread .notify-dot { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.notify-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; color: var(--text-2); }
.notify-text strong { color: var(--ink); font-weight: var(--fw-semibold); font-size: 13.5px; }
.notify-item:not(.unread) .notify-text strong { font-weight: var(--fw-medium); }
.notify-empty { padding: var(--sp-6) var(--sp-3); text-align: center; color: var(--text-muted); font-size: 13px; }
.notify-skeleton { display: grid; gap: var(--sp-2); padding: var(--sp-2); }
.notify-skeleton .skeleton { height: 44px; }

/* नेटवर्क स्टेटस, सिंक बटण, इन्स्टॉल बटण */
.net-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--success); }
.net-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(63, 107, 74, 0.15); }
.net-dot.offline { color: var(--danger); }
.net-dot.offline::before { box-shadow: 0 0 0 3px rgba(168, 64, 47, 0.15); }
.outbox-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--gold); background: var(--gold-wash); color: var(--gold-deep);
  border-radius: 999px; padding: 3px 10px; font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.outbox-btn.has-failed { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.outbox-btn[hidden], .install-btn[hidden], .notify-badge[hidden] { display: none !important; }
.install-btn { white-space: nowrap; }

.app-content { padding: var(--gutter); flex-grow: 1; width: 100%; max-width: 1520px; }

/* ============ 7. CONTENT ============ */
/* ---- KPI कार्ड्स ---- */
.stat-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 14px var(--pad-card);
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-card);
  height: 100%; min-width: 0; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-pale)); }
.stat-card .stat-label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* मोठी रक्कम (₹ 1,23,45,678.00) अरुंद कार्डात: ₹ व रक्कम एकाच ओळीत — फॉन्ट कार्डच्या रुंदीनुसार लहान होतो (container query) */
.stat-card { container-type: inline-size; }
.stat-card .stat-value { font-size: var(--fs-stat); font-weight: var(--fw-bold); color: var(--ink); line-height: var(--lh-tight); overflow-wrap: normal; font-variant-numeric: tabular-nums; }
@supports (font-size: 1cqi) { .stat-card .stat-value:not(.fs-6) { font-size: min(var(--fs-stat), 9.5cqi); } }
/* टेबलातील रकमा (उजवीकडे संरेखित) कधीही ₹ व आकड्यात तुटू नयेत */
.table td.text-end, .table th.text-end { white-space: nowrap; }
.stat-card .small { font-size: var(--fs-xs); }

/* ---- पॅनल ---- */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: var(--pad-panel);
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2);
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.panel-header h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--ink); margin: 0; }
.panel-desc { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.section-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--sp-3); font-size: 13px; font-weight: var(--fw-semibold); }

/* ---- टेबल्स ---- */
.table { color: var(--ink-text); font-size: 13.5px; margin-bottom: 0; --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 11px 12px; }
.table-sm > :not(caption) > * > * { padding: 7px 9px; }
.table thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: var(--fw-semibold); font-size: 12px; color: var(--text-muted);
  letter-spacing: .02em; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.table td { border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: rgba(176, 141, 52, 0.05); }
.table .text-end { font-variant-numeric: tabular-nums; }
.table-responsive { -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }

/* ---- बॅज (subtle, status) ---- */
.badge { font-weight: var(--fw-semibold); padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); letter-spacing: .01em; }
.badge.bg-success   { background: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-danger    { background: var(--danger-bg) !important; color: var(--danger) !important; }
.badge.bg-warning   { background: var(--warning-bg) !important; color: var(--warning) !important; }
.badge.bg-info      { background: var(--info-bg) !important; color: var(--info) !important; }
.badge.bg-secondary { background: #ECE7DC !important; color: var(--text-muted) !important; }
.badge.bg-gold      { background: var(--gold-wash) !important; color: var(--gold-deep) !important; border: 1px solid var(--gold-pale); }

/* ---- alerts ---- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 13.5px; padding: 10px 14px; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: #EDCFC7; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #CFDFD2; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--gold-pale); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: #CADBE8; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

/* ---- Empty state ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-4); }
.empty-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-wash); color: var(--gold-deep); border: 1px solid var(--gold-pale);
  margin-bottom: var(--sp-1);
}
.empty-text { margin: 0 0 var(--sp-1); color: var(--text-muted); max-width: 340px; }

/* ---- Skeleton ---- */
.skeleton {
  display: block; border-radius: var(--radius-xs);
  background: linear-gradient(90deg, #EFE8DA 25%, #F7F2E8 37%, #EFE8DA 63%);
  background-size: 400% 100%;
  animation: jn-shimmer 1.3s ease infinite;
}
.skeleton-text { display: inline-block; width: 86px; height: 12px; vertical-align: middle; }
@keyframes jn-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Pagination ---- */
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); padding-top: var(--sp-4); }
.pager-info { font-size: var(--fs-sm); color: var(--text-muted); }
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--surface-2);
  --bs-pagination-hover-color: var(--ink); --bs-pagination-hover-border-color: var(--line); --bs-pagination-focus-box-shadow: var(--focus-ring);
  --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); --bs-pagination-disabled-color: #B5AE9F; gap: 4px; }
.pagination .page-link { border-radius: var(--radius-xs) !important; min-width: 32px; text-align: center; font-size: 12.5px; font-weight: var(--fw-semibold); }

/* ---- Modal ---- */
.modal-content { border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); background: var(--surface); }
.modal-header { border-bottom: 1px solid var(--line); padding: var(--sp-4) var(--sp-5); }
.modal-title { font-size: 16px; font-weight: var(--fw-semibold); color: var(--ink); }
.modal-body { padding: var(--sp-4) var(--sp-5); }
.modal-footer { border-top: 1px solid var(--line); padding: var(--sp-3) var(--sp-5); gap: var(--sp-2); }
.modal-footer > * { margin: 0; }
.modal-desc { color: var(--text-2); }
.modal-list { margin: var(--sp-2) 0 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 6px; font-size: 13.5px; }
.modal-backdrop.show { opacity: .4; }
@media (min-width: 576px) { .modal-sm-md { max-width: 440px; } }

/* ---- डॅशबोर्ड: बार चार्ट (एकच मालिका, ब्रँड गोल्ड) ---- */
.bar-chart { position: relative; height: 210px; padding-left: 74px; }
.bar-chart-grid { position: absolute; inset: 0 0 26px 74px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bar-chart-grid span { position: relative; border-top: 1px dashed var(--line); height: 0; }
.bar-chart-grid span::before {
  content: attr(data-v); position: absolute; right: calc(100% + 8px); top: -8px;
  font-size: 11px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bar-chart-grid span:last-child { border-top-style: solid; border-color: var(--line-strong); }
.bar-chart-bars { position: relative; height: 100%; display: flex; align-items: stretch; gap: 2px; }
.bar-col { position: relative; flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 26px; outline: none; cursor: default; }
.bar { width: min(36px, 62%); background: var(--gold); border-radius: 4px 4px 0 0; min-height: 0; transition: background var(--t-fast), height var(--t-slow) var(--ease); }
.bar-col.is-today .bar { background: var(--gold-deep); }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: var(--gold-hover); }
.bar-label { position: absolute; bottom: 4px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.bar-col.is-today .bar-label { color: var(--ink); font-weight: var(--fw-semibold); }
.bar-col[data-tip]:hover::after, .bar-col[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: var(--radius-xs);
  white-space: nowrap; box-shadow: var(--shadow-pop); z-index: 5; pointer-events: none;
}
.bar-col:first-child[data-tip]:hover::after, .bar-col:first-child[data-tip]:focus-visible::after { left: 0; transform: none; }
.bar-col:last-child[data-tip]:hover::after, .bar-col:last-child[data-tip]:focus-visible::after { left: auto; right: 0; transform: none; }

/* ---- झटपट कृती ---- */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.quick-action {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); font-weight: var(--fw-semibold); font-size: 13px;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.quick-action:hover { border-color: var(--gold-pale); background: var(--gold-wash); color: var(--ink); transform: translateY(-1px); }
.qa-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--gold-wash); color: var(--gold-deep); }

/* ---- Super Admin वेगळा accent (त्याच डिझाइन सिस्टीममध्ये) ---- */
.sa-theme { --sa-accent: #B4553A; --sa-accent-deep: #8C3A24; }
.sa-theme .app-sidebar { background: linear-gradient(180deg, #221913 0%, #140E0A 100%); }
.sa-theme .brand-icon { background: linear-gradient(155deg, var(--sa-accent), var(--sa-accent-deep)); box-shadow: 0 3px 10px rgba(140, 58, 36, .4); }
.sa-theme .nav-link-item.active { background: rgba(180, 85, 58, .18); color: #F3D8CC; }
.sa-theme .nav-link-item.active::before { background: var(--sa-accent); }
.sa-theme .user-avatar { background: linear-gradient(155deg, var(--sa-accent), var(--sa-accent-deep)); color: #fff; border-color: #F3D8CC; }
.sa-logo { gap: var(--sp-2); color: #fff; }
.sa-brand-text { display: flex; flex-direction: column; font-weight: var(--fw-semibold); font-size: 14px; line-height: 1.2; color: #fff; }
.sa-brand-text small { font-size: 11px; font-weight: var(--fw-medium); color: #B9A69A; }
.sa-login { background: radial-gradient(circle at 80% 10%, rgba(180, 85, 58, 0.16), transparent 45%), linear-gradient(165deg, #221913 0%, #140E0A 100%); }
.sa-login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
.sa-login-card { width: 100%; max-width: 400px; padding: var(--sp-6); }
.sa-login-logo { height: 48px; margin: 0 auto var(--sp-3); display: block; }
.sa-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: var(--fw-bold); color: #8C3A24; background: #F6E3DB; }

@keyframes jn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jn-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ============ 8. PWA: ऑफलाइन बॅनर, टोस्ट, सिंक पॅनल ============ */
.bottom-nav { display: none; }
.jn-offline-banner {
  position: relative; z-index: var(--z-banner);
  background: var(--ink); color: var(--gold-pale);
  font-size: var(--fs-sm); text-align: center;
  padding: calc(6px + var(--safe-t)) 12px 6px;
}
.jn-toasts {
  position: fixed; z-index: var(--z-toast);
  right: 16px; bottom: calc(16px + var(--safe-b));
  display: flex; flex-direction: column; gap: var(--sp-2);
  max-width: min(380px, calc(100vw - 32px));
}
.jn-toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px;
  box-shadow: var(--shadow-pop);
  animation: jn-in var(--t-base) ease-out;
  transition: opacity .3s, transform .3s;
}
.jn-toast.out { opacity: 0; transform: translateY(6px); }
.jn-toast-success { border-left-color: #7FB28B; }
.jn-toast-error { border-left-color: #E08A79; }
.jn-toast-btn { margin-left: auto; border: 0; border-radius: var(--radius-xs); background: var(--gold); color: #fff; font-weight: var(--fw-semibold); font-size: var(--fs-xs); padding: 4px 10px; white-space: nowrap; }
@keyframes jn-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.jn-outbox-panel {
  position: fixed; z-index: var(--z-popover);
  top: calc(var(--topbar-h) + var(--safe-t) + 6px); right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: var(--sp-3);
  animation: jn-pop var(--t-base) var(--ease);
}
.jn-outbox-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: 13.5px; }
.jn-outbox-empty { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.jn-outbox-item { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.jn-outbox-label { font-weight: var(--fw-semibold); font-size: 13px; color: var(--ink); }
.jn-outbox-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.jn-outbox-error { font-size: var(--fs-xs); color: var(--danger); margin-top: 2px; }

/* ============ 9. RESPONSIVE ============
   Desktop ≥1440 · Laptop 1024–1439 · Tablet 768–1023 · Mobile 320–767 */

/* लॅपटॉप */
@media (max-width: 1439.98px) {
  :root { --gutter: 20px; --pad-panel: 18px; }
}
@media (max-width: 1199.98px) {
  :root { --gutter: 18px; --pad-panel: 16px; }
  .user-meta, .user-chip .chev { display: none; }
  .user-chip { padding: 3px; }
  .net-label { display: none; }
}

/* टॅबलेट व मोबाईल — साइडबार ड्रॉवर बनतो, बॉटम नेव्ह दिसतो */
@media (max-width: 991.98px) {
  :root { --gutter: 16px; --topbar-h: 56px; }

  .app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(288px, 86vw);
    transform: translateX(-102%);
    transition: transform var(--t-slow) var(--ease);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
    padding-top: var(--safe-t); padding-bottom: var(--safe-b);
    z-index: var(--z-drawer);
  }
  .sidebar-open .app-sidebar { transform: none; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .collapse-toggle { display: none; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: var(--z-backdrop);
    background: rgba(13, 22, 38, 0.45);
    opacity: 0; pointer-events: none; transition: opacity var(--t-base);
  }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar-open, .sidebar-open body { overflow: hidden; }
  .nav-link-item { min-height: 42px; font-size: 14.5px; }

  .topbar-menu-btn { display: inline-flex; }
  .topbar-right { gap: var(--sp-2); }

  .login-brand-panel { display: none; }
  .login-form-panel { width: 100%; }
  .auth-form-top .login-mobile-logo { display: block; }

  /* बॉटम नेव्ह */
  body.has-bottom-nav .app-content { padding-bottom: calc(var(--bottom-h) + var(--safe-b) + var(--gutter)); }
  body.has-bottom-nav .jn-toasts { bottom: calc(var(--bottom-h) + var(--safe-b) + 10px); }
  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bottomnav);
    height: calc(var(--bottom-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(255, 253, 249, 0.97);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(20, 32, 50, 0.06);
  }
  .bottom-nav-item {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: none; color: var(--text-muted);
    font-size: 10.5px; font-weight: var(--fw-semibold); position: relative;
  }
  .bottom-nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .bottom-nav-item.active { color: var(--gold-deep); }
  .bottom-nav-item.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--gold); }
}

/* मोबाईल */
@media (max-width: 767.98px) {
  :root { --gutter: 12px; --pad-panel: 14px; --pad-card: 12px; --radius-lg: 10px; }
  .app-topbar { gap: var(--sp-2); }
  .topbar-context { display: none; }
  .rate-pill { padding: 3px 8px; font-size: var(--fs-xs); }
  .install-btn span { display: none; }
  .install-btn { padding: 5px 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .stat-card { padding: 11px var(--pad-card); }
  .panel-header { margin-bottom: var(--sp-3); padding-bottom: 10px; }
  .table > :not(caption) > * > * { padding: 10px 8px; }
  .table-responsive .table td, .table-responsive .table th { white-space: nowrap; }
  .row.g-3, .row.g-4 { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
  .mb-4 { margin-bottom: var(--sp-4) !important; }
  .bar-chart { height: 180px; padding-left: 64px; }
  .bar-chart-grid { left: 64px; }
  .pager { justify-content: center; }
  .notify-panel { position: fixed !important; inset: calc(var(--topbar-h) + var(--safe-t) + 4px) 8px auto 8px !important; transform: none !important; width: auto; }
  .profile-panel { width: min(280px, calc(100vw - 16px)); }
}
@media (max-width: 575.98px) {
  .lang-switch { font-size: var(--fs-xs); gap: 3px; }
  .social-auth { grid-template-columns: 1fr; }
  .auth-title { font-size: 20px; }
}
/* खूप छोटे फोन — दर-पिल लपवा, शीर्षकाला जागा द्या */
@media (max-width: 400px) {
  .rate-pill { display: none; }
  .quick-actions { grid-template-columns: 1fr; }
}

/* टच-स्क्रीनवर iOS ऑटो-झूम टाळण्यासाठी इनपुट 16px; पुरेसा टॅप-एरिया */
@media (pointer: coarse) and (max-width: 991.98px) {
  .form-control, .form-select, textarea.form-control { font-size: 16px; min-height: 42px; }
  .form-control-sm, .form-select-sm { font-size: 15px; min-height: 36px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
}

/* डेस्कटॉपवर बिल-सारांश पॅनल स्क्रोल करताना दिसत राहतो; मोबाईलवर सामान्य */
@media (min-width: 992px) {
  .sticky-lg { position: sticky; top: calc(var(--topbar-h) + 16px); }
}

@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

@media print {
  .app-sidebar, .app-topbar, .bottom-nav, .sidebar-backdrop, .skip-link,
  .jn-toasts, .jn-offline-banner, .jn-outbox-panel { display: none !important; }
  .app-content { padding: 0 !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   Phase 1 — POS बिलिंग: सर्च ड्रॉपडाऊन, निवडलेला ग्राहक, सेगमेंट बटणे
   ============================================================ */
.pos-search { position: relative; }
.pos-form [hidden] { display: none !important; } /* Bootstrap .d-flex / .pos-chip ने hidden ओव्हरराइड होऊ नये */
.pos-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--z-popover);
  max-height: min(320px, 50vh); overflow-y: auto; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
.pos-result { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pos-result:last-child { border-bottom: 0; }
.pos-result:hover, .pos-result.active { background: var(--gold-wash); }
.pos-empty { padding: 10px 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.pos-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--gold-pale); background: var(--gold-wash); border-radius: var(--radius-sm);
}
.pos-making { border: 0; padding: 0; margin: 0; }
.pos-seg { display: flex; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.pos-seg label { flex: 1; margin: 0; cursor: pointer; }
.pos-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pos-seg span {
  display: block; text-align: center; padding: 7px 8px; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--text-2); background: var(--surface); transition: background var(--t-fast) var(--ease);
}
.pos-seg label + label span { border-left: 1px solid var(--line-strong); }
.pos-seg input:checked + span { background: var(--ink); color: #fff; }
.pos-seg input:focus-visible + span { box-shadow: inset var(--focus-ring); }
#itemsTable .item-mc-value:disabled, #itemsTable .item-mc-type:disabled { opacity: .45; }
@media (max-width: 575.98px) {
  .pos-hint { display: none; } /* फोनवर फंक्शन-की नसतात */
}
/* Phase 1B — सर्च निकालातील "उपलब्ध" खूण */
.pos-avail { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--success); background: var(--success-bg); border-radius: 999px; padding: 0 8px; white-space: nowrap; }

/* ---- पानानुसार मदत drawer (includes/assist_boot.php) ---- */
.help-drawer { --bs-offcanvas-width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--line); }
.help-drawer .offcanvas-header { align-items: flex-start; border-bottom: 1px solid var(--line); padding: var(--sp-4) var(--sp-5); }
.help-drawer .offcanvas-title { font-size: 18px; font-weight: var(--fw-semibold); margin: 2px 0 0; }
.help-kicker { font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; color: var(--gold-deep); }
.help-drawer .offcanvas-body { padding: var(--sp-5); }
.help-foot { border-top: 1px solid var(--line); padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + var(--safe-b)); }
.help-foot .link-btn { display: inline-flex; align-items: center; gap: 6px; }
.help-content { font-size: var(--fs-base); line-height: var(--lh-base); color: var(--ink-text); }
.help-content h3 { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin: var(--sp-5) 0 var(--sp-2); }
.help-content h3:first-child, .help-content p:first-child { margin-top: 0; }
.help-content h4 { font-size: 14px; font-weight: var(--fw-semibold); margin: var(--sp-4) 0 var(--sp-1); }
.help-content ul, .help-content ol { padding-left: 1.25rem; margin-bottom: var(--sp-3); }
.help-content li { margin-bottom: 4px; }
.help-content table { width: 100%; font-size: var(--fs-sm); margin-bottom: var(--sp-3); border-collapse: collapse; }
.help-content th, .help-content td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.help-content th { background: var(--surface-2); font-weight: var(--fw-semibold); }
.help-content kbd, .keys-table kbd, .pos-hint kbd, .sc-table kbd, .sc-form kbd {
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: var(--radius-xs); padding: 1px 6px; font-size: var(--fs-xs); font-family: var(--font-ui); box-shadow: none;
}
.help-content blockquote { border-left: 3px solid var(--gold-pale); background: var(--gold-wash); padding: var(--sp-2) var(--sp-3); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; margin: 0 0 var(--sp-3); }
.help-note { font-size: var(--fs-sm); background: var(--info-bg); color: var(--info); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.help-state { font-size: var(--fs-sm); color: var(--text-muted); text-align: center; padding: var(--sp-8) var(--sp-4); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.help-state.is-error { color: var(--danger); border-color: var(--danger-bg); background: var(--danger-bg); }

/* ---- Super Admin: शॉर्टकट / मदत व्यवस्थापन ---- */
.sc-status { padding: var(--sp-4) var(--pad-panel); }
.sc-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.sc-status-val { font-weight: var(--fw-semibold); color: var(--ink); margin-top: 2px; }
.sc-tabs .nav-link { color: var(--text-2); font-size: 13.5px; }
.sc-tabs .nav-link.active { color: var(--ink); font-weight: var(--fw-semibold); border-bottom-color: transparent; }
.sc-table td { font-size: 13.5px; }
.sc-keys { max-width: 240px; min-width: 180px; }
.sc-keys .btn.active { background: var(--gold-wash); border-color: var(--gold); color: var(--gold-deep); }
tr.sc-clash > td { background: var(--danger-bg); }
.sc-enter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.sc-enter-card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); background: var(--surface); }
.sc-enter-card h3 { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); }
.sc-enter-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: var(--sp-2); align-items: center; padding: 4px 0; }
.sc-enter-row label { font-size: 13px; margin: 0; }
.sc-actions { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-card); }
.hm-editor { font-size: 12.5px; line-height: 1.5; min-height: 320px; }
@media (max-width: 767.98px) {
  .sc-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-enter-row { grid-template-columns: 1fr; }
  .sc-keys { min-width: 150px; }
}

/* ---- पॅकेजेस (modules/subscription) ---- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.pkg-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-4); background: var(--surface); display: flex; flex-direction: column; }
.pkg-card.is-current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-pale); }
.pkg-card h3 { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin: 0 0 var(--sp-2); }
.pkg-price { font-size: 20px; font-weight: var(--fw-bold); color: var(--ink); }
.pkg-price small { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-muted); }
.pkg-features { list-style: none; padding: 0; margin: 0 0 var(--sp-4); font-size: 13px; flex: 1; }
.pkg-features li { padding: 4px 0 4px 20px; position: relative; border-bottom: 1px dashed var(--line); }
.pkg-features li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 8px; height: 4px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success); transform: rotate(-45deg); }

/* ---- सपोर्ट तिकीट संभाषण ---- */
.sup-thread { display: flex; flex-direction: column; gap: var(--sp-3); }
.sup-msg { max-width: 88%; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); background: var(--surface); }
.sup-msg.is-client { align-self: flex-start; background: var(--surface-2); }
.sup-msg.is-staff { align-self: flex-end; border-color: var(--gold-pale); background: var(--gold-wash); }
.sup-msg.is-internal { background: var(--warning-bg); border-style: dashed; border-color: var(--warning); }
.sup-msg-head { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.sup-msg-body { font-size: var(--fs-base); white-space: normal; overflow-wrap: anywhere; }
.sup-files { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.sup-files a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); border: 1px solid var(--line-strong); border-radius: var(--radius-xs); padding: 2px 8px; background: var(--surface); }
.sup-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--sp-3); font-size: 13px; }
.sup-meta dt { color: var(--text-muted); font-weight: var(--fw-medium); }
.sup-meta dd { margin: 0; }
@media (max-width: 575.98px) { .sup-msg { max-width: 100%; } }
.sc-nav-exceptions { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px var(--sp-3); max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }

/* ---- सूचना साइड पॅनल (assets/js/typeahead.js) — डेस्कटॉपवर सर्व type-ahead निकाल इथे ---- */
.jn-suggest-panel {
  position: fixed; z-index: var(--z-popover);
  top: calc(var(--topbar-h) + var(--safe-t) + 8px); right: 12px; bottom: 12px; width: 360px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
.jn-suggest-panel[hidden] { display: none !important; }
.jn-suggest-panel.jsp-left { right: auto; left: 12px; border-left-width: 1px; border-right: 3px solid var(--gold); }
.jn-suggest-panel .jsp-head { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--gold-wash); }
.jn-suggest-panel .jsp-title { font-weight: var(--fw-semibold); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jn-suggest-panel .jsp-hint { font-size: var(--fs-xs); color: var(--text-muted); }
.jn-suggest-panel .jsp-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.jn-suggest-panel .pos-results { position: static; max-height: none; border: 0; border-radius: 0; box-shadow: none; }

/* ---- शॉर्टकट कळ बटण/लेबलवर (assets/js/shortcuts.js — Super Admin धोरणातून) ---- */
kbd.sc-badge {
  display: inline-block; margin-left: 6px; padding: 0 5px; vertical-align: 1px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: var(--radius-xs); font-size: 10.5px; line-height: 1.5; font-family: var(--font-ui); font-weight: var(--fw-semibold); box-shadow: none;
}
.btn-gold kbd.sc-badge, .btn-primary kbd.sc-badge, .btn-success kbd.sc-badge { background: rgba(255, 255, 255, 0.85); border-color: rgba(0, 0, 0, 0.2); }
.app-sidebar kbd.sc-badge { margin-left: auto; background: transparent; color: inherit; opacity: 0.6; border-color: currentColor; }
.sidebar-collapsed .app-sidebar kbd.sc-badge { display: none; }
/* टच-स्क्रीन/मोबाइलवर कीबोर्ड नसतो — बॅज लपवा */
@media (hover: none), (max-width: 991.98px) { kbd.sc-badge { display: none; } }

/* ---- आयटम मास्टर (modules/masters/items.php + assets/js/item_master.js) — डावीकडे फॉर्म, उजवीकडे यादी ---- */
/* फॉर्म */
.im-form { padding: 0; overflow: visible; }
.im-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--pad-panel) var(--pad-panel) var(--sp-3); border-bottom: 1px solid var(--line); }
.im-form-title { font-size: var(--fs-h2); font-weight: var(--fw-bold); color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.im-legend { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.im-req { color: var(--danger); font-weight: var(--fw-bold); }
.im-opt { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); vertical-align: 2px; }
.im-dirty { background: var(--warning-bg); color: var(--warning); font-weight: var(--fw-semibold); }
.im-form .form-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ink); margin-bottom: 4px; }
.im-section { padding: var(--sp-4) var(--pad-panel); border-bottom: 1px solid var(--line); }
.im-section-req { background: var(--gold-wash); border-left: 3px solid var(--gold); }
.im-section-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--ink); margin: 0 0 var(--sp-3); }

/* स्विच व चेकबॉक्स */
.im-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); margin-top: var(--sp-4); }
.im-switch { margin: 0; padding-left: 2.8em; }
.im-switch .form-check-input { width: 2.2em; height: 1.2em; margin-left: -2.8em; cursor: pointer; }
.im-switch .form-check-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ink); cursor: pointer; }
.im-switch .form-text { font-size: var(--fs-xs); line-height: var(--lh-tight); }
.im-checks { display: grid; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }
.im-checks .form-check { margin: 0; }
.im-checks-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.im-checks-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* उघडता/बंद करता येणारे विभाग (आयटम सेटिंग्स, कुठे दाखवायचा, निर्बंध) */
.im-details > summary .im-section-title { flex: 0 0 auto; }
.im-details > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); cursor: pointer; list-style: none; }
.im-details > summary::-webkit-details-marker { display: none; }
.im-details > summary::after { content: ""; flex: 0 0 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform var(--t-fast) var(--ease); }
.im-details[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.im-summary-meta { margin-left: auto; font-size: var(--fs-sm); color: var(--text-muted); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-details[open] .im-summary-meta { visibility: hidden; }
.im-details > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.im-details:not([open]):hover { background: var(--surface-2); }
.im-details-body { margin-top: var(--sp-3); }
.im-kbd-hint { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
@media (hover: none), (max-width: 991.98px) { .im-kbd-hint { display: none; } }

/* कृती-पट्टी (लांब फॉर्ममध्ये खाली चिकटलेली) */
.im-actions { position: sticky; bottom: calc(var(--bottom-h) + var(--safe-b)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--pad-panel); background: rgba(255, 253, 249, 0.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (min-width: 992px) { .im-actions { bottom: 0; } }

/* यादी */
.im-list { padding: var(--sp-4); }
.im-list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.im-list-head h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--ink); margin: 0; }
.im-count { background: var(--gold-wash); color: var(--gold-deep); font-weight: var(--fw-semibold); vertical-align: 2px; }
.im-filter { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 6px; margin-bottom: var(--sp-2); }
.im-filter-note { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-2); }
.im-rows { list-style: none; margin: 0 0 var(--sp-3); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.im-rows li + li { border-top: 1px solid var(--line); }
.im-row { display: flex; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-3); color: var(--ink-text); text-decoration: none; background: var(--surface); }
.im-row:hover { background: var(--surface-2); color: var(--ink-text); }
.im-row.is-active { background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold); }
.im-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.im-row-name { font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-row-meta { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-row-edit { flex: 0 0 auto; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--gold-deep); }
.im-row.is-active .im-row-edit { visibility: hidden; }
.im-tag { flex: 0 0 auto; font-size: 10.5px; font-weight: var(--fw-semibold); padding: 1px 7px; border-radius: 999px; background: var(--info-bg); color: var(--info); }
.im-tag-muted { background: var(--surface-2); color: var(--text-muted); }
.im-nomatch { margin: var(--sp-4) 0; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
.im-list .pager { flex-wrap: wrap; gap: var(--sp-2); }

@media (max-width: 767.98px) {
  .im-checks-4, .im-checks-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .im-switches { grid-template-columns: 1fr; }
  .im-filter { grid-template-columns: 1fr auto; }
  .im-filter select { grid-column: 1 / -1; grid-row: 2; }
}

/* ---- स्टॅम्प मास्टर (modules/stock/purities.php) — आयटम मास्टरचेच im-* वर्ग + "कशाशी जोडा" radio जाळी ---- */
.im-form fieldset legend.form-label { float: none; width: auto; font-size: var(--fs-sm); }
.im-radios { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px var(--sp-3); padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.im-radios .form-check { margin: 0; font-size: var(--fs-sm); }
.im-row.is-inactive .im-row-name, .im-row.is-inactive .im-row-meta { opacity: .6; }
@media (max-width: 480px) { .im-radios { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.im-radios-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) { .im-radios-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- खाते मास्टर (modules/accounts/master.php) — im-* वर्ग + उघडती शिल्लक, Dr/Cr, एकूण ---- */
.im-open-grid { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 220px) auto; align-items: center; gap: var(--sp-2) var(--sp-3); }
.im-drcr { display: inline-flex; justify-self: start; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.im-drcr-opt { padding: 3px 12px; border-radius: var(--radius-xs); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); cursor: pointer; user-select: none; margin: 0; }
.btn-check:checked + .im-drcr-opt { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); outline: 1px solid var(--gold-pale); }
.btn-check:focus-visible + .im-drcr-opt { box-shadow: var(--focus-ring); }
.im-totals { padding: var(--sp-4); }
.im-totals h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--ink); margin: 0 0 var(--sp-2); }
.im-totals dl { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.im-totals dt { font-weight: var(--fw-regular); color: var(--text-muted); }
.im-totals dd { margin: 0; text-align: right; font-weight: var(--fw-semibold); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.im-bal { flex: 0 0 auto; font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.im-bal-dr { color: var(--success); }
.im-bal-cr { color: var(--danger); }
@media (max-width: 480px) { .im-open-grid { grid-template-columns: 1fr auto; } .im-open-grid > label { grid-column: 1 / -1; margin-top: var(--sp-2); } .im-open-grid > span:empty { display: none; } }

/* ---- शोध-यादी साइडबार (assets/js/picker.js) — <select> ऐवजी फील्ड-बटण + उजवीकडून उघडणारी यादी ---- */
/* मूळ select: DOM मध्ये, मूल्य त्यावरच; दिसत नाही पण offsetParent राहतो (Enter-नेव्ह / व्हॅलिडेशन फोकस बटणाकडे वळवले जाते) */
select.jp-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.jp-trigger { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--ink-text); }
.jp-trigger.jp-placeholder { color: var(--text-muted); }
.jp-trigger:disabled { cursor: not-allowed; background-color: var(--surface-2); color: var(--text-muted); }
.was-validated select:invalid + .jp-trigger, .jp-trigger.is-invalid { border-color: var(--danger); }
.was-validated select:invalid + .jp-trigger:focus, .jp-trigger.is-invalid:focus { box-shadow: 0 0 0 3px rgba(168, 64, 47, .2); }
.input-group > .jp-trigger { flex: 1 1 auto; width: 1%; min-width: 0; }

html.jp-open { overflow: hidden; }
.jp-backdrop { position: fixed; inset: 0; z-index: 1060; background: rgba(20, 32, 50, .35); opacity: 0; transition: opacity var(--t-base) var(--ease); }
.jp-backdrop.is-open { opacity: 1; }
.jp-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1061; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-pop); transform: translateX(100%); transition: transform var(--t-slow) var(--ease);
  padding-bottom: var(--safe-b); }
.jp-drawer.is-open { transform: translateX(0); }
.jp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-2); }
.jp-title { margin: 0; font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--ink); }
.jp-close { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--text-muted); padding: 0 4px; border-radius: var(--radius-xs); }
.jp-close:hover, .jp-close:focus-visible { color: var(--ink); background: var(--surface-2); outline: none; }
.jp-search { position: relative; padding: 0 var(--sp-4); }
.jp-search svg { position: absolute; left: calc(var(--sp-4) + 12px); top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.jp-search .form-control { padding-left: 38px; height: var(--control-h); }
.jp-count { padding: 6px var(--sp-4); font-size: var(--fs-xs); color: var(--text-muted); }
.jp-list { list-style: none; margin: 0; padding: 0 var(--sp-2) var(--sp-4); overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; }
.jp-item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-text); }
.jp-item-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.jp-item-text small { font-size: var(--fs-xs); color: var(--text-muted); }
.jp-item:hover { background: var(--surface-2); }
.jp-item.is-active { background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold); }
.jp-item.is-selected { font-weight: var(--fw-semibold); }
.jp-item.is-selected svg { color: var(--gold-deep); flex: 0 0 auto; }
.jp-item.is-disabled { opacity: .5; cursor: not-allowed; }
.jp-group { padding: 10px 12px 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.jp-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
@media (prefers-reduced-motion: reduce) { .jp-drawer, .jp-backdrop { transition: none; } }

/* ---- पक्ष-खातेवही (modules/vouchers/ledger.php) ---- */
.pl-table td, .pl-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-table .pl-dr { color: var(--success); }
.pl-table .pl-cr { color: var(--danger); }
.pl-table .pl-run { background: var(--surface-2); }
.pl-table tr.pl-total td { background: var(--gold-wash); font-weight: var(--fw-semibold); }

/* ---- विक्री / खरेदी व्हाउचर (modules/vouchers/edit.php + assets/js/voucher.js) ---- */
.vch-head { padding: var(--pad-panel); }
.vch-sale .vch-head { border-top: 3px solid var(--gold); }
.vch-purchase .vch-head { border-top: 3px solid var(--info); }
.vch-no { font-size: var(--fs-h2); font-weight: var(--fw-bold); color: var(--ink); padding-top: 6px; }
.vch-party { min-height: 1.2em; }
.vch-grid-wrap { max-height: 60vh; }
.vch-grid { font-size: var(--fs-sm); }
.vch-grid th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; }
.vch-grid td { padding: 3px 4px; vertical-align: middle; }
.vch-grid .form-control-sm, .vch-grid .form-select-sm { min-width: 72px; padding: 3px 6px; font-size: var(--fs-sm); }
.vch-grid .vg-tag { min-width: 90px; }
.vch-grid .vg-remarks { min-width: 110px; }
.vch-grid .vg-w-item, .vch-grid td:has(.vg-item) { min-width: 180px; }
.vch-grid .vg-w-stamp, .vch-grid td:has(.vg-stamp) { min-width: 110px; }
.vch-grid .vg-type, .vch-grid .vg-on { min-width: 58px; }
.vch-grid .vg-out { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 70px; }
.vch-grid .vg-fine, .vch-grid .vg-fine-h, .vch-grid .vg-total, .vch-grid .vg-total-h { background: var(--gold-wash); }
.vch-grid input:disabled, .vch-grid select:disabled + .jp-trigger, .vch-grid .jp-trigger:disabled { background: var(--surface-2); opacity: .55; }
.vch-grid tr.vg-metal .vg-fine { box-shadow: inset 0 -2px 0 var(--gold); font-weight: var(--fw-semibold); }
.vch-grid tr.vg-bad td { background: var(--danger-bg); }
.vch-grid .vg-no { width: 28px; text-align: center; }
.vch-strip { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-muted); }
.vch-strip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.vch-totals th, .vch-totals td { padding: 8px 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vch-totals thead th { font-size: var(--fs-xs); color: var(--text-muted); background: var(--surface-2); }
.vch-totals td { text-align: right; }
.vch-totals tr.vch-last td, .vch-totals tr.vch-last th { color: var(--text-2); }
.vch-totals tr.vch-bill th, .vch-totals tr.vch-bill td { font-weight: var(--fw-semibold); border-top: 2px solid var(--line-strong); }
.vch-totals tr.vch-net th, .vch-totals tr.vch-net td { font-weight: var(--fw-bold); background: var(--gold-wash); color: var(--ink); }
.vch-actions { position: sticky; bottom: calc(var(--bottom-h) + var(--safe-b)); z-index: 5; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3);
  padding: var(--sp-3); background: rgba(255, 253, 249, .96); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (min-width: 992px) { .vch-actions { bottom: var(--sp-2); } }
.vch-cancel summary { cursor: pointer; }
.vch-badla { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface-2); border-top: 1px solid var(--line); }
.vch-mgrid .vg-out, .vch-ygrid .vy-amount { min-width: 80px; }
.vch-grid .vm-type, .vch-grid .vy-type { min-width: 112px; }
.vch-bgrid .vb-type { min-width: 190px; } .vch-adj .input-group-text .form-check-input { margin: 0; }
.vch-totals th { white-space: normal; min-width: 110px; } .vch-totals th, .vch-totals td { padding: 6px 8px; font-size: var(--fs-sm); }
.vch-grid .vg-tagcell { min-width: 110px; } .vch-grid .vg-tagmsg { max-width: 160px; line-height: 1.2; margin-top: 2px; white-space: normal; } .vch-grid tr.vg-tagbad .vg-tag { border-color: var(--danger); }

/* ===== व्हाउचर फॉर्म — कार्ड-ओळी, टॅब, सारांश (modules/vouchers/edit.php) ===== */
.vch-actions { position: static; background: transparent; backdrop-filter: none; border: 0; padding: var(--sp-2) 0; }
.vch-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.vch-more > summary { cursor: pointer; color: var(--text-2); }
.vch-cards { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); }
.vg-row { position: relative; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); background: #fff; padding: var(--sp-2) var(--sp-3); }
.vch-purchase .vg-row { border-left-color: var(--info); }
.vg-row.vg-ret { border-left-color: var(--danger); background: #FFF9F7; }
.vg-row.vg-bad { background: var(--danger-bg); }
.vg-row.vg-metal .vg-fine { box-shadow: inset 0 -2px 0 var(--gold); }
.vg-row.vg-tagbad .vg-tag { border-color: var(--danger); }
.vg-row:focus-within { box-shadow: 0 0 0 2px var(--gold-pale); }
.vg-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2) var(--sp-2); }
.vg-line + .vg-line { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px dashed var(--line); }
.vg-no { align-self: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; justify-content: center; }
.vf { display: flex; flex-direction: column; gap: 2px; margin: 0; min-width: 0; }
.vf > span:first-child { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-medium); white-space: nowrap; }
.vf .form-control-sm, .vf .form-select-sm, .vf .input-group-sm .form-control, .vf .input-group-sm .form-select { font-size: var(--fs-sm); padding: 4px 6px; }
.vf-type { width: 120px; } .vf-tag { width: 130px; } .vf-item { flex: 1 1 200px; min-width: 180px; } .vf-stamp { width: 130px; } .vf-pcs { width: 64px; }
.vf-gross_wt, .vf-less_wt, .vf-add_wt, .vf-tunch, .vf-wastage, .vf-rate, .vf-other_amount, .vf-discount_amount { width: 86px; }
.vf-labour { width: 150px; } .vf-labour .vg-on { max-width: 64px; }
.vf-dia_wt, .vf-dia_value, .vf-stone_wt, .vf-stone_value { width: 96px; } .vf-remarks { flex: 1 1 200px; }
.vf-out output { display: block; min-width: 74px; padding: 4px 6px; border-radius: var(--radius-xs); background: var(--gold-wash); text-align: right; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.5; }
.vg-op { font-style: normal; color: var(--text-muted); padding-bottom: 6px; }
.vg-grp { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-1) var(--sp-2); padding: 4px var(--sp-2) 6px; border-radius: var(--radius-xs); background: var(--surface-2); position: relative; }
.vg-grp-t { flex-basis: 100%; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: var(--fw-semibold); }
.vg-sum { margin-left: auto; text-align: right; }
.vg-sum span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.vg-sum output { font-size: 1.15rem; font-weight: var(--fw-bold); color: var(--ink); font-variant-numeric: tabular-nums; }
.vg-del { align-self: flex-start; color: var(--text-muted); font-size: 20px; line-height: 1; padding: 0 6px; }
.vg-del:hover { color: var(--danger); }
.vg-more { align-self: center; font-size: var(--fs-sm); text-decoration: none; }
.vg-tagmsg { font-size: 11px; line-height: 1.2; max-width: 130px; }
.vg-row input:disabled, .vg-row select:disabled + .jp-trigger, .vg-row .jp-trigger:disabled { background: var(--surface-2); opacity: .55; }
.vch-add-line { border: 1px dashed var(--line-strong); color: var(--gold-deep); background: transparent; font-weight: var(--fw-semibold); }
.vch-add-line:hover { background: var(--gold-wash); border-color: var(--gold); }
.vch-add-line kbd, .vch-tab kbd, #vchSaveBtn kbd { font-size: 10.5px; padding: 1px 5px; background: rgba(0, 0, 0, .08); color: inherit; border-radius: 4px; box-shadow: none; }
.vch-tabbar { display: flex; flex-wrap: wrap; gap: 4px; padding: var(--sp-2) var(--sp-2) 0; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.vch-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-bottom: 0; background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); padding: 8px 12px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; margin-bottom: -1px; }
.vch-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.vch-tab.active { background: #fff; border-color: var(--line); color: var(--ink); font-weight: var(--fw-semibold); }
.vch-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.vch-tab-count { background: var(--gold); color: #fff; font-size: 10.5px; }
.vch-pane { border-bottom: 1px solid var(--line); }
.vch-tabs-hint { background: transparent; }
@media (min-width: 1200px) { .vch-side { position: sticky; top: calc(var(--topbar-h) + var(--sp-3)); } }
.vch-save #vchSaveBtn { padding-top: 10px; padding-bottom: 10px; font-size: 1rem; }
@media (max-width: 575.98px) {
  .vf-type, .vf-tag, .vf-stamp { width: calc(50% - var(--sp-2)); }
  .vf-item { flex-basis: 100%; }
  .vg-sum { margin-left: 0; }
}
.vch-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-content: flex-start; }
.vch-bar { position: sticky; bottom: calc(var(--bottom-h) + var(--safe-b)); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5);
  margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-4); background: rgba(255, 253, 249, .97); backdrop-filter: blur(6px);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
@media (min-width: 992px) { .vch-bar { bottom: var(--sp-2); } }
.vch-bar-fig { display: flex; flex-direction: column; line-height: 1.2; min-width: 120px; }
.vch-bar-fig > span { font-size: var(--fs-xs); color: var(--text-muted); }
.vch-bar-fig b { font-size: 1.2rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.vch-bar-fig small { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 1em; }
.vch-bar-final { margin-left: auto; max-width: 340px; margin-bottom: 0; }
.vch-bar-final .form-text { font-size: 11px; line-height: 1.25; }
.vch-bar #vchSaveBtn { padding: 10px 28px; font-size: 1rem; }
.vf-gross_wt, .vf-less_wt, .vf-add_wt, .vf-tunch, .vf-wastage, .vf-rate, .vf-other_amount, .vf-discount_amount { width: 74px; }
.vf-labour { width: 132px; } .vf-labour .vg-on { max-width: 58px; padding-right: 18px; background-position: right 4px center; }
.vf-out output { min-width: 66px; }
.vg-line2 { gap: var(--sp-2); }
.vg-grp { gap: 2px 6px; }
.vg-op { padding-bottom: 5px; font-size: 12px; }

/* ===== डॅशबोर्ड: दिवसाचा सारांश (modules/dashboard/_day_summary.php) ===== */
.dsh-day .panel-header input[type="date"] { width: 150px; }
.dsh-card { height: 100%; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); background: #fff; display: flex; flex-direction: column; }
.dsh-card .d-flex:last-child { margin-top: auto !important; padding-top: var(--sp-2); }
.dsh-info { border-top-color: var(--info); } .dsh-success { border-top-color: var(--success, #2E7D4F); } .dsh-danger { border-top-color: var(--danger); }
.dsh-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: var(--fw-semibold); }
.dsh-value { font-size: 1.45rem; font-weight: var(--fw-bold); color: var(--ink); font-variant-numeric: tabular-nums; }
.dsh-metal { color: var(--text-2); font-variant-numeric: tabular-nums; }
.dsh-pending { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: var(--sp-2) var(--sp-3); background: var(--warning-bg, #FFF6DB); border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.dsh-week td, .dsh-week th { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== व्हाउचर: एक प्रवेश-फॉर्म + ओळींचा तक्ता ===== */
.vch-entry-wrap { padding: var(--sp-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.vch-entry { position: relative; border: 1px solid var(--line-strong); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); background: #fff; padding: var(--sp-2) var(--sp-3); }
.vch-purchase .vch-entry { border-left-color: var(--info); }
.vch-entry.is-editing { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }
.vch-entry.vg-ret { border-left-color: var(--danger); }
.vch-entry.vg-bad { background: var(--danger-bg); }
.vch-entry.vg-tagbad .vg-tag { border-color: var(--danger); }
.vch-entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.vch-ltable-wrap { max-height: 55vh; }
.vch-ltable { font-size: var(--fs-sm); }
.vch-ltable th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; }
.vch-ltable td { white-space: nowrap; font-variant-numeric: tabular-nums; padding: 5px 8px; }
.vch-ltable td:nth-child(n+7) { text-align: right; }
.vch-ltable .vl-act .btn { padding: 1px 7px; line-height: 1.3; }
.vch-ltable .vl-item { white-space: normal; min-width: 140px; font-weight: var(--fw-medium); }
.vch-ltable .vg-fine, .vch-ltable .vg-total { background: var(--gold-wash); }
.vch-ltable tr.vg-ret td { color: var(--danger); }
.vch-ltable tr.vg-bad td { background: var(--danger-bg); }
.vch-ltable tr.vg-metal .vg-fine { box-shadow: inset 0 -2px 0 var(--gold); font-weight: var(--fw-semibold); }
.vch-ltable tr.vl-editing td { background: var(--gold-wash); }
.vch-ltable tr.vg-row { cursor: default; }
.vch-ltable tr.vg-row { border: 0; border-radius: 0; padding: 0; background: transparent; position: static; box-shadow: none; }
.vch-ltable td.vg-no { display: table-cell; width: 32px; height: auto; border-radius: 0; background: transparent; text-align: center; color: var(--text-muted); }
.vch-ltable tr.vg-row:focus-within { box-shadow: none; }
/* लहान साइडबार: आयकॉन साइडबारच्या आतच स्क्रोल होतात (आधी overflow:visible मुळे पान उगाच लांब होत होते, खाली रिकामी जागा दिसत होती).
   नाव = title टूलटिप (assets/js/app.js), ::after टूलटिप बंद. */
@media (min-width: 992px) {
  .sidebar-collapsed .sidebar-nav { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
  .sidebar-collapsed .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-collapsed .nav-link-item[data-tip]:hover::after, .sidebar-collapsed .nav-link-item[data-tip]:focus-visible::after { content: none; }
}

/* ===== तारीख dd-mm-yyyy (assets/js/datefield.js) ===== */
.jd-wrap { position: relative; display: flex; align-items: stretch; width: 100%; }
.jd-wrap .jd-text { padding-right: 34px; font-variant-numeric: tabular-nums; }
.jd-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-muted); padding: 4px 8px; line-height: 1; z-index: 2; }
.jd-btn:hover { color: var(--gold-deep); }
.jd-native { position: absolute; right: 0; bottom: 0; width: 34px; height: 100%; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.input-group > .jd-wrap { flex: 1 1 auto; width: 1%; }
.acg-tree li { padding-left: calc(var(--depth, 0) * 18px); }
.acg-tree li[style*="--depth: 1"] .im-row, .acg-tree li[style*="--depth: 2"] .im-row, .acg-tree li[style*="--depth: 3"] .im-row { border-left: 2px solid var(--gold-pale); }

/* ===== व्हाउचर अहवाल (modules/reports/vouchers.php) ===== */
.vrp-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.vrp-tab { padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--text-2); font-weight: var(--fw-medium); font-size: var(--fs-sm); text-decoration: none; margin-bottom: -1px; }
.vrp-tab:hover { color: var(--ink); background: var(--surface-2); }
.vrp-tab.active { background: #fff; border-color: var(--line); color: var(--ink); font-weight: var(--fw-semibold); }
.vrp-table td, .vrp-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media print { .vrp-report { border: 0; box-shadow: none; } .vrp-table { font-size: 10.5px; } }

/* ---------- डॅशबोर्ड: दैनिक व्यवहार (modules/dashboard/_day_summary.php) ---------- */
.dbk .panel-header input[type="date"] { width: 150px; }
.dbk-date { color: var(--gold-dark, #8a6a1f); font-variant-numeric: tabular-nums; margin-left: var(--sp-1); }
.dbk-wd { color: var(--text-muted); font-weight: var(--fw-semibold); font-size: .85em; margin-left: var(--sp-1); }
.dbk-body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: var(--sp-4); }
.dbk-cash { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.dbk-cash-label { background: var(--surface-2, #F4EFE4); padding: var(--sp-2) var(--sp-3); font-weight: var(--fw-semibold); }
.dbk-cash-val { padding: var(--sp-2) var(--sp-3); min-width: 150px; text-align: right; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; background: #fff; }
.dbk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0; padding: var(--sp-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dbk-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); text-decoration: none; }
.dbk-row:hover, .dbk-row:focus-visible { border-color: var(--gold); background: var(--gold-bg, #FBF5E6); color: var(--ink); }
.dbk-row.is-zero { opacity: .62; }
.dbk-row.is-zero:hover { opacity: 1; }
.dbk-k { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 4px; background: var(--surface-2, #F4EFE4); font-weight: var(--fw-bold); font-size: var(--fs-sm); text-decoration: underline; }
.dbk-l { font-weight: var(--fw-semibold); line-height: 1.2; min-width: 0; }
.dbk-l small { display: block; font-weight: normal; color: var(--text-muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbk-v { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.dbk-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.dbk-flow { display: flex; gap: var(--sp-4); font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.dbk-close .dbk-cash-label { background: var(--ink, #1f2430); color: #fff; }
.dbk-quick { display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); padding-left: var(--sp-3); }
.dbk-quick a { display: flex; align-items: center; gap: var(--sp-2); padding: 5px var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); text-decoration: none; font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.dbk-quick a:hover, .dbk-quick a:focus-visible { border-color: var(--gold); background: var(--gold-bg, #FBF5E6); }
@media (max-width: 991.98px) {
  .dbk-body { grid-template-columns: 1fr; }
  .dbk-quick { border-left: 0; padding-left: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 575.98px) { .dbk-grid { grid-template-columns: 1fr; } .dbk-cash-val { min-width: 110px; } }

/* ===== व्हाउचर: एका ओळीतील प्रवेश + त्याच स्तंभांचा ओळींचा तक्ता (दोन्हीत तोच colgroup) ===== */
.vch-gridx { --vch-minw: 1130px; overflow-x: auto; overflow-y: hidden; }
.vch-gridx > div { min-width: var(--vch-minw); }
.vch-gridx .table { width: 100%; table-layout: fixed; }
.vch-gridx col.vc-act { width: 50px; } .vch-gridx col.vc-no { width: 26px; } .vch-gridx col.vc-type { width: 66px; }
.vch-gridx col.vc-tag { width: 78px; } .vch-gridx col.vc-item { width: 150px; } .vch-gridx col.vc-stamp { width: 66px; }
.vch-gridx col.vc-pcs { width: 40px; } .vch-gridx col.vc-wt { width: 62px; } .vch-gridx col.vc-pct { width: 50px; }
.vch-gridx col.vc-rate { width: 66px; } .vch-gridx col.vc-labour { width: 100px; } .vch-gridx col.vc-amt { width: 54px; } .vch-gridx col.vc-total { width: 80px; }
/* प्रवेश-भाग: उभा स्क्रोल नाही, पण खालील तक्त्याइतकीच scrollbar-जागा → स्तंभ अचूक एकाखाली एक */
.vch-gridx .vch-entry { overflow: hidden; scrollbar-gutter: stable; border: 0; border-bottom: 2px solid var(--gold); border-radius: 0; padding: 0; background: var(--gold-wash); position: relative; }
.vch-purchase .vch-gridx .vch-entry { border-bottom-color: var(--info); background: var(--info-bg); }
.vch-gridx .vch-entry.is-editing { box-shadow: inset 0 0 0 2px var(--gold); }
.vch-gridx .vch-entry.vg-ret { border-bottom-color: var(--danger); }
.vch-gridx .vch-entry.vg-bad .vch-erow td { background: var(--danger-bg); }
.vch-etable th { background: var(--surface-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vch-etable td, .vch-etable th { padding: 3px 2px !important; vertical-align: middle; }
.vch-etable td:first-child, .vch-etable th:first-child { padding-left: 4px !important; }
.vch-etable .form-control, .vch-etable .form-select, .vch-etable .jp-trigger { width: 100%; min-width: 0; padding: 2px 4px; font-size: var(--fs-sm); }
.vch-etable .form-select { padding-right: 16px; background-position: right 3px center; background-size: 10px 8px; }
.vch-etable .input-group > .form-control { width: 52%; flex: 1 1 52%; }
.vch-etable .input-group > .form-select { width: 48%; flex: 1 1 48%; }
.vch-etable input[type="number"]::-webkit-inner-spin-button, .vch-etable input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.vch-etable input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.vch-etable .vl-out output { display: block; padding: 2px 4px; text-align: right; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vch-etable .vl-gold output { background: #fff; border-radius: var(--radius-xs); }
.vch-etable .vch-add-btn { width: 100%; padding: 0; font-size: 16px; font-weight: var(--fw-bold); line-height: 1; }
.vch-etable .vg-more { padding: 0; width: 100%; font-size: 16px; line-height: 1; text-decoration: none; color: var(--gold-deep); }
.vch-etable .vg-more[aria-expanded="true"] { color: var(--ink); }
.vch-etable .vl-tagcell { position: relative; overflow: visible; }
.vch-etable .vg-tagmsg { position: absolute; left: 2px; top: 100%; z-index: 4; max-width: 260px; padding: 1px 6px; font-size: 10.5px; line-height: 1.3; white-space: nowrap;
  background: var(--ink); color: #fff; border-radius: var(--radius-xs); pointer-events: none; }
.vch-etable .vg-tagmsg:empty { display: none; }
.vch-etable tr.vg-line3 td { background: var(--surface); border-top: 1px dashed var(--line); }
.vch-etable .vg-extra { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 8px; padding: 2px 0; }
.vch-etable .vg-extra .vf { width: 92px; } .vch-etable .vg-extra .vf-add_wt { width: 110px; } .vch-etable .vg-extra .vf-remarks { flex: 1 1 200px; width: auto; }
.vch-gridx .vch-ltable-wrap { scrollbar-gutter: stable; overflow-y: auto; overflow-x: hidden; max-height: 55vh; }
.vch-gridx .vch-ltable td { padding: 3px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vch-gridx .vch-ltable td:first-child { padding-left: 4px; }
.vch-gridx .vch-ltable td:nth-child(n+7) { text-align: right; padding-right: 6px; }
.vch-gridx .vch-ltable .vl-item { white-space: nowrap; min-width: 0; }
.vch-gridx .vch-ltable .vl-act .btn { padding: 0 5px; min-height: 20px; font-size: 11px; }
.vch-gridx .vch-ltable td.vg-no { width: auto; }
.vch-entry-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== व्हाउचर: सारांश आडवा (स्तंभ = विक्री … निव्वळ; ओळी = ₹ / सोने / चांदी) + कृती + जतन ===== */
.vch-aside { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); }
.vch-aside .vch-bar { margin-top: 0; }
.vch-totals-h th, .vch-totals-h td { padding: 3px 8px; font-size: var(--fs-sm); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.vch-totals-h thead th { font-size: var(--fs-xs); line-height: 1.2; white-space: normal; vertical-align: bottom; min-width: 64px; color: var(--text-2); }
.vch-totals-h th:first-child { text-align: left; min-width: 0; color: var(--text-muted); font-weight: var(--fw-semibold); background: var(--surface-2); }
.vch-totals-h thead th:first-child { color: var(--ink); }
.vch-totals-h .vch-bill { font-weight: var(--fw-semibold); border-left: 2px solid var(--line-strong); }
.vch-totals-h .vch-last { color: var(--text-2); }
.vch-totals-h .vch-net { font-weight: var(--fw-bold); background: var(--gold-wash); color: var(--ink); }
@media (min-width: 992px) {
  .vch-aside { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
  .vch-aside .vch-aside-sum { grid-column: 1 / -1; }
}

/* =====================================================================
   DENSE — desktop (>=992px): each form fits one screen, no page scroll.
   Pages with $bodyClass = dense-page: master forms (item, group, stamp, account,
   account group, barcode, series) and sale/purchase vouchers. Smaller fonts/fields;
   page height = viewport; long lists/lines scroll inside their own panel.
   Mobile/tablet (<992px) unchanged (touch-size controls).
   ===================================================================== */
@media (min-width: 992px) {
  body.dense-page { --topbar-h: 46px; }
  .dense-page .app-main {
    --fs-xs: 10.5px; --fs-sm: 11.5px; --fs-base: 12.5px; --fs-md: 13px; --fs-h2: 13.5px; --fs-h1: 15px;
    --control-h: 28px; --control-h-sm: 24px;
    --pad-panel: 12px; --pad-card: 10px; --gutter: 10px;
    --sp-3: 8px; --sp-4: 10px; --sp-5: 14px;
    --radius-lg: 8px; --radius: 7px; --radius-sm: 5px; --radius-xs: 4px;
    --lh-base: 1.4;
  }
  .dense-page .topbar-title { font-size: 15px; }
  .dense-page .topbar-context { font-size: 10.5px; line-height: 1.2; }

  /* --- controls --- */
  .dense-page .app-content .form-control, .dense-page .app-content .form-select { padding: 3px 8px; line-height: 1.35; }
  .dense-page .app-content .form-select { padding-right: 24px; background-position: right 6px center; background-size: 12px 9px; }
  .dense-page .app-content .form-control-sm, .dense-page .app-content .form-select-sm { padding: 2px 6px; font-size: 11.5px; }
  .dense-page .app-content .form-select-sm { padding-right: 20px; }
  .dense-page .app-content .form-label { font-size: 11.5px; margin-bottom: 2px; }
  .dense-page .app-content .form-text { font-size: 10.5px; line-height: 1.25; margin-top: 2px; }
  .dense-page .app-content .invalid-feedback { font-size: 10.5px; margin-top: 1px; }
  .dense-page .app-content .input-group-text { font-size: 11.5px; padding: 2px 7px; }
  .dense-page .app-content .form-check { min-height: 0; margin-bottom: 0; }
  .dense-page .app-content .form-check-label { font-size: 12px; }
  .dense-page .app-content .btn { font-size: 12px; padding: 3px 12px; min-height: 28px; gap: 4px; }
  .dense-page .app-content .btn-sm { font-size: 11.5px; padding: 2px 8px; min-height: 24px; }
  .dense-page .app-content .btn.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
  .dense-page .app-content .h6, .dense-page .app-content h2.h6 { font-size: 12.5px; }
  .dense-page .app-content .table { font-size: 12px; }
  .dense-page .app-content .table > :not(caption) > * > * { padding: 5px 8px; }
  .dense-page .app-content .table-sm > :not(caption) > * > * { padding: 3px 6px; }
  .dense-page .app-content .row.g-3 { --bs-gutter-x: 10px; --bs-gutter-y: 8px; }
  .dense-page .app-content .row.g-2 { --bs-gutter-x: 8px; --bs-gutter-y: 6px; }
  .dense-page .app-content .alert { padding: 5px 12px !important; margin-bottom: 0; font-size: 12px; }
  .dense-page .app-content .badge { font-size: 10px; }

  /* --- page = viewport: messages on top, main layout takes the remaining height --- */
  .dense-page .app-content {
    max-width: none; display: flex; flex-direction: column; gap: 8px;
    height: calc(100vh - var(--topbar-h) - var(--safe-t)); height: calc(100dvh - var(--topbar-h) - var(--safe-t));
    overflow-y: auto;
  }
  .dense-page .app-content > * { flex: 0 0 auto; margin-top: 0; margin-bottom: 0; }

  /* --- master pages: form on left + list on right, both full height --- */
  .dense-page .app-content > .row { flex: 1 1 0; min-height: 440px; margin-top: 0; }
  .dense-page .app-content > .row > [class*="col-"] { display: flex; flex-direction: column; gap: 8px; min-height: 0; height: 100%; margin-top: 0; }
  .dense-page .app-content > .row > [class*="col-"] > * { flex: 0 1 auto; min-height: 0; margin: 0 !important; }
  .dense-page .app-content > .row > [class*="col-"] > .panel { overflow-y: auto; }

  .dense-page .im-form-head { padding: 8px 12px 6px; align-items: center; }
  .dense-page .im-form-head > .min-w-0 { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
  .dense-page .im-form-title { font-size: 14px; }
  .dense-page .im-legend, .dense-page .im-kbd-hint { margin: 0; font-size: 10.5px; }
  .dense-page .im-section { padding: 8px 12px; }
  .dense-page .im-section-title { font-size: 12.5px; margin-bottom: 6px; }
  .dense-page .im-opt { padding: 0 6px; font-size: 10px; }
  .dense-page .im-details > summary::after { flex-basis: 8px; height: 8px; }
  .dense-page .im-details-body { margin-top: 8px; }
  .dense-page .im-summary-meta { font-size: 11px; }
  .dense-page .im-switches { gap: 6px 14px; margin-top: 8px; }
  .dense-page .im-switch { padding-left: 2.5em; }
  .dense-page .im-switch .form-check-input { width: 2em; height: 1.05em; margin-left: -2.5em; }
  .dense-page .im-switch .form-check-label { font-size: 12px; }
  .dense-page .im-checks { gap: 4px 12px; font-size: 12px; }
  .dense-page .im-radios { padding: 4px 8px; gap: 4px 10px; }
  .dense-page .im-radios .form-check { font-size: 12px; }
  .dense-page .im-drcr-opt { padding: 1px 10px; font-size: 11.5px; }
  .dense-page .im-actions { padding: 8px 12px; bottom: 0; }

  .dense-page .im-list { padding: 10px; }
  .dense-page .im-list-head { margin-bottom: 8px; }
  .dense-page .im-list-head h2 { font-size: 13.5px; }
  .dense-page .im-filter { gap: 4px; margin-bottom: 6px; }
  .dense-page .im-row { padding: 4px 10px; gap: 6px; }
  .dense-page .im-row-name { font-size: 12.5px; line-height: 1.3; }
  .dense-page .im-row-meta { font-size: 10.5px; line-height: 1.25; }
  .dense-page .im-tag { font-size: 9.5px; padding: 0 6px; }
  .dense-page .im-totals { padding: 10px; }
  /* list panel: head/search/pager fixed, only the rows scroll */
  .dense-page .im-list:has(> .im-rows) { display: flex; flex-direction: column; overflow: hidden; }
  .dense-page .im-list > * { flex: 0 0 auto; }
  .dense-page .im-list > .im-rows { flex: 0 1 auto; min-height: 60px; overflow-y: auto; margin-bottom: 8px; }
  .dense-page .im-list .pager { margin-top: 0; }
  .dense-page .empty-state { padding: 16px 8px; }
}

/* --- sale / purchase voucher: two columns at >=1200px, everything on one screen --- */
@media (min-width: 992px) {
  .dense-page .vch .panel.mb-3 { margin-bottom: 8px !important; }
  .dense-page .vch-head { padding: 6px 10px; }
  .dense-page .vch-head .form-label { margin-bottom: 1px; }
  .dense-page .vch-no { font-size: 14px; padding-top: 3px; line-height: 1.3; }
  .dense-page .vch-party { min-height: 0; font-size: 11px; line-height: 1.3; }
  .dense-page .vch-party:empty { display: none; }
  .dense-page .vch-more { margin-top: 2px !important; }
  .dense-page .vch-more > summary { font-size: 11px; }
  .dense-page .vch-sec-head { padding: 4px 10px; gap: 6px; min-height: 30px; }
  .dense-page .vg-line { gap: 5px; }
  .dense-page .vg-line + .vg-line { margin-top: 5px; padding-top: 5px; }
  .dense-page .vf { gap: 1px; }
  .dense-page .vf > span:first-child { font-size: 10.5px; line-height: 1.2; }
  .dense-page .vf .form-control-sm, .dense-page .vf .form-select-sm,
  .dense-page .vf .input-group-sm .form-control, .dense-page .vf .input-group-sm .form-select { font-size: 11.5px; padding: 2px 5px; min-height: 24px; }
  .dense-page .vf-type { width: 100px; } .dense-page .vf-tag { width: 110px; } .dense-page .vf-stamp { width: 110px; } .dense-page .vf-pcs { width: 52px; }
  .dense-page .vf-item { flex: 1 1 170px; min-width: 150px; }
  .dense-page .vf-gross_wt, .dense-page .vf-less_wt, .dense-page .vf-add_wt, .dense-page .vf-tunch, .dense-page .vf-wastage,
  .dense-page .vf-rate, .dense-page .vf-other_amount, .dense-page .vf-discount_amount { width: 66px; }
  .dense-page .vf-dia_wt, .dense-page .vf-dia_value, .dense-page .vf-stone_wt, .dense-page .vf-stone_value { width: 76px; }
  .dense-page .vf-labour { width: 120px; } .dense-page .vf-labour .vg-on { max-width: 52px; }
  .dense-page .vf-out output { min-width: 58px; padding: 2px 5px; font-size: 11.5px; line-height: 1.6; }
  .dense-page .vg-grp { padding: 2px 6px 4px; gap: 1px 5px; }
  .dense-page .vg-grp-t { font-size: 9.5px; }
  .dense-page .vg-op { padding-bottom: 3px; font-size: 11px; }
  .dense-page .vg-sum output { font-size: 1rem; }
  .dense-page .vg-tagmsg { font-size: 10px; }
  .dense-page .vch-ltable { font-size: 11.5px; }
  .dense-page .vch-ltable th { font-size: 10.5px; }
  .dense-page .vch-ltable td { padding: 2px 6px; }
  .dense-page .vch-ltable .vl-act .btn { padding: 0 6px; min-height: 20px; font-size: 11px; }
  .dense-page .vch-strip { padding: 4px 10px; gap: 2px 12px; font-size: 11px; }
  .dense-page .vch-items > p.small, .dense-page .vch-tabs-hint { display: none; }
  .dense-page .vch-pane p.small { padding-top: 4px !important; padding-bottom: 6px !important; font-size: 10.5px; }
  .dense-page .vch-pane .px-3.pt-2 { padding-top: 4px !important; }
  .dense-page .vch-pane.p-3 { padding: 8px 10px !important; }
  .dense-page .vch-tabbar { padding: 4px 4px 0; }
  .dense-page .vch-tab { padding: 3px 10px; font-size: 11.5px; }
  .dense-page .vch-badla { padding: 6px 10px; gap: 4px 10px; }
  .dense-page .vch-grid td { padding: 2px 3px; }
  .dense-page .vch-grid .form-control-sm, .dense-page .vch-grid .form-select-sm { font-size: 11.5px; padding: 2px 5px; min-width: 60px; }
  .dense-page .vch-totals th, .dense-page .vch-totals td { padding: 3px 8px; font-size: 11.5px; }
  .dense-page .vch-totals th { min-width: 0; }
  .dense-page .vch-actions { padding: 8px !important; gap: 5px; margin-top: 0; }
  .dense-page .vch-actions .btn { padding: 2px 10px; min-height: 26px; font-size: 11.5px; }
  .dense-page .vch-actions > span.w-100 { gap: 5px !important; }
  .dense-page .vch-bar { padding: 6px 10px; gap: 6px 14px; bottom: 0; }
  .dense-page .vch-bar-fig { min-width: 100px; }
  .dense-page .vch-bar-fig b { font-size: 1.05rem; }
  .dense-page .vch-bar-fig small { font-size: 10.5px; }
  .dense-page .vch-bar-final .form-text { font-size: 10px; }
  .dense-page .vch-bar #vchSaveBtn { padding: 5px 24px; font-size: 13px; min-height: 32px; }
  .dense-page .vch-aside { gap: 8px; margin-top: 0; }
}
@media (min-width: 1200px) {
  /* form = all remaining height; line table scrolls inside the leftover space */
  .dense-page #voucherForm { flex: 1 1 0; min-height: 500px; display: flex; flex-direction: column; }
  .dense-page #voucherForm > fieldset { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
  /* वर: शीर्ष · दागिने (प्रवेश-ओळ + तक्ता, उरलेली उंची) · टॅब;  खाली एका पट्टीत: आडवा सारांश | कृती | बिल/निव्वळ/जतन */
  .dense-page .vch-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  .dense-page .vch-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow-y: auto; }
  .dense-page .vch-main > .panel { flex: 0 0 auto; }
  .dense-page .vch-main > .vch-items { flex: 1 1 auto; min-height: 190px; display: flex; flex-direction: column; overflow: hidden; }
  .dense-page .vch-items > * { flex: 0 0 auto; }
  .dense-page .vch-items > .vch-gridx { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .dense-page .vch-gridx > .vch-ltable-wrap { flex: 1 1 0; min-height: 44px; max-height: none; }
  .dense-page .vch-main > .vch-tabs { margin-bottom: 0 !important; max-height: 42%; overflow-y: auto; flex: 0 1 auto; }
  .dense-page .vch-aside { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: stretch; }
  .dense-page .vch-aside .vch-aside-sum { grid-column: auto; min-width: 0; }
  .dense-page .vch-aside .vch-aside-sum > .panel { height: 100%; }
  .dense-page .vch-aside .vch-actions { display: grid; grid-template-columns: repeat(3, auto); gap: 4px; align-content: center; height: 100%; padding: 6px !important; background: var(--surface); border: 1px solid var(--line); }
  .dense-page .vch-aside .vch-actions > span.w-100 { display: contents !important; }
  .dense-page .vch-aside .vch-bar { position: static; margin: 0; display: grid; grid-template-columns: auto auto; gap: 4px 14px; align-content: center; box-shadow: none; border-color: var(--gold-pale); background: var(--surface); }
  .dense-page .vch-aside .vch-bar-final { margin: 0; max-width: 170px; align-self: center; }
  .dense-page .vch-aside .vch-bar-final .form-text { display: none; }
  .dense-page .vch-cancel, .dense-page .vch-appr { margin-top: 0 !important; }
  .dense-page .vch-cancel { padding: 6px 12px !important; font-size: 12px; }
}

/* मास्टर पाने: डावा फॉर्म व उजवी यादी — दोन्ही पॅनल एकाच उंचीचे (वर-खाली रेषेत), कृती-पट्टी फॉर्मच्या तळाशी */
@media (min-width: 992px) {
  .dense-page .app-content > .row > [class*="col-"] > :is(.im-form, .im-list, .panel:only-child) { flex: 1 1 auto; }
  .dense-page .app-content > .row > [class*="col-"] > .im-totals { flex: 0 0 auto; }
  /* उघडलेल्या विभागांचे फील्ड: ओळीत ३ (खाते मास्टर — संपर्क / वैयक्तिक / बँक / कर / सेटिंग्स) */
  .dense-page .im-details-body.row > .col-md-6, .dense-page .im-details-body.row > .col-md-5,
  .dense-page .im-details-body.row > .col-md-4, .dense-page .im-details-body.row > .col-md-3 { flex: 0 0 auto; width: 33.333%; }
  .dense-page .im-details-body.row > .col-6.col-md-3 { width: 25%; }
  .dense-page .im-open-grid { gap: 4px 10px; }
  .dense-page .im-totals dl { gap: 2px 10px; font-size: 11.5px; }
  .dense-page .im-totals h2 { font-size: 13px; margin-bottom: 4px; }
  .dense-page .app-content > .row > [class*="col-"] > .im-form { display: flex; flex-direction: column; }
  .dense-page .im-form > * { flex: 0 0 auto; }
  .dense-page .im-form > .im-actions { margin-top: auto; }
}

/* =====================================================================
   DENSE — इतर सर्व फॉर्म-पाने (बिल, खरेदी, अंदाजपत्रक, खर्च, दर, योजना, सेटिंग्स, जर्नल, स्टॉक …)
   तीन नमुने:
   1) <form> मध्ये .row (बिल/खरेदी) — मास्टर पानांसारखेच: स्तंभ पूर्ण उंचीचे, आत स्क्रोल.
   2) .dense-fill पॅनल (आयटम/यादी तक्ता) — उरलेली उंची घेते; त्याचा तक्ता आतच स्क्रोल, शीर्षक-ओळ स्थिर.
   3) body.dense-grid — एकाखाली एक असलेली अनेक पॅनल्स शेजारी-शेजारी (३ स्तंभांपर्यंत), प्रत्येक आत स्क्रोल.
   ===================================================================== */
@media (min-width: 992px) {
  /* सामान्य घट्ट मांडणी */
  .dense-page .app-content .panel-header { margin-bottom: 8px; padding-bottom: 6px; gap: 6px; }
  .dense-page .app-content .panel-header h2 { font-size: 13.5px; }
  .dense-page .app-content .panel-desc { font-size: 11px; }
  .dense-page .app-content hr { margin: 8px 0; }
  .dense-page .app-content .mb-3 { margin-bottom: 8px !important; }
  .dense-page .app-content .mt-3, .dense-page .app-content .mt-4 { margin-top: 8px !important; }
  .dense-page .app-content .mb-2 { margin-bottom: 5px !important; }
  .dense-page .app-content .mt-2 { margin-top: 5px !important; }
  .dense-page .app-content .p-3 { padding: 8px !important; }
  .dense-page .app-content .fs-5 { font-size: 14px !important; }
  .dense-page .app-content .row.g-2 .form-label, .dense-page .app-content .form-label.small { font-size: 11.5px; }
  .dense-page .app-content textarea.form-control { min-height: 0; }
  .dense-page .app-content textarea.form-control[rows] { height: auto; }
  .dense-page .app-content .back-link, .dense-page .app-content > a.d-inline-block { margin-bottom: 0 !important; font-size: 11.5px; }
  .dense-page .app-content .pos-hint { margin: 0 !important; font-size: 10.5px; }
  .dense-page .app-content .pos-seg label { padding: 3px 10px; font-size: 12px; }
  .dense-page .app-content .pos-chip { padding: 4px 8px; }
  .dense-page .app-content .sticky-lg { position: static !important; top: auto !important; }
  .dense-page .app-content .stat-card { padding: 8px 10px; }
  .dense-page .app-content .empty-state { padding: 14px 8px; }

  /* 1) <form> मधील .row — पूर्ण उंची */
  .dense-page .app-content > form:has(> .row, > .dense-fill) { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  .dense-page .app-content > form > * { flex: 0 0 auto; margin-top: 0; margin-bottom: 0; }
  .dense-page .app-content > form > .row { flex: 1 1 0; min-height: 420px; margin-top: 0; }
  .dense-page .app-content > form > .row > [class*="col-"] { display: flex; flex-direction: column; gap: 8px; min-height: 0; height: 100%; margin-top: 0; }
  .dense-page .app-content > form > .row > [class*="col-"] > * { flex: 0 1 auto; min-height: 0; margin: 0 !important; }
  .dense-page .app-content > form > .row > [class*="col-"] > .panel { overflow-y: auto; }
  .dense-page .app-content > form > .row > [class*="col-"] > .panel:only-child { flex: 1 1 auto; }

  /* 2) भरणारे पॅनल: उरलेली उंची, तक्ता आत स्क्रोल (स्तंभ-शीर्षक स्थिर) */
  .dense-page .dense-fill { flex: 1 1 0 !important; min-height: 180px; display: flex; flex-direction: column; overflow: hidden !important; max-width: none !important; }
  .dense-page .dense-fill > * { flex: 0 0 auto; }
  .dense-page .dense-fill > .table-responsive, .dense-page .dense-fill > form:has(.table-responsive) { flex: 1 1 0; min-height: 60px; overflow: auto; }
  .dense-page .dense-fill > form:has(.table-responsive) { display: flex; flex-direction: column; }
  .dense-page .dense-fill > form > .table-responsive { flex: 1 1 0; min-height: 60px; overflow: auto; }
  .dense-page .dense-fill > form > :not(.table-responsive) { flex: 0 0 auto; }
  /* शोध-सूचना (ग्राहक / दागिना) पॅनलच्या कडेला कापली जाऊ नये */
  .dense-page .app-content .panel:has(.pos-search) { overflow: visible !important; }
  .dense-page .app-content .panel:has(.pos-search):not(.dense-fill) { flex-shrink: 0 !important; }
  .dense-page .app-content .pos-results { z-index: 20; }
  .dense-page .dense-fill .table-responsive > .table > thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
  .dense-page .dense-fill .table-responsive > .table { margin-bottom: 0; }
  /* स्तंभात भरणारे पॅनल असल्यास इतर पॅनल्स आपल्या उंचीइतकेच */
  .dense-page .app-content .row > [class*="col-"] > .dense-fill { flex: 1 1 0 !important; }
  .dense-page .app-content > .dense-fill { margin-top: 0 !important; margin-bottom: 0 !important; }

  /* 3) पॅनल-ग्रिड: शेजारी-शेजारी; मागे-जा दुवा / संदेश पूर्ण रुंदीचे */
  .dense-page.dense-grid .app-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; }
  .dense-page.dense-grid .app-content > :not(.panel) { grid-column: 1 / -1; }
  .dense-page.dense-grid .app-content > .panel { max-width: none !important; margin: 0 !important; max-height: calc(100dvh - var(--topbar-h) - 70px); overflow-y: auto; }
  .dense-page.dense-grid .app-content > .row { flex: none; min-height: 0; height: auto; }
  .dense-page.dense-grid .app-content > .row > [class*="col-"] { height: auto; }
  .dense-page.dense-grid .app-content > .panel .table-responsive > .table > thead th { position: sticky; top: -8px; z-index: 2; background: var(--surface-2); }
}

/* 4) यादी-पाने (body.dense-list): तक्ता असलेले पॅनल आपोआप उरलेली उंची घेते; तक्ता आत स्क्रोल,
      स्तंभ-शीर्षक स्थिर, फिल्टर/पाने-दुवे नेहमी दिसतात. (फिल्टर-फॉर्म/आकडे-कार्ड वर स्थिर.) */
@media (min-width: 992px) {
  .dense-list .app-content > .panel:has(.table-responsive),
  .dense-list .app-content > form > .panel:has(.table-responsive),
  .dense-list .app-content > .row > [class*="col-"] > .panel:has(.table-responsive) {
    flex: 1 1 0 !important; min-height: 180px; display: flex; flex-direction: column; overflow: hidden; max-width: none !important; margin-top: 0 !important; margin-bottom: 0 !important;
  }
  .dense-list .app-content .panel:has(.table-responsive) > * { flex: 0 0 auto; }
  .dense-list .app-content .panel:has(.table-responsive) > .table-responsive,
  .dense-list .app-content .panel:has(.table-responsive) > form:has(.table-responsive) { flex: 1 1 0; min-height: 60px; overflow: auto; }
  .dense-list .app-content .panel:has(.table-responsive) > form:has(.table-responsive) { display: flex; flex-direction: column; }
  .dense-list .app-content .panel:has(.table-responsive) > form > .table-responsive { flex: 1 1 0; min-height: 60px; overflow: auto; }
  .dense-list .app-content .panel:has(.table-responsive) > form > :not(.table-responsive) { flex: 0 0 auto; }
  /* तक्ता खोलवर असल्यास (उदा. div मध्ये) — पॅनलच आत स्क्रोल */
  .dense-list .app-content .panel:has(.table-responsive):not(:has(> .table-responsive, > form > .table-responsive)) { overflow-y: auto; }
  .dense-list .app-content .table-responsive > .table > thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
  .dense-list .app-content .table-responsive > .table { margin-bottom: 0; }
  /* आकडे-कार्ड / फिल्टरची .row (तक्त्याशिवाय) — आपल्या उंचीइतकीच */
  .dense-list .app-content > .row:not(:has(.table-responsive)) { flex: 0 0 auto; min-height: 0; }
  .dense-list .app-content > .row:not(:has(.table-responsive)) > [class*="col-"] { height: auto; }
  .dense-list .app-content .pager, .dense-list .app-content .pagination { margin: 6px 0 0 !important; }
  .dense-list .app-content .table > :not(caption) > * > * { padding: 4px 8px; }
  .dense-list .app-content .table-sm > :not(caption) > * > * { padding: 3px 6px; }
}

/* खाते मास्टर: खाते क्र. आपोआप — बदलता येत नाही (modules/accounts/master.php) */
.form-control.acm-acno { background: var(--surface-2); color: var(--ink); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; cursor: default; }
.form-control.acm-acno:focus { box-shadow: none; border-color: var(--line-strong); }
