:root {
  --ink: #12304a;
  --ink-soft: #3a556e;
  --paper: #f3f7fb;
  --panel: #ffffff;
  --line: #d7e3ef;
  --muted: #6a8094;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #ccfbf1;
  --sky: #0284c7;
  --sky-soft: #e0f2fe;
  --coral: #e11d48;
  --coral-soft: #ffe4e6;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --accent: var(--teal);
  --accent-dark: var(--teal-dark);
  --ok: #059669;
  --ok-bg: #d1fae5;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #e11d48;
  --danger-bg: #ffe4e6;
  --sidebar: #0b3d4f;
  --sidebar-mid: #0f5c6e;
  --sidebar-text: #c5e8ef;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(18, 48, 74, 0.07);
  --shadow-lg: 0 18px 40px rgba(18, 48, 74, 0.12);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-w: 272px;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(14, 165, 233, 0.14), transparent 50%),
    radial-gradient(700px 380px at -5% 20%, rgba(13, 148, 136, 0.12), transparent 45%),
    radial-gradient(600px 320px at 80% 100%, rgba(225, 29, 72, 0.06), transparent 45%),
    linear-gradient(180deg, #eaf4fa 0%, var(--paper) 38%, #eef5f2 100%);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.45;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--teal-dark); }

.app-shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ?? Mobile chrome ??????????????????????????????????????????? */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: calc(0.55rem + var(--safe-t)) 0.75rem 0.55rem;
  background: #f4f7fb;
  color: var(--ink);
  border-bottom: 1px solid #e2e8f0;
}
.mobile-summary-wrap {
  display: none;
  padding: 0.65rem 0.75rem 0;
  background: transparent;
}
.mobile-top-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 16px;
  padding: 0.45rem 0.5rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.mobile-soft-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: linear-gradient(145deg, #22d3ee, #0ea5e9);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.28);
}
.mobile-soft-mark {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.mobile-centre-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.mobile-centre-logo,
.mobile-centre-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid #bae6fd;
  background: #ecfeff;
}
.mobile-centre-fallback {
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0284c7;
}
.mobile-centre-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #0f172a;
}
.mobile-logout-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #e11d48;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  text-decoration: none;
}
.mobile-logout-btn:hover {
  background: #ffe4e6;
  color: #be123c;
  text-decoration: none;
}

.mobile-summary-card {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 18px;
  padding: 0.7rem 0.75rem 0.75rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.mobile-daily-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1.5px solid #86efac;
  background: #fff;
  color: #166534;
  font-weight: 750;
  font-size: 0.92rem;
  text-decoration: none;
}
.mobile-daily-summary:hover {
  background: #f0fdf4;
  text-decoration: none;
  color: #14532d;
}
.mobile-wa-ico {
  color: #22c55e;
  display: inline-flex;
}
.mobile-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #eef2f7;
}
.mobile-plan-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.mobile-plan-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: #ea580c;
}
.mobile-plan-name strong {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-plan-crown {
  display: inline-flex;
  color: #f59e0b;
  flex-shrink: 0;
}
.mobile-plan-crown svg {
  width: 16px;
  height: 16px;
}
.mobile-plan-days {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 650;
  color: #64748b;
}
.mobile-plan-days.is-expired {
  color: #be123c;
}
.mobile-renew-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 38px;
  padding: 0.35rem 0.7rem;
  border-radius: 12px;
  border: 1.5px solid #fdba74;
  background: #fff;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.mobile-renew-btn svg {
  width: 14px;
  height: 14px;
  color: #f59e0b;
}
.mobile-renew-btn:hover {
  background: #fff7ed;
  text-decoration: none;
  color: #9a3412;
}

/* legacy mobile-bar helpers kept for safety */
.mobile-bar-brand { display: none; }
.mobile-bar-logo,
.mobile-bar-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.16);
}
.mobile-bar-mark {
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  object-fit: unset;
}
.mobile-bar-app { display: none; }
.mobile-bar-centre { display: none; }
.mobile-bar-name,
.mobile-bar-city,
.mobile-bar-plan { display: none; }
.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.centre-dash {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.centre-dash-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 45, 0.45);
  backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
body.more-open .nav-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Bottom navigation ? mobile only */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0.55rem;
  right: 0.55rem;
  bottom: calc(0.45rem + var(--safe-b));
  z-index: 60;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.2rem;
  padding: 0.4rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.96));
  border: 1px solid rgba(15, 92, 110, 0.12);
  border-radius: 20px;
  box-shadow:
    0 12px 32px rgba(11, 61, 79, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(14px);
}
.bottom-nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6a8094;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 54px;
  padding: 0.35rem 0.15rem;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.bottom-nav-item:hover,
.bottom-nav-item:focus-visible {
  text-decoration: none;
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
  outline: none;
}
.bottom-nav-item.active {
  color: #0f766e;
  background: linear-gradient(180deg, #ccfbf1 0%, #e0f2fe 100%);
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.18);
}
.bottom-nav-ico {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 0.98rem;
  background: #eef5f8;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.bottom-nav-item.active .bottom-nav-ico {
  background: linear-gradient(145deg, #2dd4bf, #0284c7);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(2, 132, 199, 0.35);
}
.bottom-nav-label {
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-nav-sheet {
  display: none;
  position: fixed;
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(78px + var(--safe-b));
  z-index: 58;
  background: linear-gradient(180deg, #fff, #f7fcfb);
  border: 1px solid rgba(15, 92, 110, 0.12);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(11, 61, 79, 0.16);
  padding: 0.8rem 0.9rem 1rem;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}
body.more-open .more-nav-sheet {
  display: block;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.more-nav-sheet[hidden] { display: none !important; }
body.more-open .more-nav-sheet[hidden] { display: block !important; }

.more-nav-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #c9d8e4;
  margin: 0.1rem auto 0.7rem;
}
.more-nav-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
}
.more-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.more-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.8rem;
  min-height: var(--tap);
  border-radius: 14px;
  border: 1px solid #dce8f0;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.more-nav-link:hover {
  text-decoration: none;
  border-color: #5eead4;
  background: #f0fdfa;
  transform: translateY(-1px);
}
.more-nav-link.active {
  border-color: #2dd4bf;
  background: linear-gradient(145deg, #ccfbf1, #e0f2fe);
  color: var(--teal-dark);
  box-shadow: 0 8px 16px rgba(13, 148, 136, 0.14);
}
.more-nav-ico {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e0f2fe, #ccfbf1);
  color: #0f766e;
  flex-shrink: 0;
}
.more-nav-link.active .more-nav-ico {
  background: linear-gradient(145deg, #2dd4bf, #0284c7);
  color: #fff;
}

/* Sidebar */
.sidebar {
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(45, 212, 191, 0.28), transparent 55%),
    radial-gradient(380px 220px at 0% 100%, rgba(14, 165, 233, 0.22), transparent 50%),
    linear-gradient(168deg, #083344 0%, #0b4a58 42%, #0f766e 100%);
  color: var(--sidebar-text);
  padding: 1rem 0.75rem calc(1rem + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(45, 212, 191, 0.08);
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #5eead4, #0ea5e9);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
}
.brand strong { display: block; color: #fff; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; }
.brand small { color: #99f6e4; font-size: 0.76rem; font-weight: 600; }

.nav-section-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(153, 246, 228, 0.72);
  padding: 0.7rem 0.85rem 0.25rem;
}

.nav { display: flex; flex-direction: column; gap: 0.28rem; flex: 1; }
.nav a {
  color: rgba(207, 250, 254, 0.88);
  text-decoration: none;
  padding: 0.62rem 0.75rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: var(--tap);
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.nav a .nav-ico {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.08);
  color: #99f6e4;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  border-color: rgba(94, 234, 212, 0.2);
  transform: translateX(2px);
}
.nav a:hover .nav-ico {
  background: rgba(45, 212, 191, 0.22);
  color: #fff;
}
.nav a.active {
  background: linear-gradient(105deg, rgba(45, 212, 191, 0.34), rgba(14, 165, 233, 0.22));
  color: #fff;
  border-color: rgba(94, 234, 212, 0.35);
  box-shadow:
    0 8px 18px rgba(2, 132, 199, 0.18),
    inset 3px 0 0 #5eead4;
}
.nav a.active .nav-ico {
  background: linear-gradient(145deg, #5eead4, #0284c7);
  color: #fff;
  box-shadow: 0 6px 12px rgba(2, 132, 199, 0.35);
  transform: scale(1.04);
}

.sidebar-foot {
  font-size: 0.75rem;
  color: rgba(153, 246, 228, 0.75);
  padding: 0.75rem 0.85rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.25rem;
}
.sidebar-foot > span {
  display: block;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #99f6e4;
  margin-bottom: 0.45rem;
}
.sidebar-foot a {
  display: block;
  margin-top: 0.28rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  color: rgba(207, 250, 254, 0.88);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.8rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-foot a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}
.sidebar-logout {
  margin-top: 0 !important;
  text-align: center;
  font-weight: 750 !important;
  letter-spacing: 0.02em;
  border: 1px solid rgba(153, 246, 228, 0.35);
  background: rgba(15, 118, 110, 0.35);
  color: #ecfeff !important;
}
.sidebar-logout:hover {
  background: rgba(20, 184, 166, 0.35) !important;
  border-color: rgba(153, 246, 228, 0.55);
  color: #fff !important;
}

/* ?? Main ???????????????????????????????????????????????????? */
.main {
  padding: 1.25rem clamp(0.9rem, 2.5vw, 1.85rem) calc(2.2rem + var(--safe-b));
  min-width: 0;
  width: 100%;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.5vw, 2.2rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* ?? Alerts ?????????????????????????????????????????????????? */
.alert {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
}
.alert-success { background: var(--ok-bg); color: #047857; border-color: #a7f3d0; }
.alert-error { background: var(--danger-bg); color: #be123c; border-color: #fecdd3; }
.alert-info { background: var(--sky-soft); color: #0369a1; border-color: #bae6fd; }

/* ?? Grids & stats ??????????????????????????????????????????? */
.grid { display: grid; gap: 0.9rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--stat-accent, var(--teal));
}
.stat .label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat .value {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  margin-top: 0.3rem;
  color: var(--ink);
  word-break: break-word;
}
.stat-sales { --stat-accent: #0d9488; background: linear-gradient(145deg, #fff, #f0fdfa); }
.stat-entries { --stat-accent: #0284c7; background: linear-gradient(145deg, #fff, #f0f9ff); }
.stat-bills { --stat-accent: #e11d48; background: linear-gradient(145deg, #fff, #fff1f2); }
.stat-clients { --stat-accent: #7c3aed; background: linear-gradient(145deg, #fff, #f5f3ff); }
.stat-today { --stat-accent: #0891b2; background: linear-gradient(145deg, #fff, #ecfeff); }
.stat-gst { --stat-accent: #059669; background: linear-gradient(145deg, #fff, #ecfdf5); }
.stat-nongst { --stat-accent: #d97706; background: linear-gradient(145deg, #fff, #fffbeb); }
.stat-challan { --stat-accent: #db2777; background: linear-gradient(145deg, #fff, #fdf2f8); }
.stat-quotes { --stat-accent: #4f46e5; background: linear-gradient(145deg, #fff, #eef2ff); }

a.stat.dash-stat {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.stat.dash-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--stat-accent, var(--teal)) 35%, var(--line));
  text-decoration: none;
}
.dash-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dash-stat-cta {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--stat-accent, var(--teal));
  opacity: 0.85;
  white-space: nowrap;
}
.dash-stat-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.35;
}
.dash-stat-meta.is-up { color: #047857; }
.dash-stat-meta.is-down { color: #be123c; }
.dash-stat-meta.is-flat { color: var(--muted); }

.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid #d7e3ef;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(13, 148, 136, 0.12), transparent 55%),
    linear-gradient(145deg, #ffffff, #f8fbfc);
}
.dash-hero-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.dash-hero-title {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: var(--ink);
  line-height: 1.2;
}
.dash-hero-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
}
.dash-stat-grid { margin-bottom: 0.15rem; }
.dash-panels { margin-top: 0.15rem; }

.recent-bill-amt {
  font-weight: 750;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.recent-bill-no small {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.recent-bill-row-head .recent-bill-amt {
  color: inherit;
  font-weight: inherit;
  text-align: right;
}

.dash-rank-list { display: flex; flex-direction: column; }
.dash-rank-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1.05rem;
  border-bottom: 1px solid #eef2f6;
  text-decoration: none;
  color: inherit;
}
.dash-rank-row:last-child { border-bottom: 0; }
.dash-rank-row:hover {
  background: #f8fbfc;
  text-decoration: none;
}
.dash-rank-pos {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #0f766e;
  background: #ccfbf1;
}
.dash-rank-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.dash-rank-main strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-rank-main small {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.75rem;
}
.dash-rank-amt {
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ?? Panels ?????????????????????????????????????????????????? */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.panel-h {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #f8fcff, #f3f9f7);
}
.panel-h h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}
.panel-h .hint { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.panel-b { padding: 1.1rem; }

/* ?? Forms ??????????????????????????????????????????????????? */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 0.85rem;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field label { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.field .hint { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: #fff;
  width: 100%;
  max-width: 100%;
  min-height: var(--tap);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--teal);
}
input.field-desc,
input.field-style,
input.field-sizes,
input[name="description"],
input[name="description[]"],
input[name="style"],
input[name="style[]"],
input[name="sizes"],
input[name="sizes[]"] {
  text-transform: uppercase;
}
input[type="email"],
input.email-lowercase,
input[data-lowercase="email"] {
  text-transform: lowercase;
}

/* ?? Buttons ????????????????????????????????????????????????? */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 1rem;
  min-height: var(--tap);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0284c7);
  color: #fff;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.btn-secondary:hover { border-color: #9ec5d8; background: #f8fcff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-danger { background: var(--coral); color: #fff; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; min-height: 36px; }
.btn-block { width: 100%; }

/* ?? Tables ?????????????????????????????????????????????????? */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: #b7cfe0;
  border-radius: 999px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 640px;
}
table.data th, table.data td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--muted);
  background: #f4faf8;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
table.data tr:hover td { background: #f7fcfb; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-open { background: var(--sky-soft); color: #0369a1; }
.badge-challan { background: var(--amber-soft); color: #b45309; }
.badge-billed, .badge-final, .badge-issued, .badge-active { background: var(--ok-bg); color: #047857; }
.badge-converted { background: var(--violet-soft); color: #6d28d9; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.toolbar .field { min-width: min(100%, 150px); flex: 1 1 150px; }

.items-editor { overflow: visible; }
.items-editor .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.items-editor table {
  min-width: 760px;
  width: 100%;
}
.items-editor input,
.items-editor select {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  min-height: 40px;
}

.totals-box {
  margin-left: auto;
  width: min(340px, 100%);
  background: linear-gradient(160deg, #f0fdfa, #e0f2fe);
  border: 1px solid #b6e4df;
  border-radius: 12px;
  padding: 0.95rem 1.05rem;
}
.totals-box .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.28rem 0;
  color: var(--ink-soft);
}
.totals-box .grand {
  margin-top: 0.45rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #7dd3c7;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--ink);
}

.empty {
  text-align: center;
  padding: 2.2rem 1.1rem;
  color: var(--muted);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa, #f0f9ff);
  min-height: var(--tap);
}
.switch-row input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }

.action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.doc-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.6rem);
}
.doc-preview .doc-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #14b8a6, #0284c7, #e11d48) 1;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.doc-brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.doc-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.doc-brand-text { min-width: 0; }
.doc-preview .centre-name,
.doc-sheet .centre-name {
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  margin: 0;
  color: #0b3d4f;
  line-height: 1.2;
}
.doc-address {
  color: var(--muted);
  white-space: pre-line;
  margin-top: 0.2rem;
  font-size: 0.86rem;
  line-height: 1.35;
}
.doc-contact {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  color: var(--ink-soft);
}
.doc-meta { text-align: right; flex-shrink: 0; }
.doc-sign-block {
  margin-top: 1.25rem;
  margin-left: auto;
  width: min(200px, 100%);
  text-align: center;
}
.doc-sign-space {
  min-height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 0.3rem;
}
.doc-signature {
  max-width: 160px;
  max-height: 58px;
  object-fit: contain;
}
.doc-sign-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}
.doc-sign-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.15rem;
  color: var(--ink-soft);
}

/* ?? Invoice / bill redesign ????????????????????????????????? */
.inv {
  --inv-ink: #14212b;
  --inv-muted: #667788;
  --inv-line: #e2e8ef;
  --inv-soft: #f4f7fa;
  --inv-accent: #0f766e;
  --inv-deep: #123447;
  position: relative;
  width: min(210mm, 100%);
  margin: 0 auto;
  background: #fff;
  color: var(--inv-ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0 0 1.1rem;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.45;
}
.inv-accent {
  height: 5px;
  background: linear-gradient(90deg, #0f766e 0%, #0e7490 55%, #155e75 100%);
}
.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.15rem 1.35rem 1rem;
  border-bottom: 1px solid var(--inv-line);
  flex-wrap: nowrap;
}
.inv-issuer {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}
.inv-logo-slot {
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  border: 1px solid var(--inv-line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.inv-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.3rem;
  display: block;
}
.inv-logo-fallback {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--inv-deep);
}
.inv-centre {
  min-width: 0;
  flex: 1 1 auto;
}
.inv-centre-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 700;
  color: var(--inv-deep);
  line-height: 1.15;
}
.inv-centre-address {
  margin: 0.28rem 0 0;
  font-size: 0.84rem;
  color: var(--inv-muted);
  white-space: pre-line;
  line-height: 1.35;
}
.inv-centre-facts {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  font-size: 0.8rem;
  color: var(--inv-ink);
}
.inv-centre-facts li span {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--inv-muted);
  margin-right: 0.25rem;
}
.inv-meta {
  flex: 0 0 auto;
  text-align: right;
  margin-left: auto;
  min-width: 10rem;
}
.inv-doc-type {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--inv-deep);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.inv-doc-kind {
  margin: 0.2rem 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--inv-accent);
}
.inv-meta-table {
  margin-left: auto;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.inv-meta-table th,
.inv-meta-table td {
  padding: 0.12rem 0;
  vertical-align: baseline;
}
.inv-meta-table th {
  padding-right: 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--inv-muted);
  text-align: right;
}
.inv-meta-table td {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--inv-ink);
}

.inv-buyer {
  padding: 1rem 1.35rem 1.05rem;
  border-bottom: 1px solid var(--inv-line);
}
.inv-label {
  margin: 0 0 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--inv-muted);
}
.inv-buyer-name {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--inv-ink);
  line-height: 1.2;
}
.inv-buyer-line {
  margin: 0.1rem 0;
  font-size: 0.86rem;
  color: var(--inv-muted);
}
.inv-buyer-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--inv-ink);
}
.inv-buyer-facts span {
  font-weight: 600;
}

.inv-table {
  width: calc(100% - 2.7rem);
  margin: 0.95rem 1.35rem 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.86rem;
}
.inv-table thead th {
  background: var(--inv-soft);
  color: var(--inv-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-top: 1px solid var(--inv-line);
  border-bottom: 1px solid var(--inv-line);
}
.inv-table tbody td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--inv-line);
  vertical-align: top;
}
.inv-table .c-no { width: 2rem; text-align: center; color: var(--inv-muted); }
.inv-table .c-unit { width: 3.2rem; color: var(--inv-muted); }
.inv-table .c-qty,
.inv-table .c-rate,
.inv-table .c-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.inv-table .c-qty { width: 3.4rem; }
.inv-table .c-rate { width: 4.6rem; }
.inv-table .c-amt { width: 5.2rem; font-weight: 700; }
.inv-table thead .c-qty,
.inv-table thead .c-rate,
.inv-table thead .c-amt,
.inv-table thead .c-no { text-align: inherit; }
.inv-table thead .c-qty,
.inv-table thead .c-rate,
.inv-table thead .c-amt { text-align: right; }
.inv-table thead .c-no { text-align: center; }
.inv-item-title {
  display: block;
  font-weight: 600;
  color: var(--inv-ink);
}
.inv-item-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.76rem;
  color: var(--inv-muted);
}

.inv-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(11.5rem, 0.85fr);
  gap: 1.1rem 1.4rem;
  padding: 1.05rem 1.35rem 0.35rem;
  align-items: start;
}
.inv-summary-left { min-width: 0; }
.inv-words { margin-bottom: 0.85rem; }
.inv-words-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--inv-ink);
}
.inv-note {
  margin-bottom: 0.7rem;
}
.inv-note p:not(.inv-label) {
  margin: 0;
  font-size: 0.8rem;
  color: var(--inv-muted);
  white-space: pre-line;
}
.inv-summary-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.inv-totals {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--inv-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.inv-totals th,
.inv-totals td {
  padding: 0.42rem 0.7rem;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--inv-line);
}
.inv-totals tr:last-child th,
.inv-totals tr:last-child td { border-bottom: 0; }
.inv-totals th {
  text-align: left;
  font-weight: 600;
  color: var(--inv-muted);
}
.inv-totals td {
  text-align: right;
  font-weight: 700;
  color: var(--inv-ink);
}
.inv-totals .inv-grand th,
.inv-totals .inv-grand td {
  background: var(--inv-deep);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 0.58rem 0.7rem;
}
.inv-sign {
  margin-top: 1.2rem;
  width: min(190px, 100%);
  margin-left: auto;
}
.inv-sign .doc-sign-block {
  margin: 0;
  width: 100%;
  text-align: center;
}
.inv-sign .doc-sign-space { min-height: 52px; }
.inv-sign .doc-signature {
  max-width: 150px;
  max-height: 52px;
  object-fit: contain;
}
.inv-sign .doc-sign-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--inv-muted);
  border-top: 1px solid var(--inv-line);
  padding-top: 0.35rem;
}
.inv-sign .doc-sign-name {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--inv-ink);
}

.inv-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 1.35rem 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--inv-line);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--inv-muted);
}

/* Payment blocks on bills / quotations */
.pay-bank,
.pay-upi {
  margin: 0.85rem 0 0.7rem;
}
.pay-bank-list {
  margin: 0.35rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--inv-line, #e2e8ef);
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  gap: 0.28rem;
}
.pay-bank-list > div {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.4rem;
  font-size: 0.84rem;
}
.pay-bank-list dt {
  margin: 0;
  color: var(--inv-muted, #667788);
  font-weight: 600;
}
.pay-bank-list dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.pay-upi-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--inv-line, #e2e8ef);
  border-radius: 10px;
  background: #f8fafc;
  max-width: 22rem;
}
.pay-upi-qr {
  width: 118px;
  height: 118px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.pay-upi-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  font-size: 0.84rem;
}
.pay-upi-meta strong {
  font-size: 1.05rem;
  color: var(--inv-deep, #123447);
}
.pay-upi-id {
  font-weight: 700;
  word-break: break-all;
}
.qt-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(12rem, 0.85fr);
  gap: 1rem 1.25rem;
  margin-top: 1rem;
  align-items: start;
}
@media (max-width: 720px) {
  .qt-footer-grid { grid-template-columns: 1fr; }
  .pay-upi-box { max-width: none; }
}

@media print {
  .pay-bank-list,
  .pay-upi-box { background: #f8fafc !important; break-inside: avoid; }
  .pay-upi-qr { width: 28mm; height: 28mm; }
}

@media (max-width: 720px) {
  .inv-head { flex-wrap: wrap; padding: 1rem 1rem 0.9rem; }
  .inv-meta { min-width: 0; }
  .inv-logo-slot { width: 88px; height: 88px; }
  .inv-buyer { padding: 0.9rem 1rem; }
  .inv-table { width: calc(100% - 2rem); margin-left: 1rem; margin-right: 1rem; font-size: 0.8rem; }
  .inv-summary {
    grid-template-columns: 1fr;
    padding: 0.95rem 1rem 0.2rem;
  }
  .inv-summary-right { align-items: stretch; }
  .inv-sign { margin-left: auto; }
  .inv-foot { margin: 0.85rem 1rem 0; }
}

@page {
  size: A4 portrait;
  margin: 10mm 12mm;
}

@media print {
  .report-invoice-break { break-before: page; page-break-before: always; }
  .report-summary-box { background: #fff; }
  .report-gst-register { font-size: 0.78rem; }

  html, body {
    background: #fff !important;
    color: #111;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sidebar, .topbar, .mobile-bar, .mobile-summary-wrap, .bottom-nav, .more-nav-sheet, .nav-backdrop, .no-print, .alert {
    display: none !important;
  }
  .app-shell { display: block; }
  .main, .content { padding: 0 !important; margin: 0 !important; }
  .panel, .doc-preview, .doc-sheet, .inv {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .inv {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10pt;
  }
  .inv-accent { height: 2.5mm; }
  .inv-head {
    padding: 0 0 4.5mm;
    margin-bottom: 4mm;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }
  .inv-logo-slot {
    width: 32mm;
    height: 32mm;
    border-radius: 2.5mm;
  }
  .inv-centre-name { font-size: 15pt; }
  .inv-centre-address { font-size: 8pt; }
  .inv-centre-facts { font-size: 8pt; gap: 1mm 3.5mm; }
  .inv-centre-facts li span { font-size: 6.5pt; }
  .inv-doc-type { font-size: 15pt; }
  .inv-doc-kind { font-size: 7.5pt; margin-bottom: 2.5mm; }
  .inv-meta-table { font-size: 9.5pt; }
  .inv-meta-table th { font-size: 7pt; }
  .inv-buyer {
    padding: 0 0 4mm;
    margin-bottom: 3.5mm;
  }
  .inv-buyer-name { font-size: 12pt; }
  .inv-buyer-line,
  .inv-buyer-facts { font-size: 9pt; }
  .inv-table {
    width: 100%;
    margin: 0;
    font-size: 9pt;
  }
  .inv-table thead th {
    background: var(--inv-soft) !important;
    padding: 2mm 1.5mm;
    font-size: 7pt;
  }
  .inv-table tbody td { padding: 2mm 1.5mm; }
  .inv-item-sub { font-size: 7.5pt; }
  .inv-summary {
    grid-template-columns: 1.2fr 0.85fr;
    padding: 4mm 0 0;
    gap: 5mm;
  }
  .inv-words-text { font-size: 9.5pt; }
  .inv-note p:not(.inv-label) { font-size: 8pt; }
  .inv-totals th,
  .inv-totals td { font-size: 9pt; padding: 1.8mm 3mm; }
  .inv-totals .inv-grand th,
  .inv-totals .inv-grand td {
    background: var(--inv-deep) !important;
    color: #fff !important;
    font-size: 10.5pt;
  }
  .inv-sign {
    break-inside: avoid;
    margin-top: 5mm;
  }
  .inv-sign .doc-signature { max-width: 36mm; max-height: 13mm; }
  .inv-foot {
    margin: 5mm 0 0;
    padding-top: 3mm;
    font-size: 8pt;
  }
  .doc-preview .doc-head { flex-direction: row; }
}

.asset-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.asset-upload-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: linear-gradient(145deg, #fff, #f5fbfd);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.asset-upload-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.asset-preview {
  width: 100%;
  max-height: 110px;
  object-fit: contain;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.35rem;
}
.asset-preview-sign { max-height: 80px; }
.asset-placeholder {
  height: 88px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.85rem;
}
.client-search {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}
.client-search input { flex: 1; min-height: 36px; }
.client-list-body {
  padding: 0 !important;
  max-height: 70vh;
  overflow: auto;
}
.client-rows { display: flex; flex-direction: column; }
.recent-bill-rows { display: flex; flex-direction: column; }
.recent-bill-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.85fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.recent-bill-row:last-child { border-bottom: 0; }
a.recent-bill-row:hover {
  background: #f4faf8;
  text-decoration: none;
}
.recent-bill-row-head {
  background: #f4faf8;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.recent-bill-row-head .recent-bill-no,
.recent-bill-row-head .recent-bill-client,
.recent-bill-row-head .recent-bill-amt,
.recent-bill-row-head .recent-bill-date {
  font-weight: 800;
  color: var(--muted);
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.recent-bill-no {
  font-weight: 800;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-bill-client {
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-bill-date {
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .recent-bill-row-head { display: none; }
  .recent-bill-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.65rem;
    padding: 0.75rem 0.9rem;
  }
  .recent-bill-no { font-size: 0.88rem; grid-column: 1; }
  .recent-bill-amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .recent-bill-client { font-size: 0.88rem; grid-column: 1; }
  .recent-bill-date { font-size: 0.8rem; grid-column: 1; text-align: left; }
}
.client-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.9fr) 52px;
  gap: 0.55rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.client-row:last-child { border-bottom: 0; }
.client-row-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4faf8;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.client-col-company strong {
  display: block;
  font-size: 0.98rem;
  color: var(--ink);
  word-break: break-word;
}
.client-col-mobile {
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.client-col-due { text-align: right; }
.client-row-eye, .client-col-eye { text-align: center; }
.due-pill {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #ffe4e6;
  color: #be123c;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.due-none { color: var(--muted); font-weight: 600; }
.btn-eye {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--teal-dark);
  background: #e0f2fe;
  text-decoration: none;
  border: 1px solid #bae6fd;
}
.btn-eye:hover {
  background: linear-gradient(145deg, #ccfbf1, #e0f2fe);
  text-decoration: none;
  color: var(--teal-dark);
}

.client-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
}
.client-detail-main,
.client-detail-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.client-detail-block {
  min-width: 0;
}
.client-detail-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.client-detail-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.35;
}
.client-detail-value.pre { white-space: pre-line; font-weight: 600; }
.client-detail-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.client-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 1rem;
  width: 100%;
}
.client-action-grid .btn {
  width: 100%;
  min-height: 40px;
  white-space: nowrap;
  justify-content: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-size: 0.82rem;
}
.client-action-grid .client-delete-form {
  display: flex;
  min-width: 0;
}
.client-action-grid .client-delete-form .btn {
  flex: 1;
}
.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: end;
}
.field-with-action > label {
  grid-column: 1 / -1;
}
.field-with-action select,
.field-with-action .client-picker {
  min-width: 0;
}
.field-with-action .btn {
  min-height: var(--tap);
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.form-grid > .field-with-action.span-2 {
  display: grid;
}

.client-picker {
  position: relative;
  min-width: 0;
}
.client-picker-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
}
.client-picker-search {
  width: 100%;
  padding-right: 4.2rem !important;
  grid-column: 1 / -1;
  grid-row: 1;
}
.client-picker-clear,
.client-picker-toggle {
  grid-row: 1;
  z-index: 1;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  min-width: 2rem;
  font-size: 1rem;
  line-height: 1;
  align-self: center;
}
.client-picker-clear {
  grid-column: 2;
  font-size: 1.15rem;
}
.client-picker-toggle {
  grid-column: 3;
  margin-right: 0.2rem;
}
.client-picker-clear:hover,
.client-picker-toggle:hover {
  color: var(--ink);
}
.client-picker-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 0.3rem);
  max-height: min(280px, 50vh);
  overflow: auto;
  background: #fff;
  border: 1px solid #d7e3ef;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
}
.client-picker-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  color: inherit;
}
.client-picker-option strong {
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--ink);
}
.client-picker-option span {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
}
.client-picker-option:hover,
.client-picker-option.is-active {
  background: #f0fdfa;
}
.client-picker-option.is-selected {
  background: #ecfeff;
}
.client-picker-option.is-empty strong {
  color: var(--muted);
  font-weight: 700;
}
.client-picker-empty {
  padding: 0.85rem 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
}
.client-delete-form { margin: 0; }
.btn-danger-soft {
  background: #fff1f2;
  color: #be123c;
  border: 1.5px solid #fecdd3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn-danger-soft:hover { background: #ffe4e6; color: #9f1239; }

@media (max-width: 640px) {
  .client-row-head { display: none; }
  .client-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "company eye"
      "mobile  eye"
      "due     eye";
    gap: 0.35rem 0.65rem;
    padding: 0.95rem 1rem;
  }
  .client-col-company { grid-area: company; }
  .client-col-mobile {
    grid-area: mobile;
    font-size: 0.9rem;
  }
  .client-col-mobile::before {
    content: "Mobile ? ";
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .client-col-due {
    grid-area: due;
    text-align: left;
  }
  .client-col-eye {
    grid-area: eye;
    align-self: center;
  }
  .client-search { max-width: none; width: 100%; }

  .client-detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 0.75rem;
  }
  .client-detail-value { font-size: 0.92rem; }
  .client-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.85rem;
  }
  .client-action-grid .btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.2rem;
    min-height: 38px;
    letter-spacing: -0.01em;
  }
  .client-action-grid .btn svg { width: 13px; height: 13px; }
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 45, 0.48);
  backdrop-filter: blur(3px);
  z-index: 80;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-b));
}
.modal[hidden], .modal-backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fcff, #f3f9f7);
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-h h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #eef5f8;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.modal-b { padding: 1.1rem; }
.app-dialog-card {
  width: min(420px, 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 92, 110, 0.14);
  box-shadow: 0 22px 50px rgba(11, 61, 79, 0.22);
}
.app-dialog .modal-h {
  background: linear-gradient(135deg, #0f766e 0%, #0ea5e9 100%);
  border-bottom: 0;
  color: #fff;
}
.app-dialog .modal-h h3 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}
.app-dialog .modal-close {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 0;
}
.app-dialog .modal-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.app-dialog-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 600;
}
.app-dialog-actions {
  margin-top: 1.15rem;
}
.app-dialog-actions .btn {
  min-width: 5.5rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}
.modal-b .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}
.modal-b .field.span-2 { grid-column: span 2; }

@media (max-width: 960px) {
  .settings-summary-grid { grid-template-columns: 1fr; }
  .modal-b .field.span-2 { grid-column: span 1; }
}

@media (max-width: 640px) {
  .asset-upload-grid { grid-template-columns: 1fr; }
  .doc-meta { text-align: left; width: 100%; }
  .doc-sign-block { margin-left: 0; width: 100%; }
}

.quick-links a {
  display: inline-flex;
}

.centre-readonly-name {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: #0b3d4f;
  margin-bottom: 0.85rem;
}
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.1rem;
  margin: 0;
}
.detail-list .full { grid-column: 1 / -1; }
.detail-list dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.detail-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}
.detail-list dd.pre { white-space: pre-line; font-weight: 500; line-height: 1.5; }

/* ?? Daily entry (mobile-first cards) ???????????????????????? */
.entry-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.entry-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.entry-form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.entry-list-panel { padding-top: 0.85rem !important; }
.entry-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.entry-bulk-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #f0fdfa, #f0f9ff);
}
.entry-bulk-bar .btn { width: 100%; }
.entry-select-all {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}
.entry-mobile-only { display: none; }
.entry-desktop-only { display: block; }

.entry-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.entry-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.entry-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}
.entry-card-check {
  display: grid;
  place-items: center;
  width: 28px;
  flex-shrink: 0;
  padding-top: 0.15rem;
}
.entry-card-check.spacer { width: 28px; }
.entry-card-check input { width: 20px; height: 20px; min-height: 0; }
.entry-card-main { flex: 1; min-width: 0; }
.entry-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.3;
}
.entry-card-meta {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.entry-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: #f5faf9;
  border: 1px solid #e0eeea;
}
.entry-card-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.entry-card-grid span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.entry-card-grid strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}
.entry-card-total {
  grid-column: 1 / -1;
  padding-top: 0.35rem;
  border-top: 1px dashed #b7ddd5;
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center;
}
.entry-card-total strong {
  font-size: 1.05rem;
  color: var(--teal-dark);
}
.entry-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.55rem;
}

@media (max-width: 960px) {
  .entry-form-row,
  .entry-form-row-3,
  .entry-filters {
    grid-template-columns: 1fr;
  }
  .entry-bulk-bar {
    grid-template-columns: 1fr;
  }
  .entry-desktop-only { display: none !important; }
  .entry-mobile-only { display: flex !important; }
}

@media (max-width: 640px) {
  .detail-list { grid-template-columns: 1fr; }
}

/* ?? Reports ????????????????????????????????????????????????? */
.report-card-gst .panel-h h2 { color: var(--teal-dark); }
.report-card-nongst .panel-h h2 { color: var(--sky); }
.report-card-party .panel-h h2 { color: #0f766e; }
.period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
.period-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.period-chip:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  text-decoration: none;
  background: var(--teal-soft);
}
.period-chip.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.report-filter-toolbar { align-items: flex-end; }
.report-filter-form .custom-dates.is-dimmed { opacity: 0.55; }
.report-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}
.report-stats-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.report-stats .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.report-stats strong { font-size: 1.05rem; }
.report-doc .muted-sm {
  font-size: 0.78rem;
  color: var(--muted);
}
.report-party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.report-summary-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.report-summary-box > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.report-summary-box .grand {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
  font-size: 1.05rem;
}
.report-tax-grid {
  max-width: 360px;
  margin-left: auto;
  margin-top: 1rem;
}
.report-total-row td {
  background: #f1f5f9;
  font-weight: 600;
}
.report-words {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.report-footnote { margin-top: 0.75rem; }
.report-supplier { margin-bottom: 0.85rem; font-size: 0.92rem; }
.party-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.party-name { font-size: 1.1rem; font-family: var(--display); }
.party-detail-totals {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.party-detail-totals span { font-size: 0.8rem; color: var(--muted); }

@media print {
  .report-invoice-break { break-before: page; page-break-before: always; }
  .report-summary-box { background: #fff; }
  .report-gst-register { font-size: 0.78rem; }
}

@media (max-width: 640px) {
  .report-stats, .report-stats-wide { grid-template-columns: 1fr 1fr; }
  .report-party-grid { grid-template-columns: 1fr; }
  .report-summary-box { grid-template-columns: 1fr; }
  .party-detail-head { flex-direction: column; }
  .party-detail-totals { text-align: left; }
}

/* ?? Print ??????????????????????????????????????????????????? */
@media print {
  .sidebar, .topbar, .mobile-bar, .mobile-summary-wrap, .bottom-nav, .more-nav-sheet, .nav-backdrop, .no-print, .alert { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .panel, .doc-preview { box-shadow: none; border: none; }
}

/* ?? Tablet ?????????????????????????????????????????????????? */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-bar { display: flex; }
  .mobile-summary-wrap { display: block; }
  .topbar {
    margin-top: 0.35rem;
  }
  .sidebar { display: none !important; }
  .bottom-nav { display: grid; }
  .dash-quick-actions { display: none !important; }
  .dash-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-hero-actions .btn { flex: 1 1 auto; }

  /* Line items: stack as cards — no horizontal scroll */
  .items-editor .table-wrap {
    overflow: visible !important;
  }
  .items-editor table.data {
    min-width: 0 !important;
    border: 0;
  }
  .items-editor table.data thead {
    display: none;
  }
  .items-editor table.data,
  .items-editor table.data tbody,
  .items-editor table.data tr,
  .items-editor table.data td {
    display: block;
    width: 100%;
  }
  .items-editor table.data tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .items-editor table.data tr.item-row,
  .items-editor table.data tr {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    margin: 0;
    padding: 0.65rem 0.75rem 0.75rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  }
  .items-editor table.data tr:hover td {
    background: transparent;
  }
  .items-editor table.data td {
    border: 0;
    padding: 0.35rem 0;
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
  }
  .items-editor table.data td::before {
    content: attr(data-label);
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a90a3;
  }
  .items-editor table.data td.line-total {
    font-weight: 800;
    color: var(--teal-dark);
    font-variant-numeric: tabular-nums;
  }
  .items-editor table.data td.item-row-actions {
    grid-template-columns: 1fr;
    padding-top: 0.55rem;
    margin-top: 0.25rem;
    border-top: 1px dashed #d7e3ef;
  }
  .items-editor table.data td.item-row-actions::before {
    display: none;
  }
  .items-editor table.data td.item-row-actions .btn {
    width: 100%;
  }

  .main {
    padding: 1rem 0.85rem calc(6.2rem + var(--safe-b));
  }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .field.span-2, .field.span-3 { grid-column: span 1; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-b { padding: 0.95rem; }
  .topbar { align-items: stretch; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1 1 auto; }
  .totals-box { width: 100%; margin-left: 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .field { min-width: 0; width: 100%; }
  .toolbar .btn { width: 100%; }
}

@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .stat { padding: 0.85rem 0.9rem 0.85rem 1rem; }
  .stat .value { font-size: 1.35rem; }
  .btn { white-space: normal; text-align: center; }
  .doc-preview .doc-head { flex-direction: column; }
  .action-chips .btn { flex: 1 1 calc(50% - 0.55rem); }

  /* Card-like stacked rows for compact list screens */
  table.data.mobile-cards {
    min-width: 0;
    border: 0;
  }
  table.data.mobile-cards thead { display: none; }
  table.data.mobile-cards,
  table.data.mobile-cards tbody,
  table.data.mobile-cards tr,
  table.data.mobile-cards td {
    display: block;
    width: 100%;
  }
  table.data.mobile-cards tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0.65rem;
    padding: 0.35rem 0;
    box-shadow: var(--shadow);
  }
  table.data.mobile-cards tr:hover td { background: transparent; }
  table.data.mobile-cards td {
    border: 0;
    padding: 0.35rem 0.85rem;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
  }
  table.data.mobile-cards td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
  }
  table.data.mobile-cards td.actions {
    justify-content: flex-end;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--line);
    margin-top: 0.25rem;
  }
  table.data.mobile-cards td.actions::before { display: none; }
  table.data.mobile-cards .num { text-align: right; }
}

@media (max-width: 420px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.bill-cat-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  padding: 0.35rem;
  border-radius: 14px;
  background: #eef4f7;
}
.bill-cat-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.55rem;
  border-radius: 10px;
  text-decoration: none;
  color: #5a7388;
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.bill-cat-tab:hover {
  color: #0f5c6e;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
}
.bill-cat-tab.active {
  background: #fff;
  color: #0f5c6e;
  box-shadow: 0 4px 12px rgba(18, 48, 74, 0.08);
}
.bill-cat-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e2eef3;
  color: #3d5568;
  font-size: 0.72rem;
  font-weight: 800;
}
.bill-cat-tab.active .bill-cat-count {
  background: #ccfbf1;
  color: #0f766e;
}
.bill-mobile-list { display: none; }
.bill-mobile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid var(--line);
}
.bill-mobile-row:last-of-type { border-bottom: 0; }
.bill-mobile-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.bill-mobile-client {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bill-mobile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bill-mobile-amount {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bill-detail-modal .detail-list {
  margin: 0;
}
.bill-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.bill-preview-field {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #d7e3ef;
  background: #f8fbfc;
  min-width: 0;
}
.bill-preview-field.span-all { grid-column: 1 / -1; }
.bill-preview-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a90a3;
  margin-bottom: 0.25rem;
}
.bill-preview-field strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.35;
  word-break: break-word;
}
.bill-preview-particulars {
  font-weight: 650 !important;
  color: var(--ink-soft) !important;
}
.bill-preview-amount {
  background: linear-gradient(135deg, #f0fdfa, #e0f2fe);
  border-color: #99f6e4;
}
.bill-preview-amount strong {
  font-size: 1.2rem;
  color: var(--teal-dark);
}
.bill-preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.95rem;
}
.bill-preview-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  padding: 0.55rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 750;
  min-height: 2.75rem;
}
.bill-preview-convert {
  margin-top: 0.55rem;
}
.bill-preview-convert .btn { width: 100%; }
.bill-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.bill-detail-actions .btn { flex: 1 1 auto; }
.bill-detail-actions form { margin: 0; flex: 1 1 auto; }
.bill-detail-actions form .btn { width: 100%; }
@media (max-width: 960px) {
  .hide-on-mobile { display: none !important; }
  .bill-desktop-table { display: none !important; }
  .bill-mobile-list { display: block; }
}
@media (max-width: 640px) {
  .bill-cat-tabs {
    grid-template-columns: 1fr;
  }
  .bill-cat-tab {
    justify-content: space-between;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

/* Current plan card (centre settings) */
.plan-card {
  --plan-accent: #0d9488;
  border: 1px solid color-mix(in srgb, var(--plan-accent) 28%, #d7e3ef);
  border-radius: 16px;
  padding: 1rem 1.05rem 1.05rem;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--plan-accent) 16%, transparent), transparent 55%),
    #fff;
  box-shadow: 0 10px 24px rgba(18, 48, 74, 0.06);
}
.plan-card.is-expired {
  border-color: #fda4af;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(244, 63, 94, 0.1), transparent 55%),
    #fff;
}
.plan-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.plan-card-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--plan-accent), color-mix(in srgb, var(--plan-accent) 65%, #0f172a));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--plan-accent) 35%, transparent);
}
.plan-card-head { min-width: 0; }
.plan-card-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plan-accent);
  background: color-mix(in srgb, var(--plan-accent) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--plan-accent) 28%, #fff);
}
.plan-card-name {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f3d4d;
  letter-spacing: -0.02em;
}
.plan-card-tagline {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #5a7388;
}
.plan-card-status {
  margin-top: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
  font-size: 0.86rem;
  font-weight: 700;
}
.plan-card-status.is-bad {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.plan-card-features {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.plan-card-features li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3d5568;
}
.plan-card-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--plan-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--plan-accent) 18%, transparent);
}
.plan-card.is-compact .plan-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.plan-card.is-compact .plan-card-name { font-size: 1.02rem; }
.plan-card-trial { --plan-accent: #0d9488; }
.plan-card-premium { --plan-accent: #2563eb; }
.plan-card-gold { --plan-accent: #d97706; }
.plan-card-diamond { --plan-accent: #7c3aed; }

  margin: 0 1rem 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #fff1f2;
  border: 1px solid #fda4af;
  color: #9f1239;
  font-size: 0.9rem;
}
.licence-lock-banner a { font-weight: 700; color: #9f1239; }
.content.is-licence-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
  opacity: 0.45;
  filter: grayscale(0.25);
}
.content.is-licence-locked::after {
  content: "Subscription locked ? renew from Admin panel";
  position: absolute;
  inset: 12% 8% auto;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #9f1239;
  background: rgba(255,255,255,0.92);
  border: 1px solid #fda4af;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  pointer-events: auto;
  z-index: 5;
}
