:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f6f0df;
  --paper: #faf8f3;
  --ink: #14181f;
  --muted: #6b665c;
  --line: #e6e1d5;
  --line-strong: #d8d1c1;
  --navy: #061557;
  --navy-2: #0a1f6f;
  --gold: #b98f2f;
  --gold-dark: #8f6a1c;
  --green: #1b7f64;
  --green-dark: #115f4c;
  --blue: #2563eb;
  --amber: #b86e12;
  --red: #b42318;
  --shadow: 0 1px 2px rgba(26, 22, 12, 0.04), 0 10px 28px rgba(26, 22, 12, 0.06);
  --shadow-soft: 0 1px 2px rgba(26, 22, 12, 0.04), 0 3px 10px rgba(26, 22, 12, 0.05);
  --shadow-lg: 0 2px 6px rgba(26, 22, 12, 0.05), 0 24px 54px rgba(26, 22, 12, 0.11);
  --ring-gold: 0 0 0 3px rgba(185, 143, 47, 0.16);
  --radius: 8px;
  --radius-sm: 6px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  font-family: var(--font-sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 380px at 82% -6%, rgba(185, 143, 47, 0.09), transparent 62%),
    radial-gradient(760px 340px at -6% 2%, rgba(6, 21, 87, 0.05), transparent 58%),
    var(--bg);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 143, 47, 0.4) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(185, 143, 47, 0.35);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 143, 47, 0.6);
  background-clip: padding-box;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.login-view {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(1200px 620px at 50% -12%, rgba(185, 143, 47, 0.18), transparent 58%),
    radial-gradient(900px 520px at 88% 116%, rgba(10, 31, 111, 0.9), transparent 55%),
    linear-gradient(180deg, #08195f, #061557 55%, #040e3a);
}

.login-view::before {
  position: absolute;
  inset: 22px;
  content: "";
  border: 1px solid rgba(185, 143, 47, 0.18);
  border-radius: 12px;
  pointer-events: none;
}

.login-view::after {
  position: absolute;
  right: -12vw;
  bottom: -20vw;
  width: min(54vw, 720px);
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(185, 143, 47, 0.16);
  border-radius: 40px;
  transform: rotate(45deg);
  pointer-events: none;
}

.login-stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(460px, 100%);
}

.login-mark {
  display: block;
  width: clamp(230px, 34vw, 330px);
  height: auto;
  margin: 0 0 -10px;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.26));
}

.login-card {
  position: relative;
  width: 100%;
  padding: 30px 30px 28px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 34px 70px rgba(2, 8, 37, 0.42);
  backdrop-filter: blur(12px);
  animation: riseIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--gold-dark), var(--gold) 50%, var(--gold-dark));
  border-radius: 12px 12px 0 0;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 22px;
  text-align: center;
}

.login-brand::after {
  content: "";
  width: 46px;
  height: 2px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 999px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  color: var(--navy);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: 0;
}

.login-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 4px 2px 0;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 22px;
  color: #ffffff;
  background:
    radial-gradient(150% 42% at 50% -8%, rgba(185, 143, 47, 0.22), transparent 60%),
    linear-gradient(180deg, #071a63, #061557 52%, #04102f);
  border-right: 1px solid rgba(185, 143, 47, 0.18);
  box-shadow: 18px 0 48px rgba(4, 12, 46, 0.24);
}

.sidebar::before {
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--gold), rgba(255, 255, 255, 0.7), rgba(185, 143, 47, 0.28));
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(185, 143, 47, 0.22);
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: center 56%;
  background: #061557;
  border: 1px solid rgba(185, 143, 47, 0.6);
  border-radius: 10px;
  box-shadow:
    0 0 0 4px rgba(185, 143, 47, 0.1),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--navy);
  background: linear-gradient(135deg, #e4bd61, var(--gold));
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.brand-initials {
  font-size: 0.92rem;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.14rem;
  letter-spacing: 0.01em;
}

.brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.nav-item .icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  transition:
    color 0.16s ease,
    background 0.16s ease;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: #ffffff;
  background: rgba(185, 143, 47, 0.15);
  border-color: rgba(185, 143, 47, 0.4);
}

.nav-item.is-active .icon {
  color: var(--navy);
  background: var(--gold);
}

.badge {
  min-width: 24px;
  margin-left: auto;
  padding: 2px 7px;
  color: var(--navy);
  background: var(--gold);
  border-radius: 999px;
  font-size: 0.78rem;
  text-align: center;
}

.sidebar-status {
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(201, 154, 50, 0.38);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.account-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.account-box strong,
.account-box small {
  display: block;
}

.account-box small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
}

.account-box .secondary {
  width: 100%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-status div {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.sidebar-status small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.62);
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(185, 143, 47, 0.45);
  animation: dotPulse 2.4s ease-out infinite;
}

@keyframes dotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(185, 143, 47, 0.5);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(185, 143, 47, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(185, 143, 47, 0);
  }
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 2.3vw, 2.4rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
  line-height: 1.22;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.02rem;
}

.panel-header p,
.detail-meta,
.case-card p,
.timeline-item p,
.document-row p {
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 42vw);
  min-width: 250px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.search:focus-within {
  border-color: var(--gold);
  box-shadow: var(--ring-gold);
}

.search .icon {
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  height: 40px;
  background: transparent;
  border: 0;
  outline: 0;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

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

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.primary {
  color: var(--navy);
  background: linear-gradient(180deg, #c9a03c, var(--gold));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 6px rgba(143, 106, 28, 0.24);
}

.primary:hover {
  background: linear-gradient(180deg, #d6ad48, #bd932f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 4px 12px rgba(143, 106, 28, 0.3);
}

.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.secondary.is-on {
  color: var(--navy);
  background: #fff8e6;
  border-color: rgba(201, 154, 50, 0.72);
  box-shadow: 0 0 0 3px rgba(201, 154, 50, 0.12);
}

.ghost {
  color: var(--navy);
  background: transparent;
  border-color: #ead9af;
}

.danger {
  color: var(--red);
  background: #fff7f6;
  border-color: #f3c7c3;
}

.danger:hover {
  background: #fee4e2;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--surface);
  border-color: var(--line);
}

.icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.metrics article {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.metrics article::before {
  position: absolute;
  top: 0;
  left: 18px;
  width: 28px;
  height: 3px;
  content: "";
  background: var(--gold);
  border-radius: 0 0 3px 3px;
  transition: width 0.22s ease;
}

.metrics article:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.metrics article:hover::before {
  width: 48px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin-top: 12px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.automation-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.monitor-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--gold-dark);
  background: rgba(185, 143, 47, 0.14);
  border: 1px solid rgba(185, 143, 47, 0.4);
  border-radius: 999px;
}

.monitor-orbit::after {
  position: absolute;
  inset: -5px;
  content: "";
  border: 1px solid rgba(185, 143, 47, 0.5);
  border-radius: 999px;
  animation: monitorPulse 2.2s ease-out infinite;
}

.automation-copy strong,
.automation-copy span {
  display: block;
}

.automation-copy strong {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--navy);
}

.automation-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.automation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, auto));
  gap: 24px;
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.automation-stats div {
  min-height: auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.automation-stats dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.automation-stats dd {
  margin: 5px 0 0;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.process-panel,
.detail-panel {
  min-height: 540px;
}

.case-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.case-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  width: 100%;
  padding: 15px 15px 15px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.case-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  content: "";
  background: var(--gold);
  border-radius: 0 999px 999px 0;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.case-card:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.case-card.is-selected {
  border-color: rgba(185, 143, 47, 0.55);
  background: #fffdf6;
  box-shadow: var(--shadow-soft);
}

.case-card:hover::before,
.case-card.is-selected::before {
  opacity: 1;
}

.case-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.case-card p {
  margin: 5px 0 0;
  font-size: 0.85rem;
}

.case-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.pill.green {
  color: var(--green-dark);
  background: #dff5ee;
}

.pill.amber {
  color: #8a4f09;
  background: #fff0d8;
}

.pill.blue {
  color: #1d4ed8;
  background: #e5edff;
}

.pill.red {
  color: var(--red);
  background: #fee4e2;
}

.detail-panel {
  display: flex;
  flex-direction: column;
}

.detail-empty {
  display: grid;
  place-items: center;
  min-height: 540px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.detail-top {
  padding: 20px 18px;
  background: linear-gradient(180deg, #fffdf7, transparent 90px);
  border-bottom: 1px solid var(--line);
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-title h2 {
  overflow-wrap: anywhere;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.42rem;
  letter-spacing: 0.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.detail-meta-line {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 22px;
  margin-top: 18px;
  font-size: 0.94rem;
}

.detail-meta > div {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.official-panel {
  margin-top: 20px;
  padding: 16px 20px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.official-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.official-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.official-updated {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.official-meta {
  margin-top: 12px;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.source-strip.is-live {
  background: #fbf7ec;
  border-color: rgba(185, 143, 47, 0.4);
}

.source-strip-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--gold-dark);
  background: rgba(185, 143, 47, 0.16);
  border: 1px solid rgba(185, 143, 47, 0.32);
  border-radius: 999px;
}

.source-strip > div:nth-child(2) {
  flex: 1 1 200px;
  min-width: 0;
}

.source-strip strong,
.source-strip p {
  display: block;
  margin: 0;
}

.source-strip strong {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--navy);
}

.source-strip p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.source-strip-actions {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 38px;
  margin-bottom: -1px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    color 0.16s ease,
    border-color 0.16s ease;
}

.tab-button:hover {
  color: var(--navy);
}

.tab-button.is-active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.detail-content {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timeline-date {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timeline-item p {
  margin: 5px 0 0;
  font-size: 0.9rem;
}

.actions-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.actions-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.actions-table th,
.actions-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.actions-table th {
  color: var(--muted);
  background: #f4f1e9;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.actions-table th:nth-child(1),
.actions-table th:nth-child(4),
.actions-table th:nth-child(5),
.actions-table th:nth-child(6) {
  width: 140px;
}

.actions-table th:nth-child(2) {
  width: 230px;
}

.actions-table th:nth-child(7) {
  width: 170px;
}

.actions-table td {
  color: #2f3237;
  line-height: 1.28;
}

.actions-table tbody tr {
  transition: background 0.16s ease;
}

.actions-table tbody tr:hover td {
  background: #faf8f2;
}

.actions-table td:first-child,
.actions-table td:nth-child(4),
.actions-table td:nth-child(5),
.actions-table td:nth-child(6) {
  white-space: nowrap;
}

.actions-table td strong {
  display: inline;
  font-weight: 600;
}

.actions-table tr:last-child td {
  border-bottom: 0;
}

.actions-table tr.is-new td {
  background: #fffaf0;
  animation: newRowGlow 1.4s ease-out 1;
}

.file-actions {
  display: grid;
  gap: 7px;
  align-items: start;
}

.inline-file-control {
  position: relative;
  overflow: hidden;
}

.inline-file-control input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.file-actions small,
.muted-note {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.settings-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0.25rem 0 0.25rem;
}

.muted-line {
  color: var(--muted);
  font-size: 0.75rem;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 7px !important;
  padding: 5px 8px;
  color: var(--navy);
  background: #fff8e6;
  border: 1px solid rgba(201, 154, 50, 0.36);
  border-radius: 999px;
  font-size: 0.78rem !important;
  font-weight: 800;
}

.file-chip .icon {
  width: 14px;
  height: 14px;
}

.document-list,
.document-repository,
.alert-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.settings-view {
  min-width: 0;
}

.settings-panel {
  min-height: 540px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--green-dark);
  background: #dff5ee;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.save-status.is-saving {
  color: var(--navy);
  background: #fff8e6;
}

.database-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.database-summary article {
  min-height: 74px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.database-summary span,
.database-summary strong {
  display: block;
}

.database-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.database-summary strong {
  margin-top: 6px;
  color: var(--navy);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.wide-database-card {
  grid-column: 1 / -1;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 16px;
}

.settings-form,
.settings-users {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.settings-users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.case-assignment-box {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.case-assignment-list,
.settings-user-list,
.settings-assigned-cases {
  display: grid;
  gap: 9px;
}

.assignment-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.assignment-option input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.assignment-option strong,
.assignment-option small {
  display: block;
}

.assignment-option small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
}

.compact-option {
  padding: 8px;
}

.settings-user-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
}

.settings-user-card.is-disabled {
  border-left-color: var(--muted);
  opacity: 0.72;
}

.settings-user-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.settings-user-main h3,
.settings-user-main p {
  margin: 0;
}

.settings-user-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--navy);
  background: #fff8e6;
  border: 1px solid rgba(201, 154, 50, 0.32);
  border-radius: var(--radius);
}

.settings-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-inline {
  padding: 12px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.document-row,
.alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.document-row h3,
.document-row p,
.alert-row h3,
.alert-row p {
  margin: 0;
}

.document-row p,
.alert-row p {
  margin-top: 5px;
  font-size: 0.88rem;
}

.document-row h3,
.alert-row h3 {
  font-size: 0.98rem;
}

/* Acciones repetidas en listas: dorado con contorno, no relleno (evita el exceso de dorado) */
.document-row .button.primary {
  color: var(--gold-dark);
  background: transparent;
  border-color: rgba(185, 143, 47, 0.5);
}

.document-row .button.primary:hover {
  background: #fbf6ea;
  border-color: var(--gold);
}

.full-view {
  min-height: 540px;
}

.hidden {
  display: none !important;
}

.modal {
  position: relative;
  overflow: hidden;
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(4, 12, 46, 0.4);
}

.modal[open] {
  animation: riseIn 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.modal::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--gold-dark), var(--gold) 50%, var(--gold-dark));
}

.modal::backdrop {
  background: rgba(6, 12, 40, 0.5);
  backdrop-filter: blur(3px);
}

.modal form {
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

label,
legend {
  color: #344054;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 0 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

input,
select {
  min-height: 42px;
}

textarea {
  min-height: 180px;
  padding: 11px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 143, 47, 0.16);
}

.wide {
  grid-column: 1 / -1;
}

.channel-box {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 16px;
  color: #ffffff;
  background: #1f2937;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.source-empty {
  border: 1px dashed #d6b761;
  border-radius: var(--radius);
  background: #fffaf0;
}

.source-empty h3 {
  color: var(--ink);
}

.source-empty .button {
  margin-top: 12px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes monitorPulse {
  0% {
    opacity: 0.7;
    transform: scale(0.92);
  }

  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes newRowGlow {
  0% {
    box-shadow: inset 4px 0 0 var(--gold);
  }

  100% {
    box-shadow: inset 4px 0 0 rgba(201, 154, 50, 0);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    flex-direction: row;
    align-items: center;
    height: auto;
    overflow-y: visible;
    padding: 12px 16px;
  }

  .sidebar::before {
    display: none;
  }

  .nav-list {
    grid-auto-flow: column;
    margin-left: auto;
  }

  .sidebar-status {
    display: none;
  }

  .view-grid,
  .metrics,
  .automation-band,
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .automation-band {
    align-items: stretch;
  }

  .automation-stats {
    grid-column: 1 / -1;
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions,
  .search {
    width: 100%;
  }

  .metrics,
  .view-grid,
  .form-grid,
  .detail-meta,
  .automation-band,
  .source-strip,
  .database-summary,
  .settings-grid,
  .settings-user-main {
    grid-template-columns: 1fr;
  }

  .monitor-orbit {
    width: 42px;
    height: 42px;
  }

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

  .sidebar {
    align-items: stretch;
    overflow-x: auto;
  }

  .brand {
    min-width: 210px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .source-strip-actions,
  .empty-actions {
    justify-content: flex-start;
  }

  .nav-item {
    white-space: nowrap;
  }

  .timeline-item,
  .document-row,
  .alert-row,
  .case-card {
    grid-template-columns: 1fr;
  }

  .actions-table {
    min-width: 0;
  }

  .actions-table thead {
    display: none;
  }

  .actions-table,
  .actions-table tbody,
  .actions-table tr,
  .actions-table td {
    display: block;
  }

  .actions-table tr {
    border-bottom: 1px solid var(--line);
  }

  .actions-table tr:last-child {
    border-bottom: 0;
  }

  .actions-table td {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 0;
    white-space: normal;
  }

  .actions-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 900;
  }

  .case-status {
    align-items: flex-start;
  }

  .detail-title {
    display: grid;
  }

  .detail-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
