:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee9;
  --brand: #0e6f68;
  --brand-2: #1c4e80;
  --accent: #d99a2b;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
button:hover { filter: brightness(0.96); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--danger); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  margin-top: 6px;
}
textarea { resize: vertical; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
label { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: 0; font-size: 12px; font-weight: 800; }

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
}
.brand-panel {
  padding: 9vw;
  background: linear-gradient(135deg, #e9f4f1, #eef3fa 55%, #fff8ea);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-panel h1 { font-size: 72px; margin-bottom: 10px; }
.brand-panel p { max-width: 620px; font-size: 20px; color: #344054; line-height: 1.65; }
.brand-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.brand-grid span { background: rgba(255,255,255,0.75); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; font-weight: 800; }
.login-card {
  align-self: center;
  justify-self: center;
  width: min(430px, 88%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card label { margin-bottom: 16px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.logo { display: flex; align-items: baseline; justify-content: space-between; }
.logo strong { font-size: 24px; }
.logo span { color: var(--accent); font-weight: 800; }
nav { display: grid; gap: 8px; }
.nav-btn { background: transparent; color: var(--muted); text-align: left; }
.nav-btn.active { background: #e8f3f1; color: var(--brand); }
.workspace { padding: 24px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tab { display: none; }
.tab.active { display: block; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric, .panel, .portal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}
.metric { padding: 18px; }
.metric span { color: var(--muted); font-weight: 800; font-size: 13px; }
.metric strong { display: block; font-size: 36px; margin-top: 8px; }
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.plain-list { line-height: 1.9; color: #344054; }
.split { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 16px; align-items: start; }
.customer-list { display: grid; gap: 8px; margin-top: 12px; }
.customer-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  background: #fff;
}
.customer-item.active { border-color: var(--brand); background: #f1faf8; }
.customer-item strong { display: block; }
.customer-item span { color: var(--muted); font-size: 13px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.editor { display: grid; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.form-section h4 {
  margin: 0;
  font-size: 15px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head button,
.repeat-head button {
  background: #eef4f8;
  color: var(--brand-2);
  border: 1px solid #d6e2ea;
  padding: 8px 10px;
}
.repeat-list {
  display: grid;
  gap: 12px;
}
.repeat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.repeat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.repeat-head strong {
  color: var(--ink);
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); }
.event-list { display: grid; gap: 10px; }
.event {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.event code { color: var(--brand-2); }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.portal-card { padding: 18px; }
.portal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.portal-actions a {
  text-decoration: none;
  color: #fff;
  background: var(--brand-2);
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .login-view, .shell, .split, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-panel { padding: 36px 24px; }
  .brand-panel h1 { font-size: 46px; }
  .workspace { padding: 14px; }
}
