.admin-body { min-height: 100vh; }
.admin-topbar { position: sticky; top: 0; z-index: 100; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid var(--line); background: rgba(3,7,17,.88); backdrop-filter: blur(22px); }
.admin-session { display: flex; align-items: center; gap: 12px; }
.admin-identity { min-width: 0; display: flex; align-items: center; gap: 9px; }
.admin-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: #041019; background: linear-gradient(135deg, var(--blue), #b8f5ff); font-size: .68rem; font-weight: 850; }
.admin-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.admin-identity-copy { min-width: 0; display: grid; line-height: 1.18; }
.admin-identity-copy strong { max-width: 180px; overflow: hidden; color: #eef6ff; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity-copy small { max-width: 190px; overflow: hidden; color: #88a0b9; font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.admin-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.compact-btn { min-height: 40px; padding: 8px 14px; }
.admin-shell { width: min(1320px, calc(100% - 48px)); margin-inline: auto; padding-block: 68px 110px; }
.admin-gate { min-height: calc(100vh - 230px); max-width: 620px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.admin-lock { width: 82px; height: 82px; display: grid; place-items: center; margin-bottom: 26px; border: 1px solid rgba(43,216,255,.38); border-radius: 28px; color: var(--blue); background: rgba(43,216,255,.07); box-shadow: 0 0 50px rgba(43,216,255,.11); font-size: 1.6rem; }
.admin-gate .eyebrow { justify-content: center; }
.admin-gate h1, .admin-hero h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 5rem); line-height: .98; letter-spacing: -.055em; }
.admin-gate > p:not(.eyebrow):not(.form-status) { max-width: 560px; margin: 22px 0 30px; color: var(--muted); }
.admin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; margin-bottom: 36px; }
.admin-hero > div:first-child { max-width: 780px; }
.admin-hero > div:first-child > p:last-child { max-width: 650px; margin: 18px 0 0; color: var(--muted); }
.sync-panel { min-width: 190px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: #7f95ae; font-size: .72rem; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 24px; }
.admin-metrics article { min-height: 150px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(14,27,50,.88), rgba(7,14,29,.72)); }
.admin-metrics small { display: block; color: #7f94ad; font-size: .67rem; letter-spacing: .12em; text-transform: uppercase; }
.admin-metrics b { display: block; margin-top: 14px; color: var(--blue); font-size: 2.6rem; line-height: 1; letter-spacing: -.04em; }
.admin-metrics span { color: var(--muted); font-size: .73rem; }
.admin-tabs { display: flex; gap: 7px; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(7,14,28,.72); }
.admin-tabs button { min-height: 42px; flex: 1 0 max-content; padding: 9px 17px; border: 0; border-radius: 11px; color: #9eb1c7; background: transparent; cursor: pointer; font-weight: 720; font-size: .78rem; }
.admin-tabs button span { display: inline-grid; min-width: 22px; min-height: 22px; place-items: center; margin-left: 7px; border-radius: 8px; background: rgba(255,255,255,.06); font-size: .65rem; }
.admin-tabs button.is-active { color: #041019; background: var(--blue); }
.admin-panel { margin-top: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: rgba(7,15,30,.72); }
.panel-heading { display: flex; justify-content: space-between; gap: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.panel-heading small { color: var(--blue); font-size: .63rem; letter-spacing: .15em; }
.panel-heading h2 { margin: 6px 0 0; font-size: 1.65rem; letter-spacing: -.025em; }
.panel-heading > p { max-width: 470px; margin: 0; color: var(--muted); font-size: .78rem; }
.admin-list { display: grid; gap: 12px; margin-top: 20px; }
.admin-row { display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(180px, .8fr) minmax(270px, 1fr); align-items: center; gap: 22px; padding: 20px; border: 1px solid rgba(139,192,255,.12); border-radius: 17px; background: rgba(255,255,255,.018); }
.admin-row h3 { margin: 0; font-size: .96rem; overflow-wrap: anywhere; }
.admin-row p { margin: 6px 0 0; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.row-meta { display: grid; gap: 5px; color: #8ea4bd; font-size: .7rem; }
.status-pill { width: max-content; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid currentColor; border-radius: 999px; color: var(--amber); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.status-pill.approved, .status-pill.completed, .status-pill.ready, .status-pill.code_issued { color: var(--green); }
.status-pill.rejected, .status-pill.failed { color: var(--red); }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.action-btn { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: #dce8f7; background: rgba(255,255,255,.035); cursor: pointer; font-size: .7rem; font-weight: 750; }
.action-btn.primary { color: #041019; border-color: transparent; background: var(--blue); }
.action-btn.success { color: #03130d; border-color: transparent; background: var(--green); }
.action-btn.danger { color: #ffd9df; border-color: rgba(255,101,125,.35); }
.action-btn[disabled] { opacity: .45; cursor: not-allowed; }
.empty-admin { padding: 45px 20px; text-align: center; color: #8298b1; border: 1px dashed var(--line-strong); border-radius: 17px; font-size: .82rem; }
.code-reveal { margin-top: 8px; padding: 8px 10px; color: var(--green); border: 1px dashed rgba(41,241,173,.34); border-radius: 9px; background: rgba(41,241,173,.05); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.protected-file-modal { width: min(1040px, calc(100% - 28px)); max-height: min(900px, calc(100dvh - 28px)); padding: 0; overflow: hidden; border: 1px solid rgba(131,178,255,.32); border-radius: 24px; color: #eef6ff; background: #060d20; }
.protected-file-modal::backdrop { background: rgba(0,4,14,.82); backdrop-filter: blur(8px); }
.protected-file-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.protected-file-head h2 { margin: 5px 0 0; font-size: clamp(1.35rem, 3vw, 2.1rem); }
.protected-file-head > div > p:last-child { margin: 7px 0 0; color: #8da4bd; font-size: .72rem; }
.protected-file-status { min-height: 360px; display: grid; place-items: center; padding: 30px; color: #9eb1c7; text-align: center; }
.protected-file-viewer { height: min(68dvh, 720px); padding: 18px; background: #02050d; }
.protected-file-viewer img, .protected-file-viewer iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; object-fit: contain; }
.protected-file-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.protected-file-actions form { margin: 0; }

@media (max-width: 980px) {
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-row { grid-template-columns: 1fr 1fr; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 680px) {
  .admin-topbar { padding-inline: 16px; }
  .admin-badge { display: none; }
  .admin-identity-copy small { display: none; }
  .admin-identity-copy strong { max-width: 92px; }
  .admin-shell { width: min(100% - 28px, 1320px); padding-top: 42px; }
  .admin-hero, .panel-heading { align-items: flex-start; flex-direction: column; }
  .sync-panel { justify-content: flex-start; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .admin-metrics article { min-height: 125px; padding: 18px; }
  .admin-panel { padding: 19px; }
  .admin-row { grid-template-columns: 1fr; gap: 14px; }
  .row-actions { grid-column: auto; }
  .protected-file-head { padding: 20px 18px 15px; }
  .protected-file-viewer { height: 62dvh; padding: 10px; }
  .protected-file-actions { align-items: stretch; flex-direction: column; padding: 12px; }
  .protected-file-actions .btn { width: 100%; }
}
@media (max-width: 430px) {
  .admin-metrics { grid-template-columns: 1fr; }
  .brand-copy small { display: none; }
}
