/* AceLocale Relay Admin — approved prototype styles (admin-panel-prototype/dist/index.html), carried over unchanged. */
:root {
  color-scheme: light;
  --ink: #122321;
  --muted: #667773;
  --line: #dce4e1;
  --surface: #ffffff;
  --surface-2: #f3f7f5;
  --shell: #0d2e2a;
  --shell-2: #123a35;
  --acid: #eaff6b;
  --green: #11845b;
  --green-soft: #e6f6ef;
  --amber: #a76508;
  --amber-soft: #fff4d7;
  --red: #b33a3a;
  --red-soft: #ffeded;
  --blue: #275ea8;
  --shadow: 0 18px 48px rgba(13, 46, 42, .10);
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--surface-2); color: var(--ink); font-size: 16px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { background: var(--shell); color: #fff; padding: 24px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.mark { width: 38px; height: 38px; border-radius: 12px; background: var(--acid); color: var(--shell); display: grid; place-items: center; font-weight: 900; letter-spacing: -.06em; }
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: #9fb7b2; font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav button { border: 0; background: transparent; color: #bed0cc; text-align: left; padding: 12px 14px; border-radius: 12px; display: flex; gap: 12px; align-items: center; font-size: 14px; font-weight: 650; }
.nav button:hover, .nav button.active { color: #fff; background: rgba(255,255,255,.09); }
.nav button.active::before { content: ""; width: 5px; height: 18px; border-radius: 4px; background: var(--acid); margin-left: -8px; }
.nav svg { width: 19px; height: 19px; }
.system-card { margin-top: auto; background: var(--shell-2); padding: 15px; border-radius: 14px; }
.system-card .online { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #54e39e; box-shadow: 0 0 0 4px rgba(84,227,158,.12); }
.system-card p { margin: 8px 0 0; color: #a8beb9; font-size: 12px; line-height: 1.45; }
main { min-width: 0; }
.topbar { height: 76px; padding: 0 34px; background: rgba(255,255,255,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.prototype { color: var(--amber); background: var(--amber-soft); border: 1px solid #f1d892; border-radius: 999px; font-size: 12px; font-weight: 750; padding: 7px 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #dbe9e5; color: var(--shell); display: grid; place-items: center; font-weight: 800; }
.mobile-nav { display: none; background: none; border: 0; color: var(--ink); }
.content { padding: 34px; max-width: 1480px; margin: auto; }
.view { display: none; }
.view.active { display: block; animation: appear .22s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 850; color: var(--green); margin-bottom: 7px; }
.page-head h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.045em; margin: 0; line-height: 1.05; }
.page-head p { color: var(--muted); margin: 9px 0 0; max-width: 620px; line-height: 1.5; }
.primary { border: 0; background: var(--shell); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 750; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 8px 22px rgba(13,46,42,.16); }
.primary:hover { background: #16453f; transform: translateY(-1px); }
.primary .plus { color: var(--acid); font-size: 20px; line-height: 0; }
.secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 11px 15px; border-radius: 11px; font-weight: 700; }
.danger { border: 1px solid #f2bcbc; background: var(--red-soft); color: var(--red); padding: 11px 15px; border-radius: 11px; font-weight: 750; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; width: 66px; height: 66px; border-radius: 50%; right: -18px; top: -20px; background: var(--accent, #e7f2ee); }
.stat label { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat strong { display: block; font-size: 32px; letter-spacing: -.04em; margin-top: 9px; }
.stat small { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 18px rgba(13,46,42,.03); overflow: hidden; }
.card-head { padding: 19px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.card-head button { border: 0; background: none; color: var(--green); font-weight: 750; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #edf1ef; align-items: center; }
.activity li:last-child { border-bottom: 0; }
.activity-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 850; }
.activity strong { font-size: 14px; display: block; }
.activity span, .activity time { color: var(--muted); font-size: 12px; }
.health { padding: 20px; }
.health-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1ef; }
.health-row:last-child { border-bottom: 0; }
.health-row span:first-child { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; padding: 6px 9px; border-radius: 999px; }
.status.active { color: var(--green); background: var(--green-soft); }
.status.paused { color: var(--amber); background: var(--amber-soft); }
.status.attention { color: var(--red); background: var(--red-soft); }
.status.closed { color: #596762; background: #edf1ef; }
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; }
.search { flex: 1; position: relative; }
.search input, .field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; color: var(--ink); outline: none; }
.search input:focus, .field input:focus, .field select:focus { border-color: #74a99e; box-shadow: 0 0 0 3px rgba(17,132,91,.1); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 13px 20px; border-bottom: 1px solid var(--line); }
td { padding: 17px 20px; border-bottom: 1px solid #edf1ef; font-size: 14px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8fbfa; }
td strong { display: block; }
td small { color: var(--muted); }
.link-button { border: 0; background: none; color: var(--green); font-weight: 800; padding: 0; }
.attention-list { display: grid; gap: 12px; }
.notice { border: 1px solid #f0c7c7; background: #fff; border-radius: 15px; padding: 17px 18px; display: flex; align-items: center; gap: 14px; }
.notice-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 900; }
.notice strong { display: block; }
.notice p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.notice button { margin-left: auto; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); display: block; font-size: 18px; margin-bottom: 6px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(6,25,23,.5); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { width: min(700px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 22px; box-shadow: var(--shadow); }
.modal-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.close { width: 36px; height: 36px; border: 0; background: var(--surface-2); border-radius: 50%; font-size: 22px; color: var(--muted); }
.modal-body { padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 7px; }
.field small { display: block; color: var(--muted); margin-top: 6px; }
.consent { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: var(--surface-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.check + .check { margin-top: 10px; }
.check input { margin-top: 3px; accent-color: var(--green); }
.pair { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 4px; }
.person { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.person span { color: var(--muted); font-size: 12px; }
.person strong { display: block; margin-top: 4px; }
.relay-mark { width: 42px; height: 42px; border-radius: 50%; background: var(--shell); color: var(--acid); display: grid; place-items: center; }
.modal-foot { padding: 18px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(6,25,23,.25); display: none; }
.drawer-backdrop.open { display: block; }
.drawer { position: absolute; right: 0; top: 0; height: 100%; width: min(560px, 100%); background: #fff; box-shadow: -20px 0 60px rgba(13,46,42,.18); overflow: auto; }
.drawer-top { padding: 24px; background: var(--shell); color: #fff; }
.drawer-top .close { float: right; }
.drawer-top p { color: #afc4bf; margin: 7px 0 0; }
.drawer-top h3 { font-size: 25px; margin: 18px 0 0; }
.drawer-body { padding: 24px; }
.detail-block { margin-bottom: 24px; }
.detail-block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 12px; }
.participant { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.participant strong { display: block; }
.participant span { color: var(--muted); font-size: 12px; }
.timeline { border-left: 2px solid #dfe9e6; margin-left: 8px; padding-left: 18px; }
.event { position: relative; margin-bottom: 18px; }
.event::before { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--green); left: -24px; top: 4px; border: 3px solid #fff; }
.event strong { font-size: 13px; }
.event p { margin: 4px 0; font-size: 13px; }
.event time { color: var(--muted); font-size: 12px; }
.drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 100; background: var(--shell); color: #fff; padding: 14px 17px; border-radius: 13px; box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; transition: .22s; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 1050px) { .stats { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { position: fixed; z-index: 80; width: 270px; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-nav { display: block; }
  .topbar { padding: 0 18px; }
  .content { padding: 24px 18px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full, .consent, .pair { grid-column: 1; }
  .pair { grid-template-columns: 1fr; }
  .relay-mark { margin: auto; transform: rotate(90deg); }
  .prototype { display: none; }
}

/* ---------- Additions for the live application (same tokens and visual language) ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 3px solid rgba(17,132,91,.45); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.stat.accent-green { --accent: #e8f8ef; }
.stat.accent-blue { --accent: #eef2ff; }
.stat.accent-amber { --accent: #fff3d4; }
.stat.accent-red { --accent: #ffeded; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.env-badge { color: var(--amber); background: var(--amber-soft); border: 1px solid #f1d892; border-radius: 999px; font-size: 12px; font-weight: 750; padding: 7px 10px; }
.readonly-badge { margin-left: auto; margin-right: 12px; color: #fff; background: var(--blue); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 7px 11px; white-space: nowrap; }
.signout { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.status.info { color: var(--blue); background: #eef2ff; }
.dot.warn { background: #f2b544; box-shadow: 0 0 0 4px rgba(242,181,68,.15); }
.dot.off { background: #9fb7b2; box-shadow: none; }

/* Login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--shell); }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); overflow: hidden; }
.login-top { background: var(--shell-2); color: #fff; padding: 26px 26px 22px; }
.login-top .brand { padding: 0; }
.login-top p { color: #a8beb9; margin: 16px 0 0; font-size: 14px; line-height: 1.5; }
.login-body { padding: 24px 26px 26px; display: grid; gap: 16px; }
.login-body .primary { justify-content: center; width: 100%; padding: 13px 16px; }
.login-foot { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }

/* Messages and states */
.form-error { border: 1px solid #f2bcbc; background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 11px 13px; font-size: 13px; font-weight: 650; line-height: 1.45; }
.form-note { border: 1px solid #f1d892; background: var(--amber-soft); color: #7a4a06; border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.form-ok { border: 1px solid #bfe5d3; background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 11px 13px; font-size: 13px; font-weight: 650; }
.field.invalid input, .field.invalid select { border-color: #e59a9a; box-shadow: 0 0 0 3px rgba(179,58,58,.08); }
.field .field-error { display: block; color: var(--red); font-size: 12px; font-weight: 650; margin-top: 6px; }
.loading { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid #dce4e1; border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { padding: 34px 20px; text-align: center; color: var(--muted); }
.error-state strong { display: block; color: var(--red); margin-bottom: 6px; }
.error-state button { margin-top: 12px; }
.load-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid #edf1ef; }
.list-foot { display: flex; justify-content: center; margin-top: 12px; }
.skeleton { color: transparent !important; background: linear-gradient(90deg, #edf1ef, #f6f9f8, #edf1ef); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Create form */
.consent-row { display: grid; gap: 8px; }
.consent-row + .consent-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.consent-row select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); }
.consent-row select:disabled { background: #edf1ef; color: var(--muted); }
.person.bad strong { color: var(--red); }
.review { display: grid; gap: 14px; }
.review dl { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 14px; }
.review dt { color: var(--muted); font-weight: 700; }
.review dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }

/* Confirmations */
.confirm-list { margin: 12px 0 0; padding-left: 20px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.confirm-code { display: inline-block; background: var(--shell); color: var(--acid); border-radius: 9px; padding: 8px 12px; font-weight: 800; letter-spacing: .06em; user-select: all; }
.modal.small { width: min(520px, 100%); }
.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }

/* Drawer details */
.drawer-top .status { margin-top: 4px; }
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.health-grid div { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.health-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.health-grid strong { font-size: 18px; }
.participant .badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.event.in::before { background: var(--blue); }
.event.failed::before { background: var(--red); }
.event p { overflow-wrap: anywhere; }
.drawer-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.notice.amber { border-color: #f1d892; }
.notice.amber .notice-icon { background: var(--amber-soft); color: var(--amber); }
.notice-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.notice .notice-actions button { margin-left: 0; }
.summary-line { color: var(--muted); font-size: 14px; margin: -12px 0 16px; }

@media (max-width: 760px) {
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .review dl { grid-template-columns: 1fr; gap: 2px; }
  .review dd { margin-bottom: 10px; }
  .notice { flex-wrap: wrap; }
  .notice-actions { width: 100%; justify-content: flex-start; }
  .env-badge { display: none; }
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .topbar h1 { flex: 1 1 0; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-actions { gap: 8px; }
  .readonly-badge { order: 3; flex: 1 0 100%; margin: 0; border-radius: 9px; text-align: center; padding: 6px 10px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot button { flex: 1 1 auto; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}
