.admin-page { min-height: 100vh; background: #f1eaf2; }
.admin-header { width: min(1180px, calc(100% - 2rem)); min-height: 72px; margin: 1rem auto 0; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; background: var(--paper); border: 1px solid #e3d7e5; border-radius: 1rem; }
.admin-back, .quiet-button { border: 0; background: none; color: var(--forest); cursor: pointer; font: inherit; font-size: .88rem; font-weight: 700; }
.admin-back:hover, .quiet-button:hover { text-decoration: underline; text-underline-offset: .2rem; }
.admin-main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) 0; }
.login-card { width: min(560px, 100%); margin: 2rem auto; padding: clamp(2rem, 6vw, 4rem); background: var(--paper); border: 1px solid #e1d5e3; border-radius: 1.6rem; box-shadow: var(--shadow); }
.admin-login-logo { display: block; width: 72px; height: 72px; margin-bottom: 1.5rem; object-fit: cover; border: 2px solid #dac9dd; border-radius: 18px; box-shadow: 0 10px 28px rgba(59,25,67,.18); }
.login-card h1, .admin-titlebar h1 { font-size: clamp(3rem, 7vw, 5.5rem); letter-spacing: -.045em; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-form { margin-top: 1.8rem; overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
.login-form > label { display: block; margin-bottom: .45rem; font-size: .88rem; font-weight: 700; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: .7rem; }
.password-row input { min-width: 0; min-height: 50px; padding: .75rem .9rem; border: 1px solid #d9cddd; border-radius: .7rem; font: inherit; }
.admin-message { min-height: 1.5rem; margin: .8rem 0 0; color: #9a3f31; font-size: .86rem; font-weight: 600; }
.admin-message.success { color: #1d674e; }
.admin-shell[hidden] { display: none; }
.admin-titlebar { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.local-banner { margin-bottom: 1rem; padding: .9rem 1rem; background: #fff0cf; border: 1px solid #e8ca87; border-radius: .8rem; color: #674611; font-size: .85rem; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 1.2rem; align-items: start; }
.content-card { margin-bottom: 1.2rem; padding: clamp(1.4rem, 4vw, 2.5rem); background: var(--paper); border: 1px solid #e1d5e3; border-radius: 1.35rem; box-shadow: 0 16px 50px rgba(59,25,67,.09); }
.content-card form { overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
.content-card .editor-heading { margin-bottom: 1.2rem; }
.content-card .field textarea { min-height: 150px; }
.team-admin-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 1.2rem; align-items: start; }
.team-photo-field { margin-top: 1rem; padding: .8rem; background: #f3edf4; border-radius: .9rem; }
.team-photo-preview { position: relative; display: grid; place-items: center; align-content: center; width: 100%; height: 210px; overflow: hidden; padding: .6rem; background: linear-gradient(145deg,#eadfec 0%,#f6f0f6 100%); border: 1px dashed #a98eae; border-radius: .7rem; color: #6b586f; }
.team-photo-preview > span { font-size: 2rem; }
.team-photo-preview p { margin: .35rem 0 0; font-size: .8rem; font-weight: 700; }
.team-photo-preview img { position: absolute; inset: .6rem; width: calc(100% - 1.2rem); height: calc(100% - 1.2rem); object-fit: contain; object-position: center; }
.team-photo-field .photo-button { width: 100%; margin-top: .7rem; }
.team-photo-field small { display: block; margin-top: .55rem; color: var(--muted); font-size: .75rem; }
.team-records { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; }
.team-record-item { display: grid; grid-template-columns: 76px 1fr; gap: .75rem; align-items: center; padding: .65rem; background: #f3edf4; border-radius: .85rem; }
.team-record-item img { width: 76px; height: 86px; padding: .2rem; object-fit: contain; object-position: center; background: #eadfec; border-radius: .6rem; }
.team-record-item h3 { font-size: 1rem; overflow-wrap: anywhere; }
.team-record-item .record-actions { margin-top: .45rem; }
.editor-card, .records-card { background: var(--paper); border: 1px solid #e1d5e3; border-radius: 1.35rem; box-shadow: 0 16px 50px rgba(59,25,67,.09); }
.editor-card { padding: clamp(1.4rem, 4vw, 2.5rem); }
.editor-heading, .records-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.editor-heading span, .records-heading span:not(.record-count) { color: #8d5b92; font-size: .7rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.editor-heading h2, .records-heading h2 { margin-top: .2rem; font-size: 2rem; }
.editor-card form { overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
.photo-field { padding: 1rem; background: #f3edf4; border-radius: 1rem; }
.photo-preview { position: relative; display: grid; place-items: center; align-content: center; width: 100%; height: clamp(320px, 52vw, 520px); overflow: hidden; padding: .75rem; background: linear-gradient(145deg, #eadfec 0%, #f6f0f6 100%); border: 1px dashed #a98eae; border-radius: .85rem; color: #6b586f; }
.photo-preview > span { font-size: 2rem; }
.photo-preview p { margin: .35rem 0 0; font-size: .85rem; font-weight: 700; }
.photo-preview img { position: absolute; inset: .75rem; width: calc(100% - 1.5rem); height: calc(100% - 1.5rem); object-fit: contain; object-position: center; }
.photo-actions { display: flex; gap: .65rem; margin-top: .85rem; }
.photo-button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .65rem .8rem; background: var(--forest); color: white; border-radius: .65rem; cursor: pointer; font-size: .84rem; font-weight: 700; }
.photo-button.secondary { background: white; color: var(--forest); border: 1px solid #d9cddd; }
.photo-field small { display: block; margin-top: .65rem; color: var(--muted); font-size: .73rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.admin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.admin-submit-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.admin-submit-row p { margin: 0; color: var(--muted); font-size: .76rem; }
.records-card { position: sticky; top: 1rem; overflow: hidden; }
.records-heading { margin: 0; padding: 1.4rem; border-bottom: 1px solid var(--line); }
.record-count { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 .5rem; background: var(--amber); color: var(--forest-2); border-radius: 999px; font-size: .82rem; font-weight: 700; }
.records-list { display: grid; gap: .8rem; max-height: 72vh; padding: 1rem; overflow: auto; }
.records-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; font-size: .87rem; }
.record-item { display: grid; grid-template-columns: 78px 1fr; gap: .85rem; padding: .65rem; background: #f3edf4; border-radius: .85rem; }
.record-item img { width: 78px; height: 92px; padding: .2rem; object-fit: contain; object-position: center; background: #eadfec; border-radius: .6rem; }
.record-item h3 { margin-top: .2rem; font-size: 1.25rem; }
.record-item p { margin: .2rem 0 .65rem; color: var(--muted); font-size: .73rem; }
.record-status { display: inline-flex; align-items: center; gap: .35rem; color: var(--forest); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.record-actions { display: flex; gap: .7rem; }
.record-actions button { padding: 0; border: 0; background: none; color: var(--forest); cursor: pointer; font: inherit; font-size: .75rem; font-weight: 700; }
.record-actions button.delete { color: #9a3f31; }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .team-admin-layout { grid-template-columns: 1fr; }
  .records-card { position: static; }
  .records-list { max-height: none; }
}
@media (max-width: 600px) {
  .admin-header { width: calc(100% - 1rem); margin-top: .5rem; }
  .admin-header .brand { font-size: .95rem; }
  .admin-back { font-size: .76rem; }
  .admin-main { width: calc(100% - 1rem); padding-top: 2rem; }
  .password-row, .admin-fields { grid-template-columns: 1fr; }
  .photo-actions, .admin-submit-row, .admin-titlebar { align-items: stretch; flex-direction: column; }
  .photo-button, .admin-submit-row .button { width: 100%; }
  .content-card { padding: 1.2rem; }
  .team-records { grid-template-columns: 1fr; }
}
.admin-page { background: radial-gradient(ellipse at 15% 15%,#eadfec,transparent 60%), #f7f3f7; }
.login-card { border-top: 5px solid var(--amber); }
.login-card h1 { font-size: clamp(2rem,6vw,3rem); letter-spacing: -.04em; }
.admin-titlebar h1 { font-size: clamp(2.3rem,6vw,4rem); }
.login-form .button { min-width: 110px; }
.editor-heading h2, .records-heading h2 { font-size: 1.7rem; }
.editor-heading span, .records-heading span:not(.record-count), .record-item p, .photo-field small { font-size: .875rem; }
.record-actions button, .photo-button { font-size: .9rem; }
