:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% -5%, rgba(77, 110, 255, .12), transparent 28rem),
    #f4f7fb;
}

button, input { font: inherit; }
button, .button { touch-action: manipulation; }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 19px; letter-spacing: -.02em; }

.muted { color: #68758b; line-height: 1.55; }
.eyebrow { color: #5368e8; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.hidden { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid #dfe5ef;
  background: rgba(255, 255, 255, .91);
  backdrop-filter: blur(14px);
}

.top-actions, .inline-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.workspace {
  width: min(1160px, calc(100vw - 32px));
  margin: 24px auto 52px;
}

.panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #dfe5ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(40, 55, 85, .055);
}

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

.panel-heading p { margin-bottom: 0; }

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

.metric {
  padding: 17px;
  border: 1px solid #e1e6f0;
  border-radius: 10px;
  background: linear-gradient(145deg, #fbfcff, #f6f8fc);
}

.metric strong {
  display: block;
  margin-bottom: 3px;
  color: #1d2940;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
}

.metric span { color: #6c788c; font-size: 13px; }

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #cbd4e2;
  border-radius: 8px;
  background: #fff;
  color: #243149;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover, button:hover { border-color: #9facbf; }
.button:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(71, 99, 238, .25); outline-offset: 2px; }
.button.primary, button.primary { border-color: #4c63e9; background: #4c63e9; color: #fff; }
.button.danger, button.danger { border-color: #efc9c9; color: #ad3232; }
.wide { width: 100%; }
button:disabled { cursor: not-allowed; opacity: .48; }

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #bdd8c6;
  border-radius: 9px;
  background: #eff9f2;
  color: #1f6940;
  line-height: 1.5;
}

.notice.error { border-color: #f0c4c0; background: #fff2f1; color: #a93229; }

.file-drop {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px dashed #aebbd0;
  border-radius: 10px;
  background: #f9fbff;
  cursor: pointer;
}

.file-drop:hover { border-color: #657bed; background: #f6f8ff; }
.file-drop span { color: #6a778d; font-size: 13px; }
.file-drop input { margin-top: 9px; }

.preview {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f4f6f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.preview.error { background: #fff2f1; color: #a93229; }

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 0;
  color: #35425a;
}

.confirm-row input { width: 17px; height: 17px; margin-top: 2px; }

.table-scroll { overflow-x: auto; border: 1px solid #e1e6f0; border-radius: 9px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 13px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: top; }
th { background: #f7f9fc; color: #68758a; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
td { color: #334058; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }

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

.login-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid #dce3ee;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(36, 50, 77, .13);
}

.login-card h1 { margin-top: 6px; }
.login-card label { display: block; margin: 22px 0 8px; font-weight: 700; }
.login-card input[type="password"] {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #cbd4e2;
  border-radius: 8px;
  background: #fff;
}
.login-card button { margin-top: 14px; }

@media (max-width: 800px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .panel-heading { align-items: stretch; flex-direction: column; }
}

@media (max-width: 480px) {
  .workspace { width: min(100% - 20px, 1160px); margin-top: 10px; }
  .panel { padding: 16px; border-radius: 10px; }
  .metrics { grid-template-columns: 1fr; }
  .topbar { padding: 16px; }
  .button, button { width: 100%; }
  .top-actions, .inline-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
