:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --ink: #15160f;
  --muted: #68695f;
  --line: #d6d3c9;
  --river: #1d5c59;
  --river-dark: #10413f;
  --signal: #ff5d37;
  --white: #fff;
  font-family: "Schibsted Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--river); }
h1, h2, p { margin-top: 0; }
button, input, textarea { font: inherit; }
.eyebrow { color: var(--river); font-family: "IBM Plex Mono", monospace; font-size: .74rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.55; }
.alert { padding: 13px 15px; border-radius: 2px; }
.alert.error { color: #781f13; background: #ffe2da; }
.alert.success { color: #16463a; background: #dceee8; }

/* Administración */
.admin-body { background: #eef0ec; }
.admin-shell { width: min(1120px, calc(100% - 32px)); margin: 44px auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.topbar h1 { margin-bottom: 5px; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.control-tabs { display: inline-grid; grid-template-columns: repeat(2, minmax(135px, 1fr)); gap: 4px; padding: 4px; margin-bottom: 22px; border: 1px solid #cbd0c8; background: #dfe3dd; box-shadow: inset 0 1px 2px rgb(21 22 15 / 5%); }
.control-tab { display: grid; place-items: center; min-height: 42px; padding: 9px 20px; border: 1px solid transparent; color: #55594f; font-family: "IBM Plex Mono", monospace; font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-align: center; text-decoration: none; text-transform: uppercase; transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease; }
.control-tab:hover { background: rgb(255 255 255 / 58%); color: var(--ink); }
.control-tab.active { border-color: var(--river); background: var(--river); color: var(--white); box-shadow: 0 2px 7px rgb(16 65 63 / 18%); }
.control-tab.active:hover { background: var(--river-dark); }
.card { padding: 28px; margin-bottom: 22px; border: 1px solid #d8dad5; background: var(--white); box-shadow: 0 9px 30px rgb(21 22 15 / 5%); }
.card h2 { margin-bottom: 20px; font-size: 1.25rem; }
.login-card { width: min(460px, 100%); margin: 12vh auto 0; }
.login-card h1 { margin-bottom: 6px; }
.stack { display: grid; gap: 18px; }
label { display: grid; gap: 7px; color: #34372e; font-size: .88rem; font-weight: 600; }
.field-help { color: var(--muted); font-size: .75rem; font-weight: 400; }
.optional { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: .62rem; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
input, textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #b9bdb4; border-radius: 0; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 3px solid rgb(29 92 89 / 17%); border-color: var(--river); }
button, .button { display: inline-grid; place-items: center; min-height: 43px; padding: 9px 17px; border: 0; border-radius: 0; background: var(--river); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--river-dark); }
button.secondary, .button.secondary { background: #dfe3dd; color: var(--ink); }
button.danger { min-height: 34px; padding: 6px 10px; border: 1px solid #d9aaa0; background: transparent; color: #922d1f; }
.back-link { display: inline-block; margin-top: 22px; }
.event-form { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.event-form .span-2 { grid-column: 1 / -1; }
.event-form button { justify-self: start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.end-event-form { display: flex; justify-content: flex-end; padding-top: 18px; margin-top: 18px; border-top: 1px solid #e2e3de; }
.link-form { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(280px, 2fr) auto; align-items: end; gap: 17px; }
.slug-input { display: flex; align-items: center; border: 1px solid #b9bdb4; background: #fff; }
.slug-input span { padding-left: 12px; color: var(--muted); }
.slug-input input { border: 0; }
.section-title { display: flex; justify-content: space-between; gap: 20px; }
.section-title .event-context { margin: -12px 0 0; }
.export-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-start; }
.count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin-left: 7px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: .78rem; vertical-align: 2px; }
.badge { display: inline-block; padding: 3px 6px; margin-left: 7px; background: #dceee8; color: #16463a; font-family: "IBM Plex Mono", monospace; font-size: .64rem; letter-spacing: .04em; text-transform: uppercase; }
.selected-row { background: #f3f6f2; }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: .82rem; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table-space { margin-top: 28px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid #e2e3de; text-align: left; }
th { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: .69rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.destination { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { width: 1%; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.empty-state { margin-top: 22px; }

/* Cowork público */
.cowork-body { min-height: 100vh; background: var(--paper); }
.cowork-header, .cowork-footer { display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.cowork-header { height: 84px; border-bottom: 1px solid var(--line); }
.cowork-brand { color: var(--ink); font-family: "Instrument Serif", serif; font-size: 2rem; text-decoration: none; }
.cowork-back { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: .76rem; text-decoration: none; text-transform: uppercase; }
.cowork-main { width: min(920px, calc(100% - 40px)); margin: 70px auto 100px; }
.cowork-intro { max-width: 790px; margin-bottom: 56px; }
.cowork-intro h1 { font-family: "Instrument Serif", Georgia, serif; font-size: clamp(3rem, 7vw, 6.4rem); font-weight: 400; letter-spacing: -.045em; line-height: .92; }
.event-poster { display: grid; grid-template-columns: 110px 1fr; gap: 34px; padding: 38px; margin-bottom: 30px; background: var(--ink); color: var(--paper); }
.event-mark { color: var(--signal); font-family: "Instrument Serif", serif; font-size: 6rem; line-height: .72; }
.poster-label { color: #b7b8af; font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.event-poster h2 { max-width: 680px; margin-bottom: 28px; font-family: "Instrument Serif", serif; font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 400; line-height: 1; }
.event-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0; }
.event-details div { padding-top: 13px; border-top: 1px solid #4a4b44; }
.event-details dt { margin-bottom: 6px; color: #aaa99f; font-family: "IBM Plex Mono", monospace; font-size: .68rem; text-transform: uppercase; }
.event-details dd { margin: 0; line-height: 1.4; }
.event-notice { max-width: 680px; margin: 25px 0 0; color: #cfcec6; line-height: 1.55; }
.registration-card { padding: clamp(28px, 5vw, 55px); border: 1px solid var(--line); background: #fff; }
.registration-card h2 { margin-bottom: 9px; font-family: "Instrument Serif", serif; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 400; }
.form-intro { max-width: 600px; color: var(--muted); line-height: 1.55; }
.event-availability { display: inline-block; padding: 9px 12px; margin: 5px 0 0; background: #dceee8; color: #16463a; font-family: "IBM Plex Mono", monospace; font-size: .78rem; }
.cowork-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: end; margin-top: 32px; }
.cowork-form button { grid-column: 1 / -1; justify-self: start; background: var(--signal); color: var(--ink); }
.cowork-form button:hover { background: #e84c29; }
.confirmation p:not(.eyebrow) { max-width: 620px; color: var(--muted); line-height: 1.6; }
.cowork-button { display: inline-block; padding: 13px 18px; margin-top: 12px; background: var(--ink); color: var(--paper); text-decoration: none; }
.cowork-footer { padding: 25px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: .72rem; text-transform: uppercase; }

@media (max-width: 780px) {
  .admin-shell { margin-top: 24px; }
  .topbar { flex-direction: column; }
  .control-tabs { display: grid; width: 100%; }
  .section-title { flex-direction: column; }
  .link-form, .event-form, .cowork-form { grid-template-columns: 1fr; }
  .event-form .span-2 { grid-column: auto; }
  .card { padding: 20px; }
  .event-poster { grid-template-columns: 1fr; padding: 28px; }
  .event-mark { font-size: 4rem; }
  .event-details { grid-template-columns: 1fr; }
  .cowork-main { margin-top: 45px; }
  .cowork-intro { margin-bottom: 38px; }
}
