.admin-page { background: var(--paper); background-attachment: initial; min-width: 320px; color: var(--ink); }
.admin-page html { scroll-behavior: auto; }
.admin-header { background: var(--navy); color: white; }
.admin-header-inner { max-width: 1240px; padding: 0 28px; margin: auto; min-height: 76px; display: flex; align-items: center; gap: 28px; }
.admin-brand { display: block; flex-shrink: 0; }
.admin-brand img { display: block; width: 180px; height: auto; }
.admin-title { flex: 1; font-size: .9rem; font-weight: 600; color: #d9e5f7; }
.admin-header form { margin: 0; }
.header-back, .nav-signout { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid #60708a; background: transparent; color: white; border-radius: 9px; font-size: .85rem; text-decoration: none; }
.header-back:hover, .nav-signout:hover { background: var(--blue); }
.admin-nav { background: white; border-bottom: 1px solid var(--line); }
.admin-nav > div { max-width: 1240px; margin: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 0 20px; }
.admin-nav a { min-height: 48px; padding: 14px 12px; text-decoration: none; color: var(--muted); font-size: .85rem; font-weight: 600; border-bottom: 2px solid transparent; }
.admin-nav a:hover { color: var(--blue); background: var(--paper); }
.admin-nav a[aria-current] { color: var(--blue); border-color: var(--blue); }
.signed-in { margin-left: auto; font-size: .75rem; padding: 10px; color: var(--muted); overflow-wrap: anywhere; }
.admin-main { width: min(1184px, calc(100% - 56px)); margin: 32px auto 56px; min-height: 60vh; }
.auth-main { max-width: 480px; margin-top: 48px; }
.admin-footer { padding: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; text-align: center; }
.paper { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.auth-paper { padding: 32px; }
.admin-page h1 { margin: 0 0 10px; font-size: 1.85rem; line-height: 1.2; letter-spacing: -.03em; }
.admin-page h2 { margin: 0 0 16px; font-size: 1.2rem; letter-spacing: -.02em; }
.admin-page p { line-height: 1.55; }
.lead { margin: 0 0 26px; font-size: .95rem; color: var(--muted); }
.quiet { color: var(--muted); font-size: .85rem; }
.auth-note { margin-bottom: 0; }
.admin-form { display: grid; gap: 20px; }
.admin-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: .85rem; font-weight: 600; }
.admin-field input, .admin-field select, .filters input, .filters select { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid #aebbd0; border-radius: 9px; background: white; color: var(--ink); }
.admin-field small { font-size: .75rem; font-weight: 400; color: var(--muted); }
.admin-field [aria-invalid] { border-color: #a5202e; background: #fff6f6; }
.admin-field-error { color: #a5202e; font-size: .78rem; font-weight: 400; }
.notice { margin: 0 0 22px; padding: 15px 18px; border-radius: 10px; background: #dff1e8; color: #075734; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.notice.info { color: var(--blue); background: #e4ecf8; }
.notice.error { background: #fff0ec; color: #862434; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }
.notice a { color: inherit; }
.button { min-height: 44px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #aebbd0; border-radius: 9px; background: white; color: var(--blue); text-decoration: none; font-size: .85rem; line-height: 1.4; font-weight: 700; }
.button:hover { border-color: var(--blue); background: #e4ecf8; }
.button.primary { background: var(--blue); color: white; border-color: var(--blue); }
.button.primary:hover { background: var(--navy); }
.button.danger { color: #a5202e; border-color: #d0a5aa; }
.button.danger:hover { background: #fff0ec; }
.button:disabled { opacity: .65; cursor: wait; }
.full-width { width: 100%; }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 68px; }
.show-password { position: absolute; right: 3px; top: 3px; min-height: 40px; padding: 0 10px; color: var(--blue); background: transparent; border: 0; border-radius: 9px; font-size: .8rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading .lead { margin-bottom: 0; }
.page-heading-actions, .action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.summary-line { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 16px 0 0; color: var(--muted); font-size: .85rem; }
.summary-line strong { color: var(--ink); }
.filters { display: grid; grid-template-columns: minmax(180px, 1fr) 170px 170px auto auto; gap: 14px; align-items: end; padding: 22px; border-bottom: 1px solid var(--line); }
.filters label { display: grid; gap: 7px; min-width: 0; font-size: .78rem; font-weight: 600; }
.ledger { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.member-table { border-collapse: collapse; width: 100%; text-align: left; font-size: .85rem; }
.member-table th { font-size: .73rem; color: var(--muted); background: var(--paper); font-weight: 700; white-space: nowrap; }
.member-table td, .member-table th { padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.member-table tbody tr:hover { background: var(--paper); }
.member-table td a { color: var(--blue); font-weight: 700; text-underline-offset: 3px; }
.member-table small { display: block; margin-top: 5px; color: var(--muted); font-size: .74rem; }
.member-table .nowrap { white-space: nowrap; }
.state { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #e4ecf8; color: var(--blue); font-size: .73rem; font-weight: 700; white-space: nowrap; }
.state.active, .state.registered { color: #075734; background: #dff1e8; }
.state.pending { background: #fff2cf; color: #795011; }
.state.expired, .state.suspended, .state.trash { background: #fff0ec; color: #862434; }
.empty-state { text-align: center; padding: 58px 24px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { max-width: 48ch; margin: 0 auto 20px; color: var(--muted); }
.pagination { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .8rem; color: var(--muted); }
.pagination div { display: flex; gap: 8px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 10px; color: var(--blue); font-size: .85rem; text-decoration: none; }
.member-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wide { grid-column: 1 / -1; }
.form-divider { grid-column: 1 / -1; margin: 4px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.photo-editor { display: flex; gap: 20px; align-items: center; }
.admin-photo { width: 80px; height: 96px; flex-shrink: 0; object-fit: cover; border-radius: 9px; background: #e4ecf8; display: grid; place-items: center; color: var(--blue); font-size: 1.4rem; font-weight: 700; }
.photo-input { max-width: 100%; font-size: .8rem; }
.check-label { display: flex; gap: 9px; align-items: center; margin-top: 14px; font-size: .85rem; }
.check-label input { width: 18px; height: 18px; }
.sidebar-note { padding: 22px; }
.sidebar-note dl { margin: 0 0 24px; }
.sidebar-note dt { color: var(--muted); font-size: .75rem; margin-top: 20px; }
.sidebar-note dd { margin: 5px 0 0; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.sidebar-note .button { width: 100%; margin-top: 10px; }
.danger-zone { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.danger-zone h2 { color: #862434; font-size: 1rem; }
.confirm-paper { max-width: 640px; }
.tracking-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; margin: 0; }
.tracking-details dt { color: var(--muted); font-size: .78rem; margin-bottom: 5px; }
.tracking-details dd { margin: 0; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.tracking-photo { display: block; width: 120px; height: 144px; object-fit: cover; border-radius: 10px; margin-bottom: 18px; }
.tracking-photo.placeholder { display: grid; place-items: center; color: var(--blue); background: #e4ecf8; font-weight: 700; font-size: 2rem; }
.tracking-history { margin-top: 24px; }
.password-paper { margin-top: 24px; }
.member-timeline { list-style: none; padding: 0; margin: 0; }
.member-timeline li { padding: 18px 0; border-top: 1px solid var(--line); }
.member-timeline li > div { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.member-timeline time, .member-timeline small { color: var(--muted); font-size: .78rem; }
.member-timeline p { margin: 7px 0; font-size: .85rem; overflow-wrap: anywhere; }
@media (max-width: 600px) { .tracking-details { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .admin-header-inner { flex-wrap: wrap; padding-block: 12px; }
  #chooseFolderHeader { flex-basis: 100%; }
}
.confirm-paper .admin-form { margin-top: 24px; }
.account-paper { max-width: 640px; }
.card-paper { max-width: 840px; margin: auto; }
.card-stage { padding: 30px; border-radius: 12px; background: #dce5f2; display: flex; justify-content: center; }
.card-paper .action-row { margin-top: 22px; justify-content: center; }
.card-foot > b.pending { color: #795011; }
.card-foot > b.expired, .card-foot > b.suspended { color: #a5202e; }
.skip-link { position: fixed; z-index: 100; left: 12px; top: -100px; padding: 14px; background: white; color: var(--blue); }
.skip-link:focus { top: 12px; }
@media (max-width: 1000px) {
  .filters { grid-template-columns: minmax(180px, 1fr) 160px; }
  .member-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .signed-in { display: none; }
}
@media (max-width: 720px) {
  .admin-title { display: none; }
  .admin-header-inner { padding: 0 18px; justify-content: space-between; gap: 12px; }
  .admin-brand img { width: 154px; }
  .admin-main { width: calc(100% - 28px); margin-top: 24px; }
  .admin-nav > div { padding: 0 6px; }
  .admin-nav a { font-size: .78rem; padding-inline: 10px; }
  .admin-nav a[target] { display: none; }
  .member-layout { grid-template-columns: minmax(0, 1fr); }
  .page-heading { flex-direction: column; gap: 16px; }
  .paper { padding: 22px; }
  .ledger { padding: 0; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px; gap: 12px; }
  .filters label:first-child { grid-column: 1 / -1; }
  .member-table th, .member-table td { padding: 14px; }
  .edit-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .card-paper { padding: 16px; }
  .card-stage { padding: 12px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .photo-editor { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .filters { grid-template-columns: 1fr; }
  .auth-paper { padding: 22px 18px; }
  .admin-brand img { width: 140px; }
  .header-back { font-size: .75rem; padding-inline: 8px; }
}
@media print {
  .admin-page { min-width: 0; }
  .admin-header, .admin-nav, .admin-footer { display: none; }
}
