:root {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #24324a;
  background: #f5f7fb;
  font-synthesis: none;
  --blue: #2563eb;
  --muted: #66758b;
  --border: #e6ebf2;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button, a { transition: background-color .15s, color .15s, box-shadow .15s; }
:focus-visible { outline: 3px solid #6090f0; outline-offset: 3px; }
button svg, a svg { flex-shrink: 0; }
a { color: #245bc1; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1440px; min-height: 88px; margin: auto; padding: 18px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 750; letter-spacing: -.3px; }
.brand-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--blue); }
.brand-subtitle { display: block; color: var(--muted); font-size: .6875rem; letter-spacing: 1.4px; font-weight: 600; margin-top: 1px; }
.course-tag { color: #53627a; font-size: .875rem; }
.course-tag span { color: #bac4d3; padding: 0 10px; }
.page { max-width: 1440px; margin: auto; padding: 30px 48px 48px; }
.breadcrumb { display: flex; gap: 12px; align-items: center; font-size: .875rem; color: var(--muted); }
.breadcrumb span { color: #a7b2c2; }
.breadcrumb strong { color: #44516a; font-weight: 500; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 36px 0 32px; }
.eyebrow { color: #55708d; font-size: .75rem; font-weight: 700; letter-spacing: 1.5px; margin-bottom: 8px; }
h1 { font-size: clamp(1.8rem, 3.1vw, 2.5rem); line-height: 1.25; font-weight: 750; letter-spacing: -1.2px; color: #17253e; }
.title-dot { color: var(--blue); }
.description { margin-top: 12px; color: var(--muted); }
.total-card { display: flex; align-items: center; gap: 17px; padding: 18px 25px; min-width: 217px; border: 1px solid #dfe7f3; border-radius: 14px; background: #fff; }
.total-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 13px; color: var(--blue); background: #edf3ff; }
.total-label { color: var(--muted); font-size: .875rem; }
.total-card strong { display: block; font-size: 1.8rem; line-height: 1.2; margin-top: 3px; font-weight: 700; letter-spacing: -.6px; color: #20365a; }
.directory { background: #fff; border: 1px solid #dfe6ef; border-radius: 16px; box-shadow: 0 5px 18px #1c355006; overflow: hidden; }
.directory-heading { padding: 26px 28px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h2 { color: #1e2d46; font-size: 1.125rem; letter-spacing: -.3px; }
.directory-heading p { margin-top: 5px; color: var(--muted); font-size: .875rem; }
.section-badge { color: #466185; font-size: .8125rem; font-weight: 600; border: 1px solid #e6edf6; border-radius: 6px; padding: 4px 10px; background: #f6f8fc; }
.toolbar { padding: 24px 28px; display: flex; justify-content: space-between; gap: 20px; }
.search-box { position: relative; max-width: 450px; flex: 1; }
.search-box > svg { position: absolute; left: 15px; top: 14px; color: #8592a6; pointer-events: none; }
.search-box input { width: 100%; height: 48px; border: 1px solid #dfe5ee; border-radius: 9px; padding: 10px 15px 10px 45px; color: #24324a; background: #fafbfd; font-size: .9375rem; }
input::placeholder { color: #7c899d; opacity: 1; }
.search-box input:focus { border-color: #779ef0; outline: 3px solid #e8efff; background: #fff; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 8px; font-size: .9375rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 3px #2563eb12; }
.button-primary:hover:not(:disabled) { background: #1d4ed8; }
.button-secondary { color: #45536a; border-color: #dce3ed; background: #fff; }
.button-secondary:hover { background: #f2f5f9; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
th { background: #f8fafc; color: #6a778c; font-size: .875rem; font-weight: 600; padding: 14px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 19px 14px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 28px; }
th:last-child, td:last-child { padding-right: 28px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcff; }
.id-cell { color: #77859b; font-variant-numeric: tabular-nums; font-size: .875rem; }
.person { display: flex; align-items: center; gap: 11px; min-width: 195px; }
.avatar { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; background: #edf3ff; color: #416cbd; border-radius: 50%; font-size: .75rem; font-weight: 700; }
.avatar-1 { background: #eaf4f0; color: #317c67; }
.avatar-2 { background: #f2edfb; color: #8260b6; }
.avatar-3 { background: #fff2e8; color: #a56832; }
.person-name { font-weight: 600; display: block; color: #28374f; overflow-wrap: anywhere; max-width: 250px; }
.secondary-text { color: #6d7b91; font-size: .875rem; display: block; margin-top: 4px; overflow-wrap: anywhere; }
.address-cell { min-width: 155px; max-width: 220px; overflow-wrap: anywhere; }
.email-cell { min-width: 170px; max-width: 230px; overflow-wrap: anywhere; }
.phone-cell { min-width: 145px; max-width: 175px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.website-link { display: inline-block; max-width: 150px; overflow-wrap: anywhere; text-decoration: none; font-size: .875rem; }
.website-link:hover { text-decoration: underline; }
.muted { color: #9aa5b5; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: .875rem; white-space: nowrap; }
.edit-button { color: #45669f; }
.edit-button:hover { background: #edf3ff; border-color: #dce7fc; }
.delete-button { color: #b25e68; }
.delete-button:hover { background: #fff0f2; border-color: #f6dce0; }
.table-footer { padding: 17px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); color: #738096; font-size: .875rem; }
.table-footer strong { color: #455770; font-weight: 600; }
.table-hint { color: #8a95a6; font-size: .75rem; }
.page-footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 22px; color: #79869a; font-size: .8125rem; }
.page-footer > span { display: flex; align-items: center; gap: 7px; }
.page-footer svg { flex-shrink: 0; }
.page-footer a { color: #6d7f98; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; padding: 65px 24px; min-height: 300px; border-top: 1px solid var(--border); }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; color: #6f8cb7; background: #f0f5fc; margin-bottom: 18px; }
.empty-state h3 { font-size: 1.1rem; color: #344662; }
.empty-state p { font-size: .9375rem; color: var(--muted); max-width: 470px; margin-top: 8px; }
.empty-state .button { margin-top: 20px; }
.spinner { width: 32px; height: 32px; border: 3px solid #e3eafb; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.storage-warning { padding: 12px 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; border-radius: 8px; color: #8b581b; background: #fff2dd; font-size: .875rem; }
.storage-warning svg { flex-shrink: 0; }
.user-dialog { border: 1px solid #e1e7f0; padding: 0; width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 48px); border-radius: 16px; color: #24324a; box-shadow: 0 24px 80px #0c1d3940; }
.user-dialog::backdrop { background: #12213c70; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 28px 23px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { font-size: 1.4rem; }
.dialog-heading .eyebrow { font-size: .6875rem; margin-bottom: 6px; }
.icon-button { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: #718096; }
.icon-button:hover { background: #edf1f7; color: #33445f; }
.dialog-body { padding: 23px 28px 28px; }
.form-note { color: var(--muted); font-size: .875rem; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-field label { display: block; font-size: .875rem; font-weight: 600; color: #41506a; margin-bottom: 7px; }
.required { color: #c04c5d; }
.form-field input { width: 100%; min-height: 44px; border: 1px solid #d9e1ec; border-radius: 7px; padding: 10px 12px; color: #24324a; background: #fff; font-size: 1rem; }
.form-field input:focus { outline: 3px solid #e8efff; border-color: #779ef0; }
.form-field input[aria-invalid="true"] { border-color: #d17883; }
.field-error { display: block; color: #b43d50; font-size: .8125rem; margin-top: 5px; }
fieldset { margin: 26px 0 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
legend { color: #708098; font-size: .8125rem; font-weight: 600; padding-right: 12px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--border); background: #fafbfd; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); padding: 12px 14px 12px 18px; border: 1px solid #dce6e1; border-radius: 12px; background: #fff; box-shadow: 0 8px 35px #243b5c24; font-size: .875rem; }
.toast [role="status"] { overflow-wrap: anywhere; min-width: 0; }
.toast-check { display: grid; place-items: center; flex-shrink: 0; width: 27px; height: 27px; background: #e7f5ed; color: #38865c; border-radius: 50%; }
.undo-button { padding: 6px 3px; color: var(--blue); border: 0; background: transparent; font-weight: 600; white-space: nowrap; }
.boot-screen { max-width: 650px; margin: 100px auto; padding: 28px; }
.boot-screen p { color: var(--muted); margin-top: 16px; }

@media (min-width: 1500px) { .page { padding-top: 40px; } .page-heading { margin-top: 44px; margin-bottom: 40px; } }
@media (max-width: 1050px) { .topbar-inner, .page { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 700px) {
  .topbar-inner { min-height: 76px; padding: 16px 20px; }
  .course-tag { display: none; }
  .page { padding: 22px 16px 32px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 22px; margin-top: 28px; margin-bottom: 24px; }
  .total-card { padding: 12px 18px; gap: 14px; min-width: 0; }
  .total-card > div { display: flex; align-items: center; justify-content: space-between; flex: 1; }
  .total-card strong { margin-top: 0; font-size: 1.6rem; }
  .total-icon { width: 40px; height: 40px; }
  .directory-heading { padding: 22px 18px 0; }
  .section-badge { display: none; }
  .toolbar { padding: 20px 18px; flex-direction: column; gap: 12px; }
  .search-box { max-width: none; }
  .toolbar > .button { align-self: flex-start; }
  .table-footer { padding: 16px 18px; }
  .table-hint { display: none; }
  .page-footer { flex-direction: column; gap: 9px; padding: 0 3px; }
  .dialog-heading { padding: 22px 20px; }
  .dialog-heading h2 { font-size: 1.2rem; }
  .dialog-body { padding: 20px; }
  .dialog-footer { padding: 16px 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .toast { bottom: 16px; gap: 8px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }
