body { background: #e9e5da; }
.admin-shell { min-height: calc(100vh - 5px); }
.login-card { width: min(520px, calc(100% - 28px)); margin: 7vh auto; padding: 46px; background: var(--cream); border-top: 5px solid var(--gold); box-shadow: 0 30px 80px rgba(25,32,20,.15); }
.login-card > img { width: 92px; height: 92px; object-fit: cover; border-radius: 50%; margin-bottom: 28px; }
.login-card .kicker, .admin-title .kicker, .settings-card .kicker { color: var(--moss); margin: 0 0 12px; }
.login-card h1 { font-size: clamp(3.1rem, 10vw, 3.8rem); }
.admin-title h1 { font-size: clamp(3.5rem, 8vw, 6rem); }
.login-card > p:not(.kicker) { color: var(--muted); line-height: 1.5; }
.login-card form { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #66675f; font-size: .73rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
input, select { width: 100%; border: 1px solid rgba(23,36,19,.2); background: #fff; padding: 13px 14px; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
button { cursor: pointer; }
.primary-button { border: 0; padding: 14px 20px; color: #fff; background: var(--forest); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.primary-button:hover { background: var(--olive); }
.form-message { min-height: 20px; margin: 0; color: var(--red); font-size: .8rem; }
.back-link { display: inline-block; margin-top: 24px; color: var(--moss); font-size: .82rem; font-weight: 700; }

.admin-header { min-height: 88px; color: #fff; background: var(--forest); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(24px, calc((100% - 1300px) / 2)); }
.admin-brand { display: flex; align-items: center; gap: 13px; }
.admin-brand img { width: 56px; height: 50px; object-fit: contain; }
.admin-brand span { display: grid; gap: 3px; }
.admin-brand small { color: var(--sand); letter-spacing: .12em; font-size: .6rem; }
.admin-brand b { text-transform: uppercase; letter-spacing: .05em; }
.admin-actions { display: flex; align-items: center; gap: 16px; font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.ghost-button { border: 1px solid rgba(255,255,255,.25); color: #fff; background: transparent; padding: 10px 13px; }
.admin-content { width: min(1300px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 90px; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.save-status { padding: 9px 12px; color: var(--olive); background: rgba(101,114,63,.13); font-size: .72rem; font-weight: 800; }
.save-status.saving { color: #835f00; background: rgba(201,162,39,.18); }
.save-status.error { color: var(--red); background: rgba(167,47,37,.12); }
.admin-tabs { display: flex; gap: 5px; margin: 38px 0 24px; border-bottom: 1px solid rgba(23,36,19,.18); }
.admin-tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 13px 18px; text-transform: uppercase; letter-spacing: .08em; font-size: .73rem; font-weight: 800; }
.admin-tabs button.active { color: var(--olive); border-color: var(--gold); }
.admin-panel { animation: appear .2s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.summary-card { min-height: 150px; color: #fff; background: var(--olive); padding: 24px; border-top: 4px solid var(--sand); }
.summary-card:first-child { background: var(--forest); border-color: var(--gold); }
.summary-card small { color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .1em; }
.summary-card b { display: block; margin-top: 15px; font: 500 2rem Impact, sans-serif; text-transform: uppercase; }
.summary-card strong { display: block; margin-top: 6px; color: var(--sand); font: 500 1.35rem Impact, sans-serif; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 25px; padding: 24px; background: var(--cream); border-bottom: 1px solid rgba(23,36,19,.12); }
.toolbar h2, .settings-card h2 { margin: 0; text-transform: uppercase; }
.toolbar p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
.toolbar label { min-width: 260px; }
.toolbar-actions { display: flex; align-items: end; gap: 12px; }
.excel-import { min-width: 0 !important; }
.excel-import input { position: absolute; opacity: 0; pointer-events: none; }
.excel-import span { display: grid; place-items: center; min-height: 43px; padding: 0 16px; color: #fff; background: var(--olive); white-space: nowrap; cursor: pointer; }
.excel-import span:hover { background: var(--forest); }
.excel-message { margin: 0; padding: 12px 24px; color: var(--muted); background: #efe9d8; border-bottom: 1px solid rgba(23,36,19,.12); font-size: .76rem; }
.excel-message.success { color: #33491f; background: #e5ecd9; }
.excel-message.error { color: var(--red); background: #f3dfda; }
.score-grid-wrap { overflow: auto; background: var(--cream); box-shadow: 0 18px 45px rgba(25,32,20,.08); }
.score-grid { width: 100%; min-width: 1020px; border-collapse: collapse; }
.score-grid th { position: sticky; top: 0; z-index: 1; color: #fff; background: var(--olive); padding: 13px 10px; font-size: .69rem; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.score-grid th:first-child { left: 0; z-index: 2; text-align: left; min-width: 250px; }
.score-grid td { border-bottom: 1px solid rgba(23,36,19,.11); border-right: 1px solid rgba(23,36,19,.08); padding: 9px; text-align: center; }
.score-grid td:first-child { position: sticky; left: 0; z-index: 1; background: var(--cream); text-align: left; }
.evaluation-name { display: block; font-weight: 800; font-size: .76rem; }
.evaluation-weight { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.score-input { width: 92px; text-align: right; padding: 9px; font-weight: 700; }
.score-input.changed { border-color: var(--gold); background: #fff9e4; }
.score-input.saved { animation: saved .7s ease; }
@keyframes saved { 50% { background: #e4edd7; border-color: var(--moss); } }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.settings-card { display: grid; gap: 17px; align-content: start; background: var(--cream); padding: 30px; box-shadow: 0 18px 45px rgba(25,32,20,.08); }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.video-preview { overflow: hidden; background: #080b07; aspect-ratio: 16/9; }
.video-preview video { width: 100%; height: 100%; object-fit: cover; }
.file-drop { cursor: pointer; border: 1px dashed rgba(23,36,19,.3); padding: 24px; text-align: center; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop span { display: grid; gap: 6px; }
.file-drop small { color: var(--muted); }
.upload-progress { height: 6px; background: rgba(23,36,19,.1); overflow: hidden; }
.upload-progress span { display: block; width: 50%; height: 100%; background: var(--gold); animation: progress 1.2s ease-in-out infinite alternate; }
@keyframes progress { to { transform: translateX(100%); } }
.map-access-grid { display: grid; grid-template-columns: .86fr 1.14fr; gap: 22px; }
.card-intro { margin: -4px 0 3px; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.generated-code { display: grid; gap: 10px; padding: 22px; color: white; background: var(--forest); border-left: 4px solid var(--gold); }
.generated-code small { color: var(--sand); font-size: .58rem; font-weight: 900; letter-spacing: .12em; }
.generated-code strong { font: 500 clamp(1.45rem, 3vw, 2.15rem) monospace; letter-spacing: .08em; overflow-wrap: anywhere; }
.generated-code span { color: rgba(255,255,255,.6); font-size: .72rem; }
.generated-code button { justify-self: start; padding: 8px 0; color: var(--sand); background: transparent; border: 0; font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.map-code-message { min-height: 20px; margin: 0; color: var(--muted); font-size: .73rem; }
.map-code-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.map-code-actions a { color: var(--olive); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.revoke-button { padding: 8px 10px; color: var(--red); background: transparent; border: 1px solid rgba(167,47,37,.25); font-size: .62rem; font-weight: 900; text-transform: uppercase; }
.map-code-list { display: grid; }
.map-code-list > p { color: var(--muted); font-size: .78rem; }
.map-code-list article { min-height: 68px; display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.map-code-list article div { display: grid; gap: 3px; }
.map-code-list article b { font-size: .75rem; text-transform: uppercase; }
.map-code-list article small, .map-code-list article time { color: var(--muted); font-size: .65rem; }
.code-status { padding: 6px 8px; text-align: center; font-size: .57rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.code-status.disponible { color: #355520; background: #dfe9d3; }
.code-status.usada { color: #6a581a; background: #eee4be; }
.code-status.vencida, .code-status.revocada { color: #8a3027; background: #f0d9d4; }
.history-note { color: var(--muted); line-height: 1.5; }

@media (max-width: 800px) {
  .admin-content { width: min(100% - 24px, 1300px); }
  .admin-summary, .settings-grid, .map-access-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar label { min-width: 0; width: 100%; }
  .toolbar-actions { align-items: stretch; flex-direction: column; width: 100%; }
}
@media (max-width: 560px) {
  .login-card { margin: 20px auto; padding: 30px 24px; }
  .admin-header { align-items: flex-start; }
  .admin-actions a { display: none; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .split-fields { grid-template-columns: 1fr; }
  .map-code-list article { grid-template-columns: 82px 1fr; }
  .map-code-list article time { grid-column: 2; }
}
