:root {
  --bg: #eef2f0;
  --bg-accent: #d9e6df;
  --surface: #ffffff;
  --ink: #1a2b24;
  --muted: #5a6f66;
  --line: #c5d4cc;
  --brand: #0f5c45;
  --brand-dark: #0a4030;
  --accent: #c45c26;
  --danger: #9b1c1c;
  --ok: #0f5c45;
  --warn: #8a5a00;
  --shadow: 0 10px 30px rgba(15, 40, 32, 0.08);
  --radius: 12px;
  --font: "DM Sans", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d7ebe2 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #f3e6d8 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner, .footer-inner, .main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 0;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-dark);
  text-decoration: none;
}
.nav { display: flex; gap: 1rem; flex: 1; }
.nav a { color: var(--ink); font-weight: 500; }
.user-meta { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.92rem; }

.main { flex: 1; padding: 1.5rem 0 3rem; }
.main-auth {
  display: grid;
  place-items: center;
  width: min(440px, calc(100% - 2rem));
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; }
.muted { color: var(--muted); }

h1, h2, h3 { font-family: var(--display); margin: 0 0 0.75rem; line-height: 1.2; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-head p { margin: 0.25rem 0 0; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
}
.login-card .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-weight: 600; font-size: 0.92rem; }
.form-control, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
.form-control:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 92, 69, 0.25);
  border-color: var(--brand);
}
.hint { font-size: 0.85rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn-danger { background: #fff; color: var(--danger); border-color: #e8b4b4; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
table.data th, table.data td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f7faf8;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-success { background: #e7f6ef; border-color: #b9e0cc; color: var(--ok); }
.alert-error { background: #fdecec; border-color: #f0c2c2; color: var(--danger); }
.alert-warning { background: #fff6e5; border-color: #f0d9a8; color: var(--warn); }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.docente-row, .crono-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: #fbfcfb;
}
.docente-row { grid-template-columns: 2fr 1fr 1fr auto; }
.crono-row { grid-template-columns: 1fr 2fr auto; }

.picker {
  position: relative;
}
.picker-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow: auto;
  z-index: 30;
  display: none;
}
.picker-results.open { display: block; }
.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  font: inherit;
}
.picker-item:hover { background: #eef7f2; }
.picker-item small { display: block; color: var(--muted); }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e8f2ed;
  color: var(--brand-dark);
}
.hospedaje-block[hidden] { display: none !important; }

@media (max-width: 800px) {
  .header-inner { flex-wrap: wrap; }
  .form-grid, .docente-row, .crono-row { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .footer-inner { flex-direction: column; }
}
