:root {
  --orange: #f26622;
  --orange-dark: #d94f12;
  --orange-soft: #fff1e8;
  --ink: #18212f;
  --muted: #687385;
  --line: #e5e9ef;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --green: #18845a;
  --green-soft: #e8f7f0;
  --red: #c73b42;
  --red-soft: #fdecee;
  --amber: #a96505;
  --amber-soft: #fff5d9;
  --shadow: 0 16px 45px rgba(25, 33, 47, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 5px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 15%, rgba(242, 102, 34, .16), transparent 26rem),
    radial-gradient(circle at 86% 78%, rgba(24, 33, 47, .10), transparent 32rem),
    #f7f8fa;
}
.login-card {
  width: min(440px, 100%);
  padding: 42px;
  border: 1px solid rgba(229, 233, 239, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(145deg, #ff7b36, var(--orange-dark));
  box-shadow: 0 10px 24px rgba(242, 102, 34, .28);
  font-size: 19px;
  font-weight: 900;
}
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 14px; }
.login-card h1 { margin: 0 0 12px; font-size: clamp(28px, 7vw, 39px); line-height: 1.05; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 28px; line-height: 1.6; }
.login-card form { display: grid; gap: 10px; }
.form-error { min-height: 22px; color: var(--red); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  color: #f7f8fa;
  background: #151c27;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; }
.sidebar-brand strong { display: block; font-size: 18px; }
.sidebar-brand span { display: block; margin-top: 2px; color: #9ca7b7; font-size: 12px; }
#navigation { display: grid; gap: 3px; }
#navigation p { margin: 18px 10px 6px; color: #728094; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: #bbc4d0;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}
.nav-item span { width: 18px; color: #7e8999; text-align: center; }
.nav-item:hover { color: white; background: rgba(255, 255, 255, .06); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(242, 102, 34, .23), rgba(242, 102, 34, .08)); }
.nav-item.active span { color: #ff884a; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 20px 8px 4px; color: #778396; font-size: 11px; }
.text-button { padding: 0; border: 0; color: #ff995f; background: none; font-size: 11px; font-weight: 700; }

.workspace { min-width: 0; }
.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px clamp(22px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid #dbe8e1;
  border-radius: 999px;
  color: #33654e;
  background: #f4fbf7;
  font-size: 11px;
  font-weight: 750;
}
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: #28a46c; box-shadow: 0 0 0 4px rgba(40, 164, 108, .12); }
main { width: min(1240px, 100%); margin: 0 auto; padding: 34px clamp(22px, 4vw, 54px) 64px; outline: none; }

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.hero h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.025em; }
.hero p { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.55; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.metric::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--orange); }
.metric span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { display: block; font-size: 30px; letter-spacing: -.04em; }
.metric small { color: var(--muted); }

.card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.card-header h3, .card h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card.subtle { background: #fafbfc; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.field { display: grid; align-content: start; gap: 7px; }
label, .label { color: #3c4655; font-size: 12px; font-weight: 750; }
input, textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8dde5;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: #f7945e; box-shadow: 0 0 0 3px rgba(242, 102, 34, .12); }
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #4d5968;
  font-size: 12px;
  font-weight: 600;
}
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--orange); }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  color: #364151;
  background: white;
  font-weight: 750;
  font-size: 12px;
}
.button:hover { border-color: #b8c0cc; background: #fafbfc; }
.button.primary { border-color: var(--orange); color: white; background: var(--orange); }
.button.primary:hover { border-color: var(--orange-dark); background: var(--orange-dark); }
.button.danger { border-color: #f2c4c7; color: var(--red); background: var(--red-soft); }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.button.full { width: 100%; margin-top: 9px; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.mobile-only { display: none; }

.notice { margin-bottom: 16px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.notice.info { color: #245777; border-color: #c8e2f0; background: #eef8fc; }
.notice.warn { color: #7c5508; border-color: #efdda6; background: var(--amber-soft); }
.notice.error { color: #963039; border-color: #f2c8cb; background: var(--red-soft); }
.notice.success { color: #176343; border-color: #bfe3d2; background: var(--green-soft); }
.service-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.service-item { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; font-weight: 700; }
.service-dot { width: 8px; height: 8px; border-radius: 50%; background: #bdc5d0; }
.service-item.ready .service-dot { background: #26a26a; box-shadow: 0 0 0 4px rgba(38, 162, 106, .11); }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #f6f7f9; }
.segmented button { padding: 7px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(25, 33, 47, .08); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: white; font-size: 12px; }
th { padding: 11px 13px; color: #6c7787; background: #f8f9fb; text-align: left; font-size: 10px; letter-spacing: .055em; text-transform: uppercase; }
td { padding: 12px 13px; border-top: 1px solid #edf0f4; vertical-align: top; }
tbody tr:hover { background: #fffaf7; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.badge.success { color: var(--green); background: var(--green-soft); }
.badge.warning { color: var(--amber); background: var(--amber-soft); }
.badge.failed { color: var(--red); background: var(--red-soft); }
.badge.neutral { color: #586476; background: #edf0f4; }
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.result-summary div { padding: 13px; border-radius: 11px; background: #f8f9fb; }
.result-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.result-summary strong { display: block; margin-top: 4px; font-size: 20px; }
.empty { padding: 38px 20px; color: var(--muted); text-align: center; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar .field { min-width: 160px; flex: 1; }
.toolbar .button { flex: 0 0 auto; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; padding: 3px 7px; border-radius: 6px; color: #685241; background: #f6eee8; font-size: 10px; font-weight: 700; }
.code-line { margin: 0 0 7px; padding: 10px 12px; border-radius: 8px; color: #dbe1e9; background: #1c2633; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }

.toast-region { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .18s ease-out; }
.toast.error { color: var(--red); border-color: #f1c6c9; }
.toast.success { color: var(--green); border-color: #bae0cc; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading-overlay { position: fixed; z-index: 60; inset: 0; display: grid; place-content: center; justify-items: center; color: white; background: rgba(15, 21, 30, .58); backdrop-filter: blur(3px); }
.loading-overlay p { font-size: 12px; font-weight: 750; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.28); border-top-color: white; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); width: 258px; transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .mobile-only { display: inline-grid; place-items: center; }
  .metrics, .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .service-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-card { padding: 30px 24px; }
  .topbar { min-height: 78px; padding: 15px 18px; }
  .topbar .eyebrow, .status-pill { display: none; }
  .topbar h1 { font-size: 21px; }
  main { padding: 24px 16px 50px; }
  .hero { display: block; }
  .hero .button { margin-top: 14px; }
  .metrics { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
}
