:root {
  --black: #1f2329;
  --night-blue: #f0f2f5;
  --blue: #59616d;
  --blue-soft: #737c89;
  --gold: #b8902f;
  --off-white: #23272f;
  --muted: #68717d;
  --danger: #b91c1c;
  --success: #15803d;
  --card: rgba(255, 255, 255, 0.76);
  --card-strong: rgba(255, 255, 255, 0.9);
  --card-soft: rgba(248, 249, 251, 0.72);
  --border: rgba(35, 39, 47, 0.12);
  --border-gold: rgba(184, 144, 47, 0.28);
  --shadow: 0 18px 45px rgba(31, 35, 41, 0.12);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.58), 0 18px 42px rgba(31, 35, 41, 0.11);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Bahnschrift", "DejaVu Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 18%, rgba(184, 144, 47, 0.08), transparent 26%),
    linear-gradient(135deg, #fbfcfd 0%, #f1f3f6 52%, #e9edf2 100%);
  color: var(--off-white);
}

body {
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(35, 39, 47, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 39, 47, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 85%);
  opacity: 0.38;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    url("assets/images/logo_dhs.png") center center / min(54vw, 720px) no-repeat;
  opacity: 0.28;
  filter: grayscale(0.15);
}

#app {
  position: relative;
  z-index: 1;
}

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

button {
  border: 0;
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 248, 251, 0.9)),
    radial-gradient(circle at top left, rgba(184, 144, 47, 0.1), transparent 32%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(31, 35, 41, 0.08);
  backdrop-filter: blur(14px);
}

.app-header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-user-panel {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  justify-content: flex-end;
}

.top-user-panel strong,
.top-user-panel span {
  display: block;
}

.top-user-panel > div {
  text-align: right;
}

.top-user-panel > div > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.top-status-pill {
  align-self: center;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions select {
  border-radius: 12px;
  border: 1px solid rgba(35, 39, 47, 0.13);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--off-white);
}


.sidebar {
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sidebar .brand {
  min-width: 190px;
}

.sidebar .user-panel {
  width: min(280px, 100%);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(31, 35, 41, 0.08);
}

.sidebar .user-panel strong {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.sidebar .user-panel .muted {
  font-size: 0.78rem;
  line-height: 1.35;
}

.sidebar .nav-list {
  flex: 1 0 100%;
  order: 10;
}

.sidebar .logout-button {
  flex: 0 0 auto;
  margin-left: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.brand-link {
  cursor: pointer;
  outline: none;
}

.brand-link:focus-visible {
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(184, 144, 47, 0.16);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border-gold);
  background: linear-gradient(135deg, #f9fafb, #e7ebf0);
  box-shadow: 0 0 0 1px rgba(200, 155, 44, 0.1), 0 12px 25px rgba(31, 35, 41, 0.12);
}

.brand-copy h1,
.brand-copy h2,
.brand-copy p {
  margin: 0;
}

.brand-copy h1,
.brand-copy h2 {
  font-size: 0.98rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-copy p {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-panel,
.status-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 248, 250, 0.72));
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--glow);
  position: relative;
  overflow: hidden;
}

.user-panel::before,
.status-panel::before,
.panel::before,
.feature-card::before,
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(184, 144, 47, 0), rgba(184, 144, 47, 0.62), rgba(184, 144, 47, 0));
}

.user-panel strong,
.status-panel strong {
  display: block;
  margin-bottom: 8px;
}

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

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-button,
.action-button,
.secondary-button,
.danger-button {
  border-radius: 12px;
  padding: 12px 14px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-button {
  background: rgba(255, 255, 255, 0.62);
  color: var(--off-white);
  text-align: center;
  border: 1px solid rgba(35, 39, 47, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  white-space: nowrap;
}

.nav-button:hover,
.nav-button.active {
  background: linear-gradient(180deg, rgba(184, 144, 47, 0.16), rgba(184, 144, 47, 0.07));
  border-color: rgba(184, 144, 47, 0.24);
  box-shadow: inset 0 0 0 1px rgba(184, 144, 47, 0.08), 0 10px 22px rgba(31, 35, 41, 0.1);
  transform: translateY(-1px);
}

.sidebar-spacer {
  flex: 1;
}

.logout-button {
  background: linear-gradient(180deg, #dc2626, #b91c1c 72%, #991b1b);
  color: #fff7f7;
  border: 1px solid rgba(127, 29, 29, 0.52);
  border-radius: 12px;
  padding: 12px 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.22);
}

.content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  position: relative;
  z-index: 1;
}

.topbar {
  margin-bottom: 26px;
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(35, 39, 47, 0.08);
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  top: -20px;
  right: 0;
  width: 120px;
  height: 120px;
  background: url("assets/images/logo_dhs.png") center center / contain no-repeat;
  opacity: 0.12;
  filter: saturate(0) brightness(1.5);
}

.topbar h2,
.topbar p {
  margin: 0;
}

.topbar h2 {
  font-size: 2rem;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card,
.feature-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 248, 250, 0.7));
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  position: relative;
  overflow: hidden;
}

.feature-card {
  padding: 22px;
}

.feature-card h3 {
  position: relative;
  padding-left: 28px;
}

.feature-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: url("assets/images/logo_dhs.png") center center / contain no-repeat;
  opacity: 0.7;
}

.feature-card h3,
.feature-card p {
  margin-top: 0;
}

.feature-card p {
  color: var(--muted);
  min-height: 52px;
}

.feature-card button,
.action-button {
  background: linear-gradient(180deg, #ffffff, #f3f5f8 72%, #e8ecf1);
  color: #23272f;
  border: 1px solid rgba(184, 144, 47, 0.34);
  box-shadow: 0 10px 22px rgba(31, 35, 41, 0.1);
}

.secondary-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 247, 249, 0.7));
  color: var(--off-white);
  border: 1px solid rgba(35, 39, 47, 0.12);
}

.danger-button {
  background: linear-gradient(180deg, #ef4444, #dc2626 72%, #b91c1c);
  color: #fff7f7;
  border: 1px solid rgba(127, 29, 29, 0.5);
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.18);
}

.action-button:hover,
.secondary-button:hover,
.danger-button:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 248, 250, 0.74));
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.panel-heading h3 {
  position: relative;
  padding-left: 28px;
}

.panel-heading h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: url("assets/images/logo_dhs.png") center center / contain no-repeat;
  opacity: 0.7;
}

.page-grid {
  display: grid;
  gap: 18px;
}

.page-grid.two-columns {
  grid-template-columns: 1.15fr 0.85fr;
}

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

.form-grid.single {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[hidden] {
  display: none !important;
}

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

.switch-field-slot {
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(35, 39, 47, 0.13);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 249, 251, 0.86));
  color: var(--off-white);
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.field select {
  color-scheme: light;
}

.field select option,
.field select optgroup {
  background: #f8f9fb;
  color: var(--off-white);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(184, 144, 47, 0.4);
  box-shadow: 0 0 0 3px rgba(184, 144, 47, 0.12);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.compact-actions {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-layout {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(380px, 1fr);
  gap: 24px;
  align-items: start;
}

.login-card {
  width: min(460px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 248, 250, 0.8)),
    radial-gradient(circle at top, rgba(184, 144, 47, 0.05), transparent 35%);
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 28px 65px rgba(31, 35, 41, 0.14);
  position: relative;
  overflow: hidden;
}

.login-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-header img {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  border: 1px solid var(--border-gold);
  margin-bottom: 14px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(200, 155, 44, 0.08), 0 14px 28px rgba(31, 35, 41, 0.12);
}

.login-header h1,
.login-header p {
  margin: 0;
}

.login-header h1 {
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.84rem;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.on-duty::before,
.badge.off-duty::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.badge.on-duty::before {
  background: #22c55e;
}

.badge.off-duty::before {
  background: #ef4444;
}

.badge.paused-duty::before {
  background: #f59e0b;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--off-white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(31, 35, 41, 0.08);
}

.status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.status-pill.on-duty span {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.status-pill.paused-duty span {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-item {
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 248, 250, 0.64));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.list-item h4,
.list-item p {
  margin: 0;
}

.list-item h4 {
  margin-bottom: 6px;
}

.inline-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 8px 0;
}

.agent-name-with-crown {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-crown {
  display: inline-block !important;
  flex: 0 0 auto;
  font-size: 0.95em;
  line-height: 1;
  transform: translateY(-1px);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.admin-crown-supervisor {
  color: #f59e0b;
}

.admin-crown-director {
  color: #dc2626;
}

.admin-crown-chief {
  color: #ffffff;
  text-shadow: 0 0 1px #111827, 0 0 3px rgba(17, 24, 39, 0.9);
}

.result-box {
  white-space: pre-wrap;
  line-height: 1.5;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 249, 251, 0.76)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.05), transparent 35%);
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  padding: 16px;
  min-height: 180px;
}

.compact-result {
  min-height: 132px;
}

.miranda-panel {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.miranda-panel h3 {
  margin: 0;
}

.miranda-box {
  min-height: 240px;
  font-size: 1rem;
  line-height: 1.8;
  border-color: rgba(184, 144, 47, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.88), rgba(250, 247, 240, 0.78)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.08), transparent 35%);
}

.detention-layout {
  grid-template-columns: 1.25fr 0.9fr;
  align-items: start;
}

.sanction-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(247, 248, 250, 0.44));
}

.sanction-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 14px;
}

.compact-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 160px);
}

.detention-selection-grid {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 16px;
}

.sanction-column {
  display: grid;
  gap: 12px;
}

.sanction-column h3 {
  margin: 0;
}

.selectable-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.compact-list {
  max-height: 220px;
}

.selectable-item {
  width: 100%;
  text-align: left;
  color: var(--off-white);
  cursor: pointer;
}

.selectable-item.selected {
  border-color: rgba(184, 144, 47, 0.34);
  background: linear-gradient(180deg, rgba(184, 144, 47, 0.16), rgba(184, 144, 47, 0.08));
  box-shadow: 0 0 0 1px rgba(184, 144, 47, 0.08);
}

.selectable-item:hover {
  border-color: rgba(184, 144, 47, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.procedure-warning-list,
.procedure-reference-list {
  display: grid;
  gap: 8px;
}

.procedure-reference-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.procedure-reference-header h3 {
  margin: 0;
}

.procedure-reference-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
}

.procedure-warning-item,
.procedure-reference-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #172b4d;
  cursor: pointer;
}

.procedure-warning-item strong,
.procedure-reference-item strong {
  color: #7a5a11;
  font-size: 0.88rem;
}

.procedure-reference-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.procedure-warning-item:hover,
.procedure-reference-item:hover,
.procedure-reference-item.selected {
  border-color: rgba(184, 144, 47, 0.36);
  background: rgba(184, 144, 47, 0.1);
}

.procedure-empty {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.procedure-detail-box {
  min-height: 170px;
}

.procedure-detail-box h4 {
  margin: 0 0 10px;
  color: #172b4d;
}

.procedure-detail-box p {
  margin: 8px 0;
}

.search-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.search-row .field {
  flex: 1;
}

.message {
  margin-top: 14px;
  color: #dfd0a7;
}

.danger-text {
  color: #fca5a5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  margin-top: 18px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 18px;
}

.dashboard-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.dashboard-panel-heading .action-button {
  flex: 0 0 auto;
}

.agent-status-panel {
  width: min(390px, 100%);
  margin-left: auto;
  padding: 9px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  box-shadow: 0 10px 24px rgba(31, 35, 41, 0.09);
}

.agent-status-panel::before {
  display: none;
}

.agent-status-head {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agent-status-head strong,
.agent-status-head p {
  margin: 0;
}

.agent-status-head strong {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.agent-status-head .status-pill {
  justify-self: start;
  padding: 6px 9px;
  font-size: 0.68rem;
  gap: 6px;
  max-width: 112px;
  white-space: nowrap;
}

.agent-status-head .status-pill span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
}

.agent-status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 6px;
  min-width: 0;
}

.agent-status-grid .field:first-child {
  grid-column: 1 / -1;
}

.agent-status-grid .field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-status-grid .field label {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

.agent-status-grid .field select {
  min-height: 30px;
  border-radius: 9px;
  padding: 5px 7px;
  font-size: 0.74rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.quick-actions-grid .feature-card {
  padding: 18px;
}

.quick-actions-grid .feature-card p {
  min-height: 44px;
}

.planning-overview-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.planning-hero-event {
  display: grid;
  grid-template-columns: minmax(220px, 0.92fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 268px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(238, 241, 246, 0.58)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.1), transparent 34%);
}

.planning-hero-media {
  min-height: 244px;
  border-radius: 12px;
  border: 1px solid rgba(35, 39, 47, 0.12);
  background: url("assets/images/planning-default.svg") center center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.planning-hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.planning-hero-body h3 {
  margin: 0;
  font-size: 2.05rem;
  line-height: 1.1;
}

.planning-hero-body p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.planning-hero-body .inline-meta {
  margin-top: 8px;
}

.next-planning-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.next-planning-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(247, 248, 250, 0.62));
}

.next-planning-thumb {
  width: 74px;
  height: 58px;
  border-radius: 10px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: url("assets/images/planning-default.svg") center center / cover no-repeat;
}

.next-planning-item h4,
.next-planning-item p {
  margin: 0;
}

.next-planning-item h4 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-planning-item p {
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patrol-compact-panel {
  padding: 18px;
}

.patrol-status-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 248, 250, 0.64));
}

.patrol-status-card strong {
  font-size: 1.45rem;
  line-height: 1.1;
}

.patrol-status-card p {
  margin: 0;
  color: var(--muted);
}

.patrol-status-card.active {
  border-color: rgba(34, 197, 94, 0.26);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.86), rgba(220, 252, 231, 0.56));
}

.patrol-status-card.inactive {
  border-color: rgba(35, 39, 47, 0.1);
}

.patrol-edit-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(35, 39, 47, 0.1);
}

.escort-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  align-items: start;
}

.escort-map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.escort-map-toolbar .secondary-button {
  min-width: 44px;
  padding: 10px 12px;
}

.escort-map-toolbar .secondary-button.active,
.escort-detail-map-toolbar .secondary-button.active {
  border-color: rgba(184, 144, 47, 0.48);
  background: linear-gradient(180deg, rgba(184, 144, 47, 0.22), rgba(184, 144, 47, 0.1));
}

.escort-map {
  height: min(58vh, 520px);
  min-height: 360px;
  border: 1px solid rgba(35, 39, 47, 0.14);
  border-radius: 14px;
  overflow: hidden;
  cursor: grab;
  background: #c7d0d6;
  touch-action: none;
  position: relative;
  user-select: none;
}

.escort-map:active {
  cursor: grabbing;
}

.escort-map-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  background: #d6ded6;
  transition: transform 0.08s linear;
}

.escort-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  display: block;
  pointer-events: none;
  user-select: none;
}

.escort-map-marker,
.escort-mini-map span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 18px rgba(31, 35, 41, 0.28);
  transform: translate(-50%, -50%);
  z-index: 3;
}

.escort-map-marker::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(220, 38, 38, 0.28);
  border-radius: 50%;
}

.destination-marker {
  background: #2563eb;
}

.destination-marker::after {
  border-color: rgba(37, 99, 235, 0.28);
}

.pickup-marker::before,
.destination-marker::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(35, 39, 47, 0.82);
  white-space: nowrap;
}

.pickup-marker::before {
  content: "REC";
}

.destination-marker::before {
  content: "DEST";
}

.escort-request-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.command-card strong {
  display: block;
  margin: 8px 0;
  font-size: 2rem;
  line-height: 1;
}

.escort-agent-panel {
  display: grid;
  gap: 16px;
}

.escort-request-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.escort-alert-state {
  margin: 0;
  font-weight: 700;
}

.escort-alert-state.active {
  color: #b91c1c;
}

.escort-alert-state.pulse {
  animation: escortPulse 1.1s ease;
}

@keyframes escortPulse {
  0%,
  100% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.04);
  }
}

.escort-request-item.request-open {
  border-color: rgba(185, 28, 28, 0.42);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(254, 226, 226, 0.72));
}

.escort-request-item.request-claimed {
  border-color: rgba(21, 128, 61, 0.36);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(220, 252, 231, 0.72));
}

.vip-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.75fr);
  align-items: start;
}

.escort-mini-map {
  height: 120px;
  margin-top: 12px;
  border: 1px solid rgba(35, 39, 47, 0.12);
  border-radius: 10px;
  background: url("assets/map-tiles/gta-v/roadmap/0_0_0.jpg") center center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.escort-detail-modal[hidden] {
  display: none;
}

.escort-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 15, 23, 0.62);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.escort-detail-modal.visible {
  opacity: 1;
}

.escort-detail-panel {
  width: min(1400px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  position: relative;
  padding: 22px;
  border: 1px solid rgba(35, 39, 47, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 250, 0.96));
  box-shadow: 0 28px 90px rgba(11, 15, 23, 0.34);
}

.escort-detail-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.escort-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 20px;
  align-items: start;
}

.escort-detail-main {
  display: grid;
  gap: 14px;
}

.escort-detail-map-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 120px;
}

.escort-detail-map {
  height: min(70vh, 680px);
  min-height: 520px;
}

.escort-detail-info {
  display: grid;
  gap: 10px;
}

.escort-detail-field {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.escort-detail-field span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.escort-detail-field strong {
  color: #23272f;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.escort-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 4px;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  text-align: left;
  color: #23272f;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 250, 0.94));
  border: 2px solid rgba(185, 28, 28, 0.56);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(185, 28, 28, 0.28);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.escort-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.escort-toast span,
.escort-toast small {
  color: var(--muted);
}

.active-agents-panel .list-stack {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.next-planning-card {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(180px, 0.82fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  min-height: 216px;
  padding: 18px;
}

.next-planning-card h3 {
  padding-left: 0;
  font-size: 1.42rem;
  margin-bottom: 8px;
}

.next-planning-card h3::before {
  display: none;
}

.next-planning-card p {
  min-height: 0;
  margin-bottom: 0;
}

.next-planning-card button {
  align-self: end;
  grid-column: 2;
  justify-self: start;
}

.next-planning-media {
  min-height: 178px;
  height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(35, 39, 47, 0.12);
  background: url("assets/images/planning-default.svg") center center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.next-planning-copy {
  display: grid;
  gap: 4px;
}

.planning-panel {
  min-height: calc(100vh - 172px);
  border: 1px solid rgba(35, 39, 47, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(236, 239, 244, 0.58)),
    radial-gradient(circle at 70% 45%, rgba(184, 144, 47, 0.1), transparent 34%),
    url("assets/images/planning-default.svg") center center / cover no-repeat;
  box-shadow: 0 22px 60px rgba(31, 35, 41, 0.12);
  overflow: hidden;
  padding: 16px;
}

.planning-board {
  display: grid;
  gap: 16px;
  min-height: 560px;
}

.planning-shell,
.planning-admin-shell {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.planning-next-strip {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.planning-next-strip strong {
  display: block;
  color: #172b4d;
}

.planning-next-items {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.planning-next-pill {
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 10px;
  background: #ffffff;
  color: #172b4d;
  text-align: left;
}

.planning-next-pill span {
  display: block;
  color: #5e6c84;
  font-size: 0.78rem;
}

.planning-empty-inline {
  color: #5e6c84;
  padding: 10px 0;
}

.planning-day-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.planning-side-days,
.planning-admin-days {
  grid-template-columns: 1fr;
}

.planning-day-tab {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: auto;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #172b4d;
  padding: 14px;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 10px 22px rgba(31, 35, 41, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.planning-day-tab strong {
  color: #14213d;
  font-size: 1rem;
}

.planning-day-tab span {
  color: #5e6c84;
  display: -webkit-box;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.planning-day-tab.active,
.planning-day-tab:hover {
  background: #ffffff;
  border-color: rgba(184, 144, 47, 0.5);
  color: #6f5519;
  box-shadow: 0 14px 30px rgba(31, 35, 41, 0.12);
  transform: translateY(-1px);
}

.planning-day {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  border: 1px solid rgba(35, 39, 47, 0.12);
  border-radius: 14px;
  background: rgba(235, 236, 240, 0.94);
  box-shadow: 0 16px 38px rgba(31, 35, 41, 0.12);
  overflow: hidden;
}

.planning-day-open {
  width: 100%;
  max-height: none;
}

.planning-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
}

.planning-day-header h3,
.planning-card h4,
.planning-card p {
  margin: 0;
}

.planning-day-header h3 {
  color: #172b4d;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
}

.planning-day-header p {
  margin: 5px 0 0;
  color: #5e6c84;
  font-size: 0.88rem;
}

.planning-day-menu {
  width: 28px;
  height: 24px;
  border-radius: 5px;
  background: transparent;
  color: #5e6c84;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.planning-day-menu:hover {
  background: rgba(9, 30, 66, 0.08);
}

.planning-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.vip-week-row {
  grid-template-columns: repeat(7, minmax(230px, 1fr));
  align-items: start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 16px;
}

.vip-week-day {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 230px;
}

.vip-week-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 0;
  border-top: 1px solid rgba(35, 39, 47, 0.08);
}

.vip-week-day-header h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vip-week-day-header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.compact-agent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.compact-agent-main {
  min-width: 0;
}

.compact-agent-main h4,
.compact-agent-main span {
  display: block;
  margin: 0;
}

.compact-agent-main h4 {
  font-size: 0.98rem;
}

.compact-agent-main span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.on-duty-dot {
  background: #22c55e;
}

.planning-card,
.planning-empty {
  border: 1px solid rgba(9, 30, 66, 0.1);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 35, 41, 0.08);
}

.planning-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.planning-card-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  border-right: 1px solid rgba(9, 30, 66, 0.08);
}

.planning-card-content {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.planning-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.planning-card-title-row span,
.planning-card-title-row em {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

.planning-card-title-row span {
  background: #172b4d;
  color: #ffffff;
}

.planning-card-title-row em {
  background: rgba(184, 144, 47, 0.15);
  color: #6f5519;
}

.image-drop-zone {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(9, 30, 66, 0.28);
  border-radius: 8px;
  background: #f7f8fa;
  color: #5e6c84;
  cursor: copy;
  overflow: hidden;
  padding-bottom: 8px;
  text-align: center;
}

.image-drop-zone img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7.8;
  object-fit: cover;
  border-bottom: 1px solid rgba(9, 30, 66, 0.08);
}

.image-drop-zone span {
  padding: 0 10px;
  font-size: 0.84rem;
}

.image-drop-zone.drag-over {
  border-color: rgba(184, 144, 47, 0.72);
  background: rgba(184, 144, 47, 0.1);
}

.photo-drop-zone {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 132px;
  border: 1px dashed rgba(9, 30, 66, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 248, 250, 0.64));
  color: var(--muted);
  cursor: copy;
  text-align: center;
}

.photo-drop-zone strong {
  color: var(--off-white);
}

.photo-drop-zone.drag-over {
  border-color: rgba(184, 144, 47, 0.72);
  background: rgba(184, 144, 47, 0.1);
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.photo-preview-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.photo-preview-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.report-photo-grid {
  margin-bottom: 12px;
}

.planning-card h4 {
  color: #172b4d;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.planning-card p {
  color: #5e6c84;
  font-size: 0.86rem;
  line-height: 1.35;
}

.planning-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5e6c84;
  font-size: 0.82rem;
}

.presence-button {
  justify-self: start;
  border: 1px solid rgba(9, 30, 66, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #f2f4f7);
  color: #172b4d;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(31, 35, 41, 0.08);
}

.presence-button.active {
  border-color: rgba(21, 128, 61, 0.32);
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.98), rgba(187, 247, 208, 0.86));
  color: #166534;
}

.planning-attendees {
  display: grid;
  gap: 6px;
  color: #5e6c84;
  font-size: 0.86rem;
}

.planning-attendees strong {
  color: #172b4d;
}

.planning-attachment {
  font-size: 0.9rem;
}

.planning-day-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 10px;
  color: #5e6c84;
  font-size: 0.92rem;
}

.planning-day-footer:hover {
  background: rgba(9, 30, 66, 0.08);
  color: #172b4d;
}

.planning-empty {
  color: #5e6c84;
  padding: 12px;
  text-align: center;
}

.planning-editor {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-bottom: 8px;
}

.planning-admin-sidebar {
  display: grid;
  gap: 12px;
}

.planning-admin-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.planning-admin-summary span {
  color: #5e6c84;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.planning-admin-summary strong {
  color: #172b4d;
  line-height: 1.35;
}

.planning-day-form {
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.planning-editor-day {
  display: grid;
  gap: 16px;
  align-self: start;
  border: 1px solid rgba(9, 30, 66, 0.18);
  border-radius: 12px;
  padding: 14px;
  background: rgba(235, 236, 240, 0.94);
}

.planning-editor-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 14px;
  align-items: end;
}

.planning-editor-header h3,
.planning-editor-header p {
  margin: 0;
}

.planning-editor-header h3 {
  color: #172b4d;
}

.planning-editor-header p {
  margin-top: 6px;
  color: #5e6c84;
}

.planning-event-editor-list {
  display: grid;
  gap: 12px;
  padding: 0;
}

.planning-event-editor,
.planning-add-event-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  border: 1px solid rgba(9, 30, 66, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(9, 30, 66, 0.18);
}

.planning-event-editor {
  grid-template-columns: 1fr;
}

.planning-event-editor-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.planning-event-editor-head strong {
  border-radius: 999px;
  background: #172b4d;
  color: #ffffff;
  padding: 5px 10px;
}

.planning-event-editor-head span {
  color: #172b4d;
  font-weight: 800;
}

.planning-event-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.planning-quick-add {
  border-color: rgba(184, 144, 47, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 240, 0.88));
}

.planning-quick-add .action-button {
  justify-self: start;
}

.planning-add-event-form .field.full,
.planning-event-editor-grid .field.full,
.planning-event-editor .field.full {
  grid-column: 1 / -1;
}

.admin-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-button {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 247, 249, 0.68));
  color: var(--off-white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tab-button.active,
.tab-button:hover {
  background: linear-gradient(180deg, rgba(184, 144, 47, 0.18), rgba(184, 144, 47, 0.08));
  border-color: rgba(184, 144, 47, 0.26);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.agent-space-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.agent-identity-panel,
.agent-files-panel,
.agent-conversation-panel {
  min-width: 0;
}

.agent-files-panel,
.agent-conversation-panel {
  grid-column: 1 / -1;
}

.agent-profile-head,
.agent-admin-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.agent-avatar-placeholder,
.agent-space-summary-photo {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(184, 144, 47, 0.28);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
}

.agent-avatar-placeholder img,
.agent-space-summary-photo img,
.agent-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-poles-field {
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
}

.agent-poles-field legend {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 6px;
}

.agent-poles-field label,
.agent-admin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agent-checks-list,
.agent-admin-checks {
  display: grid;
  gap: 10px;
}

.agent-check-row,
.agent-admin-check,
.agent-admin-file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
}


.agent-medical-countdown {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.agent-medical-countdown strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.agent-medical-countdown p {
  margin: 0;
  color: var(--muted);
}

.agent-medical-countdown.complete {
  border-color: rgba(21, 128, 61, 0.24);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.9), rgba(220, 252, 231, 0.66));
}

.agent-medical-countdown.warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.92), rgba(254, 243, 199, 0.64));
}

.agent-medical-countdown.danger {
  border-color: rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.92), rgba(254, 226, 226, 0.66));
}


.agent-medical-countdown .metric-label {
  margin-bottom: 0;
}

.agent-medical-countdown.complete strong,
.agent-medical-countdown.complete p {
  color: #166534;
}

.agent-medical-countdown.warning strong,
.agent-medical-countdown.warning p {
  color: #92400e;
}

.agent-medical-countdown.danger strong,
.agent-medical-countdown.danger p {
  color: #991b1b;
}

.agent-dossier-medical {
  display: grid;
  gap: 12px;
}

.agent-check-row strong {
  color: var(--danger);
}

.agent-check-row.complete strong {
  color: var(--success);
}

.agent-files-grid,
.agent-space-admin-grid,
.agent-admin-files {
  display: grid;
  gap: 12px;
}

.agent-files-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.agent-file-card {
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 10px;
}

.agent-file-card h4,
.agent-file-card p {
  margin: 0;
}

.agent-file-preview {
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(248, 249, 251, 0.88);
  overflow: hidden;
  border: 1px dashed rgba(35, 39, 47, 0.14);
}

.agent-file-empty,
.agent-document-preview {
  color: var(--muted);
  font-weight: 700;
}

.agent-upload-button {
  position: relative;
  overflow: hidden;
}

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

.agent-file-link {
  text-decoration: none;
}

.agent-message-list {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 14px;
}

.agent-message {
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.agent-message.admin {
  border-color: rgba(184, 144, 47, 0.32);
  background: rgba(184, 144, 47, 0.08);
}

.agent-message p {
  margin: 0;
  white-space: pre-wrap;
}

.agent-message-form {
  display: grid;
  gap: 12px;
}

.agent-message-form button {
  justify-self: start;
}

.rp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(8px);
}

.rp-modal {
  width: min(460px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(184, 144, 47, 0.3);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 24px;
}

.rp-modal h3,
.rp-modal p {
  margin-top: 0;
}

.rp-modal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(35, 39, 47, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--off-white);
}

.rp-modal-consent input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.rp-modal .action-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.agent-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
}

.agent-space-summary-card {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: stretch;
  text-align: left;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--off-white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.agent-space-summary-card:hover,
.agent-space-summary-card.selected {
  border-color: rgba(184, 144, 47, 0.34);
  background: rgba(184, 144, 47, 0.08);
}

.agent-space-summary-card.selected {
  box-shadow: inset 3px 0 0 rgba(184, 144, 47, 0.8), 0 12px 24px rgba(31, 35, 41, 0.08);
}

.agent-space-summary-photo {
  width: 56px;
  height: 56px;
  font-size: 0.74rem;
}

.agent-space-summary-photo.large {
  width: 96px;
  height: 96px;
}

.agent-space-summary-card h4 {
  margin: 0;
}

.agent-space-summary-body {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 7px;
}

.agent-space-summary-title,
.agent-summary-flags,
.agent-admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-space-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.agent-completion-pill {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(184, 144, 47, 0.14);
  color: var(--off-white);
  font-size: 0.74rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.agent-progress-track {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(35, 39, 47, 0.09);
}

.agent-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8902f, #e5c15f);
}

.agent-summary-flags {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.78rem;
}

.agent-admin-detail-empty {
  color: var(--muted);
}

.agent-admin-detail-shell {
  display: grid;
  gap: 16px;
}

.agent-admin-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(184, 144, 47, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 249, 251, 0.68)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.1), transparent 38%);
}

.agent-admin-hero-copy h3,
.agent-admin-hero-copy p {
  margin: 0;
}

.agent-admin-hero-copy h3 {
  margin: 4px 0;
  font-size: 1.35rem;
}

.agent-admin-score {
  min-width: 86px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  padding: 12px;
  background: rgba(184, 144, 47, 0.12);
  border: 1px solid rgba(184, 144, 47, 0.22);
}

.agent-admin-score strong {
  font-size: 1.35rem;
}

.agent-admin-score span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.agent-admin-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(35, 39, 47, 0.09);
  background: rgba(255, 255, 255, 0.48);
}

.agent-admin-section-title h4 {
  margin: 0;
}

.agent-admin-check {
  min-height: 48px;
}

.agent-admin-check strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.agent-admin-check:has(input:checked) {
  border-color: rgba(21, 128, 61, 0.25);
  background: rgba(21, 128, 61, 0.07);
}

.agent-admin-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-admin-info-card {
  border: 1px solid rgba(35, 39, 47, 0.09);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 4px;
}

.agent-admin-info-card span,
.agent-admin-file-copy span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.agent-admin-info-card strong {
  overflow-wrap: anywhere;
}

.agent-admin-files {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.agent-admin-file-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(35, 39, 47, 0.09);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.agent-admin-file-card.missing {
  opacity: 0.72;
}

.agent-admin-file-preview {
  height: 120px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  border: 1px dashed rgba(35, 39, 47, 0.13);
  background: rgba(248, 249, 251, 0.86);
  color: var(--muted);
  font-weight: 700;
}

.agent-admin-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-admin-file-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.agent-admin-file-copy strong {
  overflow-wrap: anywhere;
}

.agent-admin-file-copy a {
  color: #7c5f18;
  font-weight: 700;
  text-decoration: none;
}

.admin-agent-message-list {
  max-height: 300px;
}

.agent-admin-console {
  display: grid;
  gap: 18px;
}

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

.agent-admin-overview article {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 248, 250, 0.7)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.09), transparent 40%);
  box-shadow: var(--glow);
}

.agent-admin-overview strong {
  font-size: 1.65rem;
}

.agent-admin-roster {
  padding: 0;
  overflow: hidden;
}

.agent-admin-roster::before {
  display: none;
}

.agent-admin-roster-head {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(35, 39, 47, 0.09);
  background: rgba(255, 255, 255, 0.46);
}

.agent-admin-roster-head h3,
.agent-admin-roster-head p {
  margin: 0;
}

.agent-space-admin-grid {
  gap: 0;
}

.agent-roster-row {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(35, 39, 47, 0.08);
  background: rgba(255, 255, 255, 0.5);
  color: var(--off-white);
  text-align: left;
}


.agent-roster-row.complete {
  border-left: 4px solid #16a34a;
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.18), rgba(240, 253, 244, 0.72));
}

.agent-roster-row.progress {
  border-left: 4px solid #d97706;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.18), rgba(255, 251, 235, 0.72));
}

.agent-roster-row.empty {
  border-left: 4px solid #dc2626;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.18), rgba(254, 242, 242, 0.72));
}

.agent-roster-row.complete .agent-completion-pill {
  background: rgba(21, 128, 61, 0.14);
  color: #166534;
}

.agent-roster-row.progress .agent-completion-pill {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.agent-roster-row.empty .agent-completion-pill {
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
}

.agent-roster-row:hover,
.agent-roster-row.selected {
  background: rgba(184, 144, 47, 0.1);
}

.agent-roster-row.selected {
  box-shadow: inset 4px 0 0 rgba(184, 144, 47, 0.85);
}

.agent-roster-photo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.agent-roster-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.agent-roster-main strong,
.agent-roster-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-roster-main span,
.agent-roster-status small {
  color: var(--muted);
  font-size: 0.78rem;
}

.agent-roster-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.agent-completion-pill.complete {
  background: rgba(21, 128, 61, 0.12);
  color: #166534;
}

.agent-roster-empty {
  padding: 18px;
  color: var(--muted);
}

.agent-admin-detail-panel {
  min-width: 0;
}

.agent-admin-empty-state {
  min-height: 520px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 34px;
  border: 1px dashed rgba(35, 39, 47, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
}

.agent-admin-empty-state strong {
  color: var(--off-white);
  font-size: 1.1rem;
}

.agent-dossier-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(110px, auto);
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 249, 0.72)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.12), transparent 42%);
  box-shadow: var(--glow);
}

.agent-dossier-photo {
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(184, 144, 47, 0.3);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
}

.agent-dossier-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-dossier-hero h3 {
  margin: 4px 0 8px;
  font-size: 1.65rem;
}

.agent-dossier-score {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 92px;
  border-radius: 16px;
  border: 1px solid rgba(184, 144, 47, 0.22);
  background: rgba(184, 144, 47, 0.1);
}

.agent-dossier-score.complete {
  border-color: rgba(21, 128, 61, 0.22);
  background: rgba(21, 128, 61, 0.08);
}

.agent-dossier-score strong {
  font-size: 1.55rem;
}

.agent-dossier-score span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agent-dossier-grid {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 16px;
}

.agent-dossier-validation .agent-admin-checks {
  gap: 8px;
}

.agent-dossier-documents .agent-admin-files {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
}

.agent-dossier-documents .agent-admin-file-preview {
  height: 104px;
}

.agent-dossier-ticket {
  grid-template-columns: minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 251, 0.9));
  border-color: rgba(184, 144, 47, 0.18);
  box-shadow: 0 16px 34px rgba(31, 35, 41, 0.1);
}

.agent-dossier-ticket .agent-admin-section-title {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(35, 39, 47, 0.09);
}

.agent-dossier-ticket .admin-agent-message-list {
  min-height: 190px;
  max-height: 280px;
  padding: 12px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  background: #f8fafc;
}

.agent-dossier-ticket .agent-message {
  background: #ffffff;
  border-color: rgba(35, 39, 47, 0.12);
  color: #23272f;
  box-shadow: 0 8px 18px rgba(31, 35, 41, 0.06);
}

.agent-dossier-ticket .agent-message.admin {
  background: #fff8e6;
  border-color: rgba(184, 144, 47, 0.32);
}

.agent-dossier-ticket .agent-message .inline-meta {
  color: #5f6875;
  margin-top: 0;
}

.agent-dossier-ticket .agent-message p {
  color: #26313f;
  font-size: 0.96rem;
  line-height: 1.45;
}

.agent-dossier-ticket .agent-message-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.agent-dossier-ticket .agent-message-form .field {
  min-width: 0;
}

.agent-dossier-ticket textarea {
  min-height: 96px;
  background: #ffffff;
  color: #23272f;
  border-color: rgba(35, 39, 47, 0.18);
}

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

.panel-heading h3,
.metric-card strong {
  margin: 0;
}

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

.metric-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 248, 250, 0.64));
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-agent-card {
  display: grid;
  gap: 14px;
}

.admin-agent-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.collapsible-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.collapse-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: transparent;
  color: var(--off-white);
  text-align: left;
}

.collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.64);
}

.collapse-toggle-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.collapse-indicator {
  color: #f8fbff;
  background: linear-gradient(180deg, #59616d, #414954 72%, #303640);
  border: 1px solid rgba(35, 39, 47, 0.34);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(31, 35, 41, 0.16);
}

.collapse-toggle.expanded .collapse-indicator {
  color: #f8fbff;
  background: linear-gradient(180deg, #737c89, #59616d 72%, #414954);
  border-color: rgba(35, 39, 47, 0.42);
}

.collapsible-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(35, 39, 47, 0.1);
}

html[data-theme="night"],
body[data-theme="night"] {
  color: #efe6d2;
}

html[data-theme="night"],
body[data-theme="night"] {
  background:
    radial-gradient(circle at 18% 16%, rgba(184, 144, 47, 0.12), transparent 24%),
    linear-gradient(135deg, #090a0d 0%, #111217 56%, #17151f 100%);
}

body[data-theme="night"]::before {
  opacity: 0.14;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

body[data-theme="night"]::after {
  opacity: 0.08;
  filter: sepia(0.75) saturate(0.5) brightness(0.7);
}

body[data-theme="night"] .muted,
body[data-theme="night"] .metric-label,
body[data-theme="night"] .message,
body[data-theme="night"] .inline-meta,
body[data-theme="night"] .planning-hero-body p,
body[data-theme="night"] .planning-next-pill span,
body[data-theme="night"] .planning-empty-inline,
body[data-theme="night"] .planning-day-tab span,
body[data-theme="night"] .planning-day-header p,
body[data-theme="night"] .planning-card p,
body[data-theme="night"] .planning-card-meta,
body[data-theme="night"] .planning-attendees,
body[data-theme="night"] .planning-day-footer,
body[data-theme="night"] .procedure-reference-item small,
body[data-theme="night"] .procedure-empty,
body[data-theme="night"] .result-box,
body[data-theme="night"] .list-item p,
body[data-theme="night"] .patrol-status-card p,
body[data-theme="night"] .escort-toast span,
body[data-theme="night"] .escort-toast small,
body[data-theme="night"] .planning-admin-summary span {
  color: #a9a089;
}

body[data-theme="night"] .app-header,
body[data-theme="night"] .top-actions select,
body[data-theme="night"] .user-panel,
body[data-theme="night"] .status-panel,
body[data-theme="night"] .panel,
body[data-theme="night"] .feature-card,
body[data-theme="night"] .card,
body[data-theme="night"] .login-card,
body[data-theme="night"] .list-item,
body[data-theme="night"] .result-box,
body[data-theme="night"] .sanction-panel,
body[data-theme="night"] .planning-day,
body[data-theme="night"] .planning-card,
body[data-theme="night"] .planning-empty,
body[data-theme="night"] .planning-next-strip,
body[data-theme="night"] .planning-day-tab,
body[data-theme="night"] .planning-admin-summary,
body[data-theme="night"] .planning-day-form,
body[data-theme="night"] .planning-editor-day,
body[data-theme="night"] .planning-event-editor,
body[data-theme="night"] .planning-add-event-form,
body[data-theme="night"] .metric-card,
body[data-theme="night"] .procedure-warning-item,
body[data-theme="night"] .procedure-reference-item,
body[data-theme="night"] .procedure-empty,
body[data-theme="night"] .patrol-status-card,
body[data-theme="night"] .photo-preview-card,
body[data-theme="night"] .collapse-toggle,
body[data-theme="night"] .tab-button {
  background: linear-gradient(180deg, rgba(20, 21, 27, 0.96), rgba(13, 14, 18, 0.92));
  border-color: rgba(184, 144, 47, 0.16);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

body[data-theme="night"] .user-panel::before,
body[data-theme="night"] .status-panel::before,
body[data-theme="night"] .panel::before,
body[data-theme="night"] .feature-card::before,
body[data-theme="night"] .login-card::before {
  opacity: 0.72;
}

body[data-theme="night"] .topbar,
body[data-theme="night"] .brand,
body[data-theme="night"] .planning-day,
body[data-theme="night"] .planning-panel {
  border-color: rgba(184, 144, 47, 0.16);
}

body[data-theme="night"] .brand-copy p,
body[data-theme="night"] .login-header p,
body[data-theme="night"] .topbar p,
body[data-theme="night"] .planning-hero-body .metric-label,
body[data-theme="night"] .command-card .metric-label {
  color: #b89d63;
}

body[data-theme="night"] .nav-button,
body[data-theme="night"] .secondary-button,
body[data-theme="night"] .top-actions select,
body[data-theme="night"] .field input,
body[data-theme="night"] .field select,
body[data-theme="night"] .field textarea,
body[data-theme="night"] .planning-day-menu,
body[data-theme="night"] .planning-next-pill,
body[data-theme="night"] .presence-button,
body[data-theme="night"] .tab-button {
  background: linear-gradient(180deg, rgba(34, 35, 42, 0.98), rgba(23, 24, 30, 0.96));
  color: #f2e8d7;
  border-color: rgba(184, 144, 47, 0.22);
}

body[data-theme="night"] .action-button,
body[data-theme="night"] .feature-card button,
body[data-theme="night"] .logout-button,
body[data-theme="night"] .danger-button {
  color: #fff6df;
}

body[data-theme="night"] .action-button,
body[data-theme="night"] .feature-card button {
  background: linear-gradient(180deg, #b99035, #8e6d21 72%, #6d5319);
  border-color: rgba(217, 181, 86, 0.34);
  box-shadow: 0 12px 26px rgba(185, 144, 47, 0.22);
}

body[data-theme="night"] .secondary-button,
body[data-theme="night"] .nav-button:hover,
body[data-theme="night"] .nav-button.active,
body[data-theme="night"] .tab-button.active,
body[data-theme="night"] .tab-button:hover,
body[data-theme="night"] .planning-day-tab.active,
body[data-theme="night"] .planning-day-tab:hover,
body[data-theme="night"] .planning-next-pill:hover,
body[data-theme="night"] .presence-button.active {
  background: linear-gradient(180deg, rgba(184, 144, 47, 0.18), rgba(184, 144, 47, 0.08));
  border-color: rgba(217, 181, 86, 0.32);
  box-shadow: inset 0 0 0 1px rgba(217, 181, 86, 0.08), 0 10px 22px rgba(0, 0, 0, 0.26);
}

body[data-theme="night"] .field input:focus,
body[data-theme="night"] .field select:focus,
body[data-theme="night"] .field textarea:focus {
  border-color: rgba(217, 181, 86, 0.5);
  box-shadow: 0 0 0 3px rgba(217, 181, 86, 0.14);
}

body[data-theme="night"] .field select option,
body[data-theme="night"] .field select optgroup {
  background: #111217;
  color: #f2e8d7;
}

body[data-theme="night"] .badge {
  background: rgba(27, 28, 34, 0.92);
  border-color: rgba(184, 144, 47, 0.2);
  color: #f5ead3;
}

body[data-theme="night"] .status-pill {
  background: rgba(18, 19, 24, 0.82);
  border-color: rgba(184, 144, 47, 0.2);
  color: #f5ead3;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

body[data-theme="night"] .badge.on-duty::before {
  background: #4ade80;
}

body[data-theme="night"] .badge.off-duty::before {
  background: #fb7185;
}

body[data-theme="night"] .badge.paused-duty::before {
  background: #fbbf24;
}

body[data-theme="night"] .planning-hero-event {
  background:
    linear-gradient(135deg, rgba(19, 20, 26, 0.95), rgba(12, 13, 17, 0.9)),
    radial-gradient(circle at top right, rgba(184, 144, 47, 0.12), transparent 34%);
  border-color: rgba(184, 144, 47, 0.16);
}

body[data-theme="night"] .planning-hero-media,
body[data-theme="night"] .next-planning-thumb,
body[data-theme="night"] .next-planning-media,
body[data-theme="night"] .escort-map,
body[data-theme="night"] .escort-mini-map {
  border-color: rgba(184, 144, 47, 0.18);
}

body[data-theme="night"] .escort-map {
  background: #1a1b20;
}

body[data-theme="night"] .escort-map-canvas {
  background: #1a1b20;
}

body[data-theme="night"] .planning-day-header h3,
body[data-theme="night"] .planning-card h4,
body[data-theme="night"] .planning-attendees strong,
body[data-theme="night"] .planning-admin-summary strong,
body[data-theme="night"] .procedure-detail-box h4,
body[data-theme="night"] .procedure-warning-item strong,
body[data-theme="night"] .procedure-reference-item strong,
body[data-theme="night"] .collapse-toggle,
body[data-theme="night"] .feature-card h3,
body[data-theme="night"] .panel-heading h3,
body[data-theme="night"] .topbar h2,
body[data-theme="night"] .login-header h1,
body[data-theme="night"] .brand-copy h1,
body[data-theme="night"] .brand-copy h2 {
  color: #f4e7c6;
}

body[data-theme="night"] .planning-day-footer:hover {
  background: rgba(184, 144, 47, 0.1);
  color: #f5e8c9;
}

body[data-theme="night"] .planning-card-image,
body[data-theme="night"] .image-drop-zone img,
body[data-theme="night"] .photo-preview-card img {
  border-color: rgba(184, 144, 47, 0.12);
}

body[data-theme="night"] .escort-toast {
  color: #f4e8d0;
  background: linear-gradient(180deg, rgba(18, 19, 24, 0.98), rgba(10, 11, 15, 0.96));
  border-color: rgba(184, 144, 47, 0.5);
  box-shadow: 0 24px 70px rgba(184, 144, 47, 0.16);
}

body[data-theme="night"] .escort-detail-panel {
  background: linear-gradient(180deg, rgba(18, 19, 24, 0.98), rgba(10, 11, 15, 0.96));
  border-color: rgba(184, 144, 47, 0.2);
}

body[data-theme="night"] .escort-detail-field {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(184, 144, 47, 0.14);
}

body[data-theme="night"] .escort-detail-field strong {
  color: #f4e8d0;
}

body[data-theme="night"] .escort-request-item.request-open {
  border-color: rgba(239, 68, 68, 0.36);
  background: linear-gradient(180deg, rgba(54, 18, 20, 0.96), rgba(35, 12, 14, 0.9));
}

body[data-theme="night"] .escort-request-item.request-claimed {
  border-color: rgba(34, 197, 94, 0.34);
  background: linear-gradient(180deg, rgba(15, 43, 25, 0.96), rgba(10, 26, 16, 0.9));
}

body[data-theme="night"] .planning-day,
body[data-theme="night"] .planning-day-open,
body[data-theme="night"] .planning-event-editor,
body[data-theme="night"] .planning-add-event-form,
body[data-theme="night"] .sanction-panel,
body[data-theme="night"] .login-card,
body[data-theme="night"] .user-panel,
body[data-theme="night"] .status-panel {
  backdrop-filter: blur(10px);
}

body[data-theme="night"] h1,
body[data-theme="night"] h2,
body[data-theme="night"] h3,
body[data-theme="night"] h4,
body[data-theme="night"] strong,
body[data-theme="night"] label,
body[data-theme="night"] legend {
  color: #f4e8d0;
}

body[data-theme="night"] p,
body[data-theme="night"] span,
body[data-theme="night"] small,
body[data-theme="night"] a {
  color: inherit;
}

body[data-theme="night"] .muted,
body[data-theme="night"] .field label,
body[data-theme="night"] .metric-label,
body[data-theme="night"] .inline-meta,
body[data-theme="night"] .agent-roster-main span,
body[data-theme="night"] .agent-roster-status small,
body[data-theme="night"] .agent-admin-info-card span,
body[data-theme="night"] .agent-admin-file-copy span,
body[data-theme="night"] .agent-dossier-score span,
body[data-theme="night"] .agent-summary-flags,
body[data-theme="night"] .agent-file-empty,
body[data-theme="night"] .agent-document-preview,
body[data-theme="night"] .agent-admin-detail-empty,
body[data-theme="night"] .agent-roster-empty {
  color: #c9b98f;
}

body[data-theme="night"] .field input::placeholder,
body[data-theme="night"] .field textarea::placeholder {
  color: #91856d;
}

body[data-theme="night"] .agent-check-row,
body[data-theme="night"] .agent-file-card,
body[data-theme="night"] .agent-file-preview,
body[data-theme="night"] .agent-admin-section,
body[data-theme="night"] .agent-admin-info-card,
body[data-theme="night"] .agent-admin-file-card,
body[data-theme="night"] .agent-admin-file-preview,
body[data-theme="night"] .agent-admin-overview article,
body[data-theme="night"] .agent-admin-roster,
body[data-theme="night"] .agent-admin-roster-head,
body[data-theme="night"] .agent-admin-empty-state,
body[data-theme="night"] .agent-dossier-hero,
body[data-theme="night"] .agent-dossier-photo,
body[data-theme="night"] .rp-modal-consent,
body[data-theme="night"] .rp-modal {
  background: linear-gradient(180deg, rgba(24, 25, 31, 0.98), rgba(14, 15, 20, 0.94));
  border-color: rgba(217, 181, 86, 0.18);
  color: #f2e8d7;
}

body[data-theme="night"] .agent-roster-row,
body[data-theme="night"] .agent-space-summary-card,
body[data-theme="night"] .agent-admin-check,
body[data-theme="night"] .agent-admin-file-row,
body[data-theme="night"] .agent-message {
  background: rgba(24, 25, 31, 0.96);
  border-color: rgba(217, 181, 86, 0.16);
  color: #f2e8d7;
}


body[data-theme="night"] .agent-roster-row.complete {
  border-left-color: #4ade80;
  background: linear-gradient(90deg, rgba(22, 101, 52, 0.48), rgba(24, 25, 31, 0.96));
}

body[data-theme="night"] .agent-roster-row.progress {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(146, 64, 14, 0.5), rgba(24, 25, 31, 0.96));
}

body[data-theme="night"] .agent-roster-row.empty {
  border-left-color: #f87171;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.52), rgba(24, 25, 31, 0.96));
}

body[data-theme="night"] .agent-roster-row.complete .agent-completion-pill {
  background: rgba(74, 222, 128, 0.16);
  color: #bbf7d0;
}

body[data-theme="night"] .agent-roster-row.progress .agent-completion-pill {
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

body[data-theme="night"] .agent-roster-row.empty .agent-completion-pill {
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

body[data-theme="night"] .agent-roster-row:hover,
body[data-theme="night"] .agent-roster-row.selected,
body[data-theme="night"] .agent-space-summary-card:hover,
body[data-theme="night"] .agent-space-summary-card.selected {
  background: rgba(184, 144, 47, 0.16);
  border-color: rgba(217, 181, 86, 0.34);
}

body[data-theme="night"] .agent-completion-pill,
body[data-theme="night"] .agent-dossier-score,
body[data-theme="night"] .agent-admin-score {
  background: rgba(184, 144, 47, 0.18);
  border-color: rgba(217, 181, 86, 0.28);
  color: #f8edcf;
}

body[data-theme="night"] .agent-completion-pill.complete,
body[data-theme="night"] .agent-dossier-score.complete,
body[data-theme="night"] .agent-admin-check:has(input:checked) {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
  color: #d9fbe3;
}


body[data-theme="night"] .agent-medical-countdown {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 30px rgba(0, 0, 0, 0.26);
}

body[data-theme="night"] .agent-medical-countdown .metric-label {
  color: rgba(245, 232, 201, 0.72);
}

body[data-theme="night"] .agent-medical-countdown.complete {
  border-color: rgba(74, 222, 128, 0.36);
  background: linear-gradient(180deg, rgba(13, 45, 28, 0.96), rgba(8, 28, 18, 0.92));
}

body[data-theme="night"] .agent-medical-countdown.complete strong,
body[data-theme="night"] .agent-medical-countdown.complete p {
  color: #bbf7d0;
}

body[data-theme="night"] .agent-medical-countdown.warning {
  border-color: rgba(251, 191, 36, 0.38);
  background: linear-gradient(180deg, rgba(66, 43, 10, 0.96), rgba(38, 25, 8, 0.92));
}

body[data-theme="night"] .agent-medical-countdown.warning strong,
body[data-theme="night"] .agent-medical-countdown.warning p {
  color: #fde68a;
}

body[data-theme="night"] .agent-medical-countdown.danger {
  border-color: rgba(248, 113, 113, 0.38);
  background: linear-gradient(180deg, rgba(70, 18, 22, 0.96), rgba(38, 10, 14, 0.92));
}

body[data-theme="night"] .agent-medical-countdown.danger strong,
body[data-theme="night"] .agent-medical-countdown.danger p {
  color: #fecaca;
}

body[data-theme="night"] .agent-status-panel {
  background: linear-gradient(180deg, rgba(20, 21, 27, 0.98), rgba(13, 14, 18, 0.94));
}

body[data-theme="night"] .agent-progress-track {
  background: rgba(255, 255, 255, 0.1);
}

body[data-theme="night"] .agent-admin-file-copy a,
body[data-theme="night"] .agent-admin-file-card a,
body[data-theme="night"] .agent-file-link {
  color: #f1c85b;
}

body[data-theme="night"] .agent-dossier-ticket {
  background: linear-gradient(180deg, rgba(22, 23, 29, 0.98), rgba(12, 13, 18, 0.96));
  border-color: rgba(217, 181, 86, 0.24);
}

body[data-theme="night"] .agent-dossier-ticket .admin-agent-message-list {
  background: #101116;
  border-color: rgba(217, 181, 86, 0.18);
}

body[data-theme="night"] .agent-dossier-ticket .agent-message {
  background: #1b1c23;
  border-color: rgba(217, 181, 86, 0.18);
  color: #f2e8d7;
}

body[data-theme="night"] .agent-dossier-ticket .agent-message.admin {
  background: rgba(184, 144, 47, 0.18);
  border-color: rgba(217, 181, 86, 0.32);
}

body[data-theme="night"] .agent-dossier-ticket .agent-message .inline-meta {
  color: #cdbd91;
}

body[data-theme="night"] .agent-dossier-ticket .agent-message p {
  color: #f4e8d0;
}

body[data-theme="night"] .agent-dossier-ticket .agent-message-form {
  background: rgba(18, 19, 24, 0.96);
  border-color: rgba(217, 181, 86, 0.18);
}

body[data-theme="night"] .agent-dossier-ticket textarea {
  background: #111217;
  color: #f4e8d0;
  border-color: rgba(217, 181, 86, 0.24);
}

body[data-theme="night"] .photo-drop-zone,
body[data-theme="night"] .image-drop-zone,
body[data-theme="night"] .procedure-detail-box,
body[data-theme="night"] .patrol-status-card.active,
body[data-theme="night"] .patrol-status-card.inactive {
  background: rgba(18, 19, 24, 0.94);
  border-color: rgba(217, 181, 86, 0.18);
  color: #f2e8d7;
}

body[data-theme="night"] .danger-text {
  color: #fca5a5;
}

body[data-theme="night"] .agent-check-row strong,
body[data-theme="night"] .agent-admin-check strong {
  color: #f7c948;
}

body[data-theme="night"] .agent-check-row.complete strong,
body[data-theme="night"] .agent-admin-check:has(input:checked) strong {
  color: #86efac;
}

@media (max-width: 920px) {
  .app-header {
    position: static;
  }

  .app-header-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 16px;
  }

  .nav-list {
    justify-content: stretch;
  }

  .nav-button {
    flex: 1 1 140px;
  }

  .top-user-panel,
  .top-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .top-user-panel > div {
    text-align: left;
  }

  .auth-layout,
  .dashboard-layout,
  .dashboard-grid,
  .page-grid.two-columns,
  .escort-layout,
  .vip-layout,
  .agent-command-grid,
  .detention-layout,
  .detention-selection-grid,
  .sanction-toolbar,
  .stat-grid,
  .admin-grid,
  .agent-space-layout,
  .agent-admin-layout,
  .form-grid,
  .planning-hero-event,
  .planning-shell,
  .planning-admin-shell,
  .planning-next-strip,
  .next-planning-card,
  .planning-editor-header,
  .planning-event-editor,
  .planning-event-editor-grid,
  .planning-add-event-form,
  .agent-admin-hero,
  .agent-admin-info-grid,
  .agent-admin-overview,
  .agent-dossier-hero,
  .agent-dossier-grid,
  .agent-dossier-documents .agent-admin-files,
  .agent-dossier-ticket .agent-message-form {
    grid-template-columns: 1fr;
  }

  .escort-detail-layout {
    grid-template-columns: 1fr;
  }

  .escort-detail-panel {
    padding: 18px;
  }

  .escort-detail-close {
    position: static;
    justify-self: end;
    margin-bottom: 12px;
  }

  .escort-detail-map-toolbar {
    padding-right: 0;
  }

  .escort-detail-map {
    min-height: 420px;
    height: 60vh;
  }

  .dashboard-panel-heading {
    display: grid;
  }

  .quick-actions-grid,
  .next-planning-list {
    grid-template-columns: 1fr;
  }

  .planning-hero-media {
    min-height: 190px;
  }

  .planning-hero-body h3 {
    font-size: 1.55rem;
  }

  .planning-board {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow-x: visible;
    overflow-y: visible;
  }

  .planning-day {
    min-height: auto;
  }

  .planning-panel {
    min-height: 0;
  }

  .planning-card {
    grid-template-columns: 1fr;
  }

  .planning-card-image {
    height: auto;
    aspect-ratio: 16 / 8;
    border-right: 0;
    border-bottom: 1px solid rgba(9, 30, 66, 0.08);
  }

  .planning-editor {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .planning-add-event-form .field.full,
  .planning-event-editor-grid .field.full,
  .planning-event-editor .field.full {
    grid-column: 1;
  }

  .next-planning-card button {
    grid-column: 1;
  }

  .sidebar {
    padding: 12px 16px 0;
  }

  .sidebar .brand,
  .sidebar .user-panel,
  .agent-status-panel,
  .sidebar .logout-button {
    width: 100%;
    margin-left: 0;
  }

  .agent-status-panel {
    grid-template-columns: 1fr;
  }

  .agent-status-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .content {
    padding: 20px 16px;
  }
}

/* Section HSI : interface classifiée sombre et isolée visuellement. */
.hsi-shell { min-height: 100vh; background: #071018; color: #dce9f5; }
.hsi-content { background: radial-gradient(circle at 80% 0%, rgba(14, 91, 145, .18), transparent 35%), #071018; min-height: calc(100vh - 84px); }
.hsi-hero, .hsi-case-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 28px; border: 1px solid rgba(78, 155, 211, .25); background: linear-gradient(135deg, rgba(11, 32, 48, .96), rgba(6, 18, 28, .96)); box-shadow: 0 20px 55px rgba(0, 0, 0, .28); }
.hsi-hero h2, .hsi-case-header h2 { margin: 6px 0; color: #f3f8fc; letter-spacing: -.025em; }
.hsi-eyebrow, .hsi-classified { color: #52b7ff; font: 700 .72rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
.hsi-message { min-height: 24px; margin: 14px 0; color: #63d8a1; }
.hsi-message.error { color: #ff7e88; }
.hsi-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.hsi-metrics article { padding: 18px 20px; border: 1px solid rgba(78, 155, 211, .18); background: #0b1924; }
.hsi-metrics span { display: block; color: #7f9bb0; font: 600 .72rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.hsi-metrics strong { display: block; margin-top: 8px; color: #fff; font-size: 1.8rem; }
.hsi-toolbar { display: grid; grid-template-columns: 1fr 240px; gap: 14px; padding: 16px; border: 1px solid rgba(78, 155, 211, .18); background: rgba(8, 23, 34, .9); }
.hsi-shell .field label { color: #8da8bb; }
.hsi-shell input, .hsi-shell select, .hsi-shell textarea { border-color: #24485f; background: #07131d; color: #e7f2fa; }
.hsi-shell input:focus, .hsi-shell select:focus, .hsi-shell textarea:focus { border-color: #2c9ce8; box-shadow: 0 0 0 3px rgba(44, 156, 232, .14); }
.hsi-case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-top: 18px; }
.hsi-case-card { min-height: 230px; padding: 22px; border: 1px solid rgba(60, 137, 190, .22); border-left: 3px solid #298fd4; background: linear-gradient(150deg, #0d2130, #091720); color: inherit; text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.hsi-case-card:hover { transform: translateY(-3px); border-color: #3ba9f2; }
.hsi-case-card-top, .hsi-card-meta, .hsi-record-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hsi-case-card-top > span:first-child { color: #58b9fa; font: 700 .75rem ui-monospace, monospace; letter-spacing: .1em; }
.hsi-case-card h3 { color: #fff; font-size: 1.2rem; margin: 24px 0 10px; }
.hsi-case-card p { color: #8da8bb; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hsi-card-meta { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(78, 155, 211, .14); color: #7894a8; font-size: .78rem; }
.hsi-status { display: inline-flex; padding: 6px 10px; border: 1px solid #356783; color: #9dd8ff; background: rgba(23, 102, 153, .17); font: 700 .68rem ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.status-en_cours { border-color: #48a9e8; color: #8dd3ff; }.status-suspendue { border-color: #9a7938; color: #ffd477; }.status-cloturee { border-color: #47725d; color: #86d9ad; }
.hsi-empty { grid-column: 1 / -1; padding: 44px; border: 1px dashed #29485c; color: #7894a8; text-align: center; }
.hsi-back { margin-bottom: 14px; padding: 0; border: 0; background: transparent; color: #6cc1fa; cursor: pointer; }
.hsi-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 18px 0; border-bottom: 1px solid #1d3e53; }
.hsi-tabs button { padding: 13px 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #819bad; white-space: nowrap; cursor: pointer; }
.hsi-tabs button.active { border-color: #36a9f3; color: #eef8ff; background: rgba(32, 126, 188, .1); }
.hsi-panel, .hsi-shell .panel { border-color: rgba(62, 135, 184, .24); background: #0a1924; color: #dce9f5; }
.hsi-panel .full { grid-column: 1 / -1; }
.hsi-two-columns { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(380px, 1.2fr); gap: 18px; align-items: start; }
.hsi-record-list { display: grid; gap: 14px; }
.hsi-record { padding: 18px; border: 1px solid rgba(64, 139, 189, .2); background: #0b1c28; }
.hsi-record h3 { margin: 4px 0 12px; color: #f2f8fc; }.hsi-record p { color: #9cb1c0; line-height: 1.55; }
.hsi-charges { margin-top: 14px; padding: 12px; border-left: 2px solid #dba84b; background: rgba(219, 168, 75, .08); color: #ecd098; }
.hsi-icon-button { border: 0; background: transparent; color: #ef7d86; cursor: pointer; font-size: .78rem; }
.hsi-evidence-card { display: grid; grid-template-columns: 128px 1fr; gap: 16px; cursor: pointer; }
.hsi-evidence-card img, .hsi-evidence-placeholder { width: 128px; height: 110px; object-fit: cover; border: 1px solid #27516b; background: #06111a; }
.hsi-evidence-placeholder { display: grid; place-items: center; color: #54b8f9; font-size: 2rem; }
.hsi-assignment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 18px; }
.hsi-agent-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #1f4258; background: #07151f; cursor: pointer; }
.hsi-agent-option:has(input:checked) { border-color: #329fe6; background: rgba(24, 112, 171, .16); }.hsi-agent-option small { display: block; color: #7190a5; margin-top: 3px; }
.hsi-graph-toolbar { display: grid; grid-template-columns: 1fr 180px 1fr auto; gap: 12px; align-items: end; }
.hsi-graph-stage { position: relative; min-height: 620px; overflow: auto; border: 1px solid #1f455c; background-color: #06121b; background-image: linear-gradient(rgba(47, 109, 148, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 109, 148, .08) 1px, transparent 1px); background-size: 28px 28px; }
#hsi-evidence-graph { display: block; width: 100%; min-width: 900px; min-height: 620px; }
.hsi-edge line { stroke: #3b97ce; stroke-width: 2; }.hsi-edge text { fill: #789db5; font: 11px ui-monospace, monospace; text-anchor: middle; }.hsi-edge marker path, #hsi-arrow path { fill: #3b97ce; }
.hsi-node { cursor: pointer; }.hsi-node rect { fill: #0d2635; stroke: #368dbd; stroke-width: 1.5; filter: drop-shadow(0 8px 10px rgba(0,0,0,.3)); }.hsi-node:hover rect { stroke: #73caff; stroke-width: 2; }.hsi-node-icon { fill: #62c2ff; font-size: 20px; }.hsi-node-type { fill: #78a5bf; font: 10px ui-monospace, monospace; }.hsi-node-title { fill: #edf8ff; font: 700 14px Inter, sans-serif; }.hsi-node-hint { fill: #638398; font: 10px ui-monospace, monospace; }
.hsi-graph-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #617f92; pointer-events: none; }
.hsi-link-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }.hsi-link-list span { padding: 8px 10px; border: 1px solid #23485e; background: #091a25; color: #92afc1; font-size: .75rem; }.hsi-link-list button { border: 0; background: transparent; color: #ff7e88; cursor: pointer; }
.hsi-dialog { width: min(760px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; padding: 24px; border: 1px solid #2e739c; background: #091a25; color: #dce9f5; box-shadow: 0 30px 90px #000; }.hsi-dialog::backdrop { background: rgba(1, 8, 13, .82); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; grid-column: 1 / -1; margin-bottom: 18px; }.dialog-heading h3 { margin: 5px 0; color: #fff; }.dialog-close { border: 0; background: transparent; color: #8db1c8; font-size: 1.8rem; cursor: pointer; }
.hsi-admin-users { display: grid; gap: 8px; margin-top: 16px; }.hsi-admin-users article { display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: center; padding: 12px; border: 1px solid #1d4258; }.hsi-admin-users span { display: block; margin-top: 4px; color: #7895a8; font-size: .78rem; }
.hsi-detail-image { width: 100%; max-height: 420px; object-fit: contain; margin: 10px 0 18px; background: #030a0f; }.hsi-dialog p { color: #a6bac7; line-height: 1.65; white-space: pre-wrap; }
@media (max-width: 920px) { .hsi-hero, .hsi-case-header { display: grid; }.hsi-metrics, .hsi-toolbar, .hsi-two-columns, .hsi-graph-toolbar { grid-template-columns: 1fr; }.hsi-evidence-card { grid-template-columns: 90px 1fr; }.hsi-evidence-card img, .hsi-evidence-placeholder { width: 90px; height: 90px; }.hsi-admin-users article { grid-template-columns: 1fr; } }

/* Arbre d'enquête HSI v2 : suspects, preuves et relations personnalisées. */
.hsi-graph-help { margin: 10px 0 14px; color: #7797ab; font: .78rem/1.5 ui-monospace, monospace; }
.hsi-graph-toolbar { grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(180px, 1fr) 170px auto; }
.hsi-proof-link { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 11px; border: 1px solid #2c88bd; background: rgba(24, 125, 184, .12); color: #7fd1ff; font: 700 .74rem ui-monospace, monospace; text-decoration: none; }
.hsi-proof-link:hover { border-color: #69c7ff; background: rgba(32, 152, 222, .2); color: #fff; }
.hsi-record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.hsi-evidence-body { min-width: 0; }
.hsi-suspect-card { border-left: 3px solid #d89d45; transition: border-color .2s ease, background .2s ease; }
.hsi-suspect-card:target, .hsi-suspect-card:hover { border-color: #ffc565; background: #102431; }
.hsi-edge path:not(.hsi-edge-label-path) { fill: none; stroke: #4aa9e0; stroke-width: 3; filter: drop-shadow(0 0 3px rgba(74, 169, 224, .3)); }
.hsi-edge .hsi-edge-label-path { fill: none; stroke: transparent; }
.hsi-edge text { fill: #d7edfa; font: 700 12px ui-monospace, monospace; text-anchor: middle; paint-order: stroke; stroke: #06121b; stroke-width: 5px; stroke-linejoin: round; }
.hsi-edge.edge-dashed path:not(.hsi-edge-label-path) { stroke-dasharray: 11 8; }
.hsi-edge.edge-double path:not(.hsi-edge-label-path) { stroke-width: 7; stroke: #163e56; filter: none; }
.hsi-edge.edge-double text { fill: #8ed8ff; }
.hsi-edge.edge-alert path:not(.hsi-edge-label-path) { stroke: #ef5d68; stroke-width: 4; stroke-dasharray: 5 5; }
.hsi-edge.edge-alert text { fill: #ff939b; }
.hsi-edge.edge-confirmed path:not(.hsi-edge-label-path) { stroke: #42c98b; stroke-width: 4; }
.hsi-edge.edge-confirmed text { fill: #80e9b7; }
#hsi-arrow-solid path, #hsi-arrow-dashed path { fill: #4aa9e0; }
#hsi-arrow-double path { fill: #70c7f7; }
#hsi-arrow-alert path { fill: #ef5d68; }
#hsi-arrow-confirmed path { fill: #42c98b; }
.hsi-node rect { transition: stroke .16s ease, filter .16s ease, transform .16s ease; }
.hsi-node-suspect rect { fill: #2a2117; stroke: #d5963c; }
.hsi-node-suspect .hsi-node-icon, .hsi-node-suspect .hsi-node-type { fill: #ffc96f; }
.hsi-node-evidence rect { fill: #0b2637; stroke: #378fc1; }
.hsi-node.selected rect { stroke: #f5faff; stroke-width: 3; filter: drop-shadow(0 0 12px rgba(92, 196, 255, .75)); }
.hsi-node-suspect.selected rect { filter: drop-shadow(0 0 12px rgba(255, 185, 85, .68)); }
.hsi-link-list { display: grid; gap: 8px; }
.hsi-link-editor { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) 145px auto auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid #244b62; background: #091a25; }
.hsi-link-editor strong { color: #d9edf9; font-size: .82rem; }
.hsi-link-editor small { display: block; margin-top: 4px; color: #66879b; }
.hsi-link-editor input, .hsi-link-editor select { min-height: 38px; }
@media (max-width: 1100px) { .hsi-graph-toolbar, .hsi-link-editor { grid-template-columns: 1fr 1fr; }.hsi-link-editor > div { grid-column: 1 / -1; } }
@media (max-width: 700px) { .hsi-graph-toolbar, .hsi-link-editor { grid-template-columns: 1fr; }.hsi-evidence-card { grid-template-columns: 1fr; }.hsi-evidence-card img, .hsi-evidence-placeholder { width: 100%; height: 180px; } }

/* Arbre HSI v3 : déplacement libre et libellés de traits prioritaires. */
#hsi-evidence-graph { min-width: 1200px; touch-action: none; user-select: none; }
.hsi-node { cursor: grab; }
.hsi-node.dragging { cursor: grabbing; }
.hsi-node.dragging rect { stroke: #fff; stroke-width: 3; filter: drop-shadow(0 0 16px rgba(91, 196, 255, .8)); }
.hsi-node-port { fill: #071018; stroke: #6bc9ff; stroke-width: 3; opacity: .82; pointer-events: none; }
.hsi-node-suspect .hsi-node-port { stroke: #ffc66c; }
.hsi-node:hover .hsi-node-port, .hsi-node.selected .hsi-node-port { fill: #fff; opacity: 1; }
.hsi-edges-layer { pointer-events: none; }
.hsi-labels-layer { pointer-events: none; }
.hsi-edge-label rect { fill: rgba(4, 13, 20, .97); stroke: #3d7596; stroke-width: 1.5; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .7)); }
.hsi-edge-label text { fill: #eef9ff; font: 700 12px ui-monospace, monospace; text-anchor: middle; paint-order: normal; stroke: none; }
.hsi-edge-label.edge-alert rect { stroke: #ef5d68; }.hsi-edge-label.edge-alert text { fill: #ffabb1; }
.hsi-edge-label.edge-confirmed rect { stroke: #42c98b; }.hsi-edge-label.edge-confirmed text { fill: #8ce9bc; }
.hsi-edge-label.edge-dashed rect { stroke-dasharray: 5 3; }
.hsi-edge-label.edge-double rect { stroke-width: 3; }
.hsi-edge-main { vector-effect: non-scaling-stroke; }

/* Statuts opérationnels des enquêtes HSI. */
.hsi-status-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hsi-status-metrics .metric-in-progress { border-top: 3px solid #3ba9f2; }
.hsi-status-metrics .metric-paused { border-top: 3px solid #e0a340; }
.hsi-status-metrics .metric-completed { border-top: 3px solid #45c78c; }
.status-en_pause { border-color: #a9782d; color: #ffd27b; background: rgba(183, 119, 30, .16); }
.status-terminee { border-color: #3d8062; color: #8de4b8; background: rgba(39, 143, 94, .15); }
.hsi-status-detail { padding: 16px; border: 1px solid #2a5269; background: #07151f; }
.hsi-status-detail small { display: block; margin-top: 8px; color: #7593a6; }
.hsi-case-status-detail { margin-top: 12px; padding: 16px 18px; border-left: 4px solid #3b8fbd; background: #0a1b26; }
.hsi-case-status-detail strong { color: #eff9ff; font: 700 .78rem ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.hsi-case-status-detail p { margin: 8px 0 0; color: #a9bfcc; line-height: 1.6; white-space: pre-wrap; }
.hsi-case-status-detail.status-detail-en_pause { border-color: #d59a3d; background: rgba(91, 60, 17, .2); }
.hsi-case-status-detail.status-detail-terminee { border-color: #43bd82; background: rgba(20, 82, 53, .2); }
@media (max-width: 920px) { .hsi-status-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .hsi-status-metrics { grid-template-columns: 1fr; } }

/* Navigation de l'arbre HSI : zoom et déplacement du canevas. */
.hsi-graph-navigation { position: sticky; top: 86px; z-index: 8; display: flex; align-items: center; gap: 8px; width: fit-content; margin: 12px 0 8px auto; padding: 8px; border: 1px solid #28536d; border-radius: 10px; background: rgba(5, 19, 29, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); backdrop-filter: blur(8px); }
.hsi-graph-navigation button { min-width: 38px; min-height: 36px; padding: 7px 11px; border: 1px solid #326984; border-radius: 7px; background: #0c2635; color: #dff4ff; cursor: pointer; font-weight: 800; }
.hsi-graph-navigation button:hover { border-color: #72caff; background: #12364a; }
#hsi-zoom-level { min-width: 56px; color: #81cff9; font: 700 .78rem ui-monospace, monospace; text-align: center; }
.hsi-pan-hint { margin-left: 4px; color: #7897aa; font: .7rem ui-monospace, monospace; white-space: nowrap; }
.hsi-graph-stage { cursor: grab; overflow: hidden; height: min(72vh, 820px); min-height: 560px; }
.hsi-graph-stage.panning { cursor: grabbing; }
.hsi-graph-stage.panning .hsi-node { pointer-events: none; }
#hsi-evidence-graph { width: 100%; height: 100%; min-width: 0; min-height: 0; }
@media (max-width: 760px) { .hsi-graph-navigation { position: static; width: 100%; margin-left: 0; flex-wrap: wrap; }.hsi-pan-hint { flex-basis: 100%; }.hsi-graph-stage { height: 68vh; min-height: 480px; } }


/* Thème HSI noir et rouge. */
.hsi-shell { background: #070707; color: #f1e9e9; }
.hsi-content { background: radial-gradient(circle at 82% 0%, rgba(176, 18, 31, .2), transparent 38%), #070707; }
.hsi-hero, .hsi-case-header { border-color: rgba(211, 45, 58, .38); background: linear-gradient(135deg, rgba(31, 9, 11, .98), rgba(9, 9, 9, .98)); box-shadow: 0 20px 55px rgba(0, 0, 0, .48); }
.hsi-eyebrow, .hsi-classified, .hsi-case-card-top > span:first-child, .hsi-back { color: #ff5b67; }
.hsi-metrics article, .hsi-toolbar, .hsi-panel, .hsi-shell .panel { border-color: rgba(196, 43, 55, .3); background: #120d0e; }
.hsi-metrics span, .hsi-shell .field label, .hsi-case-card p, .hsi-card-meta, .hsi-record p, .hsi-agent-option small, .hsi-dialog p { color: #bba5a7; }
.hsi-shell input, .hsi-shell select, .hsi-shell textarea { border-color: #51252a; background: #090707; color: #fff4f4; }
.hsi-shell input:focus, .hsi-shell select:focus, .hsi-shell textarea:focus { border-color: #e43c49; box-shadow: 0 0 0 3px rgba(228, 60, 73, .17); }
.hsi-shell .action-button { border-color: #d33442; background: linear-gradient(135deg, #a91625, #6f0e18); color: #fff; }
.hsi-shell .action-button:hover { border-color: #ff6672; background: linear-gradient(135deg, #c91f30, #8d111e); }
.hsi-case-card { border-color: rgba(190, 44, 55, .32); border-left-color: #d62f3d; background: linear-gradient(150deg, #1a0e10, #0c0909); }
.hsi-case-card:hover { border-color: #ed4653; box-shadow: 0 14px 36px rgba(123, 8, 18, .18); }
.hsi-card-meta, .hsi-tabs { border-color: rgba(190, 44, 55, .24); }
.hsi-status { border-color: #a82b36; color: #ff9ba3; background: rgba(169, 30, 43, .18); }
.hsi-tabs button { color: #ae9597; }
.hsi-tabs button.active { border-color: #e33b48; color: #fff4f4; background: rgba(179, 29, 43, .16); }
.hsi-record, .hsi-agent-option, .hsi-link-editor, .hsi-admin-users article { border-color: rgba(190, 44, 55, .3); background: #110c0d; }
.hsi-agent-option:has(input:checked) { border-color: #df3d4a; background: rgba(155, 22, 35, .2); }
.hsi-evidence-card img, .hsi-evidence-placeholder { border-color: #6d2930; background: #080606; }
.hsi-evidence-placeholder, .hsi-proof-link { color: #ff6975; }
.hsi-proof-link { border-color: #b72e3a; background: rgba(159, 25, 38, .16); }
.hsi-proof-link:hover { border-color: #ff6975; background: rgba(195, 35, 49, .24); }
.hsi-dialog { border-color: #b72d39; background: #100b0c; color: #f1e9e9; }
.hsi-graph-stage { border-color: #62242a; background-color: #080606; background-image: linear-gradient(rgba(179, 42, 53, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(179, 42, 53, .09) 1px, transparent 1px); }
.hsi-node rect, .hsi-node-evidence rect { fill: #180d0f; stroke: #bd3440; }
.hsi-node:hover rect { stroke: #ff6672; }
.hsi-node-icon, .hsi-node-type { fill: #ef5c68; }
.hsi-node-port { fill: #080606; stroke: #f25764; }
.hsi-edge path:not(.hsi-edge-label-path) { stroke: #d7434f; filter: drop-shadow(0 0 3px rgba(215, 67, 79, .35)); }
#hsi-arrow-solid path, #hsi-arrow-dashed path, #hsi-arrow-double path { fill: #d7434f; }
.hsi-edge-label rect { fill: rgba(15, 7, 8, .97); stroke: #9f3039; }
.hsi-link-list span { border-color: #63252b; background: #100a0b; color: #cbb4b6; }
.hsi-graph-navigation { border-color: #69272e; background: rgba(14, 8, 9, .96); }
.hsi-graph-navigation button { border-color: #80303a; background: #221013; color: #ffecee; }
.hsi-graph-navigation button:hover { border-color: #ef5864; background: #39151a; }
#hsi-zoom-level { color: #ff717c; }
.hsi-status-detail { border-color: #63272d; background: #0d0909; }
.hsi-case-status-detail { border-color: #b52f3a; background: #150c0e; }
.hsi-status.status-en_pause { border-color: #a9782d; color: #ffd27b; background: rgba(183, 119, 30, .16); }
.hsi-status.status-terminee { border-color: #3d8062; color: #8de4b8; background: rgba(39, 143, 94, .15); }
.hsi-status-metrics .metric-in-progress { border-top-color: #d93644; }
.hsi-status-metrics .metric-paused { border-top-color: #e0a340; }
.hsi-status-metrics .metric-completed { border-top-color: #45c78c; }


/* Suppression des accents dorés HSI et amélioration des contrastes. */
.hsi-charges { border-left-color: #e84d6a; background: rgba(178, 28, 59, .14); color: #ffb4c2; }
.hsi-suspect-card { border-left-color: #d83b59; }
.hsi-suspect-card:target, .hsi-suspect-card:hover { border-color: #f05a75; background: #1d0d12; }
.hsi-node-suspect rect { fill: #210d13; stroke: #d9415d; }
.hsi-node-suspect .hsi-node-icon, .hsi-node-suspect .hsi-node-type { fill: #ff7890; }
.hsi-node-suspect .hsi-node-port { stroke: #ff7890; }
.hsi-node-suspect.selected rect { filter: drop-shadow(0 0 12px rgba(232, 61, 91, .7)); }
.hsi-status.status-en_pause, .hsi-status.status-suspendue { border-color: #9d5bd2; color: #ddb7ff; background: rgba(111, 50, 158, .2); }
.hsi-status-metrics .metric-paused { border-top-color: #a965df; }
.hsi-case-status-detail.status-detail-en_pause { border-color: #9d5bd2; background: rgba(75, 33, 108, .24); }
.hsi-case-status-detail.status-detail-en_pause strong { color: #e3c4ff; }
.hsi-status-detail small, .hsi-pan-hint, .hsi-graph-help, .hsi-link-editor small, .hsi-admin-users span { color: #c49aa2; }
.hsi-record h3, .hsi-link-editor strong, .hsi-node-title, .hsi-edge-label text { color: #fff0f2; fill: #fff0f2; }


/* Le thème HSI reste rouge même lorsque le thème global night est actif. */
body[data-theme="night"] .hsi-shell .panel,
body[data-theme="night"] .hsi-shell .hsi-panel {
  background: #120d0e;
  border-color: rgba(196, 43, 55, .34);
  color: #f1e9e9;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .46);
}
body[data-theme="night"] .hsi-shell .panel::before,
body[data-theme="night"] .hsi-shell .hsi-panel::before {
  opacity: .9;
  background: linear-gradient(90deg, rgba(211, 45, 58, 0), rgba(232, 63, 77, .72), rgba(211, 45, 58, 0));
}
body[data-theme="night"] .hsi-shell .field input,
body[data-theme="night"] .hsi-shell .field select,
body[data-theme="night"] .hsi-shell .field textarea {
  background: #090707;
  color: #fff4f4;
  border-color: #6b2930;
}
body[data-theme="night"] .hsi-shell .field input:focus,
body[data-theme="night"] .hsi-shell .field select:focus,
body[data-theme="night"] .hsi-shell .field textarea:focus {
  border-color: #ed4653;
  box-shadow: 0 0 0 3px rgba(228, 60, 73, .2);
}
body[data-theme="night"] .hsi-shell .field label { color: #e8b5bb; }
body[data-theme="night"] .hsi-shell .field input::placeholder,
body[data-theme="night"] .hsi-shell .field textarea::placeholder { color: #9d7479; }
body[data-theme="night"] .hsi-shell .muted { color: #c49aa2; }
body[data-theme="night"] .hsi-shell .action-button {
  background: linear-gradient(135deg, #b91d2c, #73101a);
  border-color: #e04754;
  color: #fff5f6;
  box-shadow: 0 12px 26px rgba(151, 19, 32, .28);
}
body[data-theme="night"] .hsi-shell .secondary-button {
  background: linear-gradient(180deg, #281316, #160d0f);
  border-color: #80313a;
  color: #ffd9dd;
}


/* Palette fonctionnelle de l’arbre HSI. */
.hsi-node-suspect rect { fill: #240d20; stroke: #d946b8; }
.hsi-node-suspect .hsi-node-icon,
.hsi-node-suspect .hsi-node-type { fill: #ff83df; }
.hsi-node-suspect .hsi-node-port { stroke: #f064d0; }
.hsi-node-suspect:hover rect { stroke: #ff8be1; }
.hsi-node-suspect.selected rect { stroke: #ffc3ef; filter: drop-shadow(0 0 13px rgba(224, 70, 184, .72)); }
.hsi-node-evidence rect { fill: #071c27; stroke: #28a9d6; }
.hsi-node-evidence .hsi-node-icon,
.hsi-node-evidence .hsi-node-type { fill: #70d8ff; }
.hsi-node-evidence .hsi-node-port { stroke: #4fcaff; }
.hsi-node-evidence:hover rect { stroke: #8ae2ff; }
.hsi-node-evidence.selected rect { stroke: #c1efff; filter: drop-shadow(0 0 13px rgba(45, 177, 222, .72)); }
.hsi-node-title { fill: #fff7fb; }
.hsi-node-suspect .hsi-node-hint { fill: #bd83ae; }
.hsi-node-evidence .hsi-node-hint { fill: #72a8bc; }

.hsi-edge.edge-solid path.hsi-edge-main { stroke: #3b9dff; filter: drop-shadow(0 0 4px rgba(59, 157, 255, .48)); }
#hsi-arrow-solid path { fill: #3b9dff; }
.hsi-edge-label.edge-solid rect { stroke: #3b9dff; }
.hsi-edge-label.edge-solid text { fill: #a9d5ff; }

.hsi-edge.edge-dashed path.hsi-edge-main { stroke: #a66bff; stroke-dasharray: 12 9; filter: drop-shadow(0 0 4px rgba(166, 107, 255, .42)); }
#hsi-arrow-dashed path { fill: #a66bff; }
.hsi-edge-label.edge-dashed rect { stroke: #a66bff; stroke-dasharray: 5 3; }
.hsi-edge-label.edge-dashed text { fill: #d7bfff; }

.hsi-edge.edge-double path.hsi-edge-main { stroke: #27d3c2; stroke-width: 7; filter: drop-shadow(0 0 4px rgba(39, 211, 194, .38)); }
#hsi-arrow-double path { fill: #27d3c2; }
.hsi-edge-label.edge-double rect { stroke: #27d3c2; stroke-width: 3; }
.hsi-edge-label.edge-double text { fill: #a4fff4; }

.hsi-edge.edge-alert path.hsi-edge-main { stroke: #ff4052; stroke-width: 4; stroke-dasharray: 5 5; filter: drop-shadow(0 0 5px rgba(255, 64, 82, .5)); }
#hsi-arrow-alert path { fill: #ff4052; }
.hsi-edge-label.edge-alert rect { stroke: #ff4052; }
.hsi-edge-label.edge-alert text { fill: #ffadb5; }

.hsi-edge.edge-confirmed path.hsi-edge-main { stroke: #35d07f; stroke-width: 4; filter: drop-shadow(0 0 5px rgba(53, 208, 127, .44)); }
#hsi-arrow-confirmed path { fill: #35d07f; }
.hsi-edge-label.edge-confirmed rect { stroke: #35d07f; }
.hsi-edge-label.edge-confirmed text { fill: #a4f3c9; }

/* Informations supplémentaires et checklist HSI. */
.hsi-info-card { border-left: 3px solid #8f62e8; background: #120d1c; }
.hsi-info-card .field + .field { margin-top: 12px; }
.hsi-task-panel { display: grid; gap: 18px; }
.hsi-task-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.hsi-task-list { display: grid; gap: 10px; }
.hsi-task-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid rgba(255, 105, 67, .34); background: #170d0a; }
.hsi-task-check { display: grid; place-items: center; cursor: pointer; }
.hsi-task-check input { position: absolute; opacity: 0; pointer-events: none; }
.hsi-task-check span { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #ff754f; border-radius: 6px; color: #fff; }
.hsi-task-check input:checked + span { border-color: #45d98b; background: #228b58; }
.hsi-task-check input:checked + span::after { content: "✓"; font-weight: 900; }
.hsi-task-title { width: 100%; min-height: 42px; }
.hsi-task-item.completed { border-color: rgba(69, 217, 139, .38); background: #0b1711; }
.hsi-task-item.completed .hsi-task-title { color: #8ebca3; text-decoration: line-through; }
.hsi-node-info rect { fill: #160d28; stroke: #9264ed; }
.hsi-node-info .hsi-node-icon, .hsi-node-info .hsi-node-type { fill: #c39cff; }
.hsi-node-info .hsi-node-port { stroke: #ad82f6; }
.hsi-node-info:hover rect { stroke: #c5a4ff; }
.hsi-node-info.selected rect { stroke: #eadcff; filter: drop-shadow(0 0 13px rgba(146, 100, 237, .7)); }
.hsi-node-info .hsi-node-hint { fill: #9980bd; }
@media (max-width: 760px) { .hsi-task-create, .hsi-task-item { grid-template-columns: 1fr; }.hsi-task-check { justify-content: start; } }

/* Gestion et surface étendue de l’arbre HSI. */
.hsi-graph-stage { height: min(82vh, 980px); min-height: 680px; }
.hsi-node-remove { cursor: pointer; }
.hsi-node-remove circle { fill: #321116; stroke: #f06470; stroke-width: 1.5; transition: fill .16s ease, stroke .16s ease; }
.hsi-node-remove text { fill: #ffd9dd; font: 700 19px/1 sans-serif; text-anchor: middle; pointer-events: none; }
.hsi-node-remove:hover circle { fill: #a51f2c; stroke: #ffadb4; }
.hsi-graph-removed-panel { display: grid; gap: 16px; margin-top: 14px; }
.hsi-graph-removed-panel h3 { margin: 5px 0 6px; color: #fff4f4; }
.hsi-graph-removed-panel p { margin: 0; }
.hsi-graph-removed-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.hsi-graph-removed-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid #5f272d; background: #0c0809; }
.hsi-graph-removed-card div { min-width: 0; }
.hsi-graph-removed-card span { display: block; margin-bottom: 4px; color: #d36b75; font: 700 .68rem ui-monospace, monospace; text-transform: uppercase; }
.hsi-graph-removed-card strong { display: block; overflow: hidden; color: #fff0f2; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.hsi-graph-removed-card button { flex: 0 0 auto; }
@media (max-width: 620px) { .hsi-graph-stage { height: 76vh; min-height: 540px; }.hsi-graph-removed-card { align-items: stretch; flex-direction: column; } }

.hsi-case-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
@media (max-width: 720px) { .hsi-case-actions { align-items: flex-start; justify-content: flex-start; } }

.hsi-warrant-list { display: grid; gap: 10px; }
.hsi-inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }

/* HSI warrant tree refresh */
.hsi-warrant-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}

.hsi-warrant-panel,
.hsi-warrant-detail {
  display: grid;
  gap: 16px;
}

.hsi-warrant-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(35, 39, 47, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  cursor: pointer;
}

.hsi-warrant-card.active {
  border-color: rgba(139, 17, 29, 0.48);
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.98), rgba(255, 255, 255, 0.86));
  box-shadow: 0 14px 32px rgba(139, 17, 29, 0.12);
}

.hsi-warrant-card strong,
.hsi-warrant-card small,
.hsi-warrant-card em {
  display: block;
}

.hsi-warrant-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

.hsi-warrant-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(35, 39, 47, 0.12);
}

.hsi-warrant-section h4 {
  margin: 0 0 4px;
}

.hsi-warrant-clean-form {
  padding: 16px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.hsi-warrant-files {
  display: grid;
  gap: 8px;
}

.hsi-warrant-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.hsi-warrant-tree {
  display: grid;
  gap: 12px;
}

.hsi-warrant-tree-node {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(35, 39, 47, 0.12);
  border-left: 4px solid #8b111d;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 248, 250, 0.78));
}

.hsi-warrant-tree-node.depth-1 { margin-left: 18px; border-left-color: #b8902f; }
.hsi-warrant-tree-node.depth-2 { margin-left: 36px; border-left-color: #475569; }
.hsi-warrant-tree-node.depth-3,
.hsi-warrant-tree-node.depth-4,
.hsi-warrant-tree-node.depth-5 { margin-left: 54px; border-left-color: #64748b; }

.hsi-warrant-tree-main {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
}

.hsi-warrant-tree-children {
  display: grid;
  gap: 10px;
}

.hsi-warrant-tree-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.hsi-warrant-tree-photo {
  margin: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(35, 39, 47, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.hsi-warrant-tree-photo img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(35, 39, 47, 0.08);
}

.hsi-warrant-tree-photo figcaption {
  color: #23272f;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.hsi-tree-root-form,
.hsi-tree-child-form,
.hsi-tree-photo-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.hsi-tree-photo-form {
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 1fr) auto;
}

.hsi-tree-root-form input,
.hsi-tree-child-form input,
.hsi-tree-photo-form input {
  width: 100%;
}

@media (max-width: 980px) {
  .hsi-warrant-layout,
  .hsi-warrant-tree-main,
  .hsi-tree-root-form,
  .hsi-tree-child-form,
  .hsi-tree-photo-form {
    grid-template-columns: 1fr;
  }

  .hsi-warrant-tree-node.depth-1,
  .hsi-warrant-tree-node.depth-2,
  .hsi-warrant-tree-node.depth-3,
  .hsi-warrant-tree-node.depth-4,
  .hsi-warrant-tree-node.depth-5 {
    margin-left: 10px;
  }
}
