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

:root {
  /* ── Brand DateO ── */
  --brand:       #16cf61;            /* verde — el "O" */
  --brand-light: rgba(22, 207, 97, 0.12);
  --ink:         #0c0c10;            /* negro casi puro */
  --ink-soft:    #344054;
  --muted:       #667085;

  /* ── Semánticos (se conservan para badges y estados) ── */
  --blue:        #2563eb;            /* info / enlace externo */
  --blue-light:  rgba(37, 99, 235, 0.1);
  --green:       #10b981;            /* éxito / confirmado */
  --green-light: rgba(16, 185, 129, 0.1);
  --gray:        #64748b;
  --gray-light:  rgba(100, 116, 139, 0.1);
  --orange:      #f59e0b;
  --orange-light:rgba(245, 158, 11, 0.1);
  --red:         #ef4444;
  --red-light:   rgba(239, 68, 68, 0.1);

  /* ── Glass ── */
  --white:        rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-sm:    0 4px 16px rgba(12, 12, 16, 0.05);
  --shadow-md:    0 8px 32px rgba(12, 12, 16, 0.09);
  --shadow-lg:    0 16px 48px rgba(12, 12, 16, 0.13);
  --radius:       16px;
  --text-main:    #1e293b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; overscroll-behavior-x: none; }

body {
  font-family: 'Inter', sans-serif;
  /* Fondo claro con toque verde y oscuro para que el glass se note */
  background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 55%, #f0f4ff 100%);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
  overscroll-behavior-x: none;
}

/* Blobs decorativos — verde de marca + oscuro sutil */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
}
body::before {
  top: -100px;
  left: -100px;
  width: 420px;
  height: 420px;
  background: #16cf61;
  opacity: 0.18;
}
body::after {
  bottom: -150px;
  right: -80px;
  width: 500px;
  height: 500px;
  background: #0c0c10;
  opacity: 0.06;
}

/* ── UTILITY: GLASS CARD ── */
.glass-panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ── NAV ── */
nav {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(12, 12, 16, 0.07);
  color: var(--text-main);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 70px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Logo compuesto: mark + wordmark + nombre del profesional */
nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
nav .logo-mark {
  width: 36px; height: 36px;
  background: var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; letter-spacing: -0.5px;
  color: #fff;
  flex-shrink: 0;
}
nav .logo-mark .logo-o { color: var(--brand); }
nav .logo-text {
  display: flex; flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
nav .logo-wordmark {
  font-weight: 800; font-size: 17px; letter-spacing: -0.5px;
  color: var(--ink);
  white-space: nowrap;
}
nav .logo-wordmark .logo-o { color: var(--brand); }
nav .logo-sub {
  font-size: 11px; font-weight: 500;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

nav a {
  color: #475569;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
nav a:hover {
  background: rgba(22, 207, 97, 0.08);
  color: var(--ink);
  transform: translateY(-2px);
}
nav a.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 12px rgba(12, 12, 16, 0.18);
}

/* ── NAV: links container + hamburger (desktop default) ── */
nav .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
nav .nav-logout { margin-left: 8px; }
nav .nav-toggle { display: none; }
nav .nav-backdrop { display: none; }

/* ── NAV: mobile ── */
@media (max-width: 860px) {
  nav {
    position: fixed; left: 0; right: 0; width: 100%;
    padding: 0 16px; height: 60px; gap: 8px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.97);
  }
  .page { padding-top: 76px; }
  nav .logo-wordmark { font-size: 15px; }
  nav .logo-sub { display: none; }
  nav .logo-mark { width: 30px; height: 30px; font-size: 11px; }

  nav .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 38px; height: 38px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    transition: background 0.2s;
  }
  nav .nav-toggle:hover { background: rgba(12, 12, 16, 0.06); }
  nav .nav-toggle span {
    display: block; height: 2px; width: 100%;
    background: var(--ink); border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
    transform-origin: center;
  }
  nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  nav .nav-links {
    position: absolute;
    top: 60px;
    left: 0; right: 0; width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(12, 12, 16, 0.07);
    box-shadow: 0 8px 24px rgba(12, 12, 16, 0.1);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 101;
  }
  nav.open .nav-links { opacity: 1; pointer-events: auto; transform: translateY(0); }

  nav .nav-links a {
    padding: 13px 16px;
    font-size: 15px;
    border-radius: 10px;
    width: 100%;
    text-align: left;
  }
  nav .nav-links a:hover { transform: none; }
  nav .nav-logout {
    margin-left: 0;
    margin-top: 4px;
    color: #b91c1c;
    border-top: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 0;
    padding-top: 13px;
  }
  nav .nav-logout:hover { background: rgba(239, 68, 68, 0.06); color: #991b1b; border-radius: 10px; }

  nav .nav-backdrop {
    display: block;
    position: fixed;
    top: 60px; left: 0; right: 0; bottom: 0;
    background: rgba(12, 12, 16, 0);
    pointer-events: none;
    transition: background 0.25s;
    z-index: 100;
  }
  nav.open .nav-backdrop { background: rgba(12, 12, 16, 0.25); pointer-events: auto; }
}

/* ── Pantallas muy pequeñas ── */
@media (max-width: 540px) {
  .page { padding: 76px 14px 24px; }
  .header-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .header-row h1 { font-size: 26px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-num { font-size: 28px !important; }
}

/* ── LAYOUT ── */
.page { max-width: 1280px; margin: 0 auto; padding: 40px 20px; animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.header-row h1 { font-size: 32px; font-weight: 800; color: #0f172a; letter-spacing: -1px; }
.header-row .sub { font-size: 15px; color: var(--gray); margin-top: 6px; font-weight: 500; }

/* ── STATS CARDS ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 6px; height: 100%;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); background: rgba(255, 255, 255, 0.88); }
.stat-icon { font-size: 32px; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 14px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.stat-num { font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 6px; color: #0f172a; }
.stat-label { font-size: 14px; color: #64748b; font-weight: 600; }
/* brand accent para la stat destacada */
.stat-card.brand::before  { background: var(--brand);  } .stat-card.brand .stat-icon  { color: var(--brand); }
.stat-card.blue::before   { background: var(--blue);   } .stat-card.blue .stat-icon   { color: var(--blue); }
.stat-card.green::before  { background: var(--green);  } .stat-card.green .stat-icon  { color: var(--green); }
.stat-card.gray::before   { background: var(--gray);   } .stat-card.gray .stat-icon   { color: var(--gray); }
.stat-card.orange::before { background: var(--orange); } .stat-card.orange .stat-icon { color: var(--orange); }
.stat-card.red::before    { background: var(--red);    } .stat-card.red .stat-icon    { color: var(--red); }

/* Buttons */
.btn {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: var(--ink);
  color: white;
  box-shadow: 0 8px 20px rgba(12, 12, 16, 0.22);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(12, 12, 16, 0.3);
  background: #1a1a2e;
}
.btn-danger {
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: white;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: #334155;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

/* ── CHARTS & TABLES & PANELS ── */
.chart-card, .table-card, .cal-panel, .list-panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: all 0.3s ease;
}
.chart-card:hover, .table-card:hover { box-shadow: var(--shadow-lg); background: rgba(255, 255, 255, 0.82); }

/* Agenda */
.cal-day {
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.cal-day:hover { background: rgba(255,255,255,0.8); }
.cal-day.empty { background: transparent; border: none; box-shadow: none; }
.cal-day.today {
  background: var(--ink) !important;
  color: #fff !important;
  border: none;
  box-shadow: 0 8px 16px rgba(12, 12, 16, 0.22);
}
.day-detail {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
}
.day-appt {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.5);
}
.appt-card { border-bottom: 1px solid rgba(0,0,0,0.03); }
.appt-card:hover { background: rgba(255,255,255,0.6); }

.tab-bar { border-bottom: 1px solid rgba(0,0,0,0.05); }
.search-row { border-bottom: 1px solid rgba(0,0,0,0.05); }
.search-input {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}

/* Modals */
.modal-overlay {
  background: rgba(12, 12, 16, 0.35);
  backdrop-filter: blur(8px);
}
.modal {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}
.modal-header {
  background: var(--ink);
  color: #fff;
}
.modal-actions { background: rgba(248, 250, 252, 0.5); border-top: 1px solid rgba(0,0,0,0.05); }

/* Stats / Tables */
th { background: rgba(248, 250, 252, 0.5); border-bottom: 1px solid rgba(0,0,0,0.05); }
td { border-bottom: 1px solid rgba(0,0,0,0.03); }
tr:hover td { background: rgba(255,255,255,0.6); }
