/* ===== Variables ===== */
:root {
  --blue: #0071e3;
  --blue-light: #00c7ff;
  --dark: #1d1d1f;
  --gray-bg: #f5f5f7;
  --gray-text: #86868b;
  --white: #ffffff;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
}
.nav-logo img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover;
  ring: 2px solid var(--blue);
}
.nav-logo span { font-weight: 600; font-size: 15px; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 50px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-outline {
  color: var(--blue);
  border: 1px solid var(--blue);
  background: transparent;
}
.btn-outline:hover { background: var(--blue); color: white; }
.btn-primary {
  background: var(--blue); color: white; border: 1px solid var(--blue);
}
.btn-primary:hover { background: #005bb5; }
.btn-danger {
  background: #e53e3e; color: white; border: 1px solid #e53e3e;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; padding: 80px 20px 40px;
}
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1; margin-bottom: 16px;
}
.hero .gradient {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--gray-text); margin-bottom: 32px;
}

/* ===== Sections ===== */
.section {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 80px 20px;
}
.section-gray { background: var(--gray-bg); }
.section-dark { background: var(--dark); color: white; }
.section-inner {
  max-width: 1100px; width: 100%; margin: 0 auto;
}
.section-header {
  text-align: center; margin-bottom: 48px;
}
.badge {
  display: inline-block;
  background: var(--blue); color: white;
  padding: 6px 16px; border-radius: 50px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}
.badge-dark { background: rgba(255,255,255,0.1); }
.section-header h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -0.01em;
}

/* ===== Cards Grid ===== */
.cards { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: white; padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow);
}
.card-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; margin-bottom: 16px;
}
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--gray-text); font-size: 14px; line-height: 1.6; }

/* ===== Cert cards ===== */
.cert-card {
  background: white; padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow);
  display: flex; gap: 16px; align-items: flex-start;
}
.cert-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.cert-card h3 { font-size: 14px; font-weight: 600; }
.cert-card .inst { color: var(--gray-text); font-size: 12px; margin-top: 2px; }
.cert-card .year { color: var(--blue); font-size: 12px; font-weight: 500; }

/* ===== About ===== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: center;
}
.about-photo {
  width: 280px; height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 auto;
  ring: 4px solid rgba(0,113,227,0.3);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-info .subtitle { color: var(--blue); font-weight: 500; margin-bottom: 16px; }
.about-info p { color: rgba(255,255,255,0.7); font-size: 15px; margin-bottom: 24px; }
.about-detail {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.6); font-size: 14px;
  margin-bottom: 12px;
}
.about-detail svg { color: var(--blue); flex-shrink: 0; }

/* ===== Contact ===== */
.contact-form {
  max-width: 440px; margin: 0 auto; width: 100%;
}
.contact-info {
  text-align: center; color: var(--gray-text);
  font-size: 14px; margin-bottom: 32px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 500;
  margin-bottom: 6px;
}
.form-group label .opt { color: var(--gray-text); font-weight: 400; }
.form-input {
  width: 100%; padding: 12px 16px;
  background: var(--gray-bg);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  font-size: 15px; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--blue); }
textarea.form-input { resize: none; min-height: 80px; }
.btn-submit {
  width: 100%; padding: 14px;
  background: var(--blue); color: white;
  border-radius: var(--radius);
  font-weight: 600; font-size: 15px;
  cursor: pointer; transition: background 0.2s;
}
.btn-submit:hover { background: #005bb5; }

/* ===== Footer ===== */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  padding: 24px 20px; text-align: center;
  font-size: 14px;
}

/* ===== Login page ===== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--gray-bg);
}
.login-box {
  background: white; padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  width: 100%; max-width: 400px;
}
.login-box h1 {
  font-size: 24px; font-weight: 700;
  margin-bottom: 8px; text-align: center;
}
.login-box .sub {
  text-align: center; color: var(--gray-text);
  font-size: 14px; margin-bottom: 32px;
}
.error-msg {
  background: #fee; color: #c00; padding: 10px 14px;
  border-radius: 8px; font-size: 13px;
  margin-bottom: 16px; display: none;
}

/* ===== Dashboard Layout ===== */
.dash { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 240px; background: var(--dark); color: white;
  padding: 20px 0; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.dash-sidebar .logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
}
.dash-sidebar .logo h2 { font-size: 16px; font-weight: 600; }
.dash-sidebar .logo small { color: rgba(255,255,255,0.5); font-size: 12px; }
.dash-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,0.6);
  font-size: 14px; transition: all 0.2s;
}
.dash-nav a:hover, .dash-nav a.active {
  color: white; background: rgba(255,255,255,0.08);
}
.dash-nav a svg { width: 18px; height: 18px; }
.dash-main {
  flex: 1; padding: 24px 32px;
  background: var(--gray-bg); overflow-y: auto;
}
.dash-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 24px;
}
.dash-header h1 { font-size: 24px; font-weight: 700; }
.dash-logout { margin-top: auto; padding: 12px 20px; }

/* ===== Dashboard Cards ===== */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; padding: 20px;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-card .label { font-size: 13px; color: var(--gray-text); margin-bottom: 4px; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .value.blue { color: var(--blue); }

/* ===== Tables ===== */
.table-wrap {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th {
  text-align: left; padding: 12px 16px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gray-text);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.table-wrap td {
  padding: 12px 16px; font-size: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.table-wrap tr:hover td { background: rgba(0,0,0,0.01); }

/* ===== Status badges ===== */
.status {
  display: inline-block; padding: 3px 10px;
  border-radius: 50px; font-size: 12px; font-weight: 500;
}
.status-programada { background: #ebf5ff; color: #0071e3; }
.status-confirmada { background: #e6ffed; color: #22863a; }
.status-completada { background: #f0f0f0; color: #666; }
.status-cancelada { background: #ffeef0; color: #d73a49; }

/* ===== Modal ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white; border-radius: var(--radius-lg);
  padding: 32px; width: 90%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* ===== Bitácora ===== */
.mood-scale {
  display: flex; gap: 4px; margin: 8px 0;
}
.mood-scale button {
  width: 36px; height: 36px;
  border-radius: 50%; border: 2px solid rgba(0,0,0,0.1);
  background: white; cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.mood-scale button:hover, .mood-scale button.active {
  border-color: var(--blue); background: var(--blue); color: white;
}
.entry-card {
  background: white; padding: 20px;
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.entry-card .date { font-size: 12px; color: var(--gray-text); }
.entry-card h3 { font-size: 16px; margin: 4px 0 8px; }
.entry-card .mood { font-size: 13px; color: var(--blue); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-photo { width: 200px; height: 200px; }
  .dash { flex-direction: column; }
  .dash-sidebar {
    width: 100%; flex-direction: row;
    padding: 10px; overflow-x: auto;
  }
  .dash-sidebar .logo { display: none; }
  .dash-nav { display: flex; }
  .dash-nav a { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
  .dash-main { padding: 16px; }
  .dash-logout { display: none; }
  .nav-logo span { display: none; }
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--dark); color: white;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 14px; z-index: 200;
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
