:root {
  --blue: #246da8;
  --blue-dark: #174d78;
  --teal: #18a39a;
  --ink: #1b2a38;
  --muted: #667889;
  --line: #d9e4ec;
  --panel: #ffffff;
  --bg: #f3f7fa;
}

* { box-sizing: border-box; }
html { width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
  width: 100%;
  overflow-x: hidden;
}

.login-shell,
.landing-shell {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(12, 38, 57, .82), rgba(10, 79, 78, .52)),
    url("/assets/molded-pulp-packaging-login.png") center/cover;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.landing-shell {
  --blue: #246da8;
  --blue-dark: #174d78;
  --teal: #18a39a;
  --ink: #1b2a38;
  --muted: #667889;
  --line: #d9e4ec;
  --panel: #ffffff;
  --bg: #f3f7fa;
  color: #fff;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 52px);
  background: rgba(12, 38, 57, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.landing-brand strong,
.landing-brand small {
  display: block;
  line-height: 1.15;
}

.landing-brand strong {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}

.landing-brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .78);
  font-size: .78rem;
}

.landing-brand .brand-mark {
  width: 46px;
  height: 46px;
  font-size: 1.35rem;
}

.landing-login-btn {
  flex: 0 0 auto;
  border: 0;
  color: var(--blue-dark);
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}

.landing-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 6vw, 64px) 0 44px;
}

.landing-hero {
  min-height: min(500px, calc(100vh - 130px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  align-items: center;
  gap: clamp(22px, 5vw, 52px);
}

.landing-hero-copy {
  max-width: 720px;
}

.landing-kicker {
  margin: 0 0 10px;
  color: #c9f4ef;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.85rem);
  line-height: 1.08;
  font-weight: 800;
  max-width: 12.5em;
}

.landing-hero-copy > p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, .92);
  font-size: clamp(.98rem, 1.5vw, 1.12rem);
  line-height: 1.55;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.landing-actions .btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 800;
}

.landing-actions .btn-primary,
.closing-cta .btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 14px 28px rgba(6, 70, 89, .24);
}

.eco-hero {
  position: relative;
}

.eco-visual {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.eco-ring {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.24), rgba(255,255,255,.08) 44%, rgba(10,79,78,.18) 68%),
    linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  box-shadow: 0 24px 54px rgba(0,0,0,.22);
  overflow: hidden;
}

.eco-ring::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 2px dashed rgba(201,244,239,.68);
  border-radius: 50%;
}

.eco-product {
  position: relative;
  z-index: 2;
  width: 178px;
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  color: var(--ink);
}

.eco-product i {
  font-size: 2.4rem;
  color: var(--teal);
}

.eco-product strong,
.eco-product span {
  display: block;
}

.eco-product span {
  color: var(--muted);
  font-size: .86rem;
}

.eco-orbit {
  position: absolute;
  z-index: 3;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--blue-dark);
  font-size: 1.5rem;
  box-shadow: 0 14px 28px rgba(0,0,0,.2);
}

.orbit-recycle { top: 34px; left: calc(50% - 27px); color: var(--teal); }
.orbit-quality { right: 38px; top: calc(50% - 27px); color: var(--blue); }
.orbit-production { bottom: 34px; left: calc(50% - 27px); color: var(--blue-dark); }
.orbit-sustain { left: 38px; top: calc(50% - 27px); color: #198754; }

.landing-hero-panel {
  display: grid;
  gap: 12px;
}

.landing-metric {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .13);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px);
}

.landing-metric span,
.news-card-top,
.history-item span {
  color: rgba(255, 255, 255, .72);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.landing-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.homepage-section {
  margin-top: 34px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .2);
}

.mission-section,
.digital-section,
.matters-section {
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(237,250,248,.96));
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading .landing-kicker {
  color: var(--teal);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.news-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.news-link,
.news-link:hover {
  color: inherit;
  text-decoration: none;
}

.news-link:hover {
  border-color: rgba(36, 109, 168, .45);
  box-shadow: 0 10px 22px rgba(36, 109, 168, .12);
}

.news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  text-transform: none;
}

.news-card-top time {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 700;
}

.news-card h3 {
  margin: 14px 0 10px;
  font-size: 1rem;
  line-height: 1.35;
}

.news-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: .92rem;
}

.mission-grid,
.create-grid,
.digital-grid,
.value-grid {
  display: grid;
  gap: 14px;
}

.mission-grid,
.create-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mission-card,
.create-card {
  min-width: 0;
  min-height: 205px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(23,77,120,.08);
}

.mission-card i,
.create-card i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(36,109,168,.12), rgba(24,163,154,.18));
  color: var(--teal);
  font-size: 1.55rem;
}

.mission-card h3,
.create-card h3 {
  margin: 0 0 9px;
  font-size: 1.02rem;
}

.mission-card p,
.create-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.digital-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.digital-grid span,
.value-grid div {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 750;
}

.digital-grid i,
.value-grid i {
  margin-right: 8px;
  color: var(--teal);
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.process-step {
  position: relative;
  min-width: 0;
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(23,77,120,.08);
}

.process-step:not(:last-child)::after {
  content: "\F138";
  font-family: "bootstrap-icons";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--teal);
  background: #fff;
  border-radius: 50%;
  font-size: 1.15rem;
}

.process-step i {
  font-size: 1.7rem;
  color: var(--teal);
}

.process-step span {
  font-weight: 800;
  color: var(--blue-dark);
  overflow-wrap: anywhere;
}

.value-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.history-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.history-item {
  position: relative;
  padding: 22px 18px 18px 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #f8fbfd);
  box-shadow: 0 12px 26px rgba(23,77,120,.08);
}

.history-item::before {
  content: "\F26E";
  font-family: "bootstrap-icons";
  position: absolute;
  left: 16px;
  top: 19px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(24, 163, 154, .13);
  color: var(--teal);
  font-size: .9rem;
}

.history-item span {
  display: block;
  color: var(--blue-dark);
}

.history-item p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.closing-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(135deg, rgba(23,77,120,.96), rgba(24,163,154,.94));
  color: #fff;
}

.closing-cta .landing-kicker {
  color: #c9f4ef;
}

.closing-cta h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.05rem);
  line-height: 1.25;
}

.login-modal .modal-dialog {
  width: min(430px, calc(100% - 28px));
}

.login-modal-content {
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.login-panel {
  position: relative;
  width: min(430px, 100%);
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  padding: 34px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}
.login-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.login-panel h1 { font-size: 1.55rem; margin: 0 0 4px; }
.login-panel p { color: var(--muted); margin: 0; }
.login-powered {
  text-align: center;
  font-style: italic;
  font-size: .78rem;
  margin-top: 10px !important;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  font-size: 1.6rem;
}
.demo-users {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

#appShell {
  min-height: 100vh;
  padding-top: 58px;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue), var(--teal));
  min-height: 58px;
  width: 100%;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}
.navbar-brand {
  min-width: 0;
  max-width: 62vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-users {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 42vw;
  overflow: hidden;
}

.force-logout-btn {
  border: 0;
  background: transparent;
  color: #dc3545;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  padding: 0;
}

.force-logout-btn:hover {
  background: rgba(220, 53, 69, .14);
}

.activity-log-length {
  width: 92px;
}
.notification-panel {
  position: relative;
  flex: 0 1 320px;
  max-width: 36vw;
}
.notification-bar {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 11px;
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
}
.notification-bar.has-notifications {
  background: rgba(255, 255, 255, .24);
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(430px, 92vw);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .18s ease, opacity .14s ease, transform .14s ease;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .2);
  color: var(--ink);
}
.notification-panel:hover .notification-dropdown,
.notification-panel:focus-within .notification-dropdown {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
}
.notification-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.notification-clear-all,
.notification-dismiss {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
}
.notification-list {
  max-height: 355px;
  overflow-y: auto;
}
.notification-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.notification-row:last-child { border-bottom: 0; }
.notification-row.admin-alert {
  background: #fff8e5;
}
.notification-row.message-alert {
  background: #eef7ff;
}
.notification-message {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  text-align: left;
  font-size: .86rem;
}
.notification-message:hover {
  background: #eef6ff;
}
.notification-dismiss {
  padding: 0 12px;
}
.notification-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: .86rem;
}
.notification-item.admin-alert {
  background: rgba(240, 180, 41, .34);
}
.message-top-btn {
  flex: 0 0 auto;
}
.message-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 14px;
}
.message-sidebar {
  border-right: 1px solid var(--line);
  padding-right: 14px;
}
.message-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}
.message-main {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(230px, 44vh) auto;
  gap: 12px;
}
.message-history {
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}
.message-bubble {
  width: fit-content;
  max-width: min(82%, 520px);
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  overflow-wrap: anywhere;
}
.message-bubble.mine {
  margin-left: auto;
  background: #e8f5f4;
  border-color: rgba(24, 163, 154, .28);
}
.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .72rem;
}
.message-unsend {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 700;
  padding: 0;
}
.message-unsend:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}
.message-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.message-form {
  display: grid;
  gap: 8px;
}
.message-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem;
}
.row-pulse-blue td {
  animation: pulseBlue 1.35s ease-in-out 5;
  background: #dbeeff !important;
}
@keyframes pulseBlue {
  0%, 100% { box-shadow: inset 0 0 0 rgba(36, 109, 168, 0); }
  50% { box-shadow: inset 0 0 18px rgba(36, 109, 168, .55); }
}
.online-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 180px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: .8rem;
}
.online-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
}
.online-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-0 { background: #0f766e; }
.avatar-1 { background: #2563eb; }
.avatar-2 { background: #be123c; }
.avatar-3 { background: #7c3aed; }
.avatar-4 { background: #b45309; }
.avatar-5 { background: #15803d; }
.app-layout { display: grid; grid-template-columns: 270px 1fr; min-height: calc(100vh - 58px); }
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  overflow-y: auto;
}
.content { padding: 22px; min-width: 0; }
.page-title-row {
  position: sticky;
  top: 58px;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 18px;
  padding: 18px 22px 14px;
  background: rgba(245, 247, 251, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.page-title-row > div:first-child { min-width: 0; }
.page-title-row h2 { font-size: 1.45rem; margin: 0; }
.page-title-row p { color: var(--muted); margin: 4px 0 0; }
#pageActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
#pageActions .btn { margin: 0 !important; }

.menu-group-title {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 16px 10px 6px;
}
.nav-link.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #395061;
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 2px;
  font-size: .93rem;
}
.nav-link.menu-link.active,
.nav-link.menu-link:hover {
  background: #e8f3f6;
  color: var(--blue-dark);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi-card, .chart-panel, .data-panel, .trace-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(31, 64, 88, .05);
}
.kpi-card { padding: 16px; min-height: 112px; min-width: 0; }
.kpi-card .label { color: var(--muted); font-size: .82rem; }
.kpi-card .value { font-size: clamp(1.25rem, 3vw, 1.7rem); font-weight: 750; margin-top: 8px; overflow-wrap: anywhere; }
.kpi-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.kpi-pair div {
  min-width: 0;
  border-left: 3px solid #d7e8f6;
  padding-left: 8px;
}
.kpi-pair span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.kpi-pair strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(1.12rem, 2.3vw, 1.55rem);
  overflow-wrap: anywhere;
}
.kpi-card .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f7f6;
  color: var(--teal);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.chart-panel {
  display: flex;
  flex-direction: column;
  height: 340px;
  min-height: 340px;
  min-width: 0;
  padding: 16px;
}
.chart-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 270px;
}
.chart-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
}
.chart-panel h3, .data-panel h3 {
  font-size: 1rem;
  margin: 0 0 12px;
}
.chart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chart-panel-head h3 { margin: 0 0 12px; }

.data-panel { padding: 14px; overflow-x: auto; }
.process-queue {
  overflow: hidden;
}
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.queue-head h3 {
  margin: 0;
}
.queue-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e8f7f6;
  color: #116b66;
  font-size: .78rem;
  font-weight: 700;
}
.queue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.queue-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfe;
}
.queue-action {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.queue-action:hover,
.queue-action:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 150, 142, .14);
  outline: none;
}
.queue-model {
  font-weight: 750;
  overflow-wrap: anywhere;
}
.queue-meta {
  color: var(--muted);
  font-size: .82rem;
  margin-top: 4px;
}
.queue-qty {
  margin-top: 10px;
  color: var(--blue-dark);
  font-weight: 750;
}
.planning-job-item[draggable="true"] {
  cursor: grab;
}
.planning-dragging {
  opacity: .55;
  outline: 2px solid rgba(20, 150, 142, .22);
}
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ops-card {
  min-width: 0;
}
.admin-control-panel,
.admin-control-card {
  border-color: rgba(14, 71, 103, .16);
  box-shadow: 0 10px 28px rgba(16, 58, 78, .08);
}
.admin-control-panel h3,
.admin-control-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: #12384e;
  font-size: 1.02rem;
  font-weight: 800;
}
.admin-card-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f7f6;
  color: #116b66;
  font-size: 1rem;
}
.admin-card-icon.danger {
  background: #fff0f0;
  color: #b42318;
}
.ops-card p {
  min-height: 38px;
}
.admin-control-card p {
  color: #4f6473 !important;
  line-height: 1.45;
}
.backup-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid rgba(17, 107, 102, .22);
  border-radius: 8px;
  background: #f1fbfa;
  color: #0e6761;
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
}
.backup-guide-link:hover,
.backup-guide-link:focus {
  color: #0a4d49;
  border-color: rgba(17, 107, 102, .42);
  box-shadow: 0 0 0 3px rgba(20, 150, 142, .13);
}
.ops-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfe;
}
.ops-metric span,
.ops-metric small {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  overflow-wrap: anywhere;
}
.ops-metric strong {
  display: block;
  margin: 4px 0;
  font-size: 1.25rem;
  color: var(--blue-dark);
}
.danger-zone {
  border-color: #f1b8b8;
  background: #fffafa;
}
.danger-zone h3 {
  color: #8a1f16;
}
.danger-zone .text-muted {
  color: #6f4a4a !important;
}
.update-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfe;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.album-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.album-card i {
  color: var(--teal);
  font-size: 1.35rem;
}
.album-card strong,
.album-card span {
  display: block;
  overflow-wrap: anywhere;
}
.album-card span {
  color: var(--muted);
  font-size: .82rem;
}
.product-upload-preview {
  min-height: 78px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fbfdfe;
}
.product-upload-preview img {
  max-width: 160px;
  max-height: 120px;
  object-fit: contain;
}
.product-preview {
  display: grid;
  grid-template-columns: minmax(260px, 42%) 1fr;
  gap: 18px;
  align-items: start;
}
.product-photo {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fbfdfe;
  overflow: hidden;
}
.product-photo img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
}
.product-photo.placeholder {
  color: var(--muted);
  font-size: 4rem;
}
.product-specs h3 {
  font-size: 1.25rem;
  margin: 8px 0 14px;
}
.product-album {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #e8f7f6;
  color: #116b66;
  font-size: .84rem;
  font-weight: 700;
}
.spec-notes {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.spec-notes p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}
.modal-dialog {
  margin-block: 12px;
}
.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 24px);
}
#recordForm {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.modal-header,
.modal-footer {
  padding: 10px 14px;
}
.modal-title {
  font-size: 1rem;
}
.modal-body {
  padding: 12px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#recordFields {
  --bs-gutter-x: .65rem;
  --bs-gutter-y: .55rem;
}
#recordModal .form-label {
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 3px;
}
#recordModal .form-control,
#recordModal .form-select {
  min-height: 34px;
  padding: 5px 9px;
  font-size: .9rem;
}
#recordModal textarea.form-control {
  min-height: 58px;
}
#recordModal .modal-footer {
  gap: 8px;
  flex-shrink: 0;
}
.table { width: 100% !important; min-width: 860px; }
.table th,
.table td {
  text-align: center;
  vertical-align: middle;
}
.table thead th,
.dt-container table.dataTable thead th,
.dt-container table.dataTable thead td,
.dt-container .dt-type-numeric,
.dt-container .dt-type-date {
  text-align: center !important;
  vertical-align: middle !important;
}
.table .btn-group {
  justify-content: center;
}
.module-table-product_library table th,
.module-table-product_library table td,
.module-table-products table th,
.module-table-products table td,
.module-table-molds table th,
.module-table-molds table td,
.module-table-raw_material_withdrawals table th,
.module-table-raw_material_withdrawals table td,
.module-table-fg_stock_in table th,
.module-table-fg_stock_in table td,
.module-table-product_library .dt-type-numeric,
.module-table-products .dt-type-numeric,
.module-table-molds .dt-type-numeric,
.module-table-raw_material_withdrawals .dt-type-numeric,
.module-table-fg_stock_in .dt-type-numeric {
  text-align: center !important;
  vertical-align: middle !important;
}
.module-table-product_library .btn-group,
.module-table-products .btn-group,
.module-table-molds .btn-group,
.module-table-raw_material_withdrawals .btn-group,
.module-table-fg_stock_in .btn-group {
  justify-content: center !important;
}
.dt-container { font-size: .9rem; }
.dt-layout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.dt-layout-cell {
  min-width: 0;
}
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: #12857f; border-color: #12857f; color: #fff; }

.trace-search {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}
.trace-card { margin-bottom: 12px; overflow: hidden; }
.trace-head {
  padding: 14px 16px;
  background: #eef7fa;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.genealogy {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.genealogy-node {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.genealogy-node h4 { font-size: .95rem; margin: 0 0 8px; color: var(--blue-dark); }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 4px 12px; font-size: .9rem; }
.kv span:nth-child(odd) { color: var(--muted); }
.trace-timeline {
  display: grid;
  gap: 8px;
}
.trace-event {
  border-left: 3px solid var(--teal);
  padding: 4px 0 6px 10px;
}
.trace-event strong,
.trace-event span,
.trace-event small {
  display: block;
}
.trace-event span { color: var(--ink); }
.trace-event small { color: var(--muted); }
.trace-flow-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.trace-flow-badge {
  align-self: flex-start;
  border: 1px solid #b9d8e4;
  background: #f4fbfd;
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}
.trace-flow-scroll {
  overflow-x: auto;
  padding: 14px;
}
.trace-flow {
  display: grid;
  grid-template-columns: repeat(var(--trace-stage-count, 7), minmax(230px, 1fr));
  grid-template-rows: 38px repeat(var(--trace-row-count, 1), minmax(150px, auto));
  column-gap: 34px;
  row-gap: 22px;
  min-width: 1460px;
  position: relative;
}
.trace-connector-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
}
.trace-connector-path {
  fill: none;
  stroke: #0f7f95;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .95;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.95));
  vector-effect: non-scaling-stroke;
}
.trace-arrow-head {
  fill: #0f7f95;
}
.trace-connector-spine {
  fill: none;
  stroke: #0a5f73;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 7 5;
  opacity: .9;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.95));
}
.trace-stage-title {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #163f52;
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  text-align: center;
  padding: 8px;
  position: relative;
  z-index: 3;
}
.trace-flow-cell {
  position: relative;
  min-width: 0;
  display: grid;
  z-index: 3;
}
.trace-flow-node,
.trace-empty {
  min-height: 142px;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(22, 63, 82, .07);
}
.trace-flow-node {
  position: relative;
  z-index: 3;
}
.trace-flow-node.is-shared {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: #0f7f95;
  background: #f4fbfd;
  box-shadow: 0 8px 22px rgba(15, 127, 149, .12);
}
.trace-flow-node.is-shared::before {
  content: "Shared";
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-block;
  border-radius: 999px;
  background: #0f7f95;
  color: #fff;
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 0;
}
.trace-flow-cell:not(:last-child)::after {
  display: none;
}
.trace-flow-node.is-connected:not(.is-shared)::before {
  display: none;
}
.trace-flow-cell:first-child .trace-flow-node:not(.is-shared)::before {
  display: none;
}
.trace-flow-node.is-connected::after {
  display: none;
}
.trace-flow-cell:last-child::after,
.trace-flow-cell:last-child .trace-flow-node::after {
  display: none;
}
.trace-node-date {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
  text-transform: uppercase;
}
.trace-flow-node h4 {
  margin: 4px 0;
  color: var(--blue-dark);
  font-size: .96rem;
  overflow-wrap: anywhere;
}
.trace-flow-node p {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: .82rem;
  overflow-wrap: anywhere;
}
.trace-flow-node dl {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 3px 8px;
  margin: 0;
  font-size: .78rem;
}
.trace-flow-node dt {
  color: var(--muted);
  font-weight: 750;
}
.trace-flow-node dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.trace-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f7fafb;
  border-style: dashed;
  text-align: center;
  font-size: .84rem;
}

.gantt { display: grid; gap: 10px; }
.gantt-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.gantt-bar { min-height: 28px; border-radius: 6px; padding: 4px 10px; color: #123; font-size: .82rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.gantt-bar.Completed { background: #bfe8ce; }
.gantt-bar.Upcoming { background: #ffe599; }
.gantt-bar.Overdue { background: #f5b5b5; }

.theme-select {
  width: 132px;
  background-color: rgba(255, 255, 255, .92);
}

.inventory-summary-table tbody tr {
  cursor: zoom-in;
}

.inventory-breakdown {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.inventory-breakdown h4 {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.pm-calendar-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pm-calendar-selects {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 110px;
  gap: 8px;
}

.pm-calendar-weekdays,
.pm-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.pm-calendar-weekdays span {
  text-align: center;
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
}

.pm-calendar-day {
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.pm-calendar-day.is-muted {
  background: transparent;
  border-color: transparent;
}

.pm-calendar-day.is-today {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 163, 154, .14);
}

.pm-day-number {
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}

.pm-day-events {
  display: grid;
  gap: 5px;
}

.pm-event {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 6px;
  font-size: .75rem;
  line-height: 1.2;
  text-align: left;
  background: #e9f6fb;
  color: #123;
}

.pm-event.Completed { background: #d7f2df; }
.pm-event.Upcoming { background: #fff0b8; }
.pm-event.Overdue { background: #ffd2d2; }
.pm-event.is-completed-event {
  background: #d7f2df;
  border-left: 4px solid #2f9e58;
}
.pm-event.is-due-event {
  border-left: 4px solid #f0b429;
}

.pm-event em {
  font-style: normal;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  opacity: .82;
}

.pm-event span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

html[data-theme="soft-dark"] {
  --bg: #101722;
  --panel: #172232;
  --ink: #edf4fb;
  --muted: #b7c5d5;
  --line: rgba(173, 190, 210, .28);
  --blue: #5da2db;
  --blue-dark: #1b3854;
  --teal: #4fd1c5;
}

html[data-theme="soft-dark"] body,
html[data-theme="ios-glass"] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="soft-dark"] .app-layout,
html[data-theme="soft-dark"] .content,
html[data-theme="soft-dark"] .sidebar,
html[data-theme="soft-dark"] .page-title-row,
html[data-theme="soft-dark"] .data-panel,
html[data-theme="soft-dark"] .ops-card,
html[data-theme="soft-dark"] .ops-metric,
html[data-theme="soft-dark"] .danger-zone,
html[data-theme="soft-dark"] .update-status,
html[data-theme="soft-dark"] .kpi-card,
html[data-theme="soft-dark"] .chart-panel,
html[data-theme="soft-dark"] .trace-card,
html[data-theme="soft-dark"] .album-card,
html[data-theme="soft-dark"] .product-photo,
html[data-theme="soft-dark"] .product-upload-preview,
html[data-theme="soft-dark"] .process-queue,
html[data-theme="soft-dark"] .message-panel,
html[data-theme="soft-dark"] .message-sidebar,
html[data-theme="soft-dark"] .notification-dropdown,
html[data-theme="soft-dark"] .modal-content,
html[data-theme="soft-dark"] .modal-header,
html[data-theme="soft-dark"] .modal-footer,
html[data-theme="soft-dark"] .offcanvas,
html[data-theme="soft-dark"] .pm-calendar-day,
html[data-theme="soft-dark"] .inventory-breakdown {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .topbar {
  background: #14283d !important;
  border-bottom: 1px solid var(--line);
}

html[data-theme="soft-dark"] .sidebar {
  background: #121d2b;
}

html[data-theme="soft-dark"] .nav-link,
html[data-theme="soft-dark"] .menu-link,
html[data-theme="ios-glass"] .nav-link,
html[data-theme="ios-glass"] .menu-link {
  color: var(--ink);
}

html[data-theme="soft-dark"] .menu-group-title,
html[data-theme="ios-glass"] .menu-group-title {
  color: var(--muted);
}

html[data-theme="soft-dark"] .table,
html[data-theme="ios-glass"] .table {
  --bs-table-color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-striped-color: var(--ink);
  --bs-table-striped-bg: rgba(255, 255, 255, .045);
  --bs-table-hover-color: var(--ink);
  --bs-table-hover-bg: rgba(24, 163, 154, .14);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .form-control,
html[data-theme="soft-dark"] .form-select,
html[data-theme="soft-dark"] textarea,
html[data-theme="ios-glass"] .form-control,
html[data-theme="ios-glass"] .form-select,
html[data-theme="ios-glass"] textarea {
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .form-control::placeholder,
html[data-theme="soft-dark"] .form-select::placeholder,
html[data-theme="ios-glass"] .form-control::placeholder,
html[data-theme="ios-glass"] .form-select::placeholder {
  color: rgba(237, 244, 251, .62);
}

html[data-theme="soft-dark"] .form-select option,
html[data-theme="ios-glass"] .form-select option {
  background: #172232;
  color: #edf4fb;
}

html[data-theme="soft-dark"] .btn-outline-secondary,
html[data-theme="ios-glass"] .btn-outline-secondary {
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .alert,
html[data-theme="ios-glass"] .alert {
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .admin-control-panel,
html[data-theme="soft-dark"] .admin-control-card,
html[data-theme="ios-glass"] .admin-control-panel,
html[data-theme="ios-glass"] .admin-control-card {
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

html[data-theme="soft-dark"] .admin-control-panel h3,
html[data-theme="soft-dark"] .admin-control-card h3,
html[data-theme="soft-dark"] .admin-control-panel h3 i,
html[data-theme="soft-dark"] .admin-control-card h3 i,
html[data-theme="ios-glass"] .admin-control-panel h3,
html[data-theme="ios-glass"] .admin-control-card h3,
html[data-theme="ios-glass"] .admin-control-panel h3 i,
html[data-theme="ios-glass"] .admin-control-card h3 i {
  color: var(--ink);
}

html[data-theme="soft-dark"] .admin-control-card p,
html[data-theme="ios-glass"] .admin-control-card p {
  color: var(--muted) !important;
}

html[data-theme="soft-dark"] .admin-control-panel,
html[data-theme="soft-dark"] .admin-control-card,
html[data-theme="soft-dark"] .admin-control-panel label,
html[data-theme="soft-dark"] .admin-control-card label,
html[data-theme="soft-dark"] .admin-control-panel .form-label,
html[data-theme="soft-dark"] .admin-control-card .form-label,
html[data-theme="soft-dark"] .admin-control-panel .form-check-label,
html[data-theme="soft-dark"] .admin-control-card .form-check-label,
html[data-theme="soft-dark"] .admin-control-panel .small,
html[data-theme="soft-dark"] .admin-control-card .small,
html[data-theme="ios-glass"] .admin-control-panel,
html[data-theme="ios-glass"] .admin-control-card,
html[data-theme="ios-glass"] .admin-control-panel label,
html[data-theme="ios-glass"] .admin-control-card label,
html[data-theme="ios-glass"] .admin-control-panel .form-label,
html[data-theme="ios-glass"] .admin-control-card .form-label,
html[data-theme="ios-glass"] .admin-control-panel .form-check-label,
html[data-theme="ios-glass"] .admin-control-card .form-check-label,
html[data-theme="ios-glass"] .admin-control-panel .small,
html[data-theme="ios-glass"] .admin-control-card .small {
  color: var(--ink);
}

html[data-theme="soft-dark"] .admin-card-icon,
html[data-theme="ios-glass"] .admin-card-icon {
  background: rgba(255, 255, 255, .14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, .16);
}

html[data-theme="soft-dark"] .admin-card-icon.danger,
html[data-theme="ios-glass"] .admin-card-icon.danger {
  background: rgba(248, 113, 113, .18);
  color: #fca5a5;
}

html[data-theme="soft-dark"] .danger-zone h3,
html[data-theme="ios-glass"] .danger-zone h3 {
  color: #fecaca;
}

html[data-theme="soft-dark"] .danger-zone .text-muted,
html[data-theme="ios-glass"] .danger-zone .text-muted {
  color: #f0b8b8 !important;
}

html[data-theme="soft-dark"] .backup-guide-link,
html[data-theme="ios-glass"] .backup-guide-link {
  background: rgba(79, 209, 197, .12);
  border-color: rgba(79, 209, 197, .28);
  color: #b9fff8;
}

html[data-theme="soft-dark"] .backup-guide-link:hover,
html[data-theme="soft-dark"] .backup-guide-link:focus,
html[data-theme="ios-glass"] .backup-guide-link:hover,
html[data-theme="ios-glass"] .backup-guide-link:focus {
  color: #ffffff;
  border-color: rgba(79, 209, 197, .52);
  box-shadow: 0 0 0 3px rgba(79, 209, 197, .15);
}

html[data-theme="soft-dark"] .chart-panel h3,
html[data-theme="soft-dark"] .data-panel h3,
html[data-theme="soft-dark"] .kpi-card .value,
html[data-theme="soft-dark"] .kpi-pair strong,
html[data-theme="soft-dark"] .ops-metric strong,
html[data-theme="ios-glass"] .chart-panel h3,
html[data-theme="ios-glass"] .data-panel h3,
html[data-theme="ios-glass"] .kpi-card .value,
html[data-theme="ios-glass"] .kpi-pair strong,
html[data-theme="ios-glass"] .ops-metric strong {
  color: var(--ink);
}

html[data-theme="soft-dark"] .kpi-card .label,
html[data-theme="soft-dark"] .kpi-pair span,
html[data-theme="soft-dark"] .ops-metric span,
html[data-theme="soft-dark"] .ops-metric small,
html[data-theme="ios-glass"] .kpi-card .label,
html[data-theme="ios-glass"] .kpi-pair span,
html[data-theme="ios-glass"] .ops-metric span,
html[data-theme="ios-glass"] .ops-metric small {
  color: var(--muted);
}

html[data-theme="soft-dark"] .kpi-card .icon,
html[data-theme="ios-glass"] .kpi-card .icon {
  background: rgba(255, 255, 255, .13);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, .14);
}

html[data-theme="soft-dark"] .trace-card,
html[data-theme="soft-dark"] .trace-flow-card,
html[data-theme="soft-dark"] .trace-flow-node,
html[data-theme="soft-dark"] .trace-empty,
html[data-theme="soft-dark"] .genealogy-node,
html[data-theme="soft-dark"] .presentation-admin-panel,
html[data-theme="soft-dark"] .queue-item,
html[data-theme="soft-dark"] .process-queue,
html[data-theme="soft-dark"] .planning-sequence,
html[data-theme="ios-glass"] .trace-card,
html[data-theme="ios-glass"] .trace-flow-card,
html[data-theme="ios-glass"] .trace-flow-node,
html[data-theme="ios-glass"] .trace-empty,
html[data-theme="ios-glass"] .genealogy-node,
html[data-theme="ios-glass"] .presentation-admin-panel,
html[data-theme="ios-glass"] .queue-item,
html[data-theme="ios-glass"] .process-queue,
html[data-theme="ios-glass"] .planning-sequence {
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

html[data-theme="ios-glass"] .trace-card,
html[data-theme="ios-glass"] .trace-flow-card,
html[data-theme="ios-glass"] .trace-flow-node,
html[data-theme="ios-glass"] .trace-empty,
html[data-theme="ios-glass"] .genealogy-node,
html[data-theme="ios-glass"] .presentation-admin-panel,
html[data-theme="ios-glass"] .queue-item,
html[data-theme="ios-glass"] .process-queue,
html[data-theme="ios-glass"] .planning-sequence {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045)),
    rgba(20, 31, 48, .46);
  backdrop-filter: blur(18px);
}

html[data-theme="soft-dark"] .trace-head,
html[data-theme="ios-glass"] .trace-head {
  background: rgba(255, 255, 255, .07);
  color: var(--ink);
  border-bottom-color: var(--line);
}

html[data-theme="soft-dark"] .trace-head strong,
html[data-theme="soft-dark"] .trace-head span,
html[data-theme="soft-dark"] .trace-flow-node h4,
html[data-theme="soft-dark"] .trace-flow-node p,
html[data-theme="soft-dark"] .trace-flow-node dd,
html[data-theme="soft-dark"] .genealogy-node h4,
html[data-theme="soft-dark"] .genealogy-node,
html[data-theme="soft-dark"] .kv span,
html[data-theme="soft-dark"] .queue-model,
html[data-theme="soft-dark"] .queue-action,
html[data-theme="soft-dark"] .planning-job-item,
html[data-theme="ios-glass"] .trace-head strong,
html[data-theme="ios-glass"] .trace-head span,
html[data-theme="ios-glass"] .trace-flow-node h4,
html[data-theme="ios-glass"] .trace-flow-node p,
html[data-theme="ios-glass"] .trace-flow-node dd,
html[data-theme="ios-glass"] .genealogy-node h4,
html[data-theme="ios-glass"] .genealogy-node,
html[data-theme="ios-glass"] .kv span,
html[data-theme="ios-glass"] .queue-model,
html[data-theme="ios-glass"] .queue-action,
html[data-theme="ios-glass"] .planning-job-item {
  color: var(--ink);
}

html[data-theme="soft-dark"] .trace-node-date,
html[data-theme="soft-dark"] .trace-flow-node dt,
html[data-theme="soft-dark"] .trace-event small,
html[data-theme="soft-dark"] .queue-meta,
html[data-theme="soft-dark"] .form-text,
html[data-theme="ios-glass"] .trace-node-date,
html[data-theme="ios-glass"] .trace-flow-node dt,
html[data-theme="ios-glass"] .trace-event small,
html[data-theme="ios-glass"] .queue-meta,
html[data-theme="ios-glass"] .form-text {
  color: var(--muted);
}

html[data-theme="soft-dark"] .trace-flow-node.is-shared,
html[data-theme="ios-glass"] .trace-flow-node.is-shared {
  border-color: rgba(94, 234, 212, .56);
  background: rgba(79, 209, 197, .13);
  box-shadow: 0 10px 30px rgba(79, 209, 197, .12);
}

html[data-theme="soft-dark"] .trace-flow-node.is-shared::before,
html[data-theme="ios-glass"] .trace-flow-node.is-shared::before {
  background: rgba(94, 234, 212, .22);
  color: #ffffff;
  border: 1px solid rgba(94, 234, 212, .35);
}

html[data-theme="soft-dark"] .trace-flow-badge,
html[data-theme="ios-glass"] .trace-flow-badge {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .18);
  color: var(--ink);
}

html[data-theme="soft-dark"] .trace-stage-title,
html[data-theme="ios-glass"] .trace-stage-title {
  background: rgba(255, 255, 255, .14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, .16);
}

html[data-theme="soft-dark"] .trace-connector-path,
html[data-theme="ios-glass"] .trace-connector-path {
  stroke: #5eead4;
  opacity: .98;
  filter: drop-shadow(0 0 5px rgba(94, 234, 212, .42));
}

html[data-theme="soft-dark"] .trace-arrow-head,
html[data-theme="ios-glass"] .trace-arrow-head {
  fill: #5eead4;
}

html[data-theme="soft-dark"] .trace-connector-spine,
html[data-theme="ios-glass"] .trace-connector-spine {
  stroke: #93c5fd;
  opacity: .92;
  filter: drop-shadow(0 0 5px rgba(147, 197, 253, .35));
}

html[data-theme="soft-dark"] .trace-flow-node.is-connected::after,
html[data-theme="ios-glass"] .trace-flow-node.is-connected::after {
  background: #5eead4;
  border-color: rgba(14, 23, 36, .95);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .2);
}

html[data-theme="soft-dark"] .queue-qty,
html[data-theme="ios-glass"] .queue-qty {
  color: #b9fff8;
}

html[data-theme="soft-dark"] .queue-action:hover,
html[data-theme="soft-dark"] .queue-action:focus,
html[data-theme="ios-glass"] .queue-action:hover,
html[data-theme="ios-glass"] .queue-action:focus {
  border-color: rgba(94, 234, 212, .58);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .14);
}

html[data-theme="soft-dark"] .presentation-admin-panel,
html[data-theme="soft-dark"] .presentation-admin-panel label,
html[data-theme="soft-dark"] .presentation-admin-panel th,
html[data-theme="soft-dark"] .presentation-admin-panel td,
html[data-theme="ios-glass"] .presentation-admin-panel,
html[data-theme="ios-glass"] .presentation-admin-panel label,
html[data-theme="ios-glass"] .presentation-admin-panel th,
html[data-theme="ios-glass"] .presentation-admin-panel td {
  color: var(--ink);
}

html[data-theme="soft-dark"] .presentation-admin-panel .btn-outline-primary,
html[data-theme="ios-glass"] .presentation-admin-panel .btn-outline-primary {
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, .5);
}

html[data-theme="soft-dark"] .presentation-admin-panel .btn-outline-primary:hover,
html[data-theme="ios-glass"] .presentation-admin-panel .btn-outline-primary:hover {
  color: #07111f;
  background: #bfdbfe;
  border-color: #bfdbfe;
}

html[data-theme="soft-dark"] .presentation-admin-panel .btn-outline-danger,
html[data-theme="ios-glass"] .presentation-admin-panel .btn-outline-danger {
  color: #fecaca;
  border-color: rgba(252, 165, 165, .5);
}

html[data-theme="soft-dark"] .presentation-admin-panel .btn-outline-danger:hover,
html[data-theme="ios-glass"] .presentation-admin-panel .btn-outline-danger:hover {
  color: #2b0707;
  background: #fecaca;
  border-color: #fecaca;
}

html[data-theme="ios-glass"] {
  --bg: radial-gradient(circle at top left, #173b57, #101827 42%, #070b14);
  --panel: rgba(20, 31, 48, .58);
  --ink: #f6fbff;
  --muted: #c7d6e7;
  --line: rgba(255, 255, 255, .2);
  --blue: #78b9ff;
  --blue-dark: rgba(22, 48, 76, .78);
  --teal: #5eead4;
}

html[data-theme="ios-glass"] .topbar {
  background: rgba(13, 30, 50, .72) !important;
  backdrop-filter: blur(18px);
}

html[data-theme="ios-glass"] .app-layout,
html[data-theme="ios-glass"] .content,
html[data-theme="ios-glass"] .sidebar,
html[data-theme="ios-glass"] .page-title-row,
html[data-theme="ios-glass"] .data-panel,
html[data-theme="ios-glass"] .ops-card,
html[data-theme="ios-glass"] .ops-metric,
html[data-theme="ios-glass"] .danger-zone,
html[data-theme="ios-glass"] .update-status,
html[data-theme="ios-glass"] .kpi-card,
html[data-theme="ios-glass"] .chart-panel,
html[data-theme="ios-glass"] .trace-card,
html[data-theme="ios-glass"] .album-card,
html[data-theme="ios-glass"] .product-photo,
html[data-theme="ios-glass"] .product-upload-preview,
html[data-theme="ios-glass"] .process-queue,
html[data-theme="ios-glass"] .message-panel,
html[data-theme="ios-glass"] .message-sidebar,
html[data-theme="ios-glass"] .notification-dropdown,
html[data-theme="ios-glass"] .modal-content,
html[data-theme="ios-glass"] .modal-header,
html[data-theme="ios-glass"] .modal-footer,
html[data-theme="ios-glass"] .offcanvas,
html[data-theme="ios-glass"] .pm-calendar-day,
html[data-theme="ios-glass"] .inventory-breakdown {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}

html[data-theme="ios-glass"] .sidebar {
  background: rgba(12, 20, 32, .54);
}

html[data-theme="ios-glass"] .data-panel,
html[data-theme="ios-glass"] .ops-card,
html[data-theme="ios-glass"] .ops-metric,
html[data-theme="ios-glass"] .danger-zone,
html[data-theme="ios-glass"] .update-status,
html[data-theme="ios-glass"] .kpi-card,
html[data-theme="ios-glass"] .chart-panel,
html[data-theme="ios-glass"] .trace-card,
html[data-theme="ios-glass"] .album-card,
html[data-theme="ios-glass"] .product-photo,
html[data-theme="ios-glass"] .product-upload-preview,
html[data-theme="ios-glass"] .pm-calendar-day,
html[data-theme="ios-glass"] .modal-content {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045)),
    var(--panel);
}

html[data-theme="soft-dark"] .text-muted,
html[data-theme="ios-glass"] .text-muted,
html[data-theme="soft-dark"] .pm-calendar-weekdays span,
html[data-theme="ios-glass"] .pm-calendar-weekdays span {
  color: var(--muted) !important;
}

html[data-theme="soft-dark"] .pm-day-number,
html[data-theme="ios-glass"] .pm-day-number {
  color: var(--ink);
}

html[data-theme="soft-dark"] .pm-event,
html[data-theme="ios-glass"] .pm-event {
  color: #f6fbff;
  background: rgba(93, 162, 219, .26);
}

html[data-theme="soft-dark"] .pm-event.Completed,
html[data-theme="soft-dark"] .pm-event.is-completed-event,
html[data-theme="ios-glass"] .pm-event.Completed,
html[data-theme="ios-glass"] .pm-event.is-completed-event {
  background: rgba(47, 158, 88, .32);
  border-left-color: #67e8a3;
}

html[data-theme="soft-dark"] .pm-event.Upcoming,
html[data-theme="soft-dark"] .pm-event.is-due-event,
html[data-theme="ios-glass"] .pm-event.Upcoming,
html[data-theme="ios-glass"] .pm-event.is-due-event {
  background: rgba(240, 180, 41, .3);
  border-left-color: #facc15;
}

html[data-theme="soft-dark"] .pm-event.Overdue,
html[data-theme="ios-glass"] .pm-event.Overdue {
  background: rgba(224, 93, 93, .34);
  border-left-color: #fb7185;
}

html[data-theme="soft-dark"] a,
html[data-theme="ios-glass"] a {
  color: #8bd3ff;
}

html[data-theme="soft-dark"] .landing-shell,
html[data-theme="ios-glass"] .landing-shell {
  --blue: #246da8;
  --blue-dark: #174d78;
  --teal: #18a39a;
  --ink: #1b2a38;
  --muted: #667889;
  --line: #d9e4ec;
  --panel: #ffffff;
  --bg: #f3f7fa;
  color: #fff;
}

html[data-theme="soft-dark"] .landing-shell .homepage-section,
html[data-theme="ios-glass"] .landing-shell .homepage-section,
html[data-theme="soft-dark"] .landing-shell .news-card,
html[data-theme="ios-glass"] .landing-shell .news-card,
html[data-theme="soft-dark"] .landing-shell .history-item,
html[data-theme="ios-glass"] .landing-shell .history-item,
html[data-theme="soft-dark"] .landing-shell .mission-card,
html[data-theme="ios-glass"] .landing-shell .mission-card,
html[data-theme="soft-dark"] .landing-shell .create-card,
html[data-theme="ios-glass"] .landing-shell .create-card,
html[data-theme="soft-dark"] .landing-shell .process-step,
html[data-theme="ios-glass"] .landing-shell .process-step,
html[data-theme="soft-dark"] .landing-shell .value-grid div,
html[data-theme="ios-glass"] .landing-shell .value-grid div,
html[data-theme="soft-dark"] .landing-shell .digital-grid span,
html[data-theme="ios-glass"] .landing-shell .digital-grid span {
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .landing-shell .landing-kicker,
html[data-theme="ios-glass"] .landing-shell .landing-kicker {
  color: #c9f4ef;
}

html[data-theme="soft-dark"] .landing-shell .mission-card p,
html[data-theme="ios-glass"] .landing-shell .mission-card p,
html[data-theme="soft-dark"] .landing-shell .create-card p,
html[data-theme="ios-glass"] .landing-shell .create-card p,
html[data-theme="soft-dark"] .landing-shell .history-item p,
html[data-theme="ios-glass"] .landing-shell .history-item p,
html[data-theme="soft-dark"] .landing-shell .news-card p,
html[data-theme="ios-glass"] .landing-shell .news-card p {
  color: var(--muted);
}

html[data-theme="soft-dark"] .product-album,
html[data-theme="ios-glass"] .product-album {
  background: rgba(79, 209, 197, .16);
  color: #9ff5ec;
  border: 1px solid rgba(79, 209, 197, .32);
}

html[data-theme="soft-dark"] .spec-notes,
html[data-theme="ios-glass"] .spec-notes {
  border-top-color: var(--line);
}

html[data-theme="ios-glass"] .album-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .045)),
    rgba(20, 31, 48, .52);
}

@media (max-width: 992px) {
  .landing-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 22px;
  }
  .landing-hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .news-grid,
  .history-timeline,
  .mission-grid,
  .create-grid,
  .digital-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .process-flow,
  .value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .process-step:not(:last-child)::after {
    display: none;
  }
  .closing-cta {
    align-items: flex-start;
    flex-direction: column;
  }
  .app-layout { display: block; }
  .content { padding: 16px; }
  .page-title-row {
    align-items: flex-start;
    flex-direction: column;
    margin: -16px -16px 16px;
    padding: 14px 16px 12px;
  }
  #pageActions { justify-content: flex-start; width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-preview { grid-template-columns: 1fr; }
  .product-photo { min-height: 260px; }
  .notification-panel { max-width: 30vw; }
  .online-users { max-width: 36vw; }
  .online-name { display: none; }
  .online-user { padding: 2px; }
  .message-layout {
    grid-template-columns: 1fr;
  }
  .message-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }
}

@media (max-width: 576px) {
  .landing-nav {
    min-height: 64px;
    padding: 10px 14px;
  }
  .landing-brand {
    gap: 9px;
  }
  .landing-brand .brand-mark {
    width: 40px;
    height: 40px;
  }
  .landing-brand small {
    display: none;
  }
  .landing-login-btn {
    padding-inline: 12px;
  }
  .landing-main {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
  }
  .landing-hero {
    gap: 18px;
  }
  .landing-hero-panel,
  .news-grid,
  .history-timeline,
  .mission-grid,
  .create-grid,
  .digital-grid,
  .process-flow,
  .value-grid {
    grid-template-columns: 1fr;
  }
  .eco-ring {
    min-height: 270px;
  }
  .eco-ring::before {
    width: 190px;
    height: 190px;
  }
  .eco-orbit {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }
  .orbit-quality { right: 22px; }
  .orbit-sustain { left: 22px; }
  .landing-metric,
  .homepage-section,
  .news-card,
  .history-item,
  .mission-card,
  .create-card,
  .process-step,
  .digital-grid span,
  .value-grid div {
    padding: 15px;
  }
  .history-item {
    padding-left: 40px;
  }
  .section-heading {
    display: block;
  }
  .navbar-brand { max-width: 52vw; font-size: 1rem; }
  .topbar .container-fluid { gap: 6px; }
  .notification-panel { max-width: 96px; }
  .message-top-btn {
    width: 34px;
    padding-inline: 0;
  }
  .online-users { max-width: 72px; }
  #userBadge { display: none; }
  .content { padding: 12px; }
  .page-title-row {
    margin: -12px -12px 14px;
    padding: 12px;
  }
  .page-title-row h2 { font-size: 1.2rem; }
  .page-title-row p { font-size: .9rem; }
  #pageActions .btn {
    flex: 1 1 auto;
    min-width: 44px;
  }
  .kpi-grid { grid-template-columns: 1fr; }
  .queue-grid { grid-template-columns: 1fr; }
  .ops-grid { grid-template-columns: 1fr; }
  .album-grid { grid-template-columns: 1fr; }
  .product-photo { min-height: 220px; }
  .chart-panel { height: 300px; min-height: 300px; padding: 12px; }
  .chart-canvas { height: 235px; }
  .data-panel { padding: 10px; margin-inline: -4px; }
  .trace-search { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .gantt-row { grid-template-columns: 1fr; gap: 6px; }
  .gantt-bar { width: 100% !important; white-space: normal; }
  .theme-select { width: 108px; }
  .pm-calendar-toolbar { align-items: stretch; }
  .pm-calendar-selects { grid-template-columns: 1fr; }
  .pm-calendar-weekdays,
  .pm-calendar-grid {
    grid-template-columns: 1fr;
  }
  .pm-calendar-weekdays {
    display: none;
  }
  .pm-calendar-day {
    min-height: auto;
  }
  .pm-calendar-day.is-muted {
    display: none;
  }
  .login-panel { padding: 24px; }
  .modal-dialog {
    max-width: none;
    width: calc(100% - 12px);
    margin: 6px;
  }
  .modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 12px);
  }
  .modal-header,
  .modal-footer { padding: 8px 10px; }
  .modal-body {
    padding: 10px;
    max-height: calc(100vh - 118px);
  }
  #recordFields {
    --bs-gutter-x: .5rem;
    --bs-gutter-y: .45rem;
  }
  #recordModal .form-control,
  #recordModal .form-select {
    min-height: 32px;
    padding: 4px 8px;
  }
  .modal-footer {
    flex-wrap: nowrap;
  }
  .modal-footer .btn {
    flex: 1 1 0;
  }
  .message-main {
    grid-template-rows: minmax(220px, 42vh) auto;
  }
  .message-bubble {
    max-width: 94%;
  }
}

/* UI/UX polish layer - preserves existing process flow and form structure. */
.modal-dialog-scrollable .modal-content,
#recordModal .modal-content,
#messageModal .modal-content,
#productModal .modal-content {
  overflow: hidden;
}

#recordForm {
  min-height: 0;
}

#recordModal .modal-body,
#messageModal .modal-body,
#productModal .modal-body {
  scrollbar-width: thin;
}

#recordModal .modal-footer,
#messageModal .message-form,
.modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 22px rgba(17, 36, 52, .06);
}

#recordModal .modal-header,
.modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

#recordModal .modal-footer .btn {
  min-width: 112px;
}

#recordModal .form-label::after {
  color: #dc3545;
}

#recordModal .form-control:focus,
#recordModal .form-select:focus,
.data-panel .form-control:focus,
.data-panel .form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 163, 154, .16);
}

.data-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 109, 168, .45) transparent;
}

.table,
.dt-container {
  font-size: .88rem;
}

.table thead th,
.dt-container table.dataTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef6fb;
  color: #17324a;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--line);
}

.table tbody td {
  line-height: 1.35;
}

.table-hover > tbody > tr:hover > * {
  background-color: rgba(24, 163, 154, .08);
}

.table .btn-group,
.dt-container .btn-group {
  gap: 3px;
}

.table .btn-sm {
  min-width: 32px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
}

.dt-container .dt-layout-row {
  gap: 10px;
  align-items: center;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 34px;
}

.notification-panel {
  min-width: min(360px, 38vw);
}

.notification-dropdown {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(16, 36, 52, .22);
}

.notification-row {
  transition: background .16s ease, transform .16s ease;
}

.notification-row:hover {
  transform: translateX(-1px);
}

.notification-message {
  line-height: 1.35;
}

.notification-dismiss:hover,
.notification-clear-all:hover {
  color: #b42318;
}

.queue-action,
.planning-job-row,
.inventory-product-row,
.clickable-detail-row {
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.queue-action:hover,
.planning-job-row:hover,
.inventory-product-row:hover,
.clickable-detail-row:hover {
  transform: translateY(-1px);
}

.clickable-detail-row {
  cursor: zoom-in;
}

.sales-order-workorders .queue-head h3 {
  font-size: .96rem;
  margin: 0;
}

/* Stronger dark-theme dropdown contrast, including message recipient menus. */
html[data-theme="soft-dark"] select,
html[data-theme="soft-dark"] .form-select,
html[data-theme="soft-dark"] #messageRecipient,
html[data-theme="ios-glass"] select,
html[data-theme="ios-glass"] .form-select,
html[data-theme="ios-glass"] #messageRecipient {
  background-color: #f8fbff !important;
  color: #111827 !important;
  border-color: rgba(147, 197, 253, .68) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

html[data-theme="soft-dark"] select:focus,
html[data-theme="soft-dark"] .form-select:focus,
html[data-theme="soft-dark"] #messageRecipient:focus,
html[data-theme="ios-glass"] select:focus,
html[data-theme="ios-glass"] .form-select:focus,
html[data-theme="ios-glass"] #messageRecipient:focus {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #5eead4 !important;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .28) !important;
}

html[data-theme="soft-dark"] select option,
html[data-theme="soft-dark"] .form-select option,
html[data-theme="soft-dark"] #messageRecipient option,
html[data-theme="ios-glass"] select option,
html[data-theme="ios-glass"] .form-select option,
html[data-theme="ios-glass"] #messageRecipient option {
  background-color: #ffffff !important;
  color: #111827 !important;
}

html[data-theme="soft-dark"] .message-sidebar select,
html[data-theme="soft-dark"] .message-sidebar .form-select,
html[data-theme="ios-glass"] .message-sidebar select,
html[data-theme="ios-glass"] .message-sidebar .form-select {
  background-color: #f8fbff !important;
  color: #111827 !important;
}

html[data-theme="soft-dark"] #messageModal .modal-content,
html[data-theme="soft-dark"] #messageModal .modal-body,
html[data-theme="soft-dark"] .message-history,
html[data-theme="soft-dark"] .message-main,
html[data-theme="ios-glass"] #messageModal .modal-content,
html[data-theme="ios-glass"] #messageModal .modal-body,
html[data-theme="ios-glass"] .message-history,
html[data-theme="ios-glass"] .message-main {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="ios-glass"] #messageModal .modal-content,
html[data-theme="ios-glass"] .message-history {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045)),
    var(--panel);
  backdrop-filter: blur(18px);
}

html[data-theme="soft-dark"] .message-sidebar,
html[data-theme="ios-glass"] .message-sidebar {
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .message-hint,
html[data-theme="soft-dark"] .message-empty,
html[data-theme="soft-dark"] .message-meta,
html[data-theme="ios-glass"] .message-hint,
html[data-theme="ios-glass"] .message-empty,
html[data-theme="ios-glass"] .message-meta {
  color: var(--muted);
}

html[data-theme="soft-dark"] .message-bubble,
html[data-theme="ios-glass"] .message-bubble {
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

html[data-theme="soft-dark"] .message-bubble.mine,
html[data-theme="ios-glass"] .message-bubble.mine {
  background: rgba(24, 163, 154, .24);
  color: #f7fffd;
  border-color: rgba(94, 234, 212, .38);
}

html[data-theme="soft-dark"] .message-bubble.theirs,
html[data-theme="ios-glass"] .message-bubble.theirs {
  background: rgba(96, 165, 250, .16);
  color: #f6fbff;
  border-color: rgba(147, 197, 253, .28);
}

html[data-theme="soft-dark"] .message-form textarea,
html[data-theme="soft-dark"] #messageText,
html[data-theme="ios-glass"] .message-form textarea,
html[data-theme="ios-glass"] #messageText {
  background: rgba(255, 255, 255, .09);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .message-form textarea::placeholder,
html[data-theme="ios-glass"] .message-form textarea::placeholder {
  color: rgba(237, 244, 251, .62);
}

html[data-theme="soft-dark"] .message-unsend,
html[data-theme="ios-glass"] .message-unsend {
  color: #7dd3fc;
}

html[data-theme="soft-dark"] .message-unsend:hover,
html[data-theme="ios-glass"] .message-unsend:hover {
  color: #bae6fd;
}

.badge,
.status-pill {
  letter-spacing: 0;
}

.chart-panel,
.kpi-card,
.data-panel,
.trace-card,
.process-queue,
.presentation-admin-panel,
.admin-control-panel,
.admin-control-card {
  color: var(--ink);
}

.chart-panel canvas {
  max-width: 100%;
}

html[data-theme="soft-dark"] .modal-header,
html[data-theme="soft-dark"] .modal-footer,
html[data-theme="soft-dark"] #recordModal .modal-header,
html[data-theme="soft-dark"] #recordModal .modal-footer,
html[data-theme="soft-dark"] #messageModal .message-form,
html[data-theme="ios-glass"] .modal-header,
html[data-theme="ios-glass"] .modal-footer,
html[data-theme="ios-glass"] #recordModal .modal-header,
html[data-theme="ios-glass"] #recordModal .modal-footer,
html[data-theme="ios-glass"] #messageModal .message-form {
  background: rgba(18, 30, 46, .96);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 -10px 26px rgba(0, 0, 0, .22);
}

html[data-theme="soft-dark"] .modal-title,
html[data-theme="soft-dark"] .form-label,
html[data-theme="soft-dark"] .data-panel label,
html[data-theme="soft-dark"] .admin-control-panel,
html[data-theme="soft-dark"] .admin-control-card,
html[data-theme="soft-dark"] .admin-control-panel h3,
html[data-theme="soft-dark"] .admin-control-card h3,
html[data-theme="soft-dark"] .chart-panel h3,
html[data-theme="soft-dark"] .trace-card,
html[data-theme="soft-dark"] .trace-card h3,
html[data-theme="soft-dark"] .trace-flow-node,
html[data-theme="soft-dark"] .trace-flow-node h4,
html[data-theme="soft-dark"] .trace-flow-node p,
html[data-theme="soft-dark"] .presentation-admin-panel,
html[data-theme="ios-glass"] .modal-title,
html[data-theme="ios-glass"] .form-label,
html[data-theme="ios-glass"] .data-panel label,
html[data-theme="ios-glass"] .admin-control-panel,
html[data-theme="ios-glass"] .admin-control-card,
html[data-theme="ios-glass"] .admin-control-panel h3,
html[data-theme="ios-glass"] .admin-control-card h3,
html[data-theme="ios-glass"] .chart-panel h3,
html[data-theme="ios-glass"] .trace-card,
html[data-theme="ios-glass"] .trace-card h3,
html[data-theme="ios-glass"] .trace-flow-node,
html[data-theme="ios-glass"] .trace-flow-node h4,
html[data-theme="ios-glass"] .trace-flow-node p,
html[data-theme="ios-glass"] .presentation-admin-panel {
  color: var(--ink) !important;
}

html[data-theme="soft-dark"] .table,
html[data-theme="soft-dark"] .dt-container,
html[data-theme="soft-dark"] .table td,
html[data-theme="soft-dark"] .table th,
html[data-theme="ios-glass"] .table,
html[data-theme="ios-glass"] .dt-container,
html[data-theme="ios-glass"] .table td,
html[data-theme="ios-glass"] .table th {
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="soft-dark"] .table thead th,
html[data-theme="soft-dark"] .dt-container table.dataTable thead th,
html[data-theme="ios-glass"] .table thead th,
html[data-theme="ios-glass"] .dt-container table.dataTable thead th {
  background: rgba(32, 50, 72, .98);
  color: #f8fbff;
}

html[data-theme="soft-dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
html[data-theme="ios-glass"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, .035);
}

html[data-theme="soft-dark"] .table-hover > tbody > tr:hover > *,
html[data-theme="ios-glass"] .table-hover > tbody > tr:hover > * {
  background-color: rgba(94, 234, 212, .11);
}

html[data-theme="soft-dark"] .form-control,
html[data-theme="soft-dark"] .form-select,
html[data-theme="ios-glass"] .form-control,
html[data-theme="ios-glass"] .form-select {
  background-color: rgba(255, 255, 255, .08);
  color: var(--ink);
  border-color: rgba(255, 255, 255, .22);
}

html[data-theme="soft-dark"] .form-control::placeholder,
html[data-theme="ios-glass"] .form-control::placeholder {
  color: rgba(237, 244, 251, .62);
}

html[data-theme="soft-dark"] .form-select option,
html[data-theme="ios-glass"] .form-select option {
  color: #111827;
}

html[data-theme="soft-dark"] .btn-close,
html[data-theme="ios-glass"] .btn-close {
  filter: invert(1) grayscale(1);
}

html[data-theme="soft-dark"] .notification-dropdown,
html[data-theme="ios-glass"] .notification-dropdown {
  color: var(--ink);
}

html[data-theme="soft-dark"] .notification-message,
html[data-theme="ios-glass"] .notification-message {
  color: var(--ink);
}

html[data-theme="soft-dark"] .notification-row.admin-alert,
html[data-theme="ios-glass"] .notification-row.admin-alert {
  background: rgba(250, 204, 21, .14);
}

html[data-theme="soft-dark"] .notification-row.message-alert,
html[data-theme="ios-glass"] .notification-row.message-alert {
  background: rgba(96, 165, 250, .13);
}

html[data-theme="ios-glass"] .data-panel,
html[data-theme="ios-glass"] .chart-panel,
html[data-theme="ios-glass"] .kpi-card,
html[data-theme="ios-glass"] .trace-card,
html[data-theme="ios-glass"] .process-queue,
html[data-theme="ios-glass"] .presentation-admin-panel,
html[data-theme="ios-glass"] .admin-control-panel,
html[data-theme="ios-glass"] .admin-control-card {
  backdrop-filter: blur(18px) saturate(1.15);
}

.logout-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 24, 38, .64);
  backdrop-filter: blur(8px);
}

.logout-card {
  width: min(360px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: #ffffff;
  color: #172033;
  text-align: center;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
}

.logout-card h2 {
  margin: 14px 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
}

.logout-card p {
  margin: 0;
  color: #526173;
}

.logout-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border: 4px solid rgba(47, 107, 31, .18);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: mps-spin .8s linear infinite;
}

.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 180px;
  text-align: left;
}

.loading-panel .logout-spinner {
  width: 30px;
  height: 30px;
  margin: 0;
}

@keyframes mps-spin {
  to { transform: rotate(360deg); }
}

.landing-shell,
.landing-shell * {
  color-scheme: light;
}

@media (max-width: 768px) {
  .notification-panel {
    min-width: 0;
    flex: 1 1 140px;
    max-width: min(260px, 42vw);
  }

  .notification-dropdown {
    position: fixed;
    top: 62px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }

  #recordModal .modal-dialog,
  #messageModal .modal-dialog,
  #productModal .modal-dialog {
    margin: 8px;
  }

  #recordModal .modal-footer .btn {
    min-width: 0;
  }

  .table {
    min-width: 760px;
  }

  .dt-container .dt-layout-row {
    flex-wrap: wrap;
  }
}
