:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #637078;
  --line: #dce2e5;
  --surface: #ffffff;
  --canvas: #f4f6f7;
  --primary: #166b55;
  --primary-dark: #0f513f;
  --accent: #d87918;
  --danger: #b33a3a;
  --shadow: 0 12px 32px rgba(24, 32, 38, .08);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; letter-spacing: 0; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar { height: 64px; padding: 0 max(24px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; background: #172127; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #ec6a3c; color: #fff; }
.ghost-button { min-height: 36px; border: 1px solid rgba(255,255,255,.32); border-radius: 6px; background: transparent; color: #fff; padding: 0 14px; }
.top-actions { display: flex; gap: 8px; }
.customer-layout, .admin-layout { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.intro-band { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 800; }
h1, h2, p { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(32px, 6vw, 52px); line-height: 1.08; }
.supporting { max-width: 580px; margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.queue-indicator { display: flex; align-items: center; gap: 9px; color: var(--primary); font-weight: 700; white-space: nowrap; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #2aa67d; box-shadow: 0 0 0 5px rgba(42,166,125,.14); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 34px 0 56px; }
.tool-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-heading h2 { margin: 0; font-size: 20px; }
.step-label { color: var(--muted); font-size: 12px; font-weight: 700; }
label { display: block; margin: 16px 0 7px; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #cbd3d7; border-radius: 6px; background: #fff; color: var(--ink); outline: none; }
input { height: 46px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,107,85,.12); }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.field-button { position: absolute; right: 5px; top: 5px; height: 36px; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; }
.cdk-field { position: relative; }
.cdk-field input { padding-right: 108px; font-family: Consolas, monospace; }
.cdk-actions { position: absolute; right: 5px; top: 5px; display: flex; height: 36px; }
.cdk-actions .field-button { position: static; height: 36px; padding: 0 8px; }
.cdk-actions .verify-button { border-left: 1px solid var(--line); }
.field-feedback { min-height: 18px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.field-feedback.valid { color: var(--primary); font-weight: 700; }
.field-feedback.error { color: var(--danger); font-weight: 700; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; color: #435159; font-weight: 500; line-height: 1.45; }
.check-row input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); }
.primary-button, .secondary-button { width: 100%; min-height: 44px; border-radius: 6px; padding: 0 16px; font-weight: 700; }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { margin-top: 16px; border: 1px solid #26343b; background: #26343b; color: #fff; }
button:disabled { cursor: wait; opacity: .62; }
.form-note, .feedback { margin: 12px 0 0; min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.feedback { color: var(--primary); font-weight: 700; }
.feedback.error { color: var(--danger); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 20px; }
.empty-state { display: grid; min-height: 174px; place-items: center; align-content: center; color: var(--muted); border: 1px dashed #cbd3d7; border-radius: 6px; }
.empty-state p { margin: 10px 0 0; }
.empty-code { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #edf2f1; color: var(--primary); font-weight: 800; }
.status-line { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #839098; }
.status-succeeded { background: #24916e; }.status-failed { background: var(--danger); }.status-running { background: #2b78c5; }.status-review, .status-waiting_resources, .status-stopping, .status-stopped { background: var(--accent); }
.status-details dl { margin: 20px 0 0; }
.status-details dl div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0f1; }
dt { color: var(--muted); } dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.result-message { margin: 18px 0 0; padding: 13px 14px; border-left: 3px solid var(--primary); background: #f0f6f4; }
.result-message strong, .result-message p, .result-message small { display: block; }
.result-message strong { margin-top: 4px; font-size: 14px; }
.result-message p { margin: 7px 0 0; color: #314048; font-size: 13px; line-height: 1.55; }
.result-message small { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.result-label { color: var(--primary); font-size: 11px; font-weight: 800; }
.progress-summary { margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf0f1; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-meta strong { font-size: 14px; }
.progress-meta span { color: var(--primary); font-size: 13px; font-weight: 800; }
.progress-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 4px; background: #e8edef; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .35s ease; }
.progress-live { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.progress-steps { display: grid; gap: 0; margin: 20px 0 0; padding: 0; list-style: none; }
.progress-step { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 11px; min-height: 54px; }
.progress-step:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: #dce2e5; }
.progress-marker { z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #cbd3d7; border-radius: 50%; background: #fff; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-copy { min-width: 0; padding: 3px 0 12px; }
.progress-copy strong, .progress-copy small { display: block; }
.progress-copy strong { font-size: 13px; }
.progress-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.progress-complete .progress-marker { border-color: var(--primary); background: var(--primary); color: #fff; }
.progress-complete:not(:last-child)::after { background: var(--primary); }
.progress-active .progress-marker { border-color: #2b78c5; background: #e4eef8; color: #245f9a; box-shadow: 0 0 0 4px rgba(43,120,197,.10); }
.progress-active .progress-copy strong { color: #245f9a; }
.progress-failed .progress-marker { border-color: var(--danger); background: var(--danger); color: #fff; }
.progress-failed .progress-copy strong { color: var(--danger); }
.progress-warning .progress-marker { border-color: var(--accent); background: var(--accent); color: #fff; }
.progress-warning .progress-copy strong { color: #9a5714; }
footer { padding: 22px; text-align: center; color: var(--muted); font-size: 12px; }

.login-body { min-height: 100vh; background: #eef2f3; }
.login-layout { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.login-panel h1 { font-size: 30px; }
.login-button { margin-top: 24px; }

.admin-body { background: #f5f7f8; }
.admin-layout { padding: 26px 0 60px; }
.metrics-band { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: #fff; }
.metric { min-height: 92px; padding: 18px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 9px; font-size: 28px; }
.metric.active strong { color: #2b78c5; }.metric.success strong { color: var(--primary); }.metric.warning strong { color: var(--accent); }.metric.resource strong { color: #7a4d9d; }.metric.cdk strong { color: #a34f13; }
.tabs { display: flex; gap: 4px; margin: 26px 0 0; border-bottom: 1px solid var(--line); }
.tab { min-height: 42px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.tab.active { border-bottom-color: var(--primary); color: var(--ink); }
.admin-section { padding-top: 28px; }
.section-heading h1 { font-size: 26px; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e7ebed; text-align: left; font-size: 13px; }
th { color: var(--muted); background: #f8f9fa; font-size: 11px; }
tbody tr:hover { background: #fafcfc; }
.result-cell { min-width: 190px; white-space: normal; }
.result-cell strong, .result-cell small { display: block; }
.result-cell strong { font-size: 12px; }
.result-cell small { margin-top: 3px; color: var(--muted); font-family: Consolas, monospace; font-size: 10px; }
.mono { font-family: Consolas, monospace; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; background: #edf0f1; color: #46545c; font-size: 11px; font-weight: 800; }
.badge-succeeded, .badge-available { background: #e4f3ee; color: #146149; }.badge-failed, .badge-consumed { background: #f8e7e7; color: #922f2f; }.badge-running, .badge-leased { background: #e4eef8; color: #245f9a; }.badge-review, .badge-waiting_resources, .badge-stopping { background: #fff0df; color: #9a5714; }.badge-stopped { background: #edf0f1; color: #59666d; }
.badge-active { background: #e4f3ee; color: #146149; }.badge-disabled { background: #edf0f1; color: #59666d; }.badge-exhausted { background: #f8e7e7; color: #922f2f; }
.actions { display: flex; gap: 6px; }
.table-button { min-height: 30px; padding: 0 9px; border: 1px solid #b9c5ca; border-radius: 5px; background: #fff; color: var(--ink); font-size: 12px; }
.table-button.danger { color: var(--danger); border-color: #e4bcbc; }
.empty-cell { padding: 36px; text-align: center; color: var(--muted); }
.resource-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.5fr); gap: 20px; align-items: start; }
.import-panel { padding: 20px; border: 1px solid var(--line); background: #fff; }
.import-panel label { margin-top: 0; }
.import-panel > .primary-button { margin-top: 16px; }
.edu-list-panel { min-width: 0; }
.table-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 8px; margin-bottom: 10px; }
.table-toolbar input { height: 38px; }
.table-toolbar .table-button { min-height: 38px; padding: 0 14px; }
.bulk-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 42px; margin-bottom: 8px; }
.bulk-toolbar .bulk-feedback { flex: 1 1 220px; margin: 0 0 0 4px; text-align: right; }
.select-column { width: 42px; padding-right: 4px; text-align: center; }
.select-column input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }
.edu-row-selected { background: #f2f8f5; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 4px 0; font-size: 12px; }
.pagination-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.pagination-actions .icon-button { width: 34px; height: 34px; font-size: 20px; }
.pagination-actions .icon-button:disabled { cursor: default; }
.compact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.generated-output { margin-top: 16px; }
.generated-output textarea { min-height: 150px; font-family: Consolas, monospace; }
.inline-buttons { display: flex; gap: 8px; margin-top: 10px; }
.inline-buttons .primary-button, .inline-buttons .secondary-button { width: auto; flex: 1; margin-top: 0; }
dialog { width: min(900px, calc(100% - 24px)); max-height: min(720px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(17, 26, 31, .58); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
dialog pre { max-height: 620px; margin: 0; padding: 16px; overflow: auto; background: #11191d; color: #dbe5e8; font: 12px/1.55 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .intro-band { align-items: flex-start; flex-direction: column; justify-content: center; }
  .tool-grid, .resource-layout { grid-template-columns: 1fr; }
  .metrics-band { grid-template-columns: repeat(2, 1fr); }
  .metric { border-bottom: 1px solid var(--line); }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .customer-layout, .admin-layout { width: min(100% - 20px, 1120px); }
  .tool-panel { padding: 20px; }
  h1 { font-size: 34px; }
  .metrics-band { grid-template-columns: 1fr 1fr; }
  .table-toolbar { grid-template-columns: 1fr auto; }
  .table-toolbar #eduSearch { grid-column: 1 / -1; }
  .bulk-toolbar .bulk-feedback { flex-basis: 100%; text-align: left; }
  .table-pagination { align-items: flex-start; flex-direction: column; }
}
