:root {
  --bg-dark: #07111f;
  --bg-dark-soft: #0d1b2f;
  --bg-panel: #0a1628;
  --surface: #12233a;
  --surface-alt: #1a2d48;
  --surface-strong: #081426;
  --line: rgba(206, 224, 255, 0.12);
  --line-strong: rgba(206, 224, 255, 0.22);
  --text: #f2f7ff;
  --muted: #8fa5c5;
  --muted-strong: #c3d3eb;
  --accent: #9fd414;
  --accent-soft: rgba(159, 212, 20, 0.14);
  --ambient: #2aa8ff;
  --ambient-soft: rgba(42, 168, 255, 0.14);
  --success: #75d489;
  --warning: #efb849;
  --danger: #ff7272;
  --white: #ffffff;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 22px 52px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 30px 90px rgba(0, 0, 0, 0.5);
  --font-display: "Lufga", "Aptos Display", "Montserrat", "Poppins", "Avenir Next", "Bahnschrift", sans-serif;
  --font-body: "Inter", "Segoe UI", "Aptos", "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg-dark: #eef5ff;
  --bg-dark-soft: #dce9fb;
  --bg-panel: #f5f9ff;
  --surface: #ffffff;
  --surface-alt: #edf4ff;
  --surface-strong: #dbe8fa;
  --line: rgba(69, 96, 135, 0.18);
  --line-strong: rgba(69, 96, 135, 0.3);
  --text: #101b2d;
  --muted: #71809a;
  --muted-strong: #4e5d75;
  --shadow-soft: 0 22px 52px rgba(36, 58, 94, 0.12);
  --shadow-strong: 0 30px 90px rgba(36, 58, 94, 0.24);
}

@font-face {
  font-family: "Lufga";
  src: url("../assets/fonts/Lufga-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("../assets/fonts/Lufga-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("../assets/fonts/Lufga-SemiBold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(54, 88, 151, 0.18), transparent 38%),
    linear-gradient(180deg, #edf2f8 0%, #f7f9fc 100%);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

p,
li,
td,
dd,
input,
select,
textarea {
  font-family: var(--font-body);
}

body.is-login-view {
  overflow: hidden;
}

body.capture-view {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(42, 168, 255, 0.14), transparent 30%),
    linear-gradient(145deg, #07111f 0%, #0d1b2f 100%);
}

.capture-shell {
  min-height: calc(100vh - 3rem);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.capture-card {
  width: min(100%, 520px);
  padding: 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  color: var(--text);
  background: rgba(18, 35, 58, 0.78);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(16px);
}

.capture-card__brand {
  margin-bottom: 1.2rem;
}

.capture-card__brand .brand-logo--login {
  width: 6rem;
}

.capture-card__header h1 {
  margin: 0.25rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 2rem;
}

.capture-card__header p:last-child {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.55;
}

.capture-summary {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0;
}

.capture-form {
  display: grid;
  gap: 1rem;
}

.capture-upload {
  position: relative;
  display: grid;
  gap: 0.3rem;
  min-height: 9rem;
  place-items: center;
  padding: 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(7, 17, 31, 0.52);
  text-align: center;
}

.capture-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.capture-upload__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.capture-upload__hint {
  color: var(--muted);
}

.capture-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(7, 17, 31, 0.72);
}

[hidden] {
  display: none !important;
}

input,
select,
textarea,
button {
  font: inherit;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 4rem);
  background:
    linear-gradient(90deg, rgba(16, 25, 45, 0.92) 0%, rgba(16, 25, 45, 0.88) 48%, rgba(10, 16, 29, 0.98) 100%),
    linear-gradient(125deg, #10192d 0%, #16233c 44%, #10192d 100%);
}

.auth-fallback {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    linear-gradient(90deg, rgba(16, 25, 45, 0.92) 0%, rgba(16, 25, 45, 0.88) 48%, rgba(10, 16, 29, 0.98) 100%),
    linear-gradient(125deg, #10192d 0%, #16233c 44%, #10192d 100%);
}

.login-screen__backdrop,
.login-screen__grid {
  position: absolute;
  inset: 0;
}

.login-screen__backdrop {
  background-image: url("../assets/login-ink-dispenser.svg");
  background-position: left center;
  background-size: cover;
  opacity: 0.28;
  filter: grayscale(1);
}

.login-screen__backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 25, 45, 0.18), rgba(16, 25, 45, 0.82) 58%, rgba(10, 16, 29, 0.98)),
    linear-gradient(180deg, rgba(16, 25, 45, 0.28), rgba(16, 25, 45, 0.78));
}

.login-screen__grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.8px, transparent 0.8px);
  background-size: 22px 22px;
  opacity: 0.12;
}

.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.62fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 8rem);
  width: min(100%, 1500px);
}

.login-hero {
  max-width: 740px;
  color: var(--white);
}

.login-card-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  justify-self: end;
}

.login-card {
  width: min(100%, 430px);
  padding: 1.8rem;
  border: 1px solid rgba(182, 198, 228, 0.16);
  border-radius: 26px;
  color: var(--white);
  background: rgba(16, 25, 45, 0.76);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(16px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.brand-logo-wrap,
.brand-logo {
  display: block;
  flex: 0 0 auto;
}

.brand-logo-wrap {
  width: clamp(5.5rem, 8vw, 6.8rem);
}

.brand-logo {
  width: 100%;
  height: auto;
}

.brand-logo--login {
  width: clamp(5.5rem, 9vw, 7rem);
}

.brand-logo--negative {
  display: block;
}

.brand-logo--positive {
  display: none;
}

:root[data-theme="light"] .brand-logo--negative {
  display: none;
}

:root[data-theme="light"] .brand-logo--positive {
  display: block;
}

.login-brand h1,
.topbar h2,
.panel h2,
.overview-card h3 {
  margin: 0;
  font-family: var(--font-display);
}

.login-brand h1 {
  max-width: 560px;
  font-size: clamp(2.7rem, 4.8vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-hero__eyebrow,
.login-card__eyebrow {
  margin: 0 0 0.75rem;
  color: rgba(191, 208, 232, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-hero__copy {
  max-width: 560px;
  margin: 0;
  color: rgba(237, 242, 252, 0.72);
  font-size: 1.08rem;
  line-height: 1.7;
}

.login-card__header {
  margin-bottom: 1.45rem;
}

.login-card__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0;
}

.login-card__header p:last-child {
  margin: 0.65rem 0 0;
  color: rgba(224, 234, 250, 0.72);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field--wide {
  grid-column: span 2;
}

.field span {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.05rem;
}

.field-label-row > label:first-child {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-form .field span {
  color: rgba(240, 245, 255, 0.8);
}

input,
select,
textarea {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.login-form input,
.login-form select {
  color: var(--white);
  background: rgba(12, 20, 37, 0.44);
  border-color: rgba(181, 199, 230, 0.14);
}

.login-form select option {
  color: #111827;
  background: #ffffff;
}

.login-form select option:checked {
  color: #ffffff;
  background: #1f5eff;
}

.login-form select option:hover {
  color: #111827;
  background: #eaf0fb;
}

input::placeholder,
textarea::placeholder {
  color: #9aa7bf;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 94, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.14);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

.pin-visibility {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  user-select: none;
}

.pin-visibility span {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.field-grid .field .pin-visibility span {
  color: var(--muted-strong);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
}

.pin-visibility input {
  appearance: auto;
  width: 0.9rem;
  height: 0.9rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--ambient);
}

.pin-value {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button--primary {
  color: var(--white);
  background: linear-gradient(135deg, #1f5eff 0%, #1948c5 100%);
}

.button--secondary {
  color: var(--text);
  background: #eaf0fb;
  border-color: #d6e0f1;
}

.button--ghost {
  color: var(--text);
  background: var(--white);
  border-color: #d3dde9;
}

.button--light {
  color: #16233c;
  background: var(--white);
}

.button--danger {
  color: #ffffff;
  background: linear-gradient(135deg, #ff7c7c 0%, #d94e4e 100%);
  box-shadow: 0 14px 28px rgba(217, 78, 78, 0.18);
}

.button--full {
  width: 100%;
}

.feedback {
  min-height: 1.4rem;
  margin: 0.1rem 0 0;
  font-weight: 600;
}

.feedback.is-success {
  color: var(--success);
}

.feedback.is-error {
  color: var(--danger);
}

.feedback--login {
  color: rgba(240, 245, 255, 0.78);
}

.feedback--login.is-success {
  color: #8de3bb;
}

.feedback--login.is-error {
  color: #ffb1b1;
}

.app-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  padding: 0.6rem 1rem 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.app-footer--login {
  z-index: 2;
  color: rgba(226, 236, 252, 0.58);
}

.workspace-shell {
  min-height: 100vh;
  padding-bottom: 2.8rem;
}

.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.audit-shell {
  min-height: 100vh;
  padding-bottom: 2.8rem;
}

.audit-content {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid rgba(124, 148, 188, 0.16);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.topbar__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__brand > div:last-child {
  min-width: 0;
}

.topbar__eyebrow,
.panel__eyebrow,
.overview-card__eyebrow {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar h2 {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.15rem, 1.55vw, 1.6rem);
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.topbar__pill,
.topbar__button,
.topbar__status {
  min-height: 2.55rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid #d5dfec;
  border-radius: 999px;
  background: var(--white);
  font-weight: 700;
}

.topbar__pill {
  color: var(--muted-strong);
}

.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 23rem;
  color: var(--muted-strong);
  white-space: nowrap;
}

.topbar__status #connectionStatus {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__button {
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
}

.pin-user-summary {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(181, 199, 230, 0.14);
  border-radius: var(--radius-md);
  background: rgba(12, 20, 37, 0.32);
}

.pin-user-summary span,
.pin-policy-note {
  color: rgba(224, 234, 250, 0.72);
}

.pin-policy-note {
  margin: -0.15rem 0 0.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-security-history {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.content-area {
  padding: 1.6rem 2rem 2rem;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.overview-card {
  padding: 1.3rem 1.35rem;
  border: 1px solid rgba(124, 148, 188, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
}

.overview-card--highlight {
  grid-column: span 2;
  background: linear-gradient(135deg, #192741 0%, #243555 100%);
  color: var(--white);
}

.overview-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.overview-card__value {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
}

.overview-card--highlight .overview-card__eyebrow,
.overview-card--highlight .overview-card__text {
  color: rgba(236, 243, 255, 0.72);
}

.overview-card h3 {
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.overview-card__metric {
  margin: 1rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.overview-card__text {
  margin: 0.4rem 0 0;
  color: var(--muted-strong);
  line-height: 1.58;
}

.hero-card__status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.1rem 0 0;
}

.status-dot {
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--warning);
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2s infinite;
}

.status-dot.is-success {
  color: var(--success);
}

.status-dot.is-error {
  color: var(--danger);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.94fr);
  gap: 1.5rem;
}

.dashboard--entry {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.panel {
  overflow: hidden;
  border: 1px solid rgba(124, 148, 188, 0.18);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.45rem;
  color: var(--white);
  background: linear-gradient(135deg, #18253c 0%, #223453 100%);
}

.panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.panel__badge--accent {
  background: rgba(255, 255, 255, 0.14);
}

.panel__body {
  padding: 1.4rem;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 460px);
  margin-bottom: 1.35rem;
  padding: 0.35rem;
  border: 1px solid #d8e2ef;
  border-radius: var(--radius-md);
  background: #f4f8fd;
}

.mode-switch--compact {
  width: min(100%, 520px);
  margin-bottom: 0;
}

.mode-switch__button {
  min-height: 2.8rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 12px;
  color: var(--muted-strong);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.mode-switch__button.is-active {
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(31, 94, 255, 0.18);
}

.workflow-block,
.workflow-panel {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid #dbe4f1;
}

.workflow-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.workflow-block__header {
  margin-bottom: 1rem;
}

.workflow-block__header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

.field-grid .field span {
  color: var(--text);
}

.field__hint {
  color: var(--muted-strong);
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-note {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #d9e3f0;
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  background: #f4f8fd;
  line-height: 1.62;
}

.evidence-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr);
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d9e3f0;
  border-radius: var(--radius-lg);
  background: #f4f8fd;
}

.evidence-box__copy h3 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.evidence-box__copy p:last-child {
  margin: 0;
  color: var(--muted-strong);
}

.evidence-upload {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px dashed #b8c9e3;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
  cursor: pointer;
}

.evidence-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.evidence-upload__title {
  color: var(--text);
  font-weight: 800;
}

.evidence-upload__hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.evidence-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 220px) auto;
  gap: 0.9rem;
  align-items: center;
}

.evidence-mobile {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.7rem;
}

.evidence-mobile__status {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted-strong);
  background: rgba(7, 17, 31, 0.42);
  line-height: 1.5;
  word-break: break-word;
}

.evidence-mobile__status a {
  color: var(--ambient);
  font-weight: 800;
}

.evidence-qr {
  display: grid;
  place-items: center;
}

.evidence-qr[hidden] {
  display: none;
}

.evidence-qr__card {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  width: min(100%, 280px);
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
}

.evidence-qr__svg {
  width: min(100%, 220px);
  height: auto;
  border-radius: 12px;
  background: #ffffff;
  image-rendering: pixelated;
}

.evidence-qr__card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.88rem;
  text-align: center;
}

.evidence-preview[hidden] {
  display: none;
}

.evidence-preview img {
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #dbe4f1;
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.evidence-link {
  display: inline-flex !important;
  align-items: center;
  width: max-content;
  min-height: 1.9rem;
  margin-top: 0.45rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(42, 168, 255, 0.38);
  border-radius: 999px;
  color: var(--ambient);
  background: rgba(42, 168, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.evidence-link:hover {
  border-color: rgba(42, 168, 255, 0.64);
  background: rgba(42, 168, 255, 0.18);
}

.evidence-link--missing {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.form-actions--compact {
  margin-top: 1rem;
}

.advanced-extraction {
  margin-top: 1rem;
  border: 1px solid #dbe4f1;
  border-radius: var(--radius-md);
  background: #f8fbff;
}

.advanced-extraction summary {
  padding: 0.9rem 1rem;
  color: var(--muted-strong);
  font-weight: 800;
  cursor: pointer;
}

.advanced-extraction .field {
  padding: 0 1rem 1rem;
}

.advanced-extraction .form-actions {
  padding: 0 1rem 1rem;
}

.upload-box {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #d9e3f0;
  border-radius: var(--radius-lg);
  background: #f7faff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.upload-box.is-drag-over {
  border-color: var(--accent);
  background: #eef4ff;
  box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.12);
}

.upload-box__label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.upload-box__title {
  font-weight: 700;
}

.upload-box__hint {
  color: var(--muted);
  line-height: 1.52;
}

.upload-box__drop {
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  padding: 1rem;
  border: 1px dashed #bfd0e8;
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-weight: 700;
}

.upload-box.is-drag-over .upload-box__drop {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.94);
}

.formula-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0;
}

.summary-card {
  padding: 1rem;
  border: 1px solid #dbe4f1;
  border-radius: 18px;
  background: #f8fbff;
}

.summary-card__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.formula-table-wrap {
  overflow: auto;
  border: 1px solid #dbe4f1;
  border-radius: var(--radius-lg);
  background: var(--white);
}

.formula-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.formula-table th,
.formula-table td {
  padding: 0.95rem 0.85rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e7edf6;
}

.formula-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eff4fb;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.formula-table tbody tr:hover {
  background: #f9fbff;
}

.formula-table__empty td {
  color: var(--muted);
  text-align: center;
}

.table-action {
  min-height: 2.7rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid #d4deec;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #edf3ff;
  font-weight: 700;
  cursor: pointer;
}

.table-action:hover {
  background: #e4edff;
}

.table-action--danger {
  color: #ffffff;
  border-color: rgba(255, 114, 114, 0.5);
  background: linear-gradient(135deg, #ff7c7c 0%, #d94e4e 100%);
}

.table-action--danger:hover {
  background: linear-gradient(135deg, #ff6666 0%, #c94242 100%);
}

.formula-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.formula-status--linked {
  border: 1px solid rgba(159, 212, 20, 0.45);
  background: #dff68a;
  color: #172107;
}

.formula-status--pending {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.formula-results {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid #dbe4f1;
}

.formula-results__header {
  margin-bottom: 0.9rem;
}

.formula-results__eyebrow {
  margin-bottom: 0.2rem;
}

.formula-results__header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.formula-results__list {
  display: grid;
  gap: 0.85rem;
}

.formula-results__empty {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px dashed #cfdae9;
  border-radius: 18px;
  color: var(--muted);
  background: #f9fbff;
}

.formula-result {
  overflow: hidden;
  border: 1px solid #dbe4f1;
  border-radius: 20px;
  background: #fbfdff;
}

.formula-result[open] {
  background: var(--white);
  box-shadow: 0 12px 28px rgba(18, 30, 52, 0.06);
}

.formula-result__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.formula-result__summary::-webkit-details-marker {
  display: none;
}

.formula-result__title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.formula-result__title strong {
  font-size: 1rem;
}

.formula-result__pantone {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.formula-result__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.formula-result__summary-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.formula-result__pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.formula-result__count {
  color: var(--muted-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.formula-result__body {
  padding: 0 1.1rem 1.1rem;
}

.formula-result__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.formula-result__toolbar p {
  margin: 0;
  color: var(--muted-strong);
}

.formula-result__table-wrap {
  overflow: auto;
  border: 1px solid #e3eaf4;
  border-radius: 16px;
}

.formula-result__table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--white);
}

.formula-result__table th,
.formula-result__table td {
  padding: 0.8rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ebf0f7;
}

.formula-result__table th {
  background: #f1f5fb;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: end;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0;
}

.history-table-wrap {
  overflow: auto;
  border: 1px solid #dbe4f1;
  border-radius: var(--radius-lg);
  background: var(--white);
}

.history-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.panel--audit .history-table {
  min-width: 1060px;
  table-layout: fixed;
}

.history-table--operator {
  min-width: 980px;
  table-layout: fixed;
}

.history-table--operator > thead > tr > th:nth-child(1),
.history-table--operator > tbody > .history-group-row > td:nth-child(1) {
  width: 9%;
}

.history-table--operator > thead > tr > th:nth-child(2),
.history-table--operator > tbody > .history-group-row > td:nth-child(2) {
  width: 11%;
}

.history-table--operator > thead > tr > th:nth-child(3),
.history-table--operator > tbody > .history-group-row > td:nth-child(3) {
  width: 9%;
}

.history-table--operator > thead > tr > th:nth-child(4),
.history-table--operator > tbody > .history-group-row > td:nth-child(4) {
  width: 25%;
}

.history-table--operator > thead > tr > th:nth-child(5),
.history-table--operator > tbody > .history-group-row > td:nth-child(5) {
  width: 14%;
}

.history-table--operator > thead > tr > th:nth-child(6),
.history-table--operator > tbody > .history-group-row > td:nth-child(6) {
  width: 9%;
}

.history-table--operator > thead > tr > th:nth-child(7),
.history-table--operator > tbody > .history-group-row > td:nth-child(7) {
  width: 8%;
}

.history-table--operator > thead > tr > th:nth-child(8),
.history-table--operator > tbody > .history-group-row > td:nth-child(8) {
  width: 15%;
}

.panel--audit .history-table th:nth-child(1),
.panel--audit .history-table td:nth-child(1) {
  width: 8%;
}

.panel--audit .history-table th:nth-child(2),
.panel--audit .history-table td:nth-child(2) {
  width: 6%;
}

.panel--audit .history-table th:nth-child(3),
.panel--audit .history-table td:nth-child(3) {
  width: 6%;
}

.panel--audit .history-table th:nth-child(4),
.panel--audit .history-table td:nth-child(4) {
  width: 15%;
}

.panel--audit .history-table th:nth-child(5),
.panel--audit .history-table td:nth-child(5) {
  width: 8%;
}

.panel--audit .history-table th:nth-child(6),
.panel--audit .history-table td:nth-child(6) {
  width: 5%;
}

.panel--audit .history-table th:nth-child(7),
.panel--audit .history-table td:nth-child(7) {
  width: 9%;
}

.panel--audit .history-table th:nth-child(8),
.panel--audit .history-table td:nth-child(8) {
  width: 8%;
}

.panel--audit .history-table th:nth-child(9),
.panel--audit .history-table td:nth-child(9) {
  width: 6%;
}

.panel--audit .history-table th:nth-child(10),
.panel--audit .history-table td:nth-child(10) {
  width: 6%;
}

.panel--audit .history-table th:nth-child(11),
.panel--audit .history-table td:nth-child(11) {
  width: 8%;
}

.panel--audit .history-table th:nth-child(12),
.panel--audit .history-table td:nth-child(12) {
  width: 7%;
}

.panel--audit .history-table th:nth-child(13),
.panel--audit .history-table td:nth-child(13) {
  width: 8%;
}

.history-table th,
.history-table td {
  padding: 0.9rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e7edf6;
}

.history-table th {
  background: #eff4fb;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-table td strong,
.history-table td span:not(.status-badge):not(.history-pill):not(.formula-status):not(.history-toggle__icon):not(.history-toggle__content):not(.history-toggle__label):not(.evidence-link) {
  display: block;
}

.history-table td span:not(.status-badge):not(.history-pill):not(.formula-status):not(.history-toggle__icon):not(.history-toggle__content):not(.history-toggle__label):not(.evidence-link) {
  margin-top: 0.2rem;
  color: var(--muted-strong);
}

.history-table__empty td {
  color: var(--muted);
  text-align: center;
}

.history-group-row {
  background: rgba(248, 251, 255, 0.78);
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.4rem;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.history-toggle__icon {
  display: inline-grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0 !important;
  border: 1px solid #d4deec;
  border-radius: 999px;
  color: var(--text);
  background: #ffffff;
  font-weight: 900;
  line-height: 1;
}

.history-toggle small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted-strong);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.history-toggle.is-expanded .history-toggle__icon {
  color: #172107;
  border-color: rgba(159, 212, 20, 0.55);
  background: #dff68a;
}

.history-toggle.is-expanded .history-toggle__icon::before {
  content: "-";
}

.history-toggle.is-expanded .history-toggle__icon {
  font-size: 0;
}

.history-toggle.is-expanded .history-toggle__icon::before {
  font-size: 0.95rem;
}

.history-detail-row > td {
  padding: 0 !important;
  background: rgba(239, 244, 251, 0.56);
}

.history-detail {
  padding: 0.85rem;
}

.history-detail__meta {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.history-detail__meta > div {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

.history-detail__meta span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-detail__meta strong {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
}

.history-detail__table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #dbe4f1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.history-detail__table th,
.history-detail__table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e7edf6;
}

.history-detail__table th {
  color: var(--muted);
  background: #f7faff;
  font-size: 0.72rem;
}

.history-detail__table tr:last-child td {
  border-bottom: 0;
}

.history-pill {
  display: inline-flex !important;
  width: max-content;
  min-height: 1.8rem;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.history-pill--initial {
  color: #165bc8;
  background: #e7efff;
}

.history-pill--additional {
  color: #9a5b00;
  background: #fff3d6;
}

.audit-filter-grid {
  grid-template-columns: minmax(150px, 0.6fr) minmax(150px, 0.6fr) minmax(210px, 0.9fr) minmax(280px, 1.6fr);
}

.audit-filter-grid select {
  min-width: 0;
}

.audit-summary {
  margin-top: 1.4rem;
}

.summary-card--approval-pending {
  border-color: rgba(255, 191, 71, 0.42);
}

.summary-card--approval-approved {
  border-color: rgba(158, 231, 25, 0.42);
}

.summary-card--approval-rejected {
  border-color: rgba(255, 91, 100, 0.42);
}

.audit-receiver {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.audit-receiver strong {
  color: var(--text);
  font-size: 0.78rem;
}

.audit-receiver small {
  color: var(--muted-strong);
  font-size: 0.68rem;
  line-height: 1.3;
}

.audit-receiver--pending {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.audit-receiver-cell {
  min-width: 150px;
}

.audit-shell[data-audit-scope="proysa"] .panel--audit .history-table > thead > tr > th:nth-child(11),
.audit-shell[data-audit-scope="proysa"] .panel--audit .history-table > thead > tr > th:nth-child(13),
.audit-shell[data-audit-scope="proysa"] .panel--audit .history-table > tbody > .history-group-row > td:nth-child(11),
.audit-shell[data-audit-scope="proysa"] .panel--audit .history-table > tbody > .history-group-row > td:nth-child(13),
.audit-shell[data-audit-scope="proysa"] .history-tint__approval,
.audit-shell[data-audit-scope="proysa"] .history-detail__receiver,
.audit-shell[data-audit-scope="proysa"] .history-detail__supervisor {
  display: none !important;
}

.audit-shell[data-audit-scope="supervisor"] .panel--audit .history-table > thead > tr > th:nth-child(8),
.audit-shell[data-audit-scope="supervisor"] .panel--audit .history-table > tbody > .history-group-row > td:nth-child(8) {
  display: none;
}

.supervisor-approval-panel {
  margin-bottom: 1.5rem;
}

.supervisor-approval-grid {
  margin-top: 1.1rem;
}

.supervisor-approval-card .order-card__meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.supervisor-approval-card .supervisor-deadline-field {
  grid-column: 1 / -1;
  min-width: 0;
}

.supervisor-approval-card .supervisor-deadline {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 2rem;
  padding: 0.4rem 0.75rem;
  color: #111111;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.supervisor-approval-card .supervisor-deadline.status-badge--pending {
  color: #111111;
}

.supervisor-approval-card .evidence-link {
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.panel--audit .history-table {
  min-width: 1480px;
}

.operator-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: -0.25rem 0 1.2rem;
}

.operator-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface-strong);
}

.operator-card > span,
.operator-card small {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.operator-card strong {
  font-size: 1rem;
}

.operator-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.operator-card b {
  font-size: 0.95rem;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 34, 0.5);
  backdrop-filter: blur(6px);
}

.app-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 1.8rem 1.5rem 1.4rem;
  border: 1px solid #d8e2ef;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: 0 28px 60px rgba(12, 20, 36, 0.18);
  text-align: center;
  animation: modal-enter 180ms ease;
}

.app-modal__card--success {
  box-shadow: 0 28px 60px rgba(31, 157, 103, 0.12);
}

.app-modal__card--error {
  box-shadow: 0 28px 60px rgba(212, 83, 83, 0.12);
}

.app-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid #d6dfec;
  border-radius: 50%;
  color: var(--text);
  background: #f4f8fd;
  font-size: 1.2rem;
  cursor: pointer;
}

.app-modal__icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: var(--white);
  font-weight: 800;
}

.app-modal__card--success .app-modal__icon {
  background: var(--success);
}

.app-modal__card--error .app-modal__icon {
  background: var(--danger);
}

.app-modal__title {
  margin: 0 0 0.55rem;
  font-size: 1.55rem;
  font-weight: 700;
}

.app-modal__message {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.62;
}

.app-modal__button {
  min-width: 10rem;
}

.history-modal {
  align-items: start;
  overflow: auto;
}

.history-modal__card {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid #d8e2ef;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: 0 28px 60px rgba(12, 20, 36, 0.2);
  animation: modal-enter 180ms ease;
}

.history-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.45rem;
  color: var(--white);
  background: linear-gradient(135deg, #18253c 0%, #223453 100%);
}

.history-modal__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.history-modal__body {
  max-height: calc(100vh - 9rem);
  overflow: auto;
  padding: 1.4rem;
}

.role-shell {
  min-height: 100vh;
}

.split-panels {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.1rem;
}

.admin-tabs {
  width: min(100%, 960px);
  margin: 0 auto 1rem;
  padding: 0.35rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
}

.admin-tab {
  min-height: 4.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-lg) - 6px);
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.admin-tab:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.admin-tab.is-active {
  color: var(--text);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.admin-tab span,
.admin-tab strong {
  display: block;
}

.admin-tab span {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-tab strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.admin-sections {
  width: min(100%, 960px);
  margin: 0 auto;
  display: block;
}

.admin-section {
  width: 100%;
}

.admin-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-search {
  margin-top: 1.2rem;
}

.admin-table-wrap {
  max-height: 440px;
  margin-top: 1.1rem;
}

.admin-table {
  min-width: 620px;
}

.leader-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  align-items: stretch;
}

.leader-grid--grouped {
  grid-template-columns: 1fr;
}

.op-accordion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background:
    linear-gradient(155deg, rgba(42, 168, 255, 0.1), transparent 46%),
    rgba(18, 35, 58, 0.86);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="light"] .op-accordion {
  background:
    linear-gradient(155deg, rgba(42, 168, 255, 0.1), transparent 46%),
    rgba(255, 255, 255, 0.9);
}

.op-accordion__toggle {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(260px, 1fr) auto;
  gap: 1rem;
  align-items: center;
  width: 100%;
  min-height: 4.25rem;
  padding: 0.65rem 0.85rem;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.op-accordion__toggle:hover {
  background: rgba(42, 168, 255, 0.07);
}

.op-accordion__identity {
  display: grid;
  gap: 0.12rem;
}

.op-accordion__identity strong {
  font-size: 1.08rem;
}

.op-accordion__summary,
.op-accordion__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.op-accordion__summary {
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.op-accordion__summary span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.op-accordion__summary span:nth-last-child(-n + 2) {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-accordion__summary span + span::before {
  content: "\00B7";
  margin-right: 0.45rem;
  color: var(--muted);
}

.op-accordion__badges {
  justify-content: flex-end;
}

.op-accordion__chevron {
  width: 0.65rem;
  height: 0.65rem;
  margin: 0 0.3rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.op-accordion__toggle[aria-expanded="true"] .op-accordion__chevron {
  transform: rotate(225deg);
}

.op-accordion__panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.6rem;
  border-top: 1px solid var(--line);
  background: rgba(4, 12, 24, 0.18);
}

.op-accordion__panel[hidden] {
  display: none;
}

.op-formula {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(320px, 1.2fr) minmax(300px, 1fr);
  gap: 0.55rem 0.9rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
}

.op-formula__header {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.op-formula__header strong {
  display: block;
  margin-top: 0.15rem;
}

.op-formula__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
  margin: 0;
}

.op-formula__stats dt,
.op-formula__meta strong {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.op-formula__stats dd {
  margin: 0;
  font-weight: 800;
}

.op-formula__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
  color: var(--muted-strong);
  font-size: 0.82rem;
}

.op-formula .movement-list,
.op-formula__actions {
  grid-column: 1 / -1;
}

.op-formula__actions {
  display: flex;
  justify-content: flex-end;
}

.op-formula__actions .button {
  min-height: 2.45rem;
  padding: 0.5rem 0.8rem;
}

.order-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 300px;
  border: 1px solid #dbe4f1;
  border-radius: var(--radius-lg);
  background: #fbfdff;
  box-shadow: 0 16px 34px rgba(14, 24, 44, 0.06);
}

.order-card--group {
  min-height: auto;
  grid-template-rows: auto 1fr auto;
}

.order-card--compact {
  min-height: 0;
  border-radius: var(--radius-md);
}

.order-card--compact .order-card__header {
  align-items: center;
  padding: 0.65rem 0.85rem;
}

.order-card--compact .order-card__header strong {
  margin-top: 0.12rem;
  font-size: 1.05rem;
}

.order-card--group.order-card--compact .order-card__body {
  grid-template-columns: minmax(175px, 0.85fr) minmax(320px, 1.35fr) minmax(260px, 1fr);
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.85rem;
}

.order-card--group.order-card--compact .order-card__title {
  min-height: 0;
  -webkit-line-clamp: 1;
}

.order-card--group.order-card--compact .order-card__stats--compact {
  gap: 0.4rem 0.75rem;
}

.order-card--group.order-card--compact .order-card__meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem 0.7rem;
  padding: 0;
}

.order-card--group.order-card--compact .movement-list {
  grid-column: 1 / -1;
  gap: 0.4rem;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.order-card--compact .movement-item {
  grid-template-columns: minmax(210px, 0.9fr) minmax(360px, 1.7fr) auto;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
}

.order-card--compact .movement-item__main,
.order-card--compact .movement-item__meta,
.order-card--compact .movement-item__actions {
  gap: 0.35rem 0.55rem;
}

.supervisor-approval-card.order-card--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
}

.supervisor-approval-card.order-card--compact .order-card__header {
  grid-column: 1 / -1;
}

.supervisor-approval-card.order-card--compact .order-card__body {
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: minmax(170px, 0.7fr) minmax(250px, 0.9fr) minmax(360px, 1.45fr);
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0.85rem;
}

.op-accordion__panel .supervisor-approval-card.order-card--compact .order-card__body {
  grid-template-columns: minmax(250px, 0.8fr) minmax(520px, 1.6fr);
}

.op-accordion__panel .supervisor-approval-card.order-card--compact .order-card__meta-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.supervisor-approval-card.order-card--compact .order-card__title {
  min-height: 0;
  -webkit-line-clamp: 1;
}

.supervisor-approval-card.order-card--compact .order-card__meta-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.4rem 0.65rem;
  padding: 0;
}

.supervisor-approval-card.order-card--compact .supervisor-deadline-field {
  grid-column: span 2;
}

.supervisor-approval-card.order-card--compact .order-card__actions {
  grid-column: 2;
  grid-row: 2;
  align-content: center;
  align-self: stretch;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  min-width: 205px;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-left: 1px solid var(--line);
}

.supervisor-approval-card.order-card--compact .order-card__actions .button {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.8rem;
  white-space: nowrap;
}

.order-card__header,
.order-card__body,
.order-card__actions {
  padding: 1rem;
}

.order-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.order-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  border-bottom: 1px solid #e5ecf6;
}

.order-card__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.order-card__header strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
}

.order-card__body {
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.order-card__body p {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.order-card__title {
  display: -webkit-box;
  min-height: 2.7rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

.order-card__body dl,
.order-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.order-card__stats--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.order-card__body dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-card__body dd {
  margin: 0.2rem 0 0;
  font-weight: 800;
}

.order-card__meta-grid {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.15rem;
}

.order-card__meta-grid span,
.order-card__meta {
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.order-card__meta-grid strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.movement-list {
  display: grid;
  gap: 0.65rem;
  max-height: min(42dvh, 420px);
  overflow: auto;
  padding-right: 0.25rem;
}

.movement-item {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(185px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.movement-item__main,
.movement-item__meta,
.movement-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.movement-item__main strong {
  color: var(--text);
}

.movement-item__main span:not(.history-pill),
.movement-item__meta span {
  color: var(--muted-strong);
  font-size: 0.88rem;
}

.movement-item__actions {
  justify-content: flex-end;
}

.movement-item__actions .status-badge {
  min-height: 2rem;
}

.movement-item__actions .icon-action {
  width: 2.45rem;
  height: 2.45rem;
}

.movement-item__actions .icon-action span {
  font-size: 1.2rem;
}

:root[data-theme="light"] .movement-item {
  background: rgba(255, 255, 255, 0.72);
}

.order-chip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 1.75rem;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 800;
}

.order-chip--danger {
  color: #ffffff;
  border-color: rgba(217, 78, 78, 0.5);
  background: rgba(217, 78, 78, 0.34);
}

.history-table--components {
  min-width: 880px;
  table-layout: fixed;
}

.history-table--components th:nth-child(1),
.history-table--components td:nth-child(1) {
  width: 10%;
}

.history-table--components th:nth-child(2),
.history-table--components td:nth-child(2) {
  width: 13%;
}

.history-table--components th:nth-child(3),
.history-table--components td:nth-child(3) {
  width: 17%;
}

.history-table--components th:nth-child(4),
.history-table--components td:nth-child(4) {
  width: 24%;
}

.history-table--components th:nth-child(5),
.history-table--components td:nth-child(5) {
  width: 14%;
}

.history-table--components th:nth-child(6),
.history-table--components td:nth-child(6) {
  width: 10%;
}

.history-table--components th:nth-child(7),
.history-table--components td:nth-child(7) {
  width: 12%;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-badge--open {
  border: 1px solid rgba(159, 212, 20, 0.5);
  color: #172107;
  background: #dff68a;
}

.status-badge--closed {
  color: #516076;
  background: #e7edf6;
}

.status-badge--pending {
  color: #9a5b00;
  background: #fff3d6;
}

.status-badge--rejected {
  color: #ffffff;
  background: #d94e4e;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(11, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.icon-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(11, 23, 42, 0.16);
}

.icon-action:active {
  transform: translateY(0);
}

.icon-action span {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
}

.icon-action--inspect {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.icon-action--accept {
  color: #14200d;
  background: linear-gradient(135deg, #b7f025 0%, #86bd09 100%);
}

.icon-action--reject {
  color: #ffffff;
  background: linear-gradient(135deg, #ff7c7c 0%, #d94e4e 100%);
}

.empty-state {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px dashed #cfdae9;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: #f9fbff;
}

.simple-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(11, 18, 34, 0.5);
  backdrop-filter: blur(6px);
}

.simple-modal__card {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid #d8e2ef;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: 0 28px 60px rgba(12, 20, 36, 0.2);
  animation: modal-enter 180ms ease;
}

.simple-modal__card--wide {
  width: min(100%, 940px);
  max-height: calc(100dvh - 2rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.simple-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  color: var(--white);
  background: linear-gradient(135deg, #18253c 0%, #223453 100%);
}

.simple-modal__header h2 {
  margin: 0;
  font-family: var(--font-display);
}

.simple-modal__card form {
  padding: 1.35rem;
}

.components-modal__body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  padding: 1.35rem;
}

.history-table-wrap--components {
  min-height: 0;
  overflow: auto;
}

.history-table--components th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.components-modal__summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.components-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

.components-modal__decision {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.components-modal__decision[hidden] {
  display: none;
}

.simple-modal__close {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

/* Visual refresh inspired by premium mobile dashboards. */
body:not(.is-login-view) {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(42, 168, 255, 0.14), transparent 34%),
    linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-soft) 48%, #050c18 100%);
}

.workspace-shell,
.role-shell,
.audit-shell {
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(8, 20, 38, 0.94), rgba(5, 12, 24, 0.98));
  background-size: 34px 34px, auto;
}

:root[data-theme="light"] body:not(.is-login-view) {
  background:
    radial-gradient(circle at 12% 0%, rgba(42, 168, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
}

:root[data-theme="light"] .workspace-shell,
:root[data-theme="light"] .role-shell,
:root[data-theme="light"] .audit-shell {
  background:
    linear-gradient(120deg, rgba(44, 76, 124, 0.045) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(246, 250, 255, 0.95), rgba(235, 243, 255, 0.98));
  background-size: 34px 34px, auto;
}

.topbar {
  margin: 1rem auto 0;
  width: min(100% - 2rem, 1440px);
  border: 1px solid var(--line);
  border-radius: 28px;
  color: var(--text);
  background: rgba(12, 28, 49, 0.78);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.78);
}

.topbar__eyebrow,
.panel__eyebrow,
.overview-card__eyebrow,
.workflow-block__eyebrow,
.formula-results__eyebrow {
  color: var(--muted);
}

.topbar__eyebrow {
  white-space: nowrap;
}

.topbar__pill,
.topbar__button,
.topbar__status {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.topbar__status--dot {
  width: 2.8rem;
  max-width: 2.8rem;
  justify-content: center;
  padding: 0;
}

.topbar__status--dot #connectionStatus {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.topbar__button--primary {
  border-color: transparent;
  color: #14200d;
  background: linear-gradient(135deg, #b7f025 0%, #86bd09 100%);
  box-shadow: 0 12px 26px rgba(159, 212, 20, 0.2);
}

.theme-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 4.35rem;
  min-width: 4.35rem;
  height: 2.55rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-switch__icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #a9b3c4;
  font-size: 0.92rem;
  line-height: 1;
  opacity: 0.88;
  transition: opacity 160ms ease;
}

.theme-switch__thumb {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #b7f025 0%, #86bd09 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease;
}

.theme-switch.is-dark .theme-switch__thumb {
  transform: translateX(1.78rem);
}


.content-area {
  width: min(100%, 1480px);
  margin: 0 auto;
}

.overview-card,
.panel,
.summary-card,
.formula-result,
.order-card,
.advanced-extraction,
.upload-box,
.form-note,
.evidence-box,
.empty-state,
.history-modal__card,
.simple-modal__card,
.app-modal__card {
  border-color: var(--line);
  color: var(--text);
  background: rgba(18, 35, 58, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

:root[data-theme="light"] .overview-card,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .summary-card,
:root[data-theme="light"] .formula-result,
:root[data-theme="light"] .order-card,
:root[data-theme="light"] .advanced-extraction,
:root[data-theme="light"] .upload-box,
:root[data-theme="light"] .form-note,
:root[data-theme="light"] .evidence-box,
:root[data-theme="light"] .empty-state,
:root[data-theme="light"] .history-modal__card,
:root[data-theme="light"] .simple-modal__card,
:root[data-theme="light"] .app-modal__card {
  background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .admin-tabs {
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .admin-tab {
  color: var(--muted-strong);
}

:root[data-theme="light"] .admin-tab:hover {
  background: rgba(237, 244, 255, 0.88);
}

:root[data-theme="light"] .admin-tab.is-active {
  color: var(--text);
  background: #ffffff;
}

.overview-card--highlight,
.panel__header,
.history-modal__header,
.simple-modal__header {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(42, 168, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(9, 21, 39, 0.94);
}

:root[data-theme="light"] .overview-card--highlight,
:root[data-theme="light"] .panel__header,
:root[data-theme="light"] .history-modal__header,
:root[data-theme="light"] .simple-modal__header {
  color: #f2f7ff;
  background:
    linear-gradient(135deg, rgba(42, 168, 255, 0.18), rgba(255, 255, 255, 0.06)),
    #0c2340;
}

.overview-card__text,
.field__hint,
.form-note,
.upload-box__hint,
.formula-result__meta,
.formula-result__toolbar p,
.order-card__meta,
.app-modal__message,
.history-table td span:not(.status-badge):not(.history-pill):not(.formula-status):not(.history-toggle__icon):not(.history-toggle__content):not(.history-toggle__label):not(.evidence-link) {
  color: var(--muted-strong);
}

.overview-card__value,
.panel__badge,
.formula-result__pill {
  color: #18200e;
  background: var(--accent);
}

.panel__body {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

input,
select,
textarea {
  border-color: var(--line);
  color: var(--text);
  background: rgba(7, 17, 31, 0.7);
}

input[readonly] {
  color: var(--muted-strong);
  background: rgba(7, 17, 31, 0.46);
  cursor: default;
}

.evidence-upload {
  border-color: var(--line-strong);
  background: rgba(7, 17, 31, 0.52);
}

.evidence-preview img {
  border-color: var(--line);
  background: rgba(7, 17, 31, 0.72);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .evidence-upload {
  border-color: #b8c9e3;
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .evidence-preview img {
  border-color: #dbe4f1;
  background: #ffffff;
}

:root[data-theme="light"] input[readonly] {
  color: var(--muted-strong);
  background: rgba(235, 243, 255, 0.86);
}

select option {
  color: #172033;
  background: #ffffff;
}

input::placeholder,
textarea::placeholder {
  color: rgba(218, 228, 210, 0.52);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(42, 168, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(42, 168, 255, 0.14);
}

.button {
  border-radius: 999px;
}

.button--primary,
.mode-switch__button.is-active {
  color: #14200d;
  background: linear-gradient(135deg, #b7f025 0%, #86bd09 100%);
  box-shadow: 0 14px 28px rgba(159, 212, 20, 0.2);
}

.button--secondary,
.button--ghost,
.table-action {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.button--light {
  color: #11180f;
  background: var(--white);
}

.mode-switch {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.mode-switch__button {
  color: var(--muted-strong);
  border-radius: 999px;
}

.workflow-block,
.workflow-panel,
.formula-results {
  border-color: var(--line);
}

.field-grid .field span,
.field span {
  color: var(--muted-strong);
}

.upload-box__drop,
.formula-results__empty {
  border-color: rgba(42, 168, 255, 0.28);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.045);
}

.upload-box.is-drag-over,
.upload-box.is-drag-over .upload-box__drop {
  border-color: var(--ambient);
  color: var(--ambient);
  background: rgba(42, 168, 255, 0.08);
}

.formula-table-wrap,
.history-table-wrap,
.formula-result__table-wrap {
  border-color: var(--line);
  background: rgba(6, 15, 28, 0.72);
}

:root[data-theme="light"] .formula-table-wrap,
:root[data-theme="light"] .history-table-wrap,
:root[data-theme="light"] .formula-result__table-wrap {
  background: rgba(255, 255, 255, 0.88);
}

.formula-table,
.history-table,
.formula-result__table {
  background: transparent;
}

.formula-table th,
.history-table th,
.formula-result__table th {
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.075);
}

.formula-table td,
.history-table td,
.formula-result__table td {
  border-color: var(--line);
}

.formula-table tbody tr:hover,
.history-table tbody tr:hover {
  background: rgba(42, 168, 255, 0.055);
}

.history-group-row {
  background: rgba(42, 168, 255, 0.045);
}

.history-toggle {
  color: var(--text);
}

.history-toggle__icon {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.history-toggle.is-expanded .history-toggle__icon {
  color: #172107;
  border-color: rgba(159, 212, 20, 0.55);
  background: #dff68a;
}

.history-detail-row > td {
  background: rgba(2, 8, 17, 0.42);
}

.history-detail__table {
  border-color: var(--line);
  background: rgba(6, 15, 28, 0.74);
}

.history-detail__table th {
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.06);
}

.history-detail__table th,
.history-detail__table td {
  border-color: var(--line);
}

:root[data-theme="light"] .history-group-row {
  background: rgba(248, 251, 255, 0.78);
}

:root[data-theme="light"] .history-toggle__icon {
  border-color: #d4deec;
  color: var(--text);
  background: #ffffff;
}

:root[data-theme="light"] .history-toggle.is-expanded .history-toggle__icon {
  color: #172107;
  border-color: rgba(159, 212, 20, 0.55);
  background: #dff68a;
}

:root[data-theme="light"] .history-detail-row > td {
  background: rgba(239, 244, 251, 0.56);
}

:root[data-theme="light"] .history-detail__table {
  border-color: #dbe4f1;
  background: rgba(255, 255, 255, 0.84);
}

:root[data-theme="light"] .history-detail__table th {
  color: var(--muted);
  background: #f7faff;
}

:root[data-theme="light"] .history-detail__table th,
:root[data-theme="light"] .history-detail__table td {
  border-color: #e7edf6;
}

.formula-table__empty td,
.history-table__empty td {
  color: var(--muted);
}

.formula-result[open] {
  background: rgba(32, 42, 31, 0.86);
}

.formula-result__pantone {
  color: var(--ambient);
}

.history-pill--initial {
  color: #15240d;
  background: #c7ec57;
}

.history-pill--additional,
.status-badge--pending {
  color: #342407;
  background: #f5c85f;
}

.status-badge--closed {
  color: #dce5d8;
  background: rgba(255, 255, 255, 0.14);
}

.order-card {
  min-height: 300px;
  background:
    linear-gradient(155deg, rgba(42, 168, 255, 0.11), transparent 46%),
    rgba(18, 35, 58, 0.86);
}

:root[data-theme="light"] .order-card {
  background:
    linear-gradient(155deg, rgba(42, 168, 255, 0.12), transparent 46%),
    rgba(255, 255, 255, 0.88);
}

.order-card__header {
  border-color: var(--line);
}

.order-card__body p {
  color: var(--text);
}

.app-modal__backdrop,
.simple-modal {
  background: rgba(4, 7, 4, 0.72);
}

.app-modal__close {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (max-width: 1280px) {
  .supervisor-approval-card.order-card--compact {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .supervisor-approval-card.order-card--compact .order-card__body {
    grid-column: 1;
    grid-row: 2;
  }

  .supervisor-approval-card.order-card--compact .order-card__actions {
    grid-column: 1;
    grid-row: 3;
    flex-direction: row;
    align-self: auto;
    justify-content: flex-end;
    min-width: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .supervisor-approval-card.order-card--compact .order-card__actions .button {
    width: auto;
  }

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

  .overview-card--highlight {
    grid-column: span 2;
  }
}

@media (max-width: 1120px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .login-card-wrap {
    justify-self: start;
  }

  .login-brand h1 {
    font-size: clamp(2.3rem, 8vw, 3.8rem);
  }
}

@media (max-width: 980px) {
  .op-accordion__toggle {
    grid-template-columns: auto 1fr;
  }

  .op-accordion__summary {
    display: none;
  }

  .op-formula {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .op-formula__meta,
  .op-formula .movement-list,
  .op-formula__actions {
    grid-column: 1 / -1;
  }

  .op-accordion__panel .supervisor-approval-card.order-card--compact .order-card__body {
    grid-template-columns: 1fr;
  }

  .op-accordion__panel .supervisor-approval-card.order-card--compact .order-card__meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-card--group.order-card--compact .order-card__body,
  .supervisor-approval-card.order-card--compact .order-card__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-card--group.order-card--compact .order-card__title,
  .supervisor-approval-card.order-card--compact .order-card__title,
  .order-card--group.order-card--compact .order-card__meta-grid,
  .supervisor-approval-card.order-card--compact .order-card__meta-grid {
    grid-column: 1 / -1;
  }

  .order-card__stats--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movement-item {
    grid-template-columns: 1fr;
  }

  .movement-item__actions {
    justify-content: flex-start;
  }

  .panel--audit .history-table-wrap,
  .history-table-wrap--operator {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .history-table-wrap--components {
    max-height: min(48dvh, 460px);
    overflow: auto;
  }

  .panel--audit .history-table,
  .panel--audit .history-table thead,
  .panel--audit .history-table tbody,
  .panel--audit .history-table th,
  .panel--audit .history-table td,
  .panel--audit .history-table tr,
  .history-table--operator,
  .history-table--operator thead,
  .history-table--operator tbody,
  .history-table--operator th,
  .history-table--operator td,
  .history-table--operator tr,
  .history-table--components,
  .history-table--components thead,
  .history-table--components tbody,
  .history-table--components th,
  .history-table--components td,
  .history-table--components tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .panel--audit .history-table thead,
  .history-table--operator thead,
  .history-table--components thead {
    display: none;
  }

  .panel--audit .history-table tbody,
  .history-table--operator tbody,
  .history-table--components tbody {
    display: grid;
    gap: 0.85rem;
  }

  .panel--audit .history-group-row,
  .history-table--operator .history-group-row,
  .history-table--components tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.9rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(42, 168, 255, 0.045);
  }

  :root[data-theme="light"] .panel--audit .history-group-row,
  :root[data-theme="light"] .history-table--operator .history-group-row,
  :root[data-theme="light"] .history-table--components tr {
    background: rgba(255, 255, 255, 0.9);
  }

  .panel--audit .history-group-row td,
  .history-table--operator .history-group-row td,
  .history-table--components td {
    display: grid;
    grid-template-columns: minmax(6.4rem, 0.42fr) minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding: 0;
    border: 0;
  }

  .panel--audit .history-group-row td::before,
  .history-table--operator .history-group-row td::before,
  .history-table--components td::before {
    content: attr(data-label);
    color: var(--muted-strong);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .panel--audit .history-group-row td:nth-child(4),
  .history-table--operator .history-group-row td:nth-child(4) {
    grid-column: 1 / -1;
  }

  .panel--audit .history-group-row td:nth-child(4)::before,
  .history-table--operator .history-group-row td:nth-child(4)::before {
    margin-top: 0.45rem;
  }

  .panel--audit .history-toggle,
  .history-table--operator .history-toggle {
    min-height: auto;
  }

  .panel--audit .history-detail-row,
  .history-table--operator .history-detail-row {
    margin-top: -0.85rem;
  }

  .panel--audit .history-detail-row > td,
  .history-table--operator .history-detail-row > td {
    display: block;
    padding: 0 !important;
    border: 0;
    background: transparent;
  }

  .panel--audit .history-detail,
  .history-table--operator .history-detail {
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: rgba(2, 8, 17, 0.38);
  }

  :root[data-theme="light"] .panel--audit .history-detail,
  :root[data-theme="light"] .history-table--operator .history-detail {
    background: rgba(239, 244, 251, 0.8);
  }

  .history-detail__meta {
    grid-template-columns: 1fr;
  }

  .panel--audit .history-detail__table,
  .panel--audit .history-detail__table thead,
  .panel--audit .history-detail__table tbody,
  .panel--audit .history-detail__table th,
  .panel--audit .history-detail__table td,
  .panel--audit .history-detail__table tr,
  .history-table--operator .history-detail__table,
  .history-table--operator .history-detail__table thead,
  .history-table--operator .history-detail__table tbody,
  .history-table--operator .history-detail__table th,
  .history-table--operator .history-detail__table td,
  .history-table--operator .history-detail__table tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .panel--audit .history-detail__table,
  .history-table--operator .history-detail__table {
    border: 0;
    background: transparent;
  }

  .panel--audit .history-detail__table thead,
  .history-table--operator .history-detail__table thead {
    display: none;
  }

  .panel--audit .history-detail__table tbody,
  .history-table--operator .history-detail__table tbody {
    display: grid;
    gap: 0.65rem;
  }

  .panel--audit .history-detail__table tr,
  .history-table--operator .history-detail__table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.9rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
  }

  :root[data-theme="light"] .panel--audit .history-detail__table tr,
  :root[data-theme="light"] .history-table--operator .history-detail__table tr {
    background: rgba(255, 255, 255, 0.82);
  }

  .panel--audit .history-detail__table td,
  .history-table--operator .history-detail__table td {
    display: grid;
    gap: 0.18rem;
    padding: 0;
    border: 0;
  }

  .panel--audit .history-detail__table td::before,
  .history-table--operator .history-detail__table td::before {
    content: attr(data-label);
    color: var(--muted-strong);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 720px) {
  .op-accordion__toggle {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .op-accordion__badges {
    justify-content: flex-start;
  }

  .op-formula {
    grid-template-columns: 1fr;
  }

  .op-formula__stats,
  .op-formula__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-card--group.order-card--compact .order-card__body,
  .supervisor-approval-card.order-card--compact .order-card__body {
    grid-template-columns: 1fr;
  }

  .order-card--group.order-card--compact .order-card__meta-grid,
  .supervisor-approval-card.order-card--compact .order-card__meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supervisor-approval-card.order-card--compact .order-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .supervisor-approval-card.order-card--compact .order-card__actions .button {
    width: 100%;
  }

  body.is-login-view {
    overflow: auto;
  }

  .login-screen {
    align-items: start;
    padding: 1rem;
  }

  .login-screen__backdrop {
    background-position: center;
  }

  .login-layout {
    gap: 1.4rem;
  }

  .login-card-wrap {
    padding: 0;
  }

  .login-card {
    padding: 1.5rem;
    width: 100%;
  }

  .login-brand {
    align-items: flex-start;
  }

  .brand-logo-wrap {
    width: 5.8rem;
  }

  .brand-logo--login {
    width: 5.8rem;
  }

  .login-brand h1 {
    font-size: 2.15rem;
  }

  .login-hero__copy {
    font-size: 1rem;
  }

  .topbar,
  .content-area {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__actions,
  .form-actions {
    flex-direction: column;
  }

  .topbar__pill,
  .topbar__status,
  .topbar__button,
  .button,
  .table-action {
    width: 100%;
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }

  .admin-tab {
    min-height: 3.8rem;
  }

  .overview,
  .split-panels,
  .admin-form-grid,
  .field-grid,
  .formula-summary,
  .history-summary,
  .history-search,
  .operator-summary,
  .leader-grid {
    grid-template-columns: 1fr;
  }

  .evidence-box,
  .evidence-preview {
    grid-template-columns: 1fr;
  }

  .formula-result__summary,
  .formula-result__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .formula-result__summary-right {
    justify-content: flex-start;
  }

  .overview-card--highlight {
    grid-column: auto;
  }

  .panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .field--wide {
    grid-column: auto;
  }

  .panel--audit .history-group-row,
  .history-table--operator .history-group-row {
    grid-template-columns: 1fr;
  }

  .panel--audit .history-group-row td,
  .history-table--operator .history-group-row td {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .panel--audit .history-detail__table tr,
  .history-table--operator .history-detail__table tr,
  .history-table--components tr {
    grid-template-columns: 1fr;
  }

  .movement-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .movement-item__actions .status-badge {
    width: auto;
  }

  .history-table--components td {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* Compact visual density shared by every application page. */
:root {
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.16);
  --shadow-strong: 0 18px 48px rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] {
  --shadow-soft: 0 7px 20px rgba(36, 58, 94, 0.08);
  --shadow-strong: 0 18px 48px rgba(36, 58, 94, 0.16);
}

body:not(.is-login-view) {
  font-size: 0.94rem;
}

.workspace-shell,
.role-shell,
.audit-shell {
  padding-bottom: 2.2rem;
}

.topbar {
  width: min(100% - 1.2rem, 1440px);
  margin-top: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
}

.topbar__eyebrow,
.panel__eyebrow,
.overview-card__eyebrow {
  margin-bottom: 0.16rem;
  font-size: 0.68rem;
}

.topbar__pill,
.topbar__button,
.topbar__status {
  min-height: 2.2rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

.topbar__status--dot {
  width: 2.2rem;
  max-width: 2.2rem;
}

.content-area {
  padding: 0.9rem 1rem 1.4rem;
}

.overview {
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.overview-card {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.overview-card h3 {
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.overview-card__metric {
  margin: 0.55rem 0 0.2rem;
  font-size: 1.75rem;
}

.overview-card__text {
  margin-top: 0.25rem;
  font-size: 0.84rem;
  line-height: 1.4;
}

.overview-card__value {
  min-height: 1.7rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
}

.dashboard,
.split-panels {
  gap: 0.8rem;
}

.panel {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.panel__header {
  gap: 0.7rem;
  padding: 0.8rem 1rem;
}

.panel__header h2 {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
}

.panel__badge {
  min-height: 2.15rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
}

.panel__body {
  padding: 0.85rem 1rem 1rem;
}

.field-grid,
.admin-form-grid {
  gap: 0.65rem;
}

.field {
  gap: 0.3rem;
}

.field span,
.field-label-row > label:first-child,
.field-grid .field span {
  font-size: 0.72rem;
}

input,
select,
textarea {
  min-height: 2.65rem;
  padding: 0.62rem 0.78rem;
  border-radius: var(--radius-sm);
}

textarea {
  min-height: 6rem;
}

.button,
.table-action {
  min-height: 2.5rem;
  padding: 0.58rem 0.9rem;
  font-size: 0.88rem;
  box-shadow: none;
}

.form-actions {
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.feedback {
  min-height: 1rem;
  margin-top: 0.1rem;
  font-size: 0.85rem;
}

.form-note {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.4;
  box-shadow: none;
}

.mode-switch {
  margin-bottom: 0.8rem;
  padding: 0.22rem;
}

.mode-switch__button {
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
}

.workflow-block,
.workflow-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.workflow-block__header {
  margin-bottom: 0.65rem;
}

.formula-summary,
.history-summary {
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.formula-summary {
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
}

.history-summary {
  grid-template-columns: repeat(6, minmax(90px, 1fr));
}

.summary-card {
  display: grid;
  align-content: center;
  min-height: 3.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
}

.summary-card__label {
  margin-bottom: 0.12rem;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.summary-card strong {
  font-size: 0.9rem;
}

.leader-grid,
.supervisor-approval-grid,
.operator-summary {
  gap: 0.45rem;
}

.operator-summary {
  margin: 0 0 0.75rem;
}

.operator-card {
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.operator-card div {
  padding-top: 0.3rem;
}

.admin-tabs {
  margin-bottom: 0.65rem;
  padding: 0.24rem;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.admin-tab {
  min-height: 3.2rem;
  padding: 0.5rem 0.7rem;
}

.admin-search,
.audit-summary,
.supervisor-approval-grid {
  margin-top: 0.75rem;
}

.op-accordion {
  border-radius: var(--radius-md);
  box-shadow: none;
}

.op-accordion__toggle {
  min-height: 3.6rem;
  padding: 0.42rem 0.7rem;
}

.op-accordion__identity strong {
  font-size: 1rem;
}

.op-accordion__summary {
  font-size: 0.78rem;
}

.status-badge,
.formula-status,
.history-pill {
  min-height: 1.65rem;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
}

.icon-action {
  width: 2.35rem;
  height: 2.35rem;
  box-shadow: none;
}

.order-card,
.formula-result,
.upload-box,
.advanced-extraction {
  box-shadow: none;
}

.order-card__header,
.order-card__body,
.order-card__actions {
  padding: 0.7rem;
}

.movement-list {
  gap: 0.4rem;
}

.movement-item {
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
}

.formula-table th,
.formula-table td,
.history-table th,
.history-table td,
.formula-result__table th,
.formula-result__table td {
  padding: 0.58rem 0.62rem;
}

.history-detail {
  padding: 0.65rem;
}

.formula-result__summary {
  padding: 0.7rem 0.8rem;
}

.formula-result__body {
  padding: 0 0.8rem 0.8rem;
}

.capture-card {
  padding: 0.9rem;
  border-radius: var(--radius-xl);
}

.capture-card__header h1 {
  font-size: 1.6rem;
}

.capture-upload {
  min-height: 6.5rem;
  padding: 0.8rem;
}

.login-card {
  padding: 1.35rem;
  border-radius: var(--radius-xl);
}

.login-card__header h2 {
  font-size: 1.5rem;
}

.login-form {
  gap: 0.7rem;
}

.app-footer {
  padding-bottom: 0.5rem;
  font-size: 0.72rem;
}

@media (max-width: 1100px) {
  .history-summary {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }
}

@media (max-width: 720px) {
  .content-area {
    padding: 0.65rem;
  }

  .topbar {
    width: calc(100% - 0.8rem);
    margin-top: 0.4rem;
    padding: 0.65rem;
  }

  .formula-summary,
  .history-summary,
  .operator-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card {
    min-height: 3.1rem;
  }

  .panel__header,
  .panel__body {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

/* Density pass 2: lighter typography and substantially shorter workflows. */
html {
  font-size: 15px;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
}

body:not(.is-login-view) {
  line-height: 1.35;
}

.topbar {
  min-height: 3.7rem;
  margin-top: 0.35rem;
  padding: 0.42rem 0.7rem;
  border-radius: 14px;
}

.topbar__brand {
  gap: 0.55rem;
}

.topbar .brand-logo-wrap {
  width: 4.4rem;
}

.topbar__actions {
  gap: 0.35rem;
}

.topbar__pill,
.topbar__button,
.topbar__status {
  min-height: 2rem;
  padding: 0.34rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.topbar__status--dot {
  width: 2rem;
  max-width: 2rem;
}

.theme-switch {
  width: 3.65rem;
  min-width: 3.65rem;
  height: 2.05rem;
  padding: 0.18rem;
}

.theme-switch__thumb {
  top: 0.18rem;
  left: 0.18rem;
  width: 1.65rem;
  height: 1.65rem;
}

.theme-switch.is-dark .theme-switch__thumb {
  transform: translateX(1.6rem);
}

.theme-switch__icon {
  font-size: 0.76rem;
}

.content-area {
  padding: 0.65rem 0.8rem 1.1rem;
}

.dashboard--entry {
  max-width: 1240px;
}

.panel {
  border-radius: 16px;
  background: rgba(16, 31, 51, 0.72);
  backdrop-filter: blur(6px);
}

.panel__header {
  min-height: 3.9rem;
  padding: 0.58rem 0.8rem;
}

.panel__header h2 {
  font-size: clamp(1.05rem, 1.45vw, 1.25rem);
}

.panel__badge {
  min-height: 1.9rem;
  padding: 0.3rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 650;
}

.panel__body {
  padding: 0.65rem 0.8rem 0.8rem;
}

.panel__eyebrow,
.workflow-block__eyebrow,
.formula-results__eyebrow {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.mode-switch {
  width: min(100%, 390px);
  margin-bottom: 0.6rem;
}

.mode-switch__button {
  min-height: 2.1rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 650;
}

.workflow-block,
.workflow-panel {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

.workflow-block__header {
  margin-bottom: 0.45rem;
}

.workflow-block__header h3,
.formula-results__header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.field-grid--common {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.5rem;
}

.field-grid--common > .field {
  grid-column: span 3;
}

.field-grid--common > .field--full {
  grid-column: span 9;
}

.field {
  gap: 0.22rem;
}

.field span,
.field-label-row > label:first-child,
.field-grid .field span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.035em;
}

input,
select,
textarea {
  min-height: 2.4rem;
  padding: 0.48rem 0.65rem;
  font-size: 0.88rem;
}

textarea {
  min-height: 5rem;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 2px rgba(42, 168, 255, 0.13);
}

input[type="file"] {
  min-height: 2.2rem;
  padding: 0.22rem 0.3rem;
  font-size: 0.8rem;
}

input[type="file"]::file-selector-button {
  min-height: 1.75rem;
  margin-right: 0.55rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button,
.table-action {
  min-height: 2.25rem;
  padding: 0.43rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.button--primary,
.mode-switch__button.is-active,
.topbar__button--primary {
  box-shadow: 0 5px 14px rgba(159, 212, 20, 0.13);
}

.form-actions {
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.form-note {
  margin-top: 0.5rem;
  padding: 0.5rem 0.62rem;
  font-size: 0.78rem;
}

.feedback {
  min-height: 0.85rem;
  font-size: 0.78rem;
}

.upload-box {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem 0.55rem;
  margin-bottom: 0.55rem;
  padding: 0.55rem;
  border-radius: 11px;
}

.upload-box__label,
.upload-box__drop {
  grid-column: 1 / -1;
}

.upload-box__label {
  gap: 0.12rem;
}

.upload-box__title {
  font-size: 0.86rem;
  font-weight: 650;
}

.upload-box__hint {
  font-size: 0.78rem;
  line-height: 1.3;
}

.upload-box__drop {
  min-height: 3.15rem;
  padding: 0.55rem;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
}

.upload-box > input[type="file"] {
  min-width: 0;
}

.upload-box > .button {
  align-self: stretch;
  white-space: nowrap;
}

.formula-summary,
.history-summary {
  gap: 0.35rem;
  margin: 0.55rem 0;
}

.formula-summary {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.summary-card {
  min-height: 2.8rem;
  padding: 0.38rem 0.52rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.summary-card__label {
  margin-bottom: 0.06rem;
  font-size: 0.61rem;
  font-weight: 600;
}

.summary-card strong {
  font-size: 0.82rem;
  font-weight: 650;
}

.formula-table-wrap,
.history-table-wrap,
.formula-result__table-wrap {
  border-radius: 10px;
}

.formula-table,
.history-table,
.formula-result__table {
  font-size: 0.8rem;
}

.formula-table th,
.formula-table td,
.history-table th,
.history-table td,
.formula-result__table th,
.formula-result__table td {
  padding: 0.45rem 0.5rem;
}

.formula-table th,
.history-table th,
.formula-result__table th {
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.formula-results {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
}

.formula-results__header {
  margin-bottom: 0.45rem;
}

.formula-results__list {
  gap: 0.4rem;
}

.formula-result {
  border-radius: 10px;
}

.formula-result__summary {
  padding: 0.52rem 0.62rem;
}

.formula-result__body {
  padding: 0 0.62rem 0.62rem;
}

.formula-result__pill,
.formula-status,
.status-badge,
.history-pill,
.order-chip,
.evidence-link {
  min-height: 1.45rem;
  padding: 0.16rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 650;
}

.advanced-extraction {
  margin-top: 0.55rem;
  border-radius: 9px;
}

.advanced-extraction summary {
  padding: 0.52rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.advanced-extraction .field,
.advanced-extraction .form-actions {
  padding-right: 0.65rem;
  padding-left: 0.65rem;
}

.evidence-box {
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding: 0.55rem;
  border-radius: 10px;
}

.evidence-upload {
  padding: 0.55rem;
}

.evidence-preview {
  gap: 0.55rem;
}

.evidence-preview img {
  width: min(150px, 100%);
}

.evidence-mobile {
  gap: 0.4rem;
}

.evidence-mobile__status {
  padding: 0.5rem 0.62rem;
  font-size: 0.78rem;
}

.op-accordion__toggle {
  min-height: 3.15rem;
  padding: 0.32rem 0.58rem;
}

.op-accordion__identity strong {
  font-size: 0.9rem;
  font-weight: 650;
}

.op-accordion__summary {
  font-size: 0.72rem;
  font-weight: 600;
}

.op-accordion__panel {
  gap: 0.4rem;
  padding: 0.4rem;
}

.op-formula {
  gap: 0.4rem 0.65rem;
  padding: 0.5rem;
}

.op-formula__stats dt,
.op-formula__meta strong,
.order-card__body dt,
.order-card__meta-grid strong {
  font-size: 0.62rem;
  font-weight: 650;
}

.order-card__header,
.order-card__body,
.order-card__actions {
  padding: 0.55rem;
}

.order-card__header strong {
  font-size: 1rem;
  font-weight: 650;
}

.order-card__body {
  gap: 0.5rem;
}

.order-card__body dd,
.order-card__body p {
  font-weight: 650;
}

.order-card__meta-grid span,
.order-card__meta {
  font-size: 0.78rem;
}

.movement-item {
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
}

.movement-item__main span:not(.history-pill),
.movement-item__meta span {
  font-size: 0.76rem;
}

.operator-card {
  padding: 0.5rem 0.6rem;
}

.admin-tab {
  min-height: 2.7rem;
  padding: 0.38rem 0.55rem;
}

.admin-tab span {
  font-size: 0.62rem;
}

.admin-tab strong {
  font-size: 0.8rem;
  font-weight: 650;
}

.supervisor-approval-card .supervisor-deadline {
  min-height: 1.55rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
}

.simple-modal__card,
.history-modal__card,
.app-modal__card {
  border-radius: 14px;
  box-shadow: var(--shadow-strong);
}

.simple-modal__header,
.history-modal__header {
  padding: 0.7rem 0.8rem;
}

.simple-modal__header h2,
.history-modal__header h2 {
  font-size: 1.15rem;
}

.simple-modal__card form,
.components-modal__body,
.history-modal__body {
  padding: 0.8rem;
}

.app-modal__card {
  padding: 1rem;
}

.app-modal__icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.65rem;
}

.app-modal__title {
  font-size: 1.25rem;
}

.login-layout {
  gap: 2rem;
}

.login-card {
  padding: 1.05rem;
  border-radius: 16px;
}

.login-brand {
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.login-brand h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.login-card__header {
  margin-bottom: 0.8rem;
}

.login-card__header h2 {
  font-size: 1.3rem;
}

.login-card__header p:last-child,
.login-hero__copy {
  line-height: 1.4;
}

.capture-shell {
  padding: 0.6rem;
}

.capture-card {
  padding: 0.7rem;
  border-radius: 16px;
}

.capture-summary,
.capture-form {
  gap: 0.45rem;
}

.capture-upload {
  min-height: 5rem;
  padding: 0.55rem;
}

@media (max-width: 900px) {
  .field-grid--common {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid--common > .field {
    grid-column: auto;
  }

  .field-grid--common > .field--full {
    grid-column: 1 / -1;
  }

  .upload-box {
    grid-template-columns: 1fr;
  }

  .upload-box__label,
  .upload-box__drop {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 15px;
  }

  .field-grid--common {
    grid-template-columns: 1fr;
  }

  .field-grid--common > .field--full {
    grid-column: auto;
  }

  .topbar .brand-logo-wrap {
    width: 4rem;
  }

  .panel__header {
    min-height: auto;
  }
}

.status-badge--suspended {
  color: #2e1b04;
  border: 1px solid rgba(255, 166, 52, 0.58);
  background: #ffb95c;
}

.order-state-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.25rem 0.65rem;
  align-items: center;
  padding: 0.48rem 0.6rem;
  border: 1px solid rgba(255, 166, 52, 0.38);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255, 166, 52, 0.1);
}

.order-state-notice strong {
  color: #ffc879;
  font-size: 0.78rem;
}

.order-state-notice span,
.order-state-notice small {
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.order-state-notice small {
  text-align: right;
}

.op-accordion__order-actions {
  display: flex;
  justify-content: flex-end;
}

.op-accordion__order-actions .button {
  min-height: 2rem;
  padding: 0.32rem 0.62rem;
  font-size: 0.75rem;
}

.history-rejection {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.58rem 0.65rem;
  border: 1px solid rgba(255, 99, 106, 0.34);
  border-radius: var(--radius-sm);
  background: rgba(255, 99, 106, 0.08);
}

.history-rejection > div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.history-rejection span,
.history-correction-link {
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.history-rejection strong {
  color: var(--text);
  font-size: 0.78rem;
}

.history-rejection small {
  color: var(--muted);
  font-size: 0.68rem;
}

.history-rejection .button {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.34rem 0.62rem;
  font-size: 0.74rem;
}

.history-correction-link {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.36rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.topbar__notification-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  min-height: 1.3rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  color: #fff;
  background: #d73c49;
  font-size: 0.68rem;
  line-height: 1;
}

@media (max-width: 720px) {
  .order-state-notice {
    grid-template-columns: 1fr;
  }

  .order-state-notice small {
    text-align: left;
  }

  .op-accordion__order-actions .button {
    width: 100%;
  }

  .history-rejection {
    align-items: stretch;
    flex-direction: column;
  }

  .history-rejection .button {
    width: 100%;
  }
}

/* Respiro visual del registro de entregas: solo separaciones, sin aumentar componentes. */
.dashboard--entry .delivery-form > * + * {
  margin-top: 0.9rem;
}

.dashboard--entry .workflow-block__header {
  margin-bottom: 0.7rem;
}

.dashboard--entry .field-grid {
  column-gap: 0.7rem;
  row-gap: 0.8rem;
}

.dashboard--entry .workflow-panel > * + * {
  margin-top: 0.8rem;
}

.dashboard--entry .upload-box {
  column-gap: 0.7rem;
  row-gap: 0.65rem;
}

.dashboard--entry .formula-summary {
  gap: 0.55rem;
}

.dashboard--entry .evidence-box {
  gap: 0.75rem;
}

.dashboard--entry .form-actions {
  gap: 0.6rem;
}

.batch-evidence {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 35, 58, 0.68);
}

.batch-evidence[hidden] {
  display: none;
}

.batch-evidence__header,
.active-evidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.batch-evidence__header h3,
.active-evidence h3 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
}

.batch-evidence__header > p,
.active-evidence > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  text-align: right;
}

.batch-evidence__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.batch-evidence__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  padding: 0.52rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.5);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.batch-evidence__item:hover,
.batch-evidence__item.is-active {
  border-color: var(--accent);
  background: rgba(158, 230, 0, 0.08);
}

.batch-evidence__number {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  color: #17220b;
  background: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.batch-evidence__identity {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.batch-evidence__identity strong,
.batch-evidence__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-evidence__identity strong {
  font-size: 0.82rem;
}

.batch-evidence__identity small {
  color: var(--muted-strong);
  font-size: 0.7rem;
}

.batch-evidence__status,
.formula-result__evidence {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.batch-evidence__status.is-complete,
.formula-result__evidence.is-complete {
  color: #17220b;
  background: var(--accent);
}

.batch-evidence__status.is-pending,
.formula-result__evidence.is-pending {
  color: #382600;
  background: #f5c85f;
}

.active-evidence {
  margin-top: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: rgba(158, 230, 0, 0.055);
}

:root[data-theme="light"] .batch-evidence {
  background: rgba(255, 255, 255, 0.84);
}

:root[data-theme="light"] .batch-evidence__item {
  background: rgba(239, 244, 250, 0.9);
}

@media (max-width: 820px) {
  .batch-evidence__list {
    grid-template-columns: 1fr;
  }

  .batch-evidence__header,
  .active-evidence {
    align-items: flex-start;
    flex-direction: column;
  }

  .batch-evidence__header > p,
  .active-evidence > p {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .dashboard--entry .delivery-form > * + * {
    margin-top: 0.75rem;
  }

  .dashboard--entry .workflow-panel > * + * {
    margin-top: 0.7rem;
  }
}

/* Jerarquia compacta: OP > tintas > movimientos/componentes. */
.history-tint-list {
  display: grid;
  gap: 0.65rem;
}

.history-tint {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.history-tint__summary {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(390px, 1.6fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.58rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

.history-tint__summary::-webkit-details-marker {
  display: none;
}

.history-table td .history-tint__identity,
.history-table td .history-tint__meta {
  display: flex !important;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  margin-top: 0;
}

.history-table td .history-tint__identity {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.history-tint__identity strong {
  color: var(--text);
  font-size: 0.82rem;
}

.history-tint__identity small,
.history-tint__meta {
  color: var(--muted-strong);
  font-size: 0.7rem;
}

.history-table td .history-tint__overview {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 0.38rem;
  min-width: 0;
  margin-top: 0;
  color: var(--text);
}

.history-table td .history-tint__stat {
  display: grid !important;
  gap: 0.08rem;
  min-width: 0;
  margin-top: 0;
  padding: 0.38rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.history-tint__stat small,
.history-tint__stat strong {
  display: block;
  min-width: 0;
  margin: 0;
}

.history-tint__stat small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-tint__stat strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-tint__meta {
  justify-content: flex-end;
}

.history-tint__meta > strong {
  color: var(--text);
  white-space: nowrap;
}

.history-tint__chevron {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--text);
  font-size: 1rem;
  transition: transform 160ms ease;
}

.history-tint[open] .history-tint__chevron {
  transform: rotate(180deg);
}

.history-tint__body {
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem;
  border-top: 1px solid var(--line);
}

.history-delivery-block {
  display: grid;
  gap: 0.55rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(6, 18, 34, 0.36);
}

.history-delivery-block__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.history-delivery-block__header strong {
  color: var(--text);
}

.history-detail__table-wrap {
  overflow-x: auto;
}

.op-formula {
  display: block;
}

.op-formula__header {
  width: 100%;
  cursor: pointer;
  list-style: none;
}

.op-formula__header::-webkit-details-marker {
  display: none;
}

.op-formula__body {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.2fr);
  gap: 0.6rem 0.9rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.op-formula__body > .movement-list,
.op-formula__body > .op-formula__actions {
  grid-column: 1 / -1;
}

.op-formula__chevron {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--text);
  font-size: 1rem;
  transition: transform 160ms ease;
}

.op-formula[open] .op-formula__chevron {
  transform: rotate(180deg);
}

.history-tint--rejected,
.op-formula--rejected,
.movement-item--rejected,
.history-delivery-block--rejected {
  border-color: rgba(255, 99, 106, 0.46);
  background: rgba(255, 72, 82, 0.11);
  box-shadow: inset 3px 0 0 rgba(255, 99, 106, 0.78);
}

.history-tint--rejected > .history-tint__summary {
  background: rgba(255, 72, 82, 0.06);
}

:root[data-theme="light"] .history-tint,
:root[data-theme="light"] .history-delivery-block {
  background: rgba(11, 35, 61, 0.025);
}

:root[data-theme="light"] .history-tint__stat {
  background: rgba(11, 35, 61, 0.035);
}

:root[data-theme="light"] .history-tint--rejected,
:root[data-theme="light"] .op-formula--rejected,
:root[data-theme="light"] .movement-item--rejected,
:root[data-theme="light"] .history-delivery-block--rejected {
  border-color: rgba(193, 32, 45, 0.42);
  background: rgba(220, 43, 56, 0.1);
  box-shadow: inset 3px 0 0 rgba(193, 32, 45, 0.7);
}

@media (max-width: 980px) {
  .history-tint__summary {
    grid-template-columns: minmax(160px, 1fr) auto;
  }

  .history-table td .history-tint__overview {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 720px) {
  .history-tint__summary {
    grid-template-columns: 1fr;
  }

  .history-table td .history-tint__overview {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-table td .history-tint__meta {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .op-formula__body {
    grid-template-columns: 1fr;
  }

  .op-formula__body > * {
    grid-column: 1;
  }
}
