:root {
  --green: #0E6B34;
  --green-dark: #0A5428;
  --gold: #F5B427;
  --bg: #dce5ef;
  --surface: #ffffff;
  --surface-alt: #d2dde9;
  --border: #9fb0c4;
  --text: #0f172a;
  --muted: #334155;
  --danger: #dc2626;
  --radius: 12px;
}

html.dark {
  --bg: #020617;
  --surface: #0f172a;
  --surface-alt: #1e293b;
  --border: #475569;
  --text: #ffffff;
  --muted: #e2e8f0;
}

* { box-sizing: border-box; }
html, body {
  overflow-x: clip;
  max-width: 100%;
}
html { font-size: 16px; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .brand-font {
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
button, th, label {
  font-weight: 700;
}
.mono, .kpi-value, .kpi-num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
a { color: inherit; }

/* Auth & Login */
.auth-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: #dce5ef;
  background-image:
    radial-gradient(at 0% 0%, rgba(14, 107, 52, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 180, 39, 0.1) 0px, transparent 45%);
}
html.dark .auth-body {
  background-color: #020617;
  background-image:
    radial-gradient(at 0% 0%, rgba(14, 107, 52, 0.16) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 180, 39, 0.08) 0px, transparent 45%);
}
.login-shell {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 5fr 7fr;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 48px -18px rgba(15, 23, 42, 0.18);
}
.login-brand {
  position: relative;
  background: linear-gradient(155deg, var(--green-dark) 0%, var(--green) 100%);
  color: #ffffff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
}
.login-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.login-brand-top, .login-brand-footer {
  position: relative;
  z-index: 1;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--green);
  padding: 9px 15px;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}
.brand-logo { height: 28px; width: auto; object-fit: contain; }
.login-brand h1 {
  font-size: 25px;
  line-height: 1.25;
  margin: 28px 0 12px;
  font-weight: 800;
  text-wrap: balance;
}
.login-brand p {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.6;
}
.login-brand-footer {
  font-size: 12.5px;
  font-weight: 600;
  color: #ecfdf5;
}
.copyright-line {
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  padding-top: 12px;
}
.copyright-line a {
  color: #ffffff;
  text-decoration: none;
}
.copyright-line a:hover { text-decoration: underline; }
.login-form-panel {
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.login-form-header h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-form-header p { margin-top: 6px; font-size: 14px; font-weight: 600; }
.login-back-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
}
.login-back-link:hover { text-decoration: underline; }
.login-forgot-link {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
}
.login-forgot-link:hover { text-decoration: underline; }
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}
.password-toggle:hover { color: var(--text); background: var(--surface-alt); }
.login-submit-btn {
  min-height: 48px;
  font-size: 15.5px;
  font-weight: 800;
  border-radius: 10px;
  margin-top: 4px;
}
.login-panel-footer {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.muted { color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 0; }
@media (max-width: 840px) {
  .login-shell { grid-template-columns: 1fr; max-width: 480px; }
  .login-brand { padding: 26px 24px; gap: 16px; }
  .login-brand h1 { font-size: 21px; margin: 16px 0 6px; }
  .login-brand-footer { display: none; }
  .login-form-panel { padding: 28px 24px; }
}

.auth-gate-card {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(15,23,42,0.16);
}
.auth-gate-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: #fef3c7; color: #92400e;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.auth-badge { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green); }
.auth-title { font-size: 22px; font-weight: 800; margin: 6px 0 8px; }
.auth-subtitle { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 16px; }
.auth-info-box {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.auth-footer { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.text-gold { color: #b45309; }

/* App Shell */
.app-shell { display: flex; min-height: 100dvh; }
.sidebar {
  width: 264px;
  background: var(--surface);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}
.sidebar-header {
  height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 19px;
  color: var(--green);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nav-btn-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-btn svg { flex-shrink: 0; color: var(--muted); }
.nav-btn:hover { background: var(--surface-alt); border-color: var(--border); }
.nav-btn.active { background: var(--green); color: #fff; font-weight: 800; box-shadow: 0 3px 10px rgba(14,107,52,0.28); }
.nav-btn.active svg { color: var(--gold); }
.nav-badge-count {
  background: rgba(14, 107, 52, 0.14);
  color: var(--green);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
html.dark .nav-badge-count {
  background: rgba(245, 180, 39, 0.2);
  color: var(--gold);
}
.nav-btn.active .nav-badge-count {
  background: var(--gold);
  color: #0f172a;
}

.sidebar-footer { padding: 14px; border-top: 2px solid var(--border); display: grid; gap: 10px; }
.profile-box { background: var(--surface-alt); border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.profile-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.profile-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.profile-role { font-size: 12.5px; color: var(--green); font-weight: 800; }
html.dark .profile-role { color: var(--gold); }
.sidebar-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copyright-footer { font-size: 11.5px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; line-height: 1.4; }
.copyright-footer a { color: var(--green); font-weight: 700; text-decoration: none; }
html.dark .copyright-footer a { color: var(--gold); }

.main-area { flex: 1; margin-left: 264px; display: flex; flex-direction: column; min-height: 100dvh; min-width: 0; }
.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
html.dark .topbar {
  background: rgba(15, 23, 42, 0.96);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-brand { color: var(--green); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 14px; white-space: nowrap; }
html.dark .topbar-brand { color: var(--gold); }
.topbar-title { margin: 0; font-size: 16.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sep { color: var(--border); font-weight: 800; }
html.dark .sep { color: #475569; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-alt); }

.role-btn, .role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}
.role-btn svg, .role-pill svg { color: var(--green); }
.role-btn:hover, .role-pill:hover { border-color: var(--green); }
html.dark .role-btn svg, html.dark .role-pill svg { color: var(--gold); }

.sync-btn, .sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.sync-btn svg, .sync-pill svg { color: var(--green); }
.sync-btn:hover, .sync-pill:hover { background: var(--surface-alt); }
html.dark .sync-btn svg, html.dark .sync-pill svg { color: #34d399; }

.bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
.bell-count.has-alerts { background: #dc2626; color: #fff; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-display-name, .user-email-pill { font-size: 13.5px; font-weight: 700; color: var(--text); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.role-preview-banner {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  color: #0f172a;
  padding: 10px 16px;
  margin: 12px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  flex-wrap: wrap;
}
html.dark .role-preview-banner {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.module-viewport { flex: 1; padding: 20px 24px; width: 100%; }
.app-footer {
  padding: 14px 24px;
  border-top: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
html.dark .app-footer {
  background: var(--surface);
}
.app-footer a { color: var(--green); font-weight: 800; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
html.dark .app-footer a { color: var(--gold); }

/* Architectural Hero Split & Visual Banners (1:1 React Parity) */
.hero-split {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 20px;
  align-items: stretch;
}
.hero-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 256px;
  color: #fff;
  background: #0f172a;
  display: flex;
  flex-direction: column;
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.56) 55%, rgba(2, 6, 23, 0.22) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 24px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.hero-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gold);
}
.hero-facility-meta {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  max-width: 560px;
}
.hero-sub {
  margin: 8px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  max-width: 560px;
  line-height: 1.5;
}
.hero-banner-mini {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 148px;
  display: flex;
  align-items: center;
  color: #fff;
  border: 1.5px solid var(--border);
  background: #0f172a;
}

.alerts-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.alerts-feed {
  display: flex;
  flex-direction: column;
  max-height: 215px;
  overflow-y: auto;
  padding-right: 4px;
}
.alert-feed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1.5px solid var(--border);
}
.alert-feed-item:first-child { padding-top: 2px; }
.alert-feed-item:last-child { border-bottom: none; padding-bottom: 0; }
.alert-feed-left { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.alert-feed-title { font-size: 13.5px; font-weight: 800; color: var(--text); }
.alert-feed-msg { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.alert-ack-link {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
  flex-shrink: 0;
}
html.dark .alert-ack-link { color: var(--gold); }
.alert-ack-link:hover { color: var(--text); }

/* UI Primitives */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
}
html.dark .card { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-7-5 { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.card.stack { gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kpi-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
}
.kpi-card-clean {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
}
html.dark .kpi-card, html.dark .kpi-card-clean { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.kpi-card-clean .kpi-head { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.kpi-card-clean .kpi-num { font-size: 27px; font-weight: 800; margin-top: 8px; color: var(--text); font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-card-clean .kpi-foot { font-size: 13px; margin-top: 8px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-card-clean .kpi-foot.green { color: var(--green); }
html.dark .kpi-card-clean .kpi-foot.green { color: #34d399; }

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(14, 107, 52, 0.12);
  color: var(--green);
}
html.dark .kpi-icon { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.kpi-icon.amber { background: rgba(245, 180, 39, 0.2); color: #92400e; }
html.dark .kpi-icon.amber { background: rgba(245, 158, 11, 0.22); color: #fde68a; }
.kpi-icon.blue { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
html.dark .kpi-icon.blue { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
.kpi-icon.rose { background: rgba(220, 38, 38, 0.14); color: #b91c1c; }
html.dark .kpi-icon.rose { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1.5px solid var(--border); }
.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.kpi-label { font-size: 13.5px; color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 25px; font-weight: 800; margin-top: 6px; line-height: 1.2; }
.kpi-sub { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 6px; }

/* React-Parity Split Module Header (Poultry & POS) */
.module-split-header {
  display: grid;
  grid-template-columns: 3.5fr 8.5fr;
  gap: 18px;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
}
.module-split-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  min-height: 128px;
  background: var(--surface-alt);
}
.module-split-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.module-split-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.mini-stat-tile {
  padding: 10px 12px;
  border-radius: 9px;
  background: #e6eef7;
  border: 1.5px solid var(--border);
}
html.dark .mini-stat-tile {
  background: #1e293b;
  border-color: #475569;
}
.mini-stat-tile .mini-lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mini-stat-tile .mini-val { font-size: 15px; font-weight: 800; margin-top: 2px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* Master-Detail Sites Workspace (4/8 Split) */
.sites-split-layout {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 22px;
  align-items: start;
}
.sites-list-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.site-selector-card {
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.site-selector-card:hover {
  border-color: var(--green);
}
.site-selector-card.active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  box-shadow: 0 6px 18px -6px rgba(14, 107, 52, 0.35);
}
.site-selector-card.active .muted,
.site-selector-card.active .site-card-meta {
  color: #ecfdf5;
}
.site-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.site-selector-card .progress-track {
  height: 7px;
  margin-top: 8px;
  background: rgba(15, 23, 42, 0.16);
}
.site-selector-card.active .progress-track {
  background: rgba(0, 0, 0, 0.25);
}
.site-selector-card.active .progress-fill {
  background: var(--gold);
}

/* Tactile 2-Col POS Product Grid & Register Session Bar */
.pos-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
}
.pos-session-bar.open {
  background: #dcfce7;
  border: 1.5px solid #4ade80;
}
.pos-session-bar.closed {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
}
html.dark .pos-session-bar.open {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
}
html.dark .pos-session-bar.closed {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
}
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 6px;
}
.pos-product-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.pos-product-card:hover:not(:disabled) {
  border-color: var(--green);
}
.pos-product-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pos-product-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pos-product-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.emp-initials {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: rgba(14, 107, 52, 0.14);
  border: 1.5px solid rgba(14, 107, 52, 0.35);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
html.dark .emp-initials {
  background: rgba(16, 185, 129, 0.22);
  color: var(--gold);
}

.sector-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
}
.sector-dot { width: 11px; height: 11px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.sector-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1.5px solid var(--border);
}

.vchart-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 184px;
  padding-top: 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}
.vchart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.vchart-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 100%;
}
.vchart-bar {
  width: 18px;
  border-radius: 4px 4px 0 0;
  transition: height 0.25s ease;
}
.vchart-bar.rev { background: var(--green); }
html.dark .vchart-bar.rev { background: #10b981; }
.vchart-bar.prof { background: var(--gold); }
.vchart-labels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
}
.vchart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1.5px solid var(--border);
}
.quick-nav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.quick-nav-tile:hover { background: var(--surface); border-color: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 700; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-gold { background: var(--gold); color: #0f172a; }
.btn-gold:hover:not(:disabled) { filter: brightness(0.95); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.btn-dark { background: #0f172a; color: #fff; }
.btn-danger { background: #fee2e2; color: #991b1b; border-color: #f87171; }
html.dark .btn-danger { background: rgba(220, 38, 38, 0.22); color: #fecaca; border-color: rgba(248, 113, 113, 0.55); }

.tab-bar { display: inline-flex; gap: 5px; background: var(--surface-alt); border: 1.5px solid var(--border); padding: 4px; border-radius: 10px; flex-wrap: wrap; align-items: center; }
.tab-link, .tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tab-link:hover, .tab-btn:hover { background: rgba(255, 255, 255, 0.55); }
html.dark .tab-link:hover, html.dark .tab-btn:hover { background: rgba(255, 255, 255, 0.08); }
.tab-link.active, .tab-btn.active { background: var(--green); color: #ffffff; font-weight: 800; box-shadow: 0 2px 6px rgba(14, 107, 52, 0.25); }
html.dark .tab-link.active, html.dark .tab-btn.active { background: var(--green); color: #ffffff; }

.segmented { display: inline-flex; background: var(--surface-alt); border: 1.5px solid var(--border); padding: 4px; border-radius: 9px; gap: 3px; }
.segmented button { border: none; background: transparent; padding: 6px 12px; font-size: 13px; font-weight: 700; border-radius: 6px; cursor: pointer; color: var(--text); white-space: nowrap; transition: all 0.15s ease; }
.segmented button:hover { background: rgba(255, 255, 255, 0.55); }
html.dark .segmented button:hover { background: rgba(255, 255, 255, 0.08); }
.segmented button.active { background: var(--green); color: #ffffff; font-weight: 800; box-shadow: 0 2px 6px rgba(14, 107, 52, 0.25); }
html.dark .segmented button.active { background: var(--green); color: #ffffff; }

.stack-form { display: grid; gap: 12px; min-width: 0; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); min-width: 0; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: auto; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(14, 107, 52, 0.18); border-color: var(--green); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 600; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1.5px solid var(--border); vertical-align: middle; }
th { background: #d5e0ec; font-size: 13px; font-weight: 800; color: #0f172a; border-bottom: 2px solid #94a3b8; }
html.dark th { background: #1e293b; color: #ffffff; border-bottom: 2px solid #475569; }
tbody tr:hover td { background: #eef4fa; }
html.dark tbody tr:hover td { background: rgba(30, 41, 59, 0.55); }
tr:last-child td { border-bottom: none; }
td code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; background: none; padding: 0; color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface-alt); color: var(--text); white-space: nowrap; }
.badge-green { background: #dcfce7; color: #065f46; border-color: #4ade80; }
.badge-gold { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.badge-red { background: #fee2e2; color: #991b1b; border-color: #f87171; }
.badge-blue { background: #dbeafe; color: #1e3a8a; border-color: #60a5fa; }
html.dark .badge-green { background: rgba(16,185,129,0.22); color: #6ee7b7; border-color: rgba(16,185,129,0.45); }
html.dark .badge-gold { background: rgba(245,158,11,0.22); color: #fde68a; border-color: rgba(245,158,11,0.45); }
html.dark .badge-red { background: rgba(239,68,68,0.22); color: #fca5a5; border-color: rgba(239,68,68,0.45); }
html.dark .badge-blue { background: rgba(59,130,246,0.24); color: #bfdbfe; border-color: rgba(96,165,250,0.45); }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: 1.5px solid; }
.alert-error { background: #fee2e2; border-color: #f87171; color: #991b1b; }
.alert-success { background: #dcfce7; border-color: #4ade80; color: #065f46; }
.alert-warn { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
html.dark .alert-error { background: rgba(220,38,38,0.2); border-color: rgba(248,113,113,0.5); color: #fecaca; }
html.dark .alert-success { background: rgba(16,185,129,0.2); border-color: rgba(52,211,153,0.5); color: #a7f3d0; }
html.dark .alert-warn { background: rgba(245,158,11,0.2); border-color: rgba(251,191,36,0.5); color: #fde68a; }

.progress-track { height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 999px; }

/* Charts */
.bar-chart { display: grid; gap: 10px; }
.bar-row { display: grid; gap: 4px; }
.bar-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}
.modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 14px;
  min-width: 0;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.3);
}
.modal-card.modal-xl { max-width: 1060px; }
.pdf-frame { width: 100%; height: 68vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.notif-drawer {
  position: fixed;
  right: 20px;
  top: 70px;
  width: 360px;
  max-height: 72vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 44px rgba(0,0,0,0.18);
  z-index: 50;
}
.hidden { display: none !important; }
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  z-index: 80;
  box-shadow: 0 12px 26px rgba(0,0,0,0.26);
}

.chart-box { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.mobile-only { display: none; }
.topbar-logo { height: 26px; width: auto; object-fit: contain; }
.sidebar-backdrop { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-sheet-backdrop { display: none; }

/* Commercial Studio & A4 Preview */
.studio-shell { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: start; min-width: 0; }
.studio-mobile-toggle { display: none; }
.studio-pane-hidden { display: block; }
.studio-subtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--surface-alt); padding: 4px; border-radius: 10px; border: 1.5px solid var(--border); }
.studio-subtabs button { border: none; background: transparent; padding: 8px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.studio-subtabs button.active { background: var(--green); color: #ffffff; font-weight: 800; box-shadow: 0 2px 6px rgba(14, 107, 52, 0.25); }
.fmt-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--surface-alt); border: 1.5px solid var(--border); border-radius: 8px; }
.fmt-btn { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 4px 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fmt-btn:hover { border-color: var(--green); color: var(--green); }
.color-swatch { width: 22px; height: 22px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.color-swatch.active { border-color: var(--text); transform: scale(1.1); }
.print-area {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  position: relative;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  max-width: 100%;
  overflow-x: auto;
}
.inv-sec-box { border: 1.5px solid #cbd5e1; border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #f8fafc; }
.inv-sec-title { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.inv-sec-title.underlined { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.inv-rich-body h4 { margin: 4px 0; font-size: 13px; font-weight: 800; }
.inv-rich-body ul, .inv-rich-body ol { margin: 4px 0 4px 18px; padding: 0; }
.inv-rich-body p { margin: 2px 0; font-size: 12px; line-height: 1.5; font-weight: 600; }
.inv-rich-body hr { border: none; border-top: 1px solid #94a3b8; margin: 6px 0; }
.inv-stamp {
  position: absolute;
  top: 22px;
  right: 22px;
  border: 2px solid var(--green);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transform: rotate(-8deg);
  opacity: 0.9;
}
.pos-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; border: 1.5px solid var(--border); background: var(--bg); flex-shrink: 0; }
.emp-avatar { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 1.5px solid var(--border); background: var(--bg); flex-shrink: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(76px, 1fr)); gap: 6px; min-width: 560px; }
.cal-cell { border: 1.5px solid var(--border); border-radius: 8px; padding: 7px; min-height: 76px; background: var(--surface); font-size: 12.5px; font-weight: 600; }

/* Intranet split & Correspondence split */
.split-shell { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.channel-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px; border: 1.5px solid transparent;
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.channel-btn:hover { background: var(--surface-alt); border-color: var(--border); }
.channel-btn.active { background: var(--green); color: #fff; font-weight: 800; }

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .hero-split, .grid-7-5, .sites-split-layout, .module-split-header { grid-template-columns: 1fr; }
  .split-shell { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(2px);
    z-index: 35;
  }
  .main-area { margin-left: 0; padding-bottom: 84px; min-width: 0; width: 100%; }
  .app-footer { padding-bottom: 18px; flex-direction: column; gap: 4px; text-align: center; }
  .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .pos-product-grid { grid-template-columns: 1fr; }
  .mobile-only { display: inline-flex; }
  .studio-shell { grid-template-columns: 1fr; }
  .studio-mobile-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .studio-pane-hidden { display: none !important; }
  .toast { bottom: 78px; right: 12px; left: 12px; text-align: center; }
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 38;
    background: var(--surface);
    border-top: 2px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  }
  .mobile-bottom-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 800;
    padding: 6px 4px;
    border-radius: 10px;
    min-height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    text-align: center;
    line-height: 1.15;
  }
  .mobile-bottom-btn.active { color: #ffffff; background: var(--green); }
  .mobile-sheet-backdrop {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 48;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(3px);
    align-items: flex-end;
    justify-content: center;
  }
  .mobile-sheet {
    width: 100%;
    max-height: 82dvh;
    overflow-y: auto;
    background: var(--surface);
    border-top: 2px solid var(--border);
    border-radius: 22px 22px 0 0;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    display: grid;
    gap: 12px;
  }
  .mobile-sheet-handle {
    width: 42px; height: 4px; border-radius: 999px; background: var(--border); margin: 0 auto;
  }
  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 0 10px; height: 58px; }
  .topbar-brand, .sep, .user-display-name, .user-email-pill, .desktop-only-label, .sync-btn, .sync-pill { display: none; }
  .topbar-title { font-size: 15px; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .module-viewport { padding: 12px 10px; }
  .card { padding: 14px; }
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5, .grid-4, .grid-3, .grid-2, .sector-metrics-strip, .quick-nav-grid { grid-template-columns: 1fr; }
  .vchart-bar { width: 11px; }
  .studio-subtabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notif-drawer { right: 12px; left: 12px; width: auto; max-width: calc(100vw - 24px); }
  .modal-backdrop { padding: 8px; }
  .modal-card { padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-radius: 12px; max-height: 92dvh; }
  .btn, .tab-btn, .tab-link, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 42px; }
  .btn-sm { min-height: 38px; padding: 6px 11px; }
  td .row { flex-wrap: wrap; gap: 4px; }
  .login-brand, .login-form-panel { padding: 20px; }
  .auth-body { padding: 10px; }
  .auth-gate-card { padding: 20px; }
}

/* POS Fullscreen & Isolated Articles Scroll */
.pos-split-workspace {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  height: calc(100vh - 260px);
  min-height: 460px;
  overflow: hidden;
  align-items: stretch;
}
.pos-catalog-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pos-catalog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.pos-cart-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  overflow: hidden;
  gap: 8px;
}
.pos-cart-items {
  display: grid;
  gap: 6px;
  overflow: hidden;
}
body.pos-fullscreen-active {
  overflow: hidden !important;
  height: 100dvh;
}
body.pos-fullscreen-active .sidebar,
body.pos-fullscreen-active .topbar,
body.pos-fullscreen-active .app-footer,
body.pos-fullscreen-active .mobile-bottom-nav,
body.pos-fullscreen-active .sidebar-backdrop,
body.pos-fullscreen-active .role-preview-banner {
  display: none !important;
}
body.pos-fullscreen-active .main-area {
  margin-left: 0 !important;
  padding-bottom: 0 !important;
  height: 100dvh;
  overflow: hidden;
}
body.pos-fullscreen-active .module-viewport {
  padding: 12px !important;
  max-width: none !important;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}
body.pos-fullscreen-active .pos-hide-fullscreen {
  display: none !important;
}
body.pos-fullscreen-active .pos-fullscreen-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
body.pos-fullscreen-active #pos-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
body.pos-fullscreen-active .pos-split-workspace {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 960px) {
  .pos-split-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100dvh - 200px);
    min-height: 440px;
  }
  body.pos-fullscreen-active .pos-split-workspace {
    height: auto;
    min-height: 0;
  }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; color: #0f172a !important; }
  .main-area { margin-left: 0 !important; padding-bottom: 0 !important; }
  .module-viewport { padding: 0 !important; max-width: none !important; }
  .card, .print-area { border: none !important; box-shadow: none !important; padding: 0 !important; }
}
