:root {
  --ink: #17212b;
  --muted: #66727d;
  --line: #dce3e8;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --blue: #1b5f78;
  --blue-soft: #e5f1f4;
  --gold: #c78b28;
  --green: #27745c;
  --shadow: 0 18px 45px rgba(35, 54, 64, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(circle at 100% 0, #e7f0ee 0, transparent 31rem), var(--paper);
  font-family: Georgia, 'Times New Roman', serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 72px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font: 700 0.72rem/1.2 Arial, sans-serif; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 0.95; letter-spacing: -0.04em; font-weight: 500; }
h2 { margin-bottom: 0; font-size: 2rem; letter-spacing: -0.03em; font-weight: 500; }
h3 { margin-bottom: 8px; font-size: 1.3rem; }
.subtitle { max-width: 530px; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.status-pill { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.72); color: var(--muted); font: 600 0.76rem Arial, sans-serif; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.status-pill.api-mode .status-dot { background: var(--green); }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 34px; }
.summary-card { padding: 22px 24px; border: 1px solid var(--line); border-top: 3px solid; background: rgba(255,255,255,0.76); box-shadow: var(--shadow); }
.accent-blue { border-top-color: var(--blue); }
.accent-gold { border-top-color: var(--gold); }
.accent-green { border-top-color: var(--green); }
.summary-label { display: block; margin-bottom: 12px; color: var(--muted); font: 700 0.72rem Arial, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.summary-card strong { font-size: 2rem; font-weight: 500; }

.workspace { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.section-heading, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading { padding: 28px 30px 22px; }
.toolbar { padding: 0 30px 22px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; align-items: center; gap: 10px; width: min(440px, 100%); padding: 10px 13px; border: 1px solid var(--line); color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font: 0.9rem Arial, sans-serif; }
.record-count { color: var(--muted); font: 0.8rem Arial, sans-serif; }
.button { border: 0; padding: 12px 17px; font: 700 0.82rem Arial, sans-serif; transition: transform 160ms ease, background 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: #144b60; }
.button-secondary { color: var(--blue); border: 1px solid #b9d0d7; background: var(--blue-soft); }
.button-quiet { color: var(--muted); background: transparent; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: 15px 30px; color: var(--muted); font: 700 0.68rem Arial, sans-serif; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; }
td { padding: 19px 30px; border-top: 1px solid #edf0f1; font-size: 0.98rem; }
.employee-name { display: block; margin-bottom: 4px; font-weight: 700; }
.employee-email { color: var(--muted); font: 0.78rem Arial, sans-serif; }
.actions { display: flex; justify-content: flex-end; gap: 7px; }
.action-button { padding: 7px 10px; border: 1px solid var(--line); color: var(--blue); background: transparent; font: 700 0.72rem Arial, sans-serif; }
.action-button.delete { color: #a0473c; }
.empty-state { padding: 65px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 15px; border: 1px solid #b9d0d7; border-radius: 50%; color: var(--blue); font-size: 1.5rem; }
.empty-state p { margin-bottom: 20px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

 dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; box-shadow: 0 22px 80px rgba(23, 33, 43, 0.25); }
 dialog::backdrop { background: rgba(23, 33, 43, 0.42); }
 dialog form { padding: 30px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.dialog-heading h2 { font-size: 1.8rem; }
.icon-button { width: 32px; height: 32px; border: 0; color: var(--muted); background: #f1f4f3; font-size: 1.4rem; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid label { color: var(--muted); font: 700 0.72rem Arial, sans-serif; }
.form-grid input { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); outline: 0; color: var(--ink); font: 0.9rem Arial, sans-serif; }
.form-grid input:focus, .search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.full-width { grid-column: 1 / -1; }
.form-error { min-height: 20px; margin: 15px 0 0; color: #a0473c; font: 0.8rem Arial, sans-serif; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 320px; padding: 13px 16px; color: white; background: var(--ink); box-shadow: var(--shadow); font: 0.8rem Arial, sans-serif; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .topbar, .section-heading, .toolbar { align-items: flex-start; flex-direction: column; }
  .topbar { margin-bottom: 28px; }
  .status-pill { align-self: flex-start; }
  .summary-grid { gap: 8px; }
  .summary-card { padding: 15px; }
  .summary-card strong { font-size: 1.35rem; }
  .summary-label { font-size: 0.6rem; }
  .section-heading, .toolbar { padding-left: 18px; padding-right: 18px; }
  .search-field { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
}
