:root {
  color-scheme: light;
  --navy: #0b2d5d;
  --navy-dark: #071f42;
  --blue: #173f78;
  --cyan: #39d6ff;
  --gold: #f4b72b;
  --gold-soft: #fff5d8;
  --ink: #102747;
  --muted: #657995;
  --line: #d8e3f0;
  --surface: #ffffff;
  --page: #f3f7fb;
  --success: #16734a;
  --danger: #a52d3e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: linear-gradient(180deg, #eef4fa 0%, var(--page) 100%); }
.admin-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 56px; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 6px; color: #3b77a6; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; color: var(--navy-dark); font-size: clamp(30px, 5vw, 48px); line-height: 1; }
.subline { margin: 10px 0 0; color: var(--muted); }
.back-link, button { border: 1px solid #b8cae0; border-radius: 9px; font: inherit; font-weight: 750; cursor: pointer; }
.back-link { display: inline-flex; align-items: center; padding: 11px 16px; color: #fff; background: var(--blue); text-decoration: none; box-shadow: 0 4px 0 rgba(7,31,66,.18); }
.back-link:hover, button:hover { filter: brightness(1.05); }
.admin-card, .admin-section { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.95); box-shadow: 0 12px 30px rgba(11,45,93,.08); }
.admin-card { max-width: 570px; padding: 26px; }
.admin-card h2, .admin-section h2 { margin: 0 0 8px; color: var(--navy-dark); font-size: 21px; }
.admin-card p { color: var(--muted); line-height: 1.5; }
.notice { margin: 16px 0; padding: 12px 14px; border: 1px solid #f0ce75; border-radius: 10px; color: #5b4610; background: var(--gold-soft); font-size: 13px; line-height: 1.45; }
.form-grid { display: grid; gap: 13px; }
label { display: grid; gap: 6px; color: var(--navy); font-size: 13px; font-weight: 750; }
input, select { width: 100%; min-height: 42px; border: 1px solid #bfd0e2; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: #fbfdff; font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(57,214,255,.25); border-color: #4aa6d8; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button { min-height: 40px; padding: 9px 14px; color: #fff; background: var(--blue); }
button.secondary { color: var(--navy); background: #edf3f9; }
button.danger { background: var(--danger); }
.form-error { margin: 12px 0 0; color: var(--danger); font-size: 13px; font-weight: 700; }
.form-success { margin: 12px 0 0; color: var(--success); font-size: 13px; font-weight: 700; }
.admin-dashboard { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 18px; }
.admin-section { padding: 22px; }
.admin-section.wide { grid-column: 1 / -1; }
.section-copy { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.status-list { display: grid; gap: 10px; margin: 0; }
.status-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #e5edf5; }
.status-row:last-child { border-bottom: 0; }
.status-row span:first-child { color: var(--muted); }
.status-row strong { color: var(--navy); text-align: right; }
.admin-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #075b3e; background: #dff6ea; font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.profile-log { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.profile-log th { padding: 11px 12px; color: #fff; background: var(--navy); text-align: left; white-space: nowrap; }
.profile-log td { padding: 11px 12px; border-top: 1px solid #e5edf5; vertical-align: top; white-space: nowrap; }
.profile-log tr:nth-child(even) td { background: #f8fbfe; }
.profile-log td strong, .profile-log td small { display: block; }
.profile-link { min-height: 0; padding: 0; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; color: var(--blue); background: transparent; font: inherit; font-weight: 800; text-align: left; }
.profile-link:hover { color: var(--navy-dark); filter: none; }
.profile-link:focus { outline: 3px solid rgba(57,214,255,.28); outline-offset: 3px; }
.profile-log td small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.profile-log td.recent-activity { color: var(--muted); font-size: 11px; line-height: 1.45; white-space: normal; min-width: 190px; }
.profile-details { margin-top: 18px; padding: 18px; border: 1px solid #bfd0e2; border-radius: 12px; background: #f8fbfe; }
.profile-details-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.profile-details-head h3 { margin: 4px 0 0; color: var(--navy-dark); font-size: 20px; }
.profile-details-head .eyebrow { margin: 0; }
.profile-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 18px; border: 1px solid #e0e9f2; border-radius: 9px; overflow: hidden; background: #e0e9f2; }
.profile-detail-grid > div { display: grid; gap: 4px; min-height: 58px; padding: 10px; background: #fff; }
.profile-detail-grid span { color: var(--muted); font-size: 11px; }
.profile-detail-grid strong { color: var(--navy); font-size: 13px; overflow-wrap: anywhere; }
.profile-details h4 { margin: 14px 0 8px; color: var(--navy-dark); }
.profile-detail-log { min-width: 620px; }
.profile-detail-log td:last-child { white-space: normal; overflow-wrap: anywhere; }
.grant-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.2fr) 150px auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.grant-form button, .small-button { min-height: 40px; border: 1px solid #b8cae0; border-radius: 9px; padding: 9px 13px; color: #fff; background: var(--blue); font: inherit; font-weight: 750; cursor: pointer; }
.small-button { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.grant-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #7c4b08; background: #fff0c8; font-size: 12px; font-weight: 750; }
.grant-status.active { color: #075b3e; background: #dff6ea; }
.admin-footer-note { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 760px) {
  .admin-header { flex-direction: column; }
  .admin-dashboard { grid-template-columns: 1fr; }
  .admin-section.wide { grid-column: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .grant-form { grid-template-columns: 1fr; }
  .profile-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
