@import url('https://fonts.googleapis.com/css2?family=Antonio:wght@600;700&family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700;800&display=swap');

/* Marca AM Studio: negro #000000, gris #9E9E9E, blanco hueso #F5F5F7, acento #CC4125.
   El gris de marca queda para detalles; el texto secundario usa un gris más oscuro para mantener contraste. */
:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --border: #e4e4e7;
  --text: #000000;
  --text-muted: #6b6b70;
  --brand-gray: #9e9e9e;
  --accent: #cc4125;
  --accent-dark: #a8341c;
  --accent-tint: #faece9;
  --sidebar-bg: #ffffff;
  --radius: 10px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-head: 'Montserrat', 'Inter', Arial, sans-serif;
  --font-display: 'Antonio', 'Montserrat', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

h2, h3 { font-family: var(--font-head); }

a { color: inherit; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 20px 20px;
}

.brand-logo {
  display: block;
  height: 46px;
  width: auto;
}

.sidebar-section {
  padding: 14px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  border-radius: 0;
}

.sidebar-link:hover { background: #f4f4f5; }
.sidebar-link.active { background: #f4f4f5; font-weight: 600; }

.sidebar-user {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.sidebar-user .email {
  color: var(--text-muted);
  font-size: 12px;
}

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.content { padding: 24px 28px; }

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: #f4f4f5; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card .label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.card .value {
  font-size: 28px;
  font-weight: 800;
}

.card .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.panel-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 14px 20px 0;
}

.tab {
  border: none;
  background: transparent;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.tab.active { background: #f4f4f5; color: var(--text); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  padding: 10px 20px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-gray { background: #f4f4f5; color: #52525b; }
.badge-red { background: #fee2e2; color: #b91c1c; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.modal .modal-sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  margin-bottom: 8px;
  font-size: 14px;
}

.radio-card input { width: auto; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.error-msg {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  text-align: center;
}

.login-card .field { text-align: left; }

.logo-card {
  display: block;
  height: 76px;
  width: auto;
  margin: 0 auto 18px;
}

.login-card h1 { margin: 0 0 4px; font-size: 26px; }
.login-card p.sub { margin: 0 0 24px; color: var(--text-muted); font-size: 14px; }

/* Títulos de pantalla en Antonio (tipografía principal de la marca). */
.topbar h1, .login-card h1, .reg-head h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 700;
}
.topbar h1 { font-size: 26px; }

.login-card .btn-primary { width: 100%; justify-content: center; padding: 11px; margin-top: 4px; }

/* ===== Calendario de clases (público y portal del alumno) ===== */
.cal-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cal-chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.cal-semana { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(165px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.cal-dia { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; align-content: flex-start; }
.cal-dia.hoy { border-color: var(--accent); }
.cal-dia-head { font-family: var(--font-display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; text-align: center; padding: 4px 0 6px; }
.cal-card { display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; background: #fff; font: inherit; cursor: pointer;
  border: 1px solid var(--border); border-left: 5px solid var(--brand-gray); border-radius: 8px; padding: 9px 10px; }
.cal-card:hover { background: #fafafa; }
.cal-hora { font-weight: 800; font-size: 14px; }
.cal-nombre { font-size: 13px; font-weight: 600; }
.cal-inst { font-size: 11px; color: var(--text-muted); }
.cal-estado { font-size: 11px; font-weight: 700; color: var(--accent); margin-top: 2px; }
.cal-card.lleno { opacity: .55; cursor: default; }
.cal-card.lleno .cal-estado { color: var(--text-muted); }
.cal-card.res { background: #f4f4f5; cursor: default; }
.cal-card.res .cal-estado { color: #15803d; }
.cal-sin { color: var(--text-muted); font-size: 12px; text-align: center; padding: 14px 0; }
.cal-vacio { color: var(--text-muted); text-align: center; padding: 30px 0; font-size: 14px; }
.cal-resumen { background: #f4f4f5; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 4px 0 12px; }
@media (max-width: 800px) {
  .cal-semana { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
  .cal-dia-head { text-align: left; }
}

.cal-nota { background: var(--accent-tint); color: var(--accent-dark); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }

/* ===== Ubicación y contacto ===== */
.contacto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ct-dir { font-size: 16px; font-weight: 600; line-height: 1.4; }
.ct-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cal-esp { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; margin-left: 4px; }
