@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #080d0e;
  --panel: rgba(16, 24, 28, 0.94);
  --line: rgba(0, 163, 163, 0.28);
  --text: #f7f4ec;
  --muted: rgba(247, 244, 236, 0.7);
  --teal: #007a7a;
  --teal-bright: #00a3a3;
  --teal-glow: #00c8c8;
  --gold: #ffd700;
  --gold-mid: #d4af37;
  --gold-deep: #b8860b;
  --font: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif;
  --danger: #e57373;
  --ok: #7dcea0;
  --sidebar: #0e1418;
  --sidebar-muted: #b8b0d0;
  --sidebar-w: 260px;
  --hh-glass: rgba(12, 20, 22, 0.68);
  --hh-glass-strong: rgba(16, 24, 28, 0.88);
  --hh-glass-blur: blur(20px) saturate(1.25);
  --hh-neon-teal-soft: 0 0 0 1px rgba(0, 163, 163, 0.32), 0 0 16px rgba(0, 163, 163, 0.22);
  --hh-neon-teal: 0 0 0 1px rgba(0, 200, 200, 0.48), 0 0 22px rgba(0, 163, 163, 0.34), 0 0 44px rgba(0, 163, 163, 0.12);
  --hh-neon-gold: 0 0 0 1px rgba(255, 215, 0, 0.42), 0 0 20px rgba(255, 215, 0, 0.22);
  --hh-neon-focus: 0 0 0 1px rgba(0, 200, 200, 0.58), 0 0 26px rgba(0, 163, 163, 0.42), 0 0 52px rgba(0, 163, 163, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

.cnf-body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.cnf-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 12% -5%, rgba(0, 168, 156, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 100%, rgba(235, 179, 40, 0.12), transparent 50%),
    linear-gradient(165deg, #080d0e 0%, #0c1618 55%, #0a1214 100%);
}

.cnf-shell {
  position: relative;
  z-index: 1;
  width: min(440px, 94vw);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.cnf-shell-wide {
  width: min(560px, 94vw);
}

.cnf-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.cnf-back:hover {
  color: #f5c84a;
}

.cnf-panel {
  padding: 1.6rem 1.45rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08) 0%, transparent 40%),
    var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.cnf-brand {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-bright);
}

.cnf-login-logo {
  display: block;
  width: min(220px, 72vw);
  height: auto;
  margin: 0 auto 0.85rem;
  border-radius: 1rem;
  background: #0a0a0a;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.cnf-panel h1 {
  margin: 0 0 0.45rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cnf-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.cnf-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cnf-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.cnf-form label,
.cnf-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.cnf-form-grid .cnf-modal-actions,
.cnf-form-grid .full {
  grid-column: 1 / -1;
}

.cnf-form input,
.cnf-form-grid input,
.cnf-form select,
.cnf-form-grid select,
.cnf-form textarea,
.cnf-form-grid textarea {
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.cnf-form textarea,
.cnf-form-grid textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.cnf-form input:focus,
.cnf-form-grid input:focus,
.cnf-form select:focus,
.cnf-form-grid select:focus,
.cnf-form textarea:focus,
.cnf-form-grid textarea:focus {
  outline: none;
  border-color: rgba(0, 168, 156, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 132, 123, 0.2);
}

.cnf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 200, 200, 0.55);
  border-radius: 0.75rem;
  background: linear-gradient(165deg, #00c8c8 0%, #00a3a3 48%, #007a7a 100%);
  color: #f7f4ec;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(0, 163, 163, 0.35),
    0 0 18px rgba(0, 163, 163, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cnf-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(0, 200, 200, 0.55),
    0 0 28px rgba(0, 163, 163, 0.55),
    0 0 44px rgba(255, 215, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cnf-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cnf-btn.full {
  grid-column: 1 / -1;
}

.cnf-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.cnf-btn-danger {
  background: transparent;
  border: 1px solid rgba(229, 115, 115, 0.45);
  color: var(--danger);
}

.cnf-links {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.cnf-links a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}

.cnf-links a:hover {
  text-decoration: underline;
}

.cnf-status {
  margin: 0.85rem 0 0;
  min-height: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.cnf-status.warn {
  color: var(--danger);
}

.cnf-status.ok {
  color: var(--ok);
}

.cnf-home-card {
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.cnf-home-card strong {
  color: var(--text);
}

/* ---------- App layout (sidebar) ---------- */

.cnf-app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.cnf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #12181f 0%, #0c1116 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
}

.cnf-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.cnf-side-brand {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 1rem 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(0, 163, 163, 0.28);
  margin: 0;
  background: linear-gradient(180deg, rgba(18, 24, 31, 0.98) 0%, rgba(12, 17, 22, 0.96) 100%);
  position: relative;
  z-index: 5;
}

.cnf-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0.75rem 0.55rem 1.35rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  z-index: 1;
  /* Clear scroll rail on the right */
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #00c8c8 rgba(0, 163, 163, 0.18);
}

.cnf-sidebar-scroll::-webkit-scrollbar {
  width: 12px;
}

.cnf-sidebar-scroll::-webkit-scrollbar-track {
  background: rgba(0, 163, 163, 0.14);
  border-left: 1px solid rgba(0, 163, 163, 0.35);
  border-radius: 0;
}

.cnf-sidebar-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00c8c8 0%, #00a3a3 100%);
  border-radius: 999px;
  border: 2px solid rgba(8, 13, 14, 0.85);
  min-height: 40px;
}

.cnf-sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
}

.cnf-sidebar-scroll > .cnf-nav-dashboard,
.cnf-sidebar-scroll > .cnf-nav-group {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.cnf-side-brand a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.cnf-brand-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.2rem 0.35rem 0.1rem;
}

.cnf-brand-icon-wrap {
  width: 5.25rem;
  height: 5.25rem;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  padding: 0.2rem;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(0, 163, 163, 0.12), 0 8px 20px rgba(0, 0, 0, 0.28);
}

.cnf-brand-app-icon {
  width: 100%;
  height: 100%;
  max-width: 4.85rem;
  max-height: 4.85rem;
  border-radius: 0;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  padding: 0;
  border: none;
  margin: 0;
  display: block;
}

.cnf-brand-app-icon.cnf-brand-user-logo {
  object-fit: cover;
  border-radius: 0.7rem;
  max-width: 100%;
  max-height: 100%;
}

.cnf-brand-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
  width: 100%;
  text-align: center;
  position: relative;
}

.cnf-brand-name-row strong {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.cnf-brand-name-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 100%;
  width: 100%;
  padding: 0 0.15rem;
  box-sizing: border-box;
}

.cnf-brand-name-row strong {
  flex: 1 1 auto;
  min-width: 0;
}

.cnf-brand-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.35rem;
  color: #00c8c8;
  background: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: color 0.15s ease, transform 0.15s ease;
}

.cnf-brand-chevron {
  display: block;
  transition: transform 0.15s ease;
}

.cnf-brand-settings:hover,
.cnf-brand-settings.is-active,
.cnf-brand-settings.is-open,
.cnf-brand-settings.active {
  color: #ffd700;
}

.cnf-brand-settings.is-open .cnf-brand-chevron {
  transform: rotate(180deg);
}

.cnf-brand-settings-menu {
  position: absolute;
  top: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 140;
  padding: 0.4rem;
  border-radius: 0.65rem;
  background: rgba(12, 20, 22, 0.98);
  border: 1px solid rgba(0, 163, 163, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.cnf-brand-settings-menu[hidden] {
  display: none !important;
}

.cnf-brand-settings-item,
.cnf-brand-settings-logout {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 0.55rem 0.6rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: #f7f4ec;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.cnf-brand-settings-item:hover,
.cnf-brand-settings-logout:hover {
  background: rgba(0, 163, 163, 0.14);
  color: #00c8c8;
}

.cnf-brand-settings-item.active {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.cnf-brand-settings-divider {
  height: 1px;
  margin: 0.3rem 0.1rem;
  background: rgba(255, 255, 255, 0.1);
}

.cnf-brand-settings-logout {
  color: #ffd700;
}

.cnf-nav-dashboard {
  margin-bottom: 0.15rem;
}

.cnf-brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cnf-brand-logo,
.cnf-brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.65rem;
  flex: 0 0 auto;
  object-fit: cover;
}

.cnf-brand-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.35), rgba(13, 148, 136, 0.55));
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cnf-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.cnf-brand-text strong {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cnf-brand-owner {
  font-size: 0.78rem;
  color: #e5e7eb;
  font-weight: 600;
  display: block;
  width: 100%;
  line-height: 1.3;
}

.cnf-brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
  width: 100%;
  line-height: 1.3;
  margin-top: 0.05rem;
}

.cnf-side-brand span {
  font-size: 0.72rem;
  color: var(--muted);
}

.cnf-nav-group {
  border-radius: 0.65rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.cnf-nav-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.65rem;
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.cnf-nav-head .ico {
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
}

.cnf-nav-head .chev {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.cnf-nav-group.collapsed .chev {
  transform: rotate(180deg);
}

.cnf-nav-group.collapsed .cnf-nav-links {
  display: none;
}

.cnf-nav-links {
  display: flex;
  flex-direction: column;
  padding: 0 0.35rem 0.55rem 2rem;
  gap: 0.25rem;
}

.cnf-nav-links a {
  padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  line-height: 1.35;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease,
    box-shadow 0.18s ease;
}

.cnf-nav-links a:hover {
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 168, 156, 0.28), rgba(235, 179, 40, 0.12));
  box-shadow: inset 3px 0 0 #00a89c;
}

.cnf-nav-links a.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(0, 168, 156, 0.38), rgba(0, 132, 123, 0.18));
  box-shadow: inset 3px 0 0 #ebb328;
}

.cnf-nav-links a.cnf-nav-flash {
  transform: scale(0.97);
  background: rgba(0, 168, 156, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(0, 168, 156, 0.35);
}

.cnf-nav-head:hover {
  background: rgba(0, 168, 156, 0.14);
  border-radius: 0.55rem;
}

a.cnf-nav-direct-link {
  text-decoration: none;
  box-sizing: border-box;
}

a.cnf-nav-direct-link.active,
.cnf-nav-group.cnf-nav-direct.is-active > a.cnf-nav-direct-link {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(0, 168, 156, 0.38), rgba(0, 132, 123, 0.18));
  box-shadow: inset 3px 0 0 #ebb328;
  border-radius: 0.55rem;
}

.cnf-page-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: rgba(8, 13, 14, 0.28);
  opacity: 0;
  transition: none;
}
.cnf-page-loading.on {
  opacity: 1;
}
.cnf-page-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 35%;
  background: linear-gradient(90deg, #00a89c, #ebb328);
  animation: cnfNavLoad 0.9s ease infinite;
}
@keyframes cnfNavLoad {
  0% {
    left: -35%;
  }
  100% {
    left: 100%;
  }
}

.cnf-page-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  color: var(--muted);
  font-size: 0.95rem;
  animation: cnfSkeletonPulse 1.2s ease-in-out infinite;
}

#cnfPage.cnf-page-busy {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
@keyframes cnfSkeletonPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.cnf-side-foot {
  margin-top: auto;
  padding: 0.75rem 0.55rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cnf-side-foot .biz {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.cnf-side-foot .biz strong {
  color: var(--text);
  display: block;
}

.cnf-side-foot a {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.cnf-main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem 2rem;
}

.cnf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.cnf-app-footer {
  margin-top: 1.5rem;
  padding: 0.85rem 0 0.35rem;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(247, 244, 236, 0.55);
  border-top: 1px solid rgba(0, 163, 163, 0.18);
}

.cnf-gst-calc-launch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-left: auto;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 163, 163, 0.45);
  background: rgba(0, 163, 163, 0.14);
  color: #00c8c8;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.08), 0 0 14px rgba(0, 163, 163, 0.18);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.cnf-gst-calc-launch:hover,
.cnf-gst-calc-launch[aria-pressed='true'] {
  background: rgba(255, 215, 0, 0.16);
  border-color: rgba(255, 215, 0, 0.55);
  color: #ffd700;
}

.cnf-gst-calc-launch:active {
  transform: scale(0.96);
}

.cnf-gst-calc-launch svg {
  display: block;
}

#cnfTopActions {
  margin-left: 0;
}

.cnf-topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cnf-topbar p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.cnf-menu-btn {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  gap: 0.4rem;
}

.cnf-menu-ico {
  font-size: 1.1rem;
  line-height: 1;
}

.cnf-card {
  padding: 1.25rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
    var(--panel);
}

.cnf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.cnf-toolbar input,
.cnf-toolbar select {
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 160px;
}

.cnf-table-wrap {
  overflow-x: auto;
}

.cnf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.cnf-table th,
.cnf-table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.cnf-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cnf-table td.actions {
  white-space: nowrap;
}

.cnf-table button.linkish,
.cnf-table a.linkish {
  background: none;
  border: none;
  color: var(--teal-bright);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  text-decoration: none;
}

.cnf-table button.linkish.danger {
  color: var(--danger);
}

.cnf-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.cnf-badge.on {
  background: rgba(125, 206, 160, 0.18);
  color: var(--ok);
}

.cnf-badge.off {
  background: rgba(229, 115, 115, 0.15);
  color: var(--danger);
}

.cnf-badge.warn {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.cnf-empty {
  padding: 1.5rem 0.5rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.cnf-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.cnf-stat {
  padding: 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.cnf-stat span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cnf-stat strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
}

/* —— Home dashboard (Paaner-style) —— */
.cnf-dash-reminders {
  margin-bottom: 1.15rem;
}
.cnf-dash-reminder {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.14) 0%, rgba(220, 38, 38, 0.05) 100%);
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.cnf-dash-reminder-title {
  color: #fca5a5;
  font-family: var(--font-display, 'Trebuchet MS', sans-serif);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
}
.cnf-dash-reminder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cnf-dash-reminder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(8, 13, 14, 0.92);
  color: #fecaca;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cnf-dash-reminder-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25);
  color: #f7f4ec;
}
.cnf-dash-reminder-name {
  font-weight: 800;
  color: #f7f4ec;
}
.cnf-dash-reminder-meta {
  color: #fca5a5;
  font-weight: 600;
}
.cnf-dash-reminder-amt {
  color: #ffd700;
  font-weight: 800;
}

.cnf-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.cnf-dash-stat {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1rem 1.05rem 1.05rem 1.15rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 13, 14, 0.72);
  border-left-width: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cnf-dash-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.cnf-dash-stat--supplier {
  border-left-color: #00a3a3;
}
.cnf-dash-stat--buyer {
  border-left-color: #22c55e;
}
.cnf-dash-stat--product {
  border-left-color: #38bdf8;
}
.cnf-dash-stat--company {
  border-left-color: #ffd700;
}
.cnf-dash-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.cnf-dash-stat--supplier .cnf-dash-stat-label {
  color: #5eead4;
}
.cnf-dash-stat--buyer .cnf-dash-stat-label {
  color: #86efac;
}
.cnf-dash-stat--product .cnf-dash-stat-label {
  color: #7dd3fc;
}
.cnf-dash-stat--company .cnf-dash-stat-label {
  color: #ffe566;
}
.cnf-dash-stat-value {
  display: block;
  font-family: var(--font-display, 'Trebuchet MS', sans-serif);
  font-size: 1.55rem;
  font-weight: 800;
  color: #f7f4ec;
  line-height: 1.1;
}

.cnf-dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}
.cnf-dash-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 163, 163, 0.4);
  background: rgba(0, 132, 123, 0.16);
  color: #f7f4ec;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.cnf-dash-chip:hover {
  border-color: rgba(255, 215, 0, 0.55);
  color: #ffd700;
}

.cnf-dash-activity {
  padding: 0;
  overflow: hidden;
}
.cnf-dash-activity-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cnf-dash-activity-head h2 {
  margin: 0;
  font-family: var(--font-display, 'Trebuchet MS', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  color: #00c8c8;
}
.cnf-dash-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.cnf-dash-date input[type='date'] {
  width: 170px;
  min-width: 150px;
  color-scheme: dark;
  color: #f7f4ec;
  background: rgba(8, 13, 14, 0.92);
  border: 1px solid rgba(0, 163, 163, 0.45);
  border-radius: 0.45rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
}
.cnf-dash-date input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: none;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0.15rem;
  border-radius: 4px;
  background-color: rgba(255, 215, 0, 0.28);
}
.cnf-dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.85rem 1rem 0.35rem;
}
.cnf-dash-filter {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0.45rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  border: 1px solid rgba(0, 163, 163, 0.4);
  background: transparent;
  color: #99f6e4;
}
.cnf-dash-filter.is-active {
  background: rgba(0, 163, 163, 0.28);
  border-color: rgba(0, 200, 200, 0.65);
  color: #f7f4ec;
}
.cnf-dash-table {
  margin: 0;
}
.cnf-dash-totals-row th {
  background: linear-gradient(90deg, rgba(0, 163, 163, 0.28), rgba(255, 215, 0, 0.14)) !important;
  border-bottom: 1px solid rgba(0, 163, 163, 0.35) !important;
  vertical-align: bottom;
  padding-top: 0.55rem;
  padding-bottom: 0.45rem;
}
.cnf-dash-total-lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 244, 236, 0.72);
  margin-bottom: 0.15rem;
}
.cnf-dash-totals-row strong {
  font-size: 0.95rem;
  color: #ffd700;
}
.cnf-dash-totals-row strong.is-paid {
  color: #7dffb3;
}
.cnf-dash-row {
  cursor: pointer;
}
.cnf-dash-row:hover td {
  background: rgba(0, 163, 163, 0.08);
}
.cnf-dash-party-link {
  color: #5eead4;
  font-weight: 700;
  text-decoration: none;
}
.cnf-dash-party-link:hover {
  color: #ffd700;
}
.cnf-dash-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}
.cnf-dash-type[data-type='supplier'] {
  background: rgba(0, 163, 163, 0.25);
  color: #00c8c8;
}
.cnf-dash-type[data-type='buyer'] {
  background: rgba(255, 215, 0, 0.18);
  color: #ffd700;
}
.cnf-dash-actions-col {
  text-align: center;
  white-space: nowrap;
}
.cnf-dash-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(0, 163, 163, 0.45);
  background: rgba(0, 132, 123, 0.22);
  color: #f7f4ec;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}
.cnf-dash-open:hover {
  border-color: rgba(255, 215, 0, 0.55);
  color: #ffd700;
}

@media (max-width: 900px) {
  .cnf-dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .cnf-dash-stats {
    grid-template-columns: 1fr;
  }
  .cnf-dash-date input[type='date'] {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .cnf-app {
    display: block;
  }

  .cnf-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    margin-bottom: 0.45rem;
  }

  .cnf-nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 199;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .cnf-nav-scrim[hidden] {
    display: none !important;
  }

  .cnf-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 320px);
    max-width: min(88vw, 320px);
    height: 100%;
    height: 100dvh;
    z-index: 200;
    overflow: hidden;
    pointer-events: none;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .cnf-sidebar-panel {
    height: 100%;
    max-height: 100%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #12181f 0%, #0c1116 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
    transform: translate3d(-105%, 0, 0);
    -webkit-transform: translate3d(-105%, 0, 0);
    transition: transform 0.24s ease;
    pointer-events: auto;
  }

  .cnf-side-brand {
    flex: 0 0 auto;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
  }

  .cnf-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: scroll;
    touch-action: pan-y;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .cnf-app:not(.nav-open) .cnf-sidebar {
    pointer-events: none;
  }

  .cnf-app.nav-open .cnf-sidebar {
    pointer-events: auto;
  }

  .cnf-app.nav-open .cnf-sidebar-panel {
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }

  .cnf-main {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding-left: max(0.9rem, env(safe-area-inset-left));
    padding-right: max(0.9rem, env(safe-area-inset-right));
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
  }

  .cnf-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .cnf-form-grid {
    grid-template-columns: 1fr;
  }

  .cnf-main {
    padding: 1rem 0.9rem 1.75rem;
  }
}

/* ---------- Card grid + modals + long-press ---------- */

.cnf-search-bar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cnf-search-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.cnf-search-bar input:focus {
  outline: none;
  border-color: rgba(0, 168, 156, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 132, 123, 0.2);
}

.cnf-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 1rem 0 0.35rem;
}

.cnf-section-head .cnf-section-title {
  margin: 0;
}

.cnf-section-head .cnf-search-bar {
  flex: 1;
  min-width: min(100%, 240px);
  margin-bottom: 0;
}

.cnf-search-empty {
  margin: 0 0 0.65rem;
  color: #fbbf24;
}

.cnf-hint {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.cnf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 0.7rem;
  align-items: start;
}

/* Products — compact accordion cards */
.cnf-product-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 0.65rem;
  align-items: start;
}
.cnf-product-cards .cnf-product-card,
.cnf-product-cards .cnf-item-card {
  padding: 0;
  border-radius: 0.75rem;
  height: auto;
  align-self: start;
  overflow: hidden;
}
.cnf-product-cards .cnf-product-card.is-open {
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.28);
}
.cnf-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: #ecfeff;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.55) 0%, rgba(15, 118, 110, 0.38) 55%, rgba(15, 23, 42, 0.55) 100%);
  font: inherit;
}
.cnf-product-head:hover {
  filter: brightness(1.06);
}
.cnf-product-head-main {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}
.cnf-product-head-chevron {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.85rem;
  opacity: 0.85;
  transition: transform 0.15s ease;
}
.cnf-product-card.is-open .cnf-product-head-chevron {
  transform: rotate(90deg);
}
.cnf-product-head-title {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
  word-break: break-word;
}
.cnf-product-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}
.cnf-product-body {
  padding: 0.65rem 0.8rem 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.35);
}
.cnf-product-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}
.cnf-ph-cell {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
}
.cnf-ph-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.cnf-ph-cell strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}
.cnf-ph-stock {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
}
.cnf-ph-stock .cnf-ph-label {
  color: #7dd3fc;
}
.cnf-ph-purchase {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.12);
}
.cnf-ph-purchase .cnf-ph-label {
  color: #fcd34d;
}
.cnf-ph-sell {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.14);
}
.cnf-ph-sell .cnf-ph-label {
  color: #6ee7b7;
}
.cnf-ph-mrp {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(71, 85, 105, 0.22);
}
.cnf-ph-mrp .cnf-ph-label {
  color: #cbd5e1;
}
.cnf-product-body-actions {
  margin-top: 0.55rem;
  display: flex;
  justify-content: flex-end;
}
.cnf-product-cards .cnf-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.55rem;
  font-size: 0.76rem;
  line-height: 1.25;
}
.cnf-product-cards .cnf-meta div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.08rem;
}
.cnf-product-cards .cnf-meta b {
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.cnf-product-cards .cnf-meta span {
  text-align: left;
  font-weight: 600;
  color: #e2e8f0;
}
.cnf-product-cards .cnf-meta-hot {
  grid-column: span 1;
}
.cnf-product-alias {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  word-break: break-word;
}
.cnf-rate-chip {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  white-space: nowrap;
}

/* Small side toasts (non-blocking) */
.cnf-side-toast-stack {
  position: fixed;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 11600;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.45rem;
  width: min(280px, calc(100vw - 1.25rem));
  pointer-events: none;
}
.cnf-side-toast {
  position: relative;
  pointer-events: auto;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(235, 179, 40, 0.55);
  background: rgba(14, 20, 24, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  animation: cnfOrderFlashCard 0.35s ease-out;
}
.cnf-side-toast-kicker {
  margin: 0 0 0.1rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.cnf-side-toast-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}
.cnf-side-toast-body {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.cnf-side-toast-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
}
.cnf-side-toast-link {
  border: none;
  background: transparent;
  color: #2dd4bf;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.cnf-side-toast-dismiss {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.4rem;
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.cnf-side-toast-dismiss:hover {
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
}
.cnf-side-toast-sticky .cnf-side-toast-kicker,
.cnf-side-toast-sticky .cnf-side-toast-title {
  padding-right: 1.85rem;
}

.cnf-acc-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .cnf-acc-mini-grid {
    grid-template-columns: 1fr;
  }
}
.cnf-acc-mini-card {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(0, 168, 156, 0.28);
  background: linear-gradient(160deg, rgba(0, 132, 123, 0.14), rgba(12, 18, 22, 0.92));
}
.cnf-acc-mini-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.cnf-acc-mini-top h3 {
  margin: 0;
  font-size: 1rem;
}
.cnf-acc-mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.cnf-acc-mini-metrics .cnf-exp-kpi {
  padding: 0.45rem 0.5rem;
}
.cnf-acc-mini-metrics .cnf-exp-kpi strong {
  font-size: 0.95rem;
}
.cnf-acc-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}
.cnf-acc-detail-body .cnf-exp-kpis {
  margin-top: 0.25rem;
}

.cnf-card-mini {
  display: flex !important;
  flex-direction: column;
  gap: 0.55rem !important;
  padding: 0.75rem 0.9rem !important;
}
.cnf-card-mini .cnf-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}
.cnf-card-mini .cnf-buyer-card-title {
  flex: 1;
  min-width: 0;
}
.cnf-card-mini .cnf-buyer-card-title h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}
.cnf-card-sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cnf-buyer-avatar-sm {
  width: 40px !important;
  height: 40px !important;
  border-radius: 0.55rem;
}
.cnf-due-flash-mini {
  grid-column: auto !important;
  padding: 0.35rem 0.65rem !important;
  margin: 0 !important;
}
.cnf-due-flash-mini strong {
  font-size: 0.98rem !important;
}
.cnf-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

/* Suppliers list: full-width stacked cards — no empty side column */
/* Buyers list — full-width stacked cards */
.cnf-buyer-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cnf-buyer-cards .cnf-item-card:not(.cnf-card-mini) {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1.6fr);
  gap: 0.85rem 1.25rem;
  align-items: start;
}

.cnf-buyer-due-flash {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(252, 211, 77, 0.28);
  background: rgba(120, 53, 15, 0.35);
  margin: 0 0 0.15rem;
}
.cnf-buyer-due-flash span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fde68a;
}
.cnf-buyer-due-flash strong {
  font-size: 1.15rem;
  font-family: var(--font-display);
  color: #fef3c7;
  font-weight: 800;
}
.cnf-buyer-due-flash.has-due {
  border-color: rgba(248, 113, 113, 0.45);
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.55), rgba(120, 53, 15, 0.4));
  animation: cnfDuePulse 2.4s ease-in-out infinite;
}
.cnf-buyer-due-flash.has-due strong {
  color: #fecaca;
}
.cnf-buyer-due-flash-page {
  margin: 0 0 0.85rem;
  grid-column: auto;
}
@keyframes cnfDuePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.08);
  }
}

.cnf-pay-due-box {
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 18, 22, 0.92);
}
.cnf-pay-due-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
}
.cnf-pay-due-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.cnf-pay-due-kpis {
  margin: 0;
}
.cnf-exp-kpi-paid strong {
  color: #34d399;
}
.cnf-acc-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cnf-acc-expense-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.cnf-acc-expense-block {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}
.cnf-acc-expense-block h4 {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
}
.cnf-acc-chart-board {
  padding: 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(0, 168, 156, 0.28);
  background: linear-gradient(160deg, rgba(0, 132, 123, 0.18), rgba(12, 18, 22, 0.95));
}
.cnf-acc-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.cnf-acc-chart-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.cnf-chart-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.cnf-chart-legend .lg::before {
  content: '';
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.lg-sale::before {
  background: #34d399;
}
.lg-buy::before {
  background: #38bdf8;
}
.lg-exp::before {
  background: #fbbf24;
}
.cnf-acc-chart-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  min-height: 140px;
  margin-bottom: 0.85rem;
}
.cnf-acc-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 140px;
  justify-content: flex-end;
}
.cnf-acc-bar {
  width: 42%;
  min-width: 28px;
  max-width: 56px;
  height: 0;
  border-radius: 0.55rem 0.55rem 0.3rem 0.3rem;
  animation: cnfBarRise 0.85s ease forwards;
}
.cnf-acc-bar.sale {
  background: linear-gradient(180deg, #6ee7b7, #059669);
  height: var(--h, 8%);
}
.cnf-acc-bar.buy {
  background: linear-gradient(180deg, #7dd3fc, #0284c7);
  height: var(--h, 8%);
}
.cnf-acc-bar.exp {
  background: linear-gradient(180deg, #fde68a, #d97706);
  height: var(--h, 8%);
}
@keyframes cnfBarRise {
  from {
    transform: scaleY(0.08);
    transform-origin: bottom;
    opacity: 0.35;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
    opacity: 1;
  }
}
.cnf-acc-bar-col strong {
  font-size: 0.92rem;
}
.cnf-acc-bar-col span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cnf-acc-chart-svg-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem;
}
.cnf-acc-chart-svg {
  width: 100%;
  min-width: 280px;
  height: 140px;
  display: block;
}
.cnf-chart-line {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: cnfLineDraw 1.1s ease forwards;
}
@keyframes cnfLineDraw {
  to {
    stroke-dashoffset: 0;
  }
}
.cnf-acc-tx-table td {
  font-size: 0.86rem;
}
@media (max-width: 900px) {
  .cnf-acc-expense-split {
    grid-template-columns: 1fr;
  }
}

.cnf-buyer-cards .cnf-card-top {
  grid-column: 1;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0;
}

.cnf-buyer-cards .cnf-card-top h3 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}

.cnf-buyer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 0.65rem;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(16, 24, 28, 0.9);
  border: 1px solid rgba(0, 168, 156, 0.35);
}

.cnf-buyer-card-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.cnf-buyer-logo-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cnf-buyer-logo-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.cnf-buyer-logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cnf-buyer-cards .cnf-meta {
  grid-column: 2;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem 1rem;
}

.cnf-buyer-cards .cnf-meta div {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.cnf-buyer-cards .cnf-meta span {
  text-align: left;
  font-weight: 600;
}

.cnf-buyer-type {
  color: #99f6e4 !important;
}

.cnf-challan-modal {
  /* fit-content avoids browsers stretching the box to max-height when overflow is set */
  height: fit-content;
  max-height: min(90dvh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.cnf-modal-xl.cnf-challan-modal,
.cnf-modal.cnf-modal-xl {
  width: min(1180px, 98vw);
}

.cnf-challan-lines,
.cnf-line-list {
  max-height: min(52vh, 520px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.15rem 0.1rem 0.35rem;
  border: none;
  background: transparent;
}

.cnf-line-card {
  border: 1px solid rgba(0, 163, 163, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
    rgba(12, 18, 22, 0.96);
  padding: 0.85rem 0.95rem 1rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.cnf-line-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cnf-line-badge {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-bright);
}

.cnf-line-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  cursor: pointer;
}

.cnf-line-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--teal-bright);
}

.cnf-line-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0 0.15rem;
}

.cnf-inv-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin: 0.75rem 0 0.5rem;
}

.cnf-inv-footer label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(247, 244, 236, 0.78);
}

.cnf-inv-footer input[type='number'] {
  min-height: 2.45rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-family: var(--font);
  font-size: 0.95rem;
}

.cnf-form .cnf-line-list.span-3,
.cnf-form-3 .cnf-line-list.span-3 {
  grid-column: 1 / -1;
}

.cnf-line-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.65rem 0.75rem;
  align-items: end;
}

.cnf-lf {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  min-width: 0;
}

.cnf-lf > span {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 244, 236, 0.72);
}

.cnf-lf input,
.cnf-lf select {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  box-sizing: border-box;
  overflow: visible;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
}

/* Hide number spinners — they steal width and clip digits */
.cnf-lf input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.cnf-lf input[type='number']::-webkit-outer-spin-button,
.cnf-lf input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}

.cnf-lf input:focus,
.cnf-lf select:focus {
  outline: 2px solid rgba(0, 168, 156, 0.55);
  outline-offset: 1px;
  border-color: var(--teal-bright);
}

.cnf-lf input[readonly] {
  background: #e8eef0;
  color: #333;
}

.cnf-lf-product {
  grid-column: 1 / span 2;
}

.cnf-lf-result {
  min-width: 8.75rem;
}

.cnf-lf-result input {
  font-weight: 700;
  background: #dff5f2;
  border-color: rgba(0, 132, 123, 0.35);
  min-width: 8.75rem;
}

.cnf-lf-wide {
  min-width: 9.75rem;
}

.cnf-lf-wide input {
  min-width: 9.75rem;
}

.cnf-lf-batch {
  min-width: 8.25rem;
}

@media (max-width: 900px) {
  .cnf-line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cnf-lf-product {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .cnf-line-grid {
    grid-template-columns: 1fr;
  }
}

/* Purchase line — fixed 12-col grid so boxes align and money fields never clip */
.cnf-purchase-line-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.7rem 0.65rem;
  align-items: end;
}
.cnf-purchase-line-grid .cnf-lf {
  min-width: 0;
  width: auto;
  max-width: none;
}
.cnf-purchase-line-grid .cnf-lf > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cnf-purchase-line-grid .cnf-lf input,
.cnf-purchase-line-grid .cnf-lf select {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 2.7rem;
  padding: 0.5rem 0.55rem;
  overflow: visible;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}
.cnf-purchase-line-grid .cnf-lf-product {
  grid-column: span 4;
}
.cnf-product-pick-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}
.cnf-product-pick-row .pproduct {
  flex: 1 1 auto;
  min-width: 0;
}
.cnf-product-pick-row .padd-product {
  flex: 0 0 auto;
  min-width: 2.6rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}
.cnf-purchase-line-grid .cnf-lf-hsn {
  grid-column: span 2;
}
.cnf-purchase-line-grid .cnf-lf-sm {
  grid-column: span 1;
}
.cnf-purchase-line-grid .cnf-lf-batch,
.cnf-purchase-line-grid .cnf-lf-money,
.cnf-purchase-line-grid .cnf-lf-result,
.cnf-purchase-line-grid .cnf-lf-pct {
  grid-column: span 2;
}
.cnf-purchase-line-grid .cnf-lf-total {
  grid-column: span 4;
}
.cnf-purchase-line-grid .cnf-lf-result input,
.cnf-purchase-line-grid .cnf-lf-total input {
  font-weight: 700;
  background: #dff5f2;
  border-color: rgba(0, 132, 123, 0.35);
  font-size: 0.9rem;
}
@media (max-width: 900px) {
  .cnf-purchase-line-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .cnf-purchase-line-grid .cnf-lf-product {
    grid-column: span 6;
  }
  .cnf-purchase-line-grid .cnf-lf-hsn,
  .cnf-purchase-line-grid .cnf-lf-batch,
  .cnf-purchase-line-grid .cnf-lf-money,
  .cnf-purchase-line-grid .cnf-lf-result,
  .cnf-purchase-line-grid .cnf-lf-pct {
    grid-column: span 2;
  }
  .cnf-purchase-line-grid .cnf-lf-sm {
    grid-column: span 1;
  }
  .cnf-purchase-line-grid .cnf-lf-total {
    grid-column: span 2;
  }
}
@media (max-width: 560px) {
  .cnf-purchase-line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cnf-purchase-line-grid .cnf-lf-product,
  .cnf-purchase-line-grid .cnf-lf-hsn,
  .cnf-purchase-line-grid .cnf-lf-batch,
  .cnf-purchase-line-grid .cnf-lf-money,
  .cnf-purchase-line-grid .cnf-lf-result,
  .cnf-purchase-line-grid .cnf-lf-sm,
  .cnf-purchase-line-grid .cnf-lf-total {
    grid-column: span 2;
  }
}

/* legacy table lines (supplier / other) keep old sizing */
.cnf-challan-lines .cnf-table input,
.cnf-challan-lines .cnf-table select {
  width: 100%;
  min-width: 0;
  font-size: 0.9rem;
  min-height: 2.2rem;
}

.cnf-buyer-overview {
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .cnf-buyer-cards .cnf-item-card {
    grid-template-columns: 1fr;
  }
  .cnf-buyer-cards .cnf-meta {
    grid-column: 1;
  }
}

.cnf-supplier-cards .cnf-item-card.cnf-card-mini {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
}

.cnf-supplier-cards .cnf-item-card.cnf-card-mini .cnf-card-top,
.cnf-supplier-cards .cnf-item-card.cnf-card-mini .cnf-card-actions,
.cnf-supplier-cards .cnf-item-card.cnf-card-mini .cnf-buyer-due-flash {
  grid-column: auto !important;
}

.cnf-supplier-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cnf-supplier-cards .cnf-item-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(0, 1.6fr);
  gap: 0.85rem 1.25rem;
  align-items: start;
}

.cnf-supplier-cards .cnf-card-top {
  grid-column: 1;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}

.cnf-supplier-cards .cnf-card-top h3 {
  font-size: 1.12rem;
  margin-bottom: 0.35rem;
}

.cnf-supplier-cards .cnf-meta {
  grid-column: 2;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.45rem 1rem;
}

.cnf-supplier-cards .cnf-meta div {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.cnf-supplier-cards .cnf-meta span {
  text-align: left;
  font-weight: 600;
}

@media (max-width: 720px) {
  .cnf-supplier-cards .cnf-item-card {
    grid-template-columns: 1fr;
  }
  .cnf-supplier-cards .cnf-meta {
    grid-column: 1;
  }
}

.cnf-item-card {
  padding: 1rem 1.05rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
    rgba(12, 18, 22, 0.92);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cnf-item-card:active,
.cnf-item-card.pressing {
  transform: scale(0.985);
  border-color: rgba(0, 168, 156, 0.55);
}

.cnf-item-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cnf-item-card .cnf-meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.cnf-item-card .cnf-meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.cnf-item-card .cnf-meta b {
  color: rgba(247, 244, 236, 0.55);
  font-weight: 600;
  flex-shrink: 0;
}

.cnf-item-card .cnf-meta span {
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

.cnf-item-card .cnf-meta-due span {
  color: #fcd34d;
  font-weight: 800;
}

.cnf-item-card .cnf-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.cnf-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cnf-overlay.center {
  align-items: flex-start;
  justify-content: center;
  padding-top: max(0.75rem, 2vh);
  padding-bottom: max(0.75rem, 2vh);
}

.cnf-overlay.center > .cnf-modal,
.cnf-overlay.center > .cnf-sheet {
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
}

/* Nested dialogs above bill import (bill overlay is z-index 60) */
.cnf-overlay.cnf-overlay-top {
  z-index: 90;
}

.cnf-overlay.anchored {
  align-items: flex-start;
  justify-content: flex-start;
  background: rgba(0, 0, 0, 0.28);
  padding: 0;
  pointer-events: auto;
}

.cnf-sheet,
.cnf-modal {
  box-sizing: border-box;
  width: min(480px, calc(100vw - 2rem));
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #121a1e;
  padding: 1.15rem 1.1rem 1.2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 2rem);
  height: fit-content;
  max-height: min(90dvh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cnf-sheet.cnf-sheet-anchored {
  position: fixed;
  width: min(300px, calc(100vw - 1.5rem));
  margin: 0;
  z-index: 95;
  animation: cnfSheetPop 0.16s ease-out;
  max-height: min(70dvh, 420px);
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 163, 163, 0.25);
}

@keyframes cnfSheetPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cnf-modal-wide {
  width: min(720px, calc(100vw - 2rem));
}

.cnf-modal-xl {
  width: min(1100px, calc(100vw - 2rem));
}

.cnf-sheet h2,
.cnf-modal h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.cnf-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cnf-sheet-actions button {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.cnf-sheet-actions button.danger {
  color: var(--danger);
  border-color: rgba(229, 115, 115, 0.35);
}

.cnf-sheet-actions button.cancel {
  margin-top: 0.25rem;
  text-align: center;
  color: var(--muted);
}

.cnf-modal .cnf-form {
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.cnf-modal-wide .cnf-form,
.cnf-modal-xl .cnf-form,
.cnf-modal .cnf-sr-form {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.cnf-modal-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.cnf-modal-actions .cnf-btn {
  flex: 1;
  margin-top: 0;
}

.cnf-form-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.cnf-form-3 label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.cnf-form-3 label.span-2 {
  grid-column: span 2;
}

.cnf-form-3 .span-3,
.cnf-form-3 label.span-3,
.cnf-form-3 .cnf-line-tools,
.cnf-form-3 .cnf-table-scroll,
.cnf-form-3 .cnf-totals,
.cnf-form-3 .cnf-check-row,
.cnf-form-3 .cnf-modal-actions {
  grid-column: 1 / -1;
}

.cnf-form-3 .cnf-modal-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.cnf-form-grid > *,
.cnf-form-3 > * {
  min-width: 0;
}

.cnf-form input,
.cnf-form-grid input,
.cnf-form select,
.cnf-form-grid select,
.cnf-form textarea,
.cnf-form-grid textarea,
.cnf-form-3 input,
.cnf-form-3 select,
.cnf-form-3 textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.cnf-form select,
.cnf-form-grid select,
.cnf-form-3 select {
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sales Return: readable fields + visible selected values */
.cnf-sr-form {
  gap: 0.75rem 0.85rem;
}
.cnf-sr-form label {
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(247, 244, 236, 0.82);
}
.cnf-sr-form select,
.cnf-sr-form input,
.cnf-sr-form textarea,
.cnf-sr-form .cnf-sr-select {
  color-scheme: light !important;
  appearance: auto;
  -webkit-appearance: menulist;
  min-height: 2.65rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
  caret-color: #111111;
  border: 1px solid rgba(15, 23, 42, 0.22) !important;
  border-radius: 0.55rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.cnf-sr-form select option {
  color: #111111;
  background: #ffffff;
}
.cnf-sr-form textarea {
  min-height: 4.25rem;
  resize: vertical;
  font-weight: 500;
}
.cnf-sr-form .cnf-modal-actions {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
}
.cnf-sr-picked {
  margin: -0.35rem 0 0.15rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(13, 148, 136, 0.16);
  color: #99f6e4;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.cnf-sr-summary {
  margin: 0.15rem 0 0;
  padding: 0.65rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(0, 168, 156, 0.35);
  background: rgba(0, 168, 156, 0.12);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
}
.cnf-sr-summary strong,
.cnf-sr-summary b {
  color: #fbbf24;
}
.cnf-sr-form .cnf-sr-packhint input {
  font-weight: 600;
}

.cnf-icon-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--teal-bright);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.cnf-icon-btn:hover {
  border-color: rgba(0, 168, 156, 0.55);
  background: rgba(0, 168, 156, 0.12);
}

.cnf-item-card.compact {
  padding: 0.85rem 0.95rem;
}

.cnf-item-card.compact .cnf-meta {
  gap: 0.25rem;
}

.cnf-item-card.compact h3 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.cnf-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cnf-btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cnf-hidden-cell {
  width: 0;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
}

.cnf-section-title {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cnf-purchase-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.cnf-purchase-lines th,
.cnf-purchase-lines td {
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.cnf-purchase-lines th {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.cnf-purchase-lines input,
.cnf-purchase-lines select {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
}

.cnf-purchase-lines .col-chk {
  width: 2rem;
}

.cnf-line-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-start;
  margin: 0.65rem 0 0.35rem;
}

/* Text action buttons — do NOT force icon-square size (was overlapping Add/Remove) */
.cnf-line-tools .cnf-btn {
  width: auto;
  height: auto;
  min-height: 2.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Legacy icon-only +/− buttons (if any remain without .cnf-btn) */
.cnf-line-tools > button:not(.cnf-btn) {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  border: none;
  background: linear-gradient(180deg, var(--teal-bright), var(--teal));
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

.cnf-check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.cnf-totals {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.86rem;
  display: grid;
  gap: 0.3rem;
}

.cnf-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.cnf-totals strong {
  color: var(--text);
}

.cnf-bill-footer {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.cnf-footer-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
}

.cnf-footer-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cnf-footer-fields input,
.cnf-footer-fields select {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  padding: 0.5rem 0.55rem;
  min-height: 2.35rem;
}

.cnf-totals-bill .cnf-final-balance {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(45, 212, 191, 0.35);
  color: #99f6e4;
}

.cnf-totals-bill .cnf-final-balance strong {
  color: #5eead4;
  font-size: 1.05rem;
}

.cnf-modal-xl {
  width: min(1100px, 100%);
}

.cnf-supplier-block {
  margin-bottom: 1.15rem;
}

.cnf-under-purchases {
  margin: 0.45rem 0 0 0.85rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(0, 168, 156, 0.35);
  display: grid;
  gap: 0.55rem;
}

.cnf-purchase-lines.cnf-bill-lines th,
.cnf-purchase-lines.cnf-bill-lines td {
  font-size: 0.72rem;
  padding: 0.28rem 0.22rem;
}

.cnf-purchase-lines.cnf-bill-lines input,
.cnf-purchase-lines.cnf-bill-lines select {
  font-size: 0.72rem;
  padding: 0.32rem 0.3rem;
  min-width: 3.2rem;
}

.cnf-purchase-lines.cnf-bill-lines td:nth-child(2) select {
  min-width: 8rem;
}

.cnf-form-3 input,
.cnf-form-3 select,
.cnf-form-3 textarea {
  padding: 0.65rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}

/* Product line cards: keep Rate/Qty/etc readable (light box + dark digits) */
.cnf-form-3 .cnf-lf input,
.cnf-form-3 .cnf-lf select,
.cnf-form .cnf-lf input,
.cnf-form .cnf-lf select {
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  -webkit-text-fill-color: #111;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 500;
}

.cnf-form-3 .cnf-lf input[readonly],
.cnf-form .cnf-lf input[readonly],
.cnf-form-3 .cnf-lf-result input,
.cnf-form .cnf-lf-result input {
  background: #e8eef0;
  color: #222;
  -webkit-text-fill-color: #222;
  font-weight: 700;
}

.cnf-form-3 .cnf-lf-result input,
.cnf-form .cnf-lf-result input {
  background: #dff5f2;
  border-color: rgba(0, 132, 123, 0.35);
}

.cnf-combo {
  position: relative;
}

.cnf-combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #101820;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.cnf-combo-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.cnf-combo-list button:hover,
.cnf-combo-list button.active {
  background: rgba(0, 168, 156, 0.18);
}

.cnf-req {
  color: var(--danger);
}

@media (max-width: 720px) {
  .cnf-form-3 {
    grid-template-columns: 1fr;
  }

  .cnf-form-3 label.span-2 {
    grid-column: auto;
  }

  .cnf-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .cnf-topbar > div:first-child {
    width: 100%;
  }

  .cnf-topbar h1 {
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .cnf-top-actions {
    justify-content: stretch;
    width: 100%;
  }

  .cnf-top-actions .cnf-btn,
  .cnf-top-actions a.cnf-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .cnf-search-bar input[type="search"] {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  .cnf-exp-sheet {
    min-width: 560px;
    font-size: 0.82rem;
  }

  .cnf-table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 900px) {
  .cnf-form-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .cnf-form-3 {
    grid-template-columns: 1fr;
  }

  .cnf-form-3 label.span-2 {
    grid-column: auto;
  }
}


.cnf-item-card.cnf-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cnf-item-card.cnf-clickable:hover {
  border-color: rgba(45, 212, 191, 0.45);
}

.cnf-item-card.cnf-clickable:active {
  transform: scale(0.995);
}

.cnf-supplier-banner {
  margin-bottom: 0.85rem;
}

.cnf-date-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.cnf-date-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 5.5rem;
}

.cnf-date-filters label.cnf-filter-search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.cnf-date-filters select,
.cnf-date-filters input {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  padding: 0.5rem 0.55rem;
  min-height: 2.35rem;
}

.cnf-report-box {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.cnf-grand-total-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem 1rem;
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(
    90deg,
    rgba(13, 148, 136, 0.22) 0%,
    rgba(15, 23, 42, 0.55) 55%,
    rgba(45, 212, 191, 0.12) 100%
  );
}

.cnf-gt-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 7.5rem;
  margin-right: 0.25rem;
}

.cnf-gt-label strong {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #99f6e4;
  text-transform: uppercase;
}

.cnf-gt-period {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.12rem;
}

.cnf-gt-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 5.5rem;
}

.cnf-gt-stat span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cnf-gt-stat strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.cnf-gt-final strong {
  color: #5eead4;
  font-size: 1.02rem;
}

.cnf-gt-due strong {
  color: #fcd34d;
}

.cnf-settle-reminder-wrap {
  margin: 0 0 0.85rem;
}

.cnf-settle-reminder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
}

.cnf-settle-reminder-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fcd34d;
  text-transform: uppercase;
}

.cnf-settle-reminder-meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.cnf-settle-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cnf-stl-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: rgba(13, 148, 136, 0.12);
}

.cnf-stl-summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 6rem;
}

.cnf-stl-summary span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cnf-stl-summary strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: #99f6e4;
}

.cnf-row-tag {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #5eead4;
}

.cnf-row-tag-muted {
  color: var(--muted);
}

.cnf-payment-row {
  background: rgba(45, 212, 191, 0.06);
}

.cnf-settlement-row {
  background: rgba(251, 191, 36, 0.08);
}

.cnf-period-closed {
  opacity: 0.72;
}

@media (max-width: 640px) {
  .cnf-grand-total-bar {
    gap: 0.65rem 0.85rem;
  }

  .cnf-gt-stat {
    min-width: calc(50% - 0.5rem);
  }
}

.cnf-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: end;
}

.cnf-report-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cnf-acc-party-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.cnf-acc-search {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  min-width: 10rem;
}

.cnf-acc-search input {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(8, 13, 14, 0.35);
  color: #f7f4ec;
}

.cnf-mode-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: transparent;
  color: #99f6e4;
  cursor: pointer;
}

.cnf-mode-btn.active {
  background: linear-gradient(145deg, var(--teal-bright, #00c8c8), var(--teal, #00a3a3));
  border-color: rgba(0, 200, 200, 0.65);
  color: #061210;
  box-shadow: var(--hh-neon-teal), 0 0 0 1px rgba(255, 215, 0, 0.2);
}

.cnf-report-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.cnf-report-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cnf-report-inputs input,
.cnf-report-inputs select {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
  min-height: 2.3rem;
}

.cnf-date-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cnf-date-input {
  flex: 1 1 auto;
  min-width: 9.5rem;
  color-scheme: dark;
  cursor: pointer;
}

.cnf-cal-btn {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(13, 148, 136, 0.25);
  color: #99f6e4;
  cursor: pointer;
  min-height: 2.3rem;
}

.cnf-cal-btn:hover {
  background: rgba(13, 148, 136, 0.45);
}

.cnf-eway-iframe-wrap {
  position: relative;
  width: 100%;
  min-height: 62vh;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #0b1220;
}

.cnf-eway-iframe {
  width: 100%;
  height: 62vh;
  border: 0;
  background: #fff;
}

.cnf-eway-iframe-note {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  opacity: 0.85;
}

.cnf-eway-portal-panel {
  margin-top: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background:
    linear-gradient(155deg, rgba(13, 148, 136, 0.18) 0%, transparent 55%),
    rgba(12, 18, 22, 0.95);
}

.cnf-eway-portal-title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: #99f6e4;
}

.cnf-eway-portal-steps {
  margin: 0 0 0.75rem 1.1rem;
  padding: 0;
  line-height: 1.55;
}

.cnf-eway-portal-steps li {
  margin: 0.25rem 0;
}

.cnf-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.cnf-action-sheet-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.85rem;
}

.cnf-buyer-overview {
  margin: 0 0 0.85rem;
}

.cnf-buyer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cnf-buyer-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cnf-buyer-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.cnf-topbar p .cnf-buyer-head-meta {
  margin-top: 0;
}

.cnf-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #99f6e4;
  cursor: pointer;
}

.cnf-icon-btn:hover,
.cnf-icon-btn.is-open {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(13, 148, 136, 0.22);
}

.cnf-buyer-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  opacity: 0.92;
}

.cnf-buyer-head-meta b {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  margin-right: 0.25rem;
}

.cnf-buyer-details-panel {
  margin-top: 0.75rem;
  display: none;
}

.cnf-buyer-details-panel.is-open {
  display: grid;
}

.cnf-buyer-details-panel[hidden] {
  display: none !important;
}

.cnf-detail-meta {
  margin: 0.75rem 0 0.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: rgba(13, 148, 136, 0.08);
}

.cnf-buyer-profile-grid {
  margin: 0;
}

.cnf-buyer-profile-grid b {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.cnf-txn-row {
  cursor: pointer;
}

.cnf-txn-row:hover td {
  background: rgba(45, 212, 191, 0.06);
}

.cnf-detail-meta {
  margin: 0.75rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
    rgba(12, 18, 22, 0.9);
}

/* Must come after .cnf-detail-meta so the grid does not force details open */
.cnf-detail-meta.cnf-buyer-details-panel {
  display: none !important;
  margin-top: 0.75rem;
}

.cnf-detail-meta.cnf-buyer-details-panel.is-open {
  display: grid !important;
}

.cnf-detail-meta > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cnf-detail-meta b {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 244, 236, 0.5);
}

.cnf-detail-meta span {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
  word-break: break-word;
}

.cnf-detail-meta .cnf-meta-due span,
.cnf-detail-meta .cnf-detail-due span {
  color: #fcd34d;
  font-weight: 800;
}

.cnf-detail-modal h2 {
  margin-bottom: 0.35rem;
}

.cnf-detail-modal .cnf-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Slim grand-total summary card */
.cnf-grand-total-bar.cnf-gt-slim {
  gap: 0.75rem 1.4rem;
}

.cnf-grand-total-bar.cnf-gt-slim .cnf-gt-stat {
  min-width: 4.5rem;
}

.danger-outline {
  border-color: rgba(248, 113, 113, 0.55) !important;
  color: #fca5a5 !important;
}

.cnf-range-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: end;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
}

.cnf-range-group em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.15rem;
  padding-bottom: 0.55rem;
}

.cnf-txn-table tfoot td {
  border-bottom: none;
  padding-top: 0.85rem;
  color: var(--muted);
}

.cnf-txn-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.phsn-search,
.cnf-type-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0.15rem 0 0.35rem;
}
.cnf-type-seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.cnf-type-seg label:has(input:checked) {
  border-color: rgba(0, 168, 156, 0.7);
  background: rgba(0, 168, 156, 0.18);
  color: #fff;
}
.cnf-type-seg input {
  accent-color: var(--teal-bright);
}
.cnf-flow-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.65rem;
  line-height: 1.35;
}
.cnf-hsn-field {
  cursor: pointer;
}

.cnf-hsn-overlay .cnf-hsn-card {
  width: min(520px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  margin: auto 0 0;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: 0.85rem 0.85rem 0 0;
  background: #1a1f2a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.cnf-hsn-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cnf-hsn-card-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.cnf-hsn-search-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.cnf-hsn-search {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(45, 212, 191, 0.45);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  min-height: 2.5rem;
}

.cnf-hsn-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 0.75rem;
}

.cnf-hsn-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem 0.65rem;
  align-items: center;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
}

.cnf-hsn-option:hover {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(13, 148, 136, 0.15);
}

.cnf-hsn-option strong {
  font-size: 0.9rem;
  color: #99f6e4;
}

.cnf-hsn-option span {
  font-size: 0.8rem;
  color: var(--muted);
}

.cnf-hsn-option em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fcd34d;
}

.cnf-hsn-selected {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(13, 148, 136, 0.12);
}

.cnf-hsn-sel-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
}

.cnf-hsn-sel-row b {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (min-width: 720px) {
  .cnf-hsn-overlay {
    align-items: center;
  }

  .cnf-hsn-overlay .cnf-hsn-card {
    border-radius: 0.85rem;
    margin: 0;
  }
}

.cnf-top-actions a.cnf-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Supplier account + bill import — HisabHub dark teal/gold contrast */
.cnf-account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.85rem;
}
.cnf-sum-card {
  background:
    linear-gradient(155deg, rgba(0, 168, 156, 0.12) 0%, transparent 55%),
    rgba(16, 24, 28, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  color: var(--text);
}
.cnf-sum-card span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 0.28rem;
}
.cnf-sum-card strong {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}
.cnf-sum-due {
  border-color: rgba(235, 179, 40, 0.55);
  background:
    linear-gradient(155deg, rgba(235, 179, 40, 0.16) 0%, transparent 55%),
    rgba(22, 20, 12, 0.96);
}
.cnf-sum-due span {
  color: rgba(255, 220, 120, 0.85);
}
.cnf-sum-due strong {
  color: var(--gold);
}
.cnf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}
.cnf-tab {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.cnf-tab:hover {
  border-color: rgba(0, 168, 156, 0.55);
  color: #fff;
}
.cnf-tab.active {
  background: linear-gradient(145deg, var(--teal-bright), var(--teal));
  color: #061210;
  border-color: transparent;
  font-weight: 700;
  box-shadow: var(--hh-neon-teal), 0 0 0 1px rgba(255, 215, 0, 0.18);
}
.cnf-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 720px) {
  .cnf-overview-grid { grid-template-columns: 1fr; }
}
.cnf-overview-grid > div {
  background: rgba(16, 24, 28, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
.cnf-overview-grid h4 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--teal-bright);
  font-weight: 700;
  font-family: var(--font-display);
}
.cnf-overview-grid p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  font-family: var(--font);
}
.cnf-bill-overlay {
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 60;
}
.cnf-bill-overlay .cnf-bill-card {
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
    #121a1e;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  color: var(--text);
}
.cnf-bill-overlay .cnf-bill-card.cnf-bill-card--review {
  width: min(1180px, 98vw);
}
.cnf-bill-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.cnf-bill-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.cnf-bill-head .cnf-hint,
.cnf-bill-card > .cnf-hint,
.cnf-bill-step .cnf-hint {
  color: var(--muted) !important;
}
.cnf-bill-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 2px dashed rgba(0, 168, 156, 0.45);
  border-radius: 12px;
  cursor: pointer;
  background: rgba(0, 168, 156, 0.08);
  color: var(--text);
  font-weight: 600;
}
.cnf-bill-drop span {
  color: var(--text);
}
.cnf-bill-drop:hover {
  border-color: var(--teal-bright);
  background: rgba(0, 168, 156, 0.14);
}
.cnf-bill-drop input { display: none; }

.cnf-bill-scanner {
  margin-top: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background:
    linear-gradient(160deg, rgba(0, 132, 123, 0.14) 0%, transparent 55%),
    rgba(10, 16, 20, 0.95);
}

.cnf-bill-scanner-frame {
  position: relative;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      rgba(45, 212, 191, 0.06) 11px,
      rgba(45, 212, 191, 0.06) 12px
    ),
    #0a1216;
}

.cnf-bill-scanner-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2dd4bf, #fbbf24, #2dd4bf, transparent);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.85);
  animation: cnfScanBeam 1.6s ease-in-out infinite;
}

@keyframes cnfScanBeam {
  0% { top: 8%; opacity: 0.55; }
  50% { top: 88%; opacity: 1; }
  100% { top: 8%; opacity: 0.55; }
}

.cnf-bill-scanner-label {
  margin: 0.7rem 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #99f6e4;
}

.cnf-bill-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cnf-bill-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d9488, #2dd4bf, #fbbf24);
  transition: width 0.35s ease;
}

.cnf-bill-progress-pct {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.cnf-pack-modal .cnf-pack-list,
.cnf-pack-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(52vh, 420px);
  overflow: auto;
  margin: 0.75rem 0 1rem;
}

.cnf-pack-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) minmax(100px, 0.8fr);
  gap: 0.55rem 0.75rem;
  align-items: end;
  padding: 0.7rem 0.8rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 18, 22, 0.9);
}

.cnf-pack-name {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cnf-pack-name small {
  color: var(--muted);
  font-size: 0.75rem;
}

.cnf-pack-preview {
  font-size: 0.82rem;
  font-weight: 700;
  color: #99f6e4;
  padding-bottom: 0.45rem;
}

.cnf-pay-modal .cnf-hint {
  margin-bottom: 0.85rem;
}
.cnf-pay-modal .cnf-input-invalid,
.cnf-pay-modal input.cnf-input-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28);
  background: rgba(254, 226, 226, 0.95);
}
.cnf-pay-modal #payStatus {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 720px) {
  .cnf-pack-row {
    grid-template-columns: 1fr 1fr;
  }
  .cnf-pack-name {
    grid-column: 1 / -1;
  }
  .cnf-pack-preview {
    grid-column: 1 / -1;
  }
}

.cnf-bill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
  margin: 0.65rem 0;
}
.cnf-bill-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  padding: 0.45rem 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.cnf-bill-grid input,
.cnf-bill-lines input {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  width: 100%;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}
.cnf-bill-grid input:focus,
.cnf-bill-lines input:focus {
  outline: none;
  border-color: rgba(0, 168, 156, 0.7);
  box-shadow: 0 0 0 2px rgba(0, 168, 156, 0.2);
}
.cnf-bill-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 168, 156, 0.35);
  background: rgba(0, 168, 156, 0.1);
  color: var(--text);
  font-size: 0.9rem;
}
.cnf-bill-summary b {
  color: var(--gold);
  font-weight: 700;
  margin-right: 0.25rem;
}
.cnf-bill-smart {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.75rem 0 0.35rem;
}
.cnf-bill-smart .cnf-check {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.35;
}
.cnf-bill-smart .cnf-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.cnf-bill-smart .cnf-check small {
  color: var(--gold);
  font-weight: 600;
}
.cnf-bill-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 0.15rem 0.2rem 0.35rem;
  border: none;
  border-radius: 0;
  background: transparent;
}
.cnf-bill-line {
  margin: 0;
}
.cnf-bill-line-new {
  border-color: rgba(229, 115, 115, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(229, 115, 115, 0.18);
}
.cnf-bill-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cnf-bill-tag-new {
  color: #fecaca;
  background: rgba(229, 115, 115, 0.22);
  border: 1px solid rgba(229, 115, 115, 0.4);
}
.cnf-bill-tag-ok {
  color: #bbf7d0;
  background: rgba(125, 206, 160, 0.16);
  border: 1px solid rgba(125, 206, 160, 0.35);
  max-width: min(280px, 55vw);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cnf-bill-line-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.75rem 0.9rem;
  align-items: flex-end;
  grid-template-columns: none;
}
.cnf-bill-line-grid .cnf-lf {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
}
.cnf-bill-line-grid .cnf-lf-product {
  flex: 1 1 220px;
  min-width: min(200px, 100%);
}
.cnf-bill-line-grid .cnf-lf > span {
  white-space: nowrap;
}
.cnf-bill-lines .cnf-lf input,
.cnf-bill-lines .cnf-lf select {
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.16);
  min-height: 2.7rem;
  padding: 0.55rem 0.7rem;
  line-height: 1.4;
  overflow: visible;
  text-overflow: clip;
  box-shadow: none;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}
.cnf-bill-lines .cnf-lf input:focus,
.cnf-bill-lines .cnf-lf select:focus {
  outline: 2px solid rgba(0, 168, 156, 0.55);
  outline-offset: 1px;
  border-color: var(--teal-bright);
  box-shadow: none;
}
.cnf-bill-lines .cnf-lf-result input {
  font-weight: 700;
  background: #dff5f2;
  border-color: rgba(0, 132, 123, 0.35);
  font-size: 0.92rem;
}
.cnf-bill-lines input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.cnf-bill-lines input[type='number']::-webkit-outer-spin-button,
.cnf-bill-lines input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}
.cnf-ocr-ok {
  background: rgba(125, 206, 160, 0.14) !important;
  border-color: rgba(125, 206, 160, 0.35) !important;
  color: var(--text) !important;
}
.cnf-ocr-ok small { color: var(--ok) !important; }
.cnf-ocr-warn {
  background: rgba(235, 179, 40, 0.14) !important;
  border-color: rgba(235, 179, 40, 0.4) !important;
  color: var(--text) !important;
}
.cnf-ocr-warn small { color: var(--gold) !important; }
.cnf-ocr-bad {
  background: rgba(229, 115, 115, 0.14) !important;
  border-color: rgba(229, 115, 115, 0.4) !important;
  color: var(--text) !important;
}
.cnf-ocr-bad small { color: var(--danger) !important; }
.cnf-bill-warn {
  background: rgba(235, 179, 40, 0.12);
  border: 1px solid rgba(235, 179, 40, 0.45);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  color: var(--text);
}
.cnf-bill-warn b,
.cnf-bill-warn ul,
.cnf-bill-warn li {
  color: var(--text);
}
.cnf-bill-warn ul { margin: 0; padding-left: 1.1rem; }
.cnf-bill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
  position: sticky;
  bottom: 0;
  padding-top: 0.65rem;
  background: linear-gradient(180deg, transparent, #121a1e 35%);
}
.cnf-stmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.cnf-stmt-actions[hidden] {
  display: none !important;
}
.cnf-bill-list { padding-left: 1.1rem; color: var(--text); }
.cnf-bill-list a { color: var(--teal-bright); }
.cnf-bill-table tbody tr.cnf-bill-row {
  cursor: pointer;
}
.cnf-bill-table tbody tr.cnf-bill-row:hover td {
  background: rgba(20, 184, 166, 0.08);
}
.cnf-top-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
#cnfTopActions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
}
.cnf-top-actions .cnf-btn-ghost {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
}
.cnf-top-actions .cnf-btn-ghost:hover {
  border-color: var(--teal-bright);
  color: #fff;
}
.cnf-tab-panel,
#tabOverview,
#tabAccountExtra {
  color: var(--text);
}
.cnf-section-title {
  color: var(--text);
}

/* Display font: titles, nameplates, important lines */
h1,
h2,
h3,
h4,
.cnf-brand,
.cnf-brand-text strong,
.cnf-brand-owner,
.cnf-panel h1,
.cnf-topbar h1,
.cnf-item-card h3,
.cnf-item-card.compact h3,
.cnf-supplier-cards .cnf-card-top h3,
.cnf-sheet h2,
.cnf-modal h2,
.cnf-detail-modal h2,
.cnf-hsn-card-head h3,
.cnf-bill-head h3,
.cnf-section-title,
.cnf-buyer-name,
.cnf-party-name,
.cnf-nameplate,
.cnf-stat-value,
.cnf-total-value,
.cnf-amount-strong,
.cnf-btn,
.cnf-btn-primary,
.cnf-btn-ghost,
.cnf-back {
  font-family: var(--font-display);
}

/* Missing sale / MRP rates */
.cnf-item-card-warn {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.18);
}

.cnf-price-alert {
  margin: 0 0 0.45rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.cnf-meta-missing {
  color: #f87171 !important;
  font-weight: 700;
}

.cnf-lf-err span {
  color: #f87171;
}

.cnf-field-err,
.cnf-lf-err input {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
  /* Keep light fill so rate digits stay readable on dark UI */
  background: #fff7f7 !important;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
  caret-color: #111;
  font-weight: 700;
}

.cnf-line-callout {
  margin: 0.65rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.55rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.cnf-line-callout[hidden] {
  display: none !important;
}

.cnf-line-callout-msg {
  margin: 0;
  flex: 1 1 12rem;
  color: #fecaca;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.cnf-line-callout .cnf-btn {
  flex: 0 0 auto;
}

.cnf-callout-product {
  color: var(--text);
  font-size: 1rem;
}

.cnf-uom-rates {
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}

.cnf-uom-rates .cnf-label {
  display: block;
  margin-bottom: 0.55rem;
  font-weight: 700;
  color: var(--text);
}

.cnf-hint-inline {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
}

.cnf-uom-rates-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cnf-uom-rate-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr 1fr;
  gap: 0.5rem;
  align-items: end;
}

.cnf-uom-rate-name {
  font-weight: 800;
  color: var(--gold);
  padding-bottom: 0.45rem;
  font-size: 0.88rem;
}

.cnf-uom-rate-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.cnf-uom-rate-row input {
  width: 100%;
}

@media (max-width: 560px) {
  .cnf-uom-rate-row {
    grid-template-columns: 1fr 1fr;
  }
  .cnf-uom-rate-name {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }
}


/* ---------- Stock Manager ---------- */
.cnf-stock-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.cnf-kpi {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 18, 22, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cnf-kpi-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cnf-kpi strong {
  font-size: 1.25rem;
  font-family: var(--font-display);
  color: var(--text);
}

.cnf-kpi strong.ok { color: #86efac; }
.cnf-kpi strong.warn { color: #fcd34d; }
.cnf-kpi strong.danger { color: #fca5a5; }

.cnf-stock-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cnf-stock-toolbar .cnf-search-bar {
  flex: 1 1 14rem;
  margin: 0;
}

.cnf-stock-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cnf-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.cnf-chip.active {
  border-color: rgba(0, 168, 156, 0.55);
  color: var(--text);
  background: rgba(0, 168, 156, 0.18);
}

.cnf-stock-cards {
  margin-bottom: 1.25rem;
}

/* Landscape / wide product rows (not portrait cards) */
.cnf-stock-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.35rem;
}

.cnf-stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(8rem, 0.9fr) minmax(5.5rem, 0.55fr) auto;
  gap: 0.65rem 1rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 163, 163, 0.28);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.05) 0%, transparent 45%),
    rgba(12, 18, 22, 0.96);
}

.cnf-stock-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.cnf-stock-row-title h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.cnf-stock-row-sub {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.cnf-stock-row-qty {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.cnf-stock-row-qty strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
}

.cnf-stock-row-qty span {
  font-size: 0.72rem;
  color: var(--muted);
}

.cnf-stock-row-value {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.cnf-stock-row-value span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.cnf-stock-row-value strong {
  font-size: 0.95rem;
  color: var(--text);
}

.cnf-stock-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.cnf-stock-search input {
  min-height: 2.55rem;
  width: 100%;
}

.cnf-stock-mov-head .cnf-section-title small {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
}

.cnf-stock-report {
  margin-top: 0.75rem;
}

.cnf-stock-report .cnf-report-toolbar {
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.cnf-stock-dir,
.cnf-stock-mov-q {
  min-height: 2.2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  padding: 0.35rem 0.55rem;
  font: inherit;
}

.cnf-stock-mov-q {
  flex: 1 1 10rem;
  min-width: 9rem;
}

.cnf-stock-report .cnf-report-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.cnf-stock-report .cnf-report-inputs input,
.cnf-stock-report .cnf-report-inputs select {
  min-height: 2.2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  padding: 0.3rem 0.45rem;
}

.cnf-muted {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 820px) {
  .cnf-stock-row {
    grid-template-columns: 1fr 1fr;
  }
  .cnf-stock-row-main {
    grid-column: 1 / -1;
  }
  .cnf-stock-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.cnf-stock-qty-hero {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
  margin: 0.35rem 0 0.55rem;
}

.cnf-stock-card-low {
  border-color: rgba(245, 158, 11, 0.45);
}

.cnf-stock-card-out {
  border-color: rgba(239, 68, 68, 0.45);
}

.cnf-stock-mov-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.cnf-stock-mov-row {
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.cnf-stock-mov-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.2rem;
}

.cnf-stock-mov-qty {
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.cnf-stock-mov-qty.in { color: #86efac; }
.cnf-stock-mov-qty.out { color: #fca5a5; }

.cnf-stock-mov-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.cnf-stock-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cnf-stock-badge.cnf-stock-in {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.cnf-stock-badge.cnf-stock-out {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.cnf-stock-mov-notes {
  color: var(--muted);
  font-size: 0.82rem;
}

.cnf-section-title {
  margin: 1.25rem 0 0.65rem;
  font-size: 1rem;
}

/* Full-page saving lock — gray overlay, spinner, blocks interaction */
.cnf-save-busy {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: wait;
  user-select: none;
}
.cnf-save-busy[hidden] {
  display: none !important;
}
html.cnf-busy-lock,
body.cnf-busy-lock {
  overflow: hidden !important;
  pointer-events: none;
}
body.cnf-busy-lock .cnf-save-busy {
  pointer-events: all;
}
.cnf-save-busy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: min(280px, 88vw);
  padding: 1.35rem 1.5rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 45%),
    rgba(14, 22, 28, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.cnf-save-spinner {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #2dd4bf;
  border-right-color: #5eead4;
  animation: cnf-save-spin 0.7s linear infinite;
}
.cnf-save-busy-title {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #99f6e4;
}
.cnf-save-busy-msg {
  margin: 0;
  max-width: 22rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(247, 244, 236, 0.82);
}
@keyframes cnf-save-spin {
  to {
    transform: rotate(360deg);
  }
}

/* —— Buyer portal —— */
.cnf-buyer-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  position: relative;
  z-index: 1;
}
.cnf-buyer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
#buyerShopPlate {
  margin-bottom: 1rem;
}
#buyerShopPlate .cnf-buyer-shop-card {
  margin-bottom: 0;
}
.cnf-buyer-shop-card h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cnf-buyer-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cnf-buyer-tabs button {
  font: inherit;
  border: 1px solid var(--line);
  background: rgba(16, 24, 28, 0.7);
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  border-radius: 0.55rem;
  cursor: pointer;
}
.cnf-buyer-tabs button.is-active {
  color: var(--text);
  border-color: rgba(0, 168, 156, 0.55);
  background: rgba(0, 132, 123, 0.22);
}
.cnf-buyer-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.cnf-buyer-summary > div {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: rgba(16, 24, 28, 0.75);
}
.cnf-buyer-summary span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.cnf-buyer-summary strong {
  font-size: 1.05rem;
}
.cnf-buyer-order-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .cnf-buyer-order-grid {
    grid-template-columns: 1fr;
  }
}
.cnf-buyer-cart {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(16, 24, 28, 0.75);
  align-self: start;
}
.cnf-buyer-cart-title {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.cnf-buyer-cart .cnf-buyer-manual-notes {
  margin-top: 0.85rem;
}
.cnf-buyer-cart #placeOrderBtn {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.35rem;
  font-weight: 700;
}
.cnf-buyer-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cnf-buyer-cart-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
}
.cnf-buyer-cart-list button {
  font: inherit;
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
}
.cnf-buyer-mini-invoice {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cnf-buyer-mini-invoice-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 280px;
  overflow: auto;
}
.cnf-buyer-mini-line {
  border: 1px solid rgba(0, 168, 156, 0.28);
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: rgba(8, 14, 18, 0.5);
}
.cnf-buyer-mini-line-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.cnf-buyer-mini-line-top strong {
  font-size: 0.88rem;
  line-height: 1.3;
}
.cnf-buyer-mini-line-top button {
  font: inherit;
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
}
.cnf-buyer-mini-line-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.cnf-buyer-mini-line-grid b {
  color: var(--text);
  font-weight: 700;
}
.cnf-buyer-mini-wide {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cnf-buyer-mini-totals {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(235, 179, 40, 0.35);
  background: rgba(40, 32, 12, 0.35);
}
.cnf-buyer-mini-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.cnf-buyer-mini-totals strong {
  color: var(--text);
  font-weight: 800;
}
.cnf-buyer-mini-grand {
  padding-top: 0.35rem;
  border-top: 1px solid rgba(235, 179, 40, 0.25);
  font-size: 0.95rem !important;
}
.cnf-buyer-mini-grand strong {
  color: #2dd4bf;
  font-size: 1.05rem;
}
.cnf-buyer-catalog-table {
  max-height: min(52vh, 480px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
}
.cnf-buyer-order-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.cnf-buyer-order-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #152024;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.55rem 0.45rem;
}
.cnf-buyer-order-table th,
.cnf-buyer-order-table td {
  font-size: 0.82rem;
  white-space: nowrap;
}
.cnf-buyer-order-table td:first-child {
  white-space: normal;
  min-width: 140px;
}
.cnf-buyer-qty-inp {
  width: 68px;
  box-sizing: border-box;
  padding: 0.35rem 0.4rem;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  font: inherit;
}
.cnf-buyer-row-active {
  background: rgba(0, 132, 123, 0.12);
}
.cnf-buyer-row-nostock {
  opacity: 0.92;
}
.cnf-buyer-stock-warn {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.cnf-buyer-total-cell {
  color: #99f6e4;
}
.cnf-buyer-stock-toast {
  position: fixed;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 11650;
  width: min(300px, calc(100vw - 1.25rem));
  padding: 0.7rem 2rem 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(239, 68, 68, 0.55);
  background: rgba(28, 14, 14, 0.97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: var(--text);
}
.cnf-buyer-stock-toast[hidden] {
  display: none !important;
}
.cnf-buyer-stock-toast strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
  color: #fecaca;
}
.cnf-buyer-stock-toast span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  padding-right: 1.2rem;
}
.cnf-buyer-stock-toast-x {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
}
.cnf-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  text-transform: capitalize;
  color: var(--teal-bright);
}
.cnf-buyer-order-card {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: rgba(16, 24, 28, 0.72);
}
.cnf-buyer-order-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.cnf-buyer-order-card ul {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.cnf-buyer-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}
.cnf-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.35);
}
.cnf-action-group-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.15rem;
}
.cnf-action-group-payment {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.1);
}
.cnf-action-group-payment .cnf-action-group-label {
  color: #fcd34d;
}
.cnf-action-group-delivery {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.1);
}
.cnf-action-group-delivery .cnf-action-group-label {
  color: #6ee7b7;
}
.cnf-action-group-invoice {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 165, 233, 0.1);
}
.cnf-action-group-invoice .cnf-action-group-label {
  color: #7dd3fc;
}
.cnf-status.ok {
  color: var(--ok);
}

.cnf-order-reminder {
  position: relative;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(235, 179, 40, 0.45);
  background: rgba(235, 179, 40, 0.12);
  color: #f6e7b2;
  font-size: 0.92rem;
  line-height: 1.4;
}
.cnf-order-reminder strong {
  color: var(--gold);
}
.cnf-order-reminder-dismissible {
  padding-right: 2.75rem;
}
.cnf-order-reminder-x {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: rgba(248, 113, 113, 0.32);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cnf-order-reminder-x:hover {
  background: rgba(248, 113, 113, 0.48);
}
.cnf-order-reminder-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  opacity: 0.72;
}
.cnf-global-alerts {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(235, 179, 40, 0.5);
  background: rgba(235, 179, 40, 0.14);
  color: #f6e7b2;
  font-size: 0.92rem;
  line-height: 1.45;
}
.cnf-global-alerts a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
}
.cnf-buyer-invoice-alert {
  margin: 0.75rem 1rem 0;
}
.cnf-buyer-order-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: flex-end;
  margin: 0 0 1rem;
}
.cnf-buyer-order-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.cnf-buyer-order-filters .cnf-input {
  min-width: 9rem;
}
.cnf-buyer-shop-card {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(0, 168, 156, 0.35);
  background:
    linear-gradient(135deg, rgba(0, 132, 123, 0.18), rgba(16, 24, 28, 0.92)),
    rgba(16, 24, 28, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.cnf-buyer-shop-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.cnf-buyer-shop-logo {
  width: 56px;
  height: 56px;
}
.cnf-buyer-shop-card h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cnf-buyer-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem 1rem;
  margin-top: 0.85rem;
}
.cnf-buyer-shop-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cnf-buyer-shop-grid span {
  font-size: 0.72rem;
  color: var(--muted);
}
.cnf-buyer-shop-grid b {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.cnf-buyer-shop-wide {
  grid-column: 1 / -1;
}
.cnf-buyer-report-box {
  margin-bottom: 1rem;
}
.cnf-buyer-catalog-card {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem 1rem;
  background: rgba(16, 24, 28, 0.75);
}
.cnf-buyer-catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.cnf-buyer-catalog-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.cnf-buyer-prod-search {
  flex: 1 1 220px;
  margin: 0;
  max-width: 420px;
}
.cnf-buyer-orders-wrap {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.35rem;
  background: rgba(16, 24, 28, 0.55);
}
.cnf-buyer-orders-table th {
  white-space: nowrap;
}
.cnf-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #eb3b40;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.cnf-pill-warn {
  border-color: rgba(235, 179, 40, 0.55);
  color: var(--gold);
}
.cnf-challan-modal .cnf-order-reminder {
  margin: 0 0 0.85rem;
}
.cnf-order-challan-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cnf-order-actions-cell {
  white-space: normal;
}
.cnf-order-actions-cell .cnf-btn {
  margin: 0.15rem 0.15rem 0.15rem 0;
}

.cnf-delivery-ask {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 9.5rem;
}
.cnf-delivery-ask-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}
.cnf-delivery-ask-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cnf-msg-popup-overlay,
.cnf-delivery-reminder-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(3px);
}
.cnf-msg-popup-overlay.cnf-msg-popup-flash {
  animation: cnfOrderFlashBg 0.9s ease-in-out 2;
}
.cnf-msg-popup-overlay.cnf-msg-popup-flash .cnf-msg-popup-card {
  animation: cnfOrderFlashCard 0.55s cubic-bezier(0.22, 1.2, 0.36, 1);
  border-color: rgba(235, 179, 40, 0.85);
  box-shadow:
    0 0 0 3px rgba(235, 179, 40, 0.25),
    0 18px 48px rgba(0, 0, 0, 0.45);
}
@keyframes cnfOrderFlashBg {
  0%,
  100% {
    background: rgba(6, 10, 14, 0.72);
  }
  50% {
    background: rgba(235, 179, 40, 0.28);
  }
}
@keyframes cnfOrderFlashCard {
  0% {
    transform: scale(0.86);
    opacity: 0;
  }
  60% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.cnf-msg-popup-card,
.cnf-delivery-reminder-card {
  position: relative;
  width: min(420px, 94vw);
  padding: 1.25rem 1.35rem;
  border-radius: 1rem;
  border: 1px solid rgba(235, 179, 40, 0.4);
  background: rgba(14, 22, 28, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  text-align: left;
}
.cnf-msg-popup-close {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  z-index: 5;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: rgba(248, 113, 113, 0.28);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cnf-msg-popup-close:hover {
  background: rgba(248, 113, 113, 0.45);
  color: #fff;
}
.cnf-msg-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.cnf-msg-popup-actions .cnf-btn {
  margin: 0;
}
.cnf-msg-popup-snooze-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.78rem;
  opacity: 0.7;
  line-height: 1.35;
}
.cnf-msg-popup-card .cnf-msg-popup-kicker {
  padding-right: 2rem;
}
.cnf-msg-popup-card h3 {
  padding-right: 1.75rem;
}
.cnf-msg-popup-kicker,
.cnf-delivery-reminder-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.cnf-msg-popup-card h3,
.cnf-delivery-reminder-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}
.cnf-msg-popup-body,
.cnf-delivery-reminder-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}


/* Place order settings + manual order + challan split */
.cnf-place-order-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
}
.cnf-place-order-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 0.85rem;
  border: 2px solid var(--line);
  background: rgba(16, 24, 28, 0.75);
  cursor: pointer;
  min-height: 7.5rem;
}
.cnf-place-order-card:has(input:checked) {
  border-color: rgba(0, 168, 156, 0.85);
  box-shadow: 0 0 0 2px rgba(0, 168, 156, 0.35);
  background: rgba(0, 132, 123, 0.2);
}
.cnf-place-order-card input[type='radio'] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0 0 0.35rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.cnf-place-order-card input[type='radio']::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: transparent;
}
.cnf-place-order-card input[type='radio']:checked {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
}
.cnf-place-order-card input[type='radio']:checked::after {
  background: #2dd4bf;
}
.cnf-place-order-card strong {
  font-size: 1.12rem;
  font-weight: 800;
}
.cnf-place-order-card span {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.cnf-buyer-manual-order {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1rem;
  background: rgba(16, 24, 28, 0.75);
}
.cnf-manual-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cnf-manual-line {
  border: 1px solid rgba(0, 168, 156, 0.28);
  border-radius: 0.65rem;
  padding: 0.75rem;
  background: rgba(8, 14, 18, 0.55);
}
.cnf-manual-line-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cnf-manual-line-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.55fr 0.45fr 0.8fr;
  gap: 0.55rem;
}
.cnf-manual-line-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.cnf-manual-line-grid input,
.cnf-manual-line-grid select {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
}
.cnf-manual-wide { grid-column: span 1; }
.cnf-buyer-manual-notes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1rem 0 1.1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 168, 156, 0.28);
  background: rgba(8, 14, 18, 0.45);
}
.cnf-buyer-manual-notes > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cnf-buyer-manual-notes textarea {
  width: 100%;
  min-height: 5.5rem;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
  padding: 0.7rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  line-height: 1.45;
}
.cnf-buyer-manual-order #placeOrderBtn,
.cnf-buyer-manual-order #manualAddLine {
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  font-size: 1rem;
  font-weight: 700;
}
.cnf-buyer-manual-order #placeOrderBtn {
  width: 100%;
  max-width: 280px;
}
@media (max-width: 700px) {
  .cnf-manual-line-grid { grid-template-columns: 1fr; }
}
.cnf-challan-split {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.cnf-challan-buyer-request {
  flex: 0 0 300px;
  width: 300px;
  max-width: 34%;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  border: 1px solid rgba(235, 179, 40, 0.55);
  border-radius: 0.9rem;
  padding: 1rem 1.05rem 1.1rem;
  background:
    linear-gradient(165deg, rgba(235, 179, 40, 0.12) 0%, transparent 45%),
    rgba(28, 24, 14, 0.92);
  max-height: min(72vh, 680px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cnf-challan-split-main {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  position: relative;
  z-index: 0;
}
.cnf-challan-split-main .cnf-challan-form {
  width: 100%;
  max-width: 100%;
}
.cnf-buyer-request-head {
  margin-bottom: 0.75rem;
}
.cnf-buyer-request-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.cnf-challan-buyer-request h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 800;
}
.cnf-buyer-request-meta {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: #99f6e4;
  font-weight: 600;
}
.cnf-buyer-request-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cnf-buyer-request-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(235, 179, 40, 0.28);
  background: rgba(8, 12, 16, 0.55);
}
.cnf-buyer-request-num {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(235, 179, 40, 0.22);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
}
.cnf-buyer-request-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.cnf-buyer-request-body strong {
  font-size: 0.98rem;
  line-height: 1.3;
  word-break: break-word;
}
.cnf-buyer-request-qty {
  font-size: 0.88rem;
  font-weight: 700;
  color: #99f6e4;
}
.cnf-buyer-request-note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
.cnf-modal.cnf-modal-xl.cnf-challan-modal-manual,
.cnf-challan-modal-manual {
  width: min(1280px, 98vw) !important;
  max-width: 98vw;
}
@media (max-width: 960px) {
  .cnf-challan-split {
    flex-direction: column;
  }
  .cnf-challan-buyer-request {
    flex: none;
    width: 100%;
    max-width: none;
    max-height: none;
  }
}

/* Sticky buyer-input alert (orders / payments) */
.cnf-buyer-alert-toast {
  position: fixed;
  left: 0.85rem;
  bottom: 0.85rem;
  z-index: 11500;
  width: min(280px, calc(100vw - 1.5rem));
  padding: 0.7rem 0.8rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(235, 179, 40, 0.7);
  background: rgba(18, 24, 28, 0.98);
  box-shadow:
    0 0 0 3px rgba(235, 179, 40, 0.2),
    0 16px 40px rgba(0, 0, 0, 0.45);
  animation: cnfOrderFlashCard 0.45s ease-out;
}
.cnf-buyer-alert-toast[hidden] {
  display: none !important;
}
.cnf-buyer-alert-toast-x {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.cnf-buyer-alert-toast-x:hover {
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
}
.cnf-buyer-alert-toast .cnf-msg-popup-kicker,
.cnf-buyer-alert-toast h3 {
  padding-right: 1.85rem;
}
.cnf-buyer-alert-toast .cnf-msg-popup-kicker {
  margin-bottom: 0.2rem;
}
.cnf-buyer-alert-toast h3 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}
.cnf-buyer-alert-toast p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.cnf-buyer-alert-toast .cnf-btn {
  width: 100%;
  min-height: 2.2rem;
  font-size: 0.85rem;
}


.cnf-buyer-shop-compact {
  padding: 0.75rem 0.9rem;
}
.cnf-buyer-shop-compact .cnf-buyer-shop-top {
  justify-content: flex-start;
  gap: 0.75rem;
}
.cnf-buyer-shop-names {
  flex: 1;
  min-width: 0;
}
.cnf-buyer-shop-names h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}
.cnf-buyer-shop-owner {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.cnf-buyer-details-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(0, 168, 156, 0.45);
  background: rgba(0, 132, 123, 0.18);
  color: #99f6e4;
  cursor: pointer;
}
.cnf-buyer-details-btn:hover {
  background: rgba(0, 132, 123, 0.32);
}
.cnf-buyer-details-card {
  width: min(520px, 94vw);
}
.cnf-buyer-details-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.cnf-buyer-logo-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.cnf-buyer-shop-logo-lg {
  width: 72px;
  height: 72px;
}
.cnf-buyer-logo-change {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2dd4bf;
  cursor: pointer;
  text-decoration: underline;
}

/* Business identity (Buyers page top) */
.cnf-biz-identity {
  margin-bottom: 0.65rem;
}
.cnf-biz-identity-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.cnf-biz-identity-name {
  margin: 0;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}
.cnf-biz-identity-meta {
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}
.cnf-biz-sep {
  display: inline-block;
  width: 1px;
  height: 0.85em;
  margin: 0 0.55rem;
  background: rgba(255, 255, 255, 0.28);
  vertical-align: middle;
}

/* Buyer portal identity header */
.cnf-buyer-bar {
  align-items: flex-start;
}
.cnf-buyer-bar-identity {
  min-width: 0;
  flex: 1;
}
.cnf-buyer-bar-kicker {
  margin: 0 0 0.2rem !important;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.cnf-buyer-bar-name {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
}
.cnf-buyer-bar-meta {
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Stock ledger sheet page */
.cnf-ledger-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cnf-ledger-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
}
.cnf-ledger-head h2 {
  margin: 0.15rem 0;
  font-size: 1.45rem;
  font-weight: 800;
}
.cnf-ledger-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cnf-ledger-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.cnf-ledger-pill.in {
  color: #86efac;
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(34, 197, 94, 0.4);
}
.cnf-ledger-pill.out {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}
.cnf-ledger-pill.ret {
  color: #fde68a;
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
}
.cnf-ledger-sheet-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  background: rgba(10, 14, 18, 0.75);
  max-height: min(72vh, 720px);
}
.cnf-ledger-sheet {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}
.cnf-ledger-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #152024;
  text-align: left;
  padding: 0.65rem 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.cnf-ledger-sheet td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.cnf-ledger-date {
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
}
.cnf-ledger-qty {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cnf-ledger-notes {
  color: var(--muted);
  max-width: 280px;
  word-break: break-word;
}
.cnf-ledger-row.cnf-ledger-in {
  background: rgba(22, 163, 74, 0.1);
}
.cnf-ledger-row.cnf-ledger-in .cnf-ledger-qty,
.cnf-ledger-row.cnf-ledger-in .cnf-ledger-type {
  color: #86efac;
}
.cnf-ledger-row.cnf-ledger-out {
  background: rgba(220, 38, 38, 0.1);
}
.cnf-ledger-row.cnf-ledger-out .cnf-ledger-qty,
.cnf-ledger-row.cnf-ledger-out .cnf-ledger-type {
  color: #fecaca;
}
.cnf-ledger-row.cnf-ledger-return {
  background: rgba(217, 119, 6, 0.12);
}
.cnf-ledger-row.cnf-ledger-return .cnf-ledger-qty,
.cnf-ledger-row.cnf-ledger-return .cnf-ledger-type {
  color: #fde68a;
}

/* ---------- Expense Management (Indian day-book style) ---------- */
.cnf-exp-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.cnf-exp-kpi {
  padding: 0.85rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 18, 22, 0.92);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cnf-exp-kpi span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cnf-exp-kpi strong {
  font-size: 1.2rem;
  font-family: var(--font-display);
  color: var(--text);
}
.cnf-exp-kpi small {
  font-size: 0.75rem;
  color: var(--muted);
}
.cnf-exp-kpi-due strong {
  color: #fcd34d;
}
.cnf-exp-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.cnf-exp-cat {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font: inherit;
}
.cnf-exp-cat b {
  font-weight: 600;
  font-size: 0.82rem;
}
.cnf-exp-cat span {
  color: #5eead4;
  font-size: 0.82rem;
  font-weight: 700;
}
.cnf-exp-cat:hover {
  border-color: rgba(0, 168, 156, 0.55);
  background: rgba(0, 168, 156, 0.12);
}
.cnf-link-quiet {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.cnf-link-quiet:hover {
  color: #5eead4;
}
.cnf-panel-block {
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .cnf-exp-kpis {
    grid-template-columns: 1fr;
  }
}

.cnf-label-line {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.cnf-exp-kind-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
}
.cnf-exp-kind-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1.2;
}
.cnf-exp-kind-chip:hover {
  border-color: rgba(0, 168, 156, 0.55);
  background: rgba(0, 168, 156, 0.12);
}
.cnf-exp-kind-chip.active {
  border-color: rgba(0, 168, 156, 0.85);
  background: rgba(0, 168, 156, 0.22);
  color: #99f6e4;
  font-weight: 700;
}
.cnf-exp-kind-add {
  border-style: dashed !important;
  color: #5eead4 !important;
  font-weight: 700 !important;
}

.cnf-sheet-handle {
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  margin: 0 auto 0.85rem;
}
.cnf-form-sheet {
  width: min(560px, calc(100vw - 1rem));
  border-radius: 1.15rem 1.15rem 0.75rem 0.75rem;
  max-height: min(92dvh, 920px);
  animation: cnfSheetUp 0.22s ease-out;
}
@keyframes cnfSheetUp {
  from {
    opacity: 0.6;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cnf-sheet .cnf-modal-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, #121a1e 35%);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

/* Expense khata spreadsheet rows */
.cnf-exp-sheet-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.55rem;
  background: rgba(8, 12, 14, 0.9);
  max-height: min(70vh, 780px);
}
.cnf-exp-sheet {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.cnf-exp-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1a2428;
  text-align: left;
  padding: 0.55rem 0.65rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.cnf-exp-sheet thead th.num,
.cnf-exp-sheet td.num {
  text-align: right;
}
.cnf-exp-sheet td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  vertical-align: middle;
}
.cnf-exp-sheet td.desc {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cnf-exp-sheet tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}
.cnf-exp-sheet tbody tr:hover {
  background: rgba(0, 168, 156, 0.1);
}
.cnf-exp-sheet tr.is-pay td.num {
  color: #86efac;
}
.cnf-exp-sheet tr.is-credit td.num {
  color: #fcd34d;
}
.cnf-exp-sheet td.act {
  white-space: nowrap;
  border-right: none;
}
.cnf-exp-sheet .cnf-linkish {
  background: none;
  border: none;
  color: #5eead4;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.cnf-exp-sheet .cnf-linkish.danger {
  color: #fca5a5;
}

.cnf-vendor-name-card {
  margin: 0 0 0.85rem;
}
.cnf-exp-sheet-full {
  width: 100%;
  max-height: min(68vh, 820px);
}
.cnf-exp-sheet-full .cnf-exp-sheet {
  min-width: 100%;
  width: 100%;
}
.cnf-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.65rem;
}
.cnf-report-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: flex-end;
}
.cnf-report-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.cnf-report-inputs input,
.cnf-report-inputs select {
  min-width: 8.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
}
.cnf-report-label {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.cnf-exp-pay-block {
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(45, 212, 191, 0.45);
  background: rgba(13, 148, 136, 0.1);
}
.cnf-exp-pay-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #99f6e4;
  letter-spacing: 0.02em;
}
.cnf-exp-pay-block .cnf-hint {
  margin: 0 0 0.65rem;
}
.cnf-exp-pay-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 560px) {
  .cnf-exp-pay-row {
    grid-template-columns: 1fr;
  }
}

.cnf-exp-home-tabs {
  margin: 0.25rem 0 0.85rem;
}
.cnf-exp-home-panel {
  margin-bottom: 1rem;
}
.cnf-exp-sheet tr.cnf-clickable-row {
  cursor: pointer;
}
.cnf-exp-sheet tr.cnf-clickable-row:hover td {
  background: rgba(0, 168, 156, 0.12);
}

.cnf-exp-due-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(252, 211, 77, 0.35);
  background: rgba(245, 158, 11, 0.12);
  margin: 0.15rem 0 0.25rem;
}
.cnf-exp-due-box span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cnf-exp-due-box strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fcd34d;
  font-variant-numeric: tabular-nums;
}

/* Staff card actions — Service Slip / Open Khata (Edit via long-press) */
.cnf-emp-longpress-hint {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.78rem;
  color: rgba(247, 244, 236, 0.62);
}

.cnf-emp-status-tabs {
  margin: 0.35rem 0 0.15rem;
}

.cnf-emp-card .cnf-emp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 163, 163, 0.22);
}

.cnf-emp-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}

.cnf-emp-act {
  flex: 1 1 0;
  min-width: 5.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.cnf-emp-act-edit {
  background: rgba(0, 163, 163, 0.12);
  border: 1px solid rgba(0, 163, 163, 0.55);
  color: var(--teal-glow, #00c8c8);
}

.cnf-emp-act-edit:hover {
  background: rgba(0, 163, 163, 0.22);
  border-color: var(--teal-bright);
  color: #f7f4ec;
}

.cnf-emp-act-slip {
  background: linear-gradient(180deg, var(--teal-bright), var(--teal));
  border: 1px solid rgba(0, 200, 200, 0.35);
  color: #fff;
  width: 100%;
}

.cnf-emp-act-slip:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.cnf-emp-khata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 215, 0, 0.4);
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(0, 163, 163, 0.12));
  color: var(--gold);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cnf-emp-khata:hover,
.cnf-emp-khata:visited:hover {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.18), rgba(0, 163, 163, 0.18));
  color: #ffe566;
}

.cnf-emp-khata:visited {
  color: var(--gold);
}

.cnf-emp-khata-arrow {
  color: var(--teal-glow, #00c8c8);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.cnf-linkish {
  background: none;
  border: none;
  color: var(--teal-bright);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.2rem 0.15rem;
  text-decoration: none;
}

.cnf-linkish:hover,
.cnf-linkish:visited:hover {
  color: var(--teal-glow, #00c8c8);
  text-decoration: underline;
}

.cnf-linkish:visited {
  color: var(--teal-bright);
}

a.cnf-linkish {
  color: var(--gold-mid, #d4af37);
}

a.cnf-linkish:visited {
  color: var(--gold-mid, #d4af37);
}

/* Field-level errors (under Username / Email / Mobile) */
.cnf-field-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.cnf-form-grid > .cnf-field-block,
.cnf-form-3 > .cnf-field-block {
  min-width: 0;
}

.cnf-form-3 .cnf-field-block > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.cnf-field-msg {
  margin: 0;
  padding: 0.35rem 0.15rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  min-height: 0;
}

.cnf-field-msg-error {
  color: #ff6b6b;
}

.cnf-field-invalid {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.28) !important;
}

.cnf-status-banner {
  margin: 0.35rem 0 0.15rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  min-height: 1.4rem;
  border: 1px solid transparent;
  background: rgba(0, 163, 163, 0.08);
}

.cnf-status-banner:empty {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
  min-height: 0;
}

.cnf-status-banner.busy {
  color: var(--teal-glow, #00c8c8);
  border-color: rgba(0, 163, 163, 0.45);
  background: rgba(0, 163, 163, 0.14);
}

.cnf-status-banner.ok {
  color: #0d3d2e;
  background: linear-gradient(180deg, #ffe566, var(--gold));
  border-color: rgba(184, 134, 11, 0.55);
}

.cnf-status-banner.warn {
  color: #ffc9c9;
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(180, 40, 40, 0.22);
}

.cnf-save-toast {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 9999;
  max-width: min(92vw, 420px);
  padding: 1rem 1.35rem;
  border-radius: 0.85rem;
  font-family: var(--font-display, "Trebuchet MS", Arial, sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 163, 163, 0.4);
  background: #0c1416;
  color: var(--text);
}

.cnf-save-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cnf-save-toast.busy {
  color: var(--teal-glow, #00c8c8);
  border-color: rgba(0, 200, 200, 0.5);
}

.cnf-save-toast.ok {
  color: #080d0e;
  background: linear-gradient(180deg, #ffe566, var(--gold));
  border-color: var(--gold-deep);
}

.cnf-save-toast.warn {
  color: #ffc9c9;
  border-color: rgba(255, 107, 107, 0.55);
  background: #1a0c0c;
}

/* Salary Paid row — Print / Share / Email */
.cnf-slip-acts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.cnf-slip-act {
  margin: 0;
  padding: 0.28rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(0, 163, 163, 0.55);
  background: rgba(0, 163, 163, 0.14);
  color: var(--teal-glow, #00c8c8);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}
.cnf-slip-act:hover {
  background: rgba(0, 163, 163, 0.28);
  color: #f7f4ec;
}
.cnf-slip-act-wa {
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold);
}
.cnf-slip-act-wa:hover {
  background: rgba(255, 215, 0, 0.22);
  color: #ffe566;
}
.cnf-slip-act-mail {
  border-color: rgba(247, 244, 236, 0.28);
  background: rgba(247, 244, 236, 0.06);
  color: var(--text);
}
.cnf-exp-sheet td.act {
  white-space: normal;
  min-width: 11rem;
}

/* Language settings cards */
.cnf-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.cnf-lang-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(0, 163, 163, 0.35);
  background: rgba(0, 163, 163, 0.08);
  cursor: pointer;
  color: var(--text);
}
.cnf-lang-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cnf-lang-card strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.cnf-lang-card span {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.cnf-bg {
  background:
    radial-gradient(ellipse 55% 42% at 8% 0%, rgba(0, 200, 200, 0.28), transparent 58%),
    radial-gradient(ellipse 48% 38% at 92% 8%, rgba(255, 215, 0, 0.14), transparent 52%),
    radial-gradient(ellipse 50% 40% at 95% 100%, rgba(255, 215, 0, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 45% at 5% 100%, rgba(0, 163, 163, 0.22), transparent 55%),
    linear-gradient(165deg, #080d0e 0%, #0c1618 55%, #0a1214 100%);
}

.cnf-panel {
  backdrop-filter: var(--hh-glass-blur);
  -webkit-backdrop-filter: var(--hh-glass-blur);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1) 0%, transparent 38%),
    var(--hh-glass-strong);
  box-shadow: var(--hh-neon-teal-soft), 0 18px 40px rgba(0, 0, 0, 0.4);
}

.cnf-card,
.cnf-item-card {
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-color: rgba(0, 163, 163, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--hh-neon-teal-soft);
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.15s ease;
}

.cnf-item-card:hover,
.cnf-card-mini:hover {
  border-color: rgba(0, 200, 200, 0.45);
  box-shadow: var(--hh-neon-teal);
}

.cnf-sidebar-panel {
  background: linear-gradient(180deg, rgba(18, 24, 31, 0.82) 0%, rgba(12, 17, 22, 0.9) 100%);
  backdrop-filter: var(--hh-glass-blur);
  -webkit-backdrop-filter: var(--hh-glass-blur);
  border-right: 1px solid rgba(0, 163, 163, 0.24);
  box-shadow: inset -1px 0 0 rgba(0, 200, 200, 0.08), 4px 0 32px rgba(0, 0, 0, 0.28);
}

.cnf-nav-group {
  border: 1px solid rgba(0, 163, 163, 0.14);
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.cnf-nav-group:hover,
.cnf-nav-group.is-active {
  border-color: rgba(0, 200, 200, 0.38);
  box-shadow: var(--hh-neon-teal-soft);
}

.cnf-nav-links a:hover {
  box-shadow: var(--hh-neon-teal-soft), inset 3px 0 0 var(--teal-glow);
}

.cnf-nav-links a.active,
a.cnf-nav-direct-link.active,
.cnf-nav-group.cnf-nav-direct.is-active > a.cnf-nav-direct-link {
  box-shadow: var(--hh-neon-teal), inset 3px 0 0 var(--gold);
}

.cnf-brand-settings-menu {
  backdrop-filter: var(--hh-glass-blur);
  -webkit-backdrop-filter: var(--hh-glass-blur);
  background: rgba(10, 16, 18, 0.94);
  box-shadow: var(--hh-neon-teal);
}

.cnf-search-bar input[type="search"],
.cnf-toolbar input,
.cnf-toolbar select,
.cnf-form input,
.cnf-form-grid input,
.cnf-form select,
.cnf-form-grid select {
  backdrop-filter: blur(8px);
  background: rgba(8, 13, 14, 0.55);
  border-color: rgba(0, 163, 163, 0.22);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cnf-search-bar input:focus,
.cnf-toolbar input:focus,
.cnf-form input:focus,
.cnf-form-grid input:focus,
.cnf-form select:focus,
.cnf-form-grid select:focus {
  border-color: rgba(0, 200, 200, 0.65);
  box-shadow: var(--hh-neon-focus);
}

.cnf-btn {
  box-shadow: 0 0 18px rgba(0, 163, 163, 0.28);
}

.cnf-btn:hover {
  box-shadow: var(--hh-neon-teal);
}

.cnf-lang-card.is-active,
.cnf-lang-card:has(input:checked) {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.14), rgba(0, 163, 163, 0.16));
  box-shadow: var(--hh-neon-gold);
}

/* ---------- Mobile polish (GDK) ---------- */
html.cnf-body,
body.cnf-body {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body.cnf-nav-locked {
  overflow: hidden;
}

html.cnf-nav-locked {
  overflow: hidden;
  height: 100%;
}

@media (max-width: 900px) {
  .cnf-sidebar {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cnf-sidebar-panel {
    background: linear-gradient(180deg, rgba(18, 24, 31, 0.98) 0%, rgba(12, 17, 22, 0.98) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid rgba(0, 163, 163, 0.24);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 560px) {
  .cnf-btn,
  .cnf-btn-ghost,
  .cnf-toolbar .cnf-btn {
    min-height: 44px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .cnf-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cnf-tabs::-webkit-scrollbar {
    display: none;
  }

  .cnf-modal-panel,
  .cnf-form-sheet {
    width: min(100%, calc(100vw - 1rem));
    max-height: calc(100dvh - 1rem);
    margin: 0.5rem;
  }

  .cnf-stats {
    grid-template-columns: 1fr;
  }

  .cnf-top-actions .cnf-btn,
  .cnf-top-actions a.cnf-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 400px) {
  .cnf-exp-sheet {
    min-width: 480px;
  }
}


/* GST Reports toolbar — period vs report, glowing selection (sticky while scrolling) */
.gst-report-toolbar {
  position: sticky;
  top: 0;
  z-index: 35;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid rgba(0, 163, 163, 0.28);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(12, 20, 22, 0.98) 0%, rgba(8, 13, 14, 0.96) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 163, 163, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gst-toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gst-toolbar-label {
  font-family: 'Trebuchet MS', 'Lucida Grande', Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 244, 236, 0.62);
}

.gst-period-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.gst-period-modes .cnf-mode-btn:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(247, 244, 236, 0.72);
  box-shadow: none;
}

.gst-period-modes .cnf-mode-btn.active {
  background: linear-gradient(145deg, var(--teal-bright, #00c8c8), var(--teal, #00a3a3));
  border-color: rgba(0, 200, 200, 0.85);
  color: #061210;
  font-weight: 800;
  box-shadow: var(--hh-neon-teal), 0 0 20px rgba(0, 200, 200, 0.35), 0 0 0 1px rgba(255, 215, 0, 0.28);
}

.gst-period-extra {
  margin-top: 0.15rem;
}

.gst-toolbar-divider {
  border: 0;
  border-top: 1px solid rgba(0, 163, 163, 0.4);
  margin: 0.9rem 0;
  box-shadow: 0 0 14px rgba(0, 163, 163, 0.22);
}

.gst-report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.gst-report-tabs .cnf-tab {
  margin: 0;
  border-radius: 0.45rem;
}

.gst-report-tabs .cnf-tab:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(247, 244, 236, 0.72);
  box-shadow: none;
}

.gst-report-tabs .cnf-tab.active {
  background: linear-gradient(145deg, var(--teal-bright, #00c8c8), var(--teal, #00a3a3));
  border-color: transparent;
  color: #061210;
  font-weight: 800;
  box-shadow: var(--hh-neon-teal), 0 0 20px rgba(0, 200, 200, 0.35), 0 0 0 1px rgba(255, 215, 0, 0.28);
}

.gst-warnings {
  margin-bottom: 0.75rem;
}

#cnfPage .gst-period-modes .cnf-mode-btn.active,
#cnfPage .gst-report-tabs .cnf-tab.active {
  box-shadow: var(--hh-neon-teal), 0 0 22px rgba(0, 200, 200, 0.4), 0 0 0 1px rgba(255, 215, 0, 0.3);
}

@media (max-width: 900px) {
  .gst-report-toolbar {
    top: 0.35rem;
  }
}
