:root {
  color-scheme: light;
  --maroon: #3f1724;
  --maroon-deep: #32111d;
  --accent: #7a3047;
  --ink: #331e27;
  --muted: #6e5b62;
  --line: #e8dfe2;
  --paper: #fff;
  --back: #f8f5f5;
  --rose: #f5eaee;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--back);
}
* { box-sizing: border-box; }
body { display: grid; grid-template-columns: 228px minmax(0,1fr); margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
button { padding: 8px 13px; }
button:disabled { cursor: default; opacity: .45; }
button:hover:not(:disabled) { border-color: var(--accent); }
:focus-visible { outline: 3px solid #a95676; outline-offset: 3px; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 28px 18px 22px; color: #fff8fb; background: linear-gradient(165deg,var(--maroon),var(--maroon-deep)); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font-size: 24px; font-weight: 720; padding: 0 7px; }
.mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #a47785; border-radius: 10px; font: bold 25px Georgia,serif; background: #602e40; }
.brand small { display: block; color: #e1c4ce; font-size: 11px; font-weight: 500; white-space: nowrap; }
nav { display: grid; gap: 6px; margin-top: 42px; }
nav button { text-align: left; color: #f2dde4; background: transparent; border-color: transparent; padding: 11px 13px; }
nav button[aria-current] { background: #623345; color: #fff; border-color: #845164; font-weight: 650; }
.environment { margin: auto 7px 0; padding-top: 18px; border-top: 1px solid #805366; font-size: 12px; color: #f1d8e1; }
.environment span { display: inline-block; background: #e7a8bd; border-radius: 50%; width: 7px; height: 7px; margin-right: 5px; }
.topbar { min-height: 64px; padding: 0 clamp(20px,4vw,52px); display: flex; align-items: center; gap: 12px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.topbar strong { color: var(--ink); border-left: 1px solid var(--line); padding-left: 12px; }
.view { max-width: 1580px; margin: auto; padding: 34px clamp(20px,4vw,52px) 52px; }
h1,h2,p { margin: 0; }
h1 { font: 500 clamp(34px,4vw,48px)/1.08 Georgia,serif; letter-spacing: -.035em; color: var(--maroon); }
h2 { font-size: 17px; }
.heading { margin-bottom: 26px; }
.heading p,.panel p, dialog p { color: var(--muted); margin-top: 8px; font-size: 14px; line-height: 1.5; }
.metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 25px; }
.metric,.panel,.table-card { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.metric { padding: 15px; display: grid; gap: 10px; }
.metric strong { color: var(--maroon); font-size: clamp(19px,2vw,30px); letter-spacing: -.04em; white-space: nowrap; }
.metric span,.subtle { font-size: 12px; color: var(--muted); }
.panel { padding: 19px; }
.tools { display: flex; flex-wrap: wrap; gap: 9px; padding: 16px; align-items: end; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.tools label:first-child { flex: 1 1 220px; }
input,select,textarea { width: 100%; padding: 8px 10px; min-height: 37px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { font-size: 11px; color: var(--muted); background: #fbf8f9; white-space: nowrap; }
td,th { padding: 13px 14px; border-top: 1px solid var(--line); }
td { vertical-align: middle; }
.customer { background: none; border: 0; padding: 0; color: var(--maroon); font-weight: 700; text-align: left; text-decoration: underline; text-decoration-color: #d4aebc; text-underline-offset: 3px; }
td .subtle { display: block; margin-top: 4px; }
.tag { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 650; border-radius: 999px; padding: 4px 8px; color: #63243c; background: var(--rose); }
.tag.warn { background: #f8ecd9; color: #784500; }
.tag.ok { background: #e7f2eb; color: #27563b; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--line); }
.back { margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.detail-grid dl { display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: 13px; }
.detail-grid .panel { min-width: 0; }
.panel .table-scroll { margin-top: 12px; }
.panel th,.panel td { padding: 10px 8px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.timeline { margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; }
.timeline li { border-top: 1px solid var(--line); padding: 10px 0; overflow-wrap: anywhere; }
.timeline time { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-weight: 650; }
.primary { color: #fff; background: var(--maroon); border-color: var(--maroon); }
dialog { width: min(92vw,475px); border: 1px solid var(--line); border-radius: 14px; padding: 20px; color: var(--ink); }
dialog::backdrop { background: #32111d99; }
dialog form { display: grid; gap: 13px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: end; }
@media (max-width: 1050px) { body { grid-template-columns: 175px minmax(0,1fr); } .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 660px) {
  body { display: block; }
  .sidebar { position: static; height: auto; padding: 15px 18px; }
  nav { display: flex; flex-wrap: wrap; margin: 13px 0; }
  .environment { margin: 0 7px; padding-top: 9px; }
  .metrics,.detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topbar { min-height: 46px; }
  .view { padding-top: 23px; }
}
@media (max-width: 370px) { .detail-grid { grid-template-columns: 1fr; } }
.operator-form { display: grid; gap: 14px; max-width: 400px; margin-top: 16px; }
.operator-form button { justify-self: start; }
