:root {
  --bg-dark: #050508;
  --bg-darker: #020203;
  --bg-card: #111018;
  --bg-card-soft: #181623;
  --accent-pink: #ff4f8b;
  --accent-pink-soft: #ff8fb3;
  --accent-gold: #f9d57a;
  --accent-gold-soft: #fbe9b4;
  --text-main: #f5f5f5;
  --text-muted: #a0a0b8;
  --border-subtle: #2a2836;
  --danger: #ff6b81;
  --success: #4cd964;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
  --radius-lg: 16px;
  --radius-md: 10px;
  --transition-fast: 0.18s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-dark);
}

/* Links */
a {
  color: var(--accent-pink-soft);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ----------------- SHELL APP (dashboard) ----------------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: radial-gradient(circle at top left, #221325 0, #050508 55%, #020203 100%);
}

/* Sidebar */

.app-sidebar {
  width: 230px;
  background: linear-gradient(180deg, #050508 0, #120f18 45%, #050508 100%);
  border-right: 1px solid var(--border-subtle);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.app-sidebar-logo img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent-gold);
}

.app-sidebar-logo span {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 4px 6px;
  letter-spacing: 0.12em;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border var(--transition-fast), transform var(--transition-fast);
}

.sidebar-link span.icon {
  display: inline-flex;
  width: 22px;
  justify-content: center;
  margin-right: 8px;
  opacity: 0.8;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: radial-gradient(circle at left, rgba(255, 79, 139, 0.28), transparent 60%);
  border-color: rgba(255, 79, 139, 0.45);
  transform: translateX(2px);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-user {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Main area */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Top bar */

.app-topbar {
  height: 60px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top right, rgba(249, 213, 122, 0.08), transparent 55%);
}

.app-topbar-left h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}

.app-topbar-left span.sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Content wrapper */

.app-content {
  padding: 22px 24px 32px;
}

/* Generic cards */

.card {
  background: linear-gradient(145deg, var(--bg-card) 0, var(--bg-card-soft) 60%, #151321 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
}

/* Metrics grid (dashboard) */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-card-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-card-main span.value {
  font-size: 26px;
  font-weight: 600;
}

.metric-card-main span.unit {
  font-size: 13px;
  color: var(--text-muted);
}

.metric-trend {
  font-size: 12px;
  margin-top: 6px;
}

.metric-trend.positive {
  color: var(--success);
}
.metric-trend.neutral {
  color: var(--text-muted);
}
.metric-trend.negative {
  color: var(--danger);
}

/* Chart placeholder */

.chart-card {
  margin-top: 8px;
}

.chart-placeholder {
  margin-top: 8px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.07);
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* --------------- LOGIN PAGE --------------- */

.auth-page {
  min-height: 100vh;
  background-image:
    linear-gradient(135deg, rgba(255, 79, 139, 0.35), rgba(5, 5, 8, 0.97)),
    url("../images/rous-bg-login.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.85));
  z-index: -1;
}

.auth-card {
  width: 360px;
  max-width: 100%;
  background: rgba(8, 8, 10, 0.92);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 22px 24px 20px;
  border: 1px solid rgba(249, 213, 122, 0.35);
  backdrop-filter: blur(14px);
  color: var(--text-main);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-logo img {
  height: 72px;
  width: auto;
  object-fit: contain;
}

.auth-title {
  text-align: center;
  margin-bottom: 16px;
}
.auth-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.auth-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-form-group {
  margin-bottom: 12px;
}

.auth-form-group label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.auth-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #2c2936;
  background: #050509;
  color: var(--text-main);
  font-size: 13px;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-pink-soft);
  box-shadow: 0 0 0 1px rgba(255, 79, 139, 0.3);
}

.auth-error {
  background: rgba(255, 107, 129, 0.12);
  border: 1px solid rgba(255, 107, 129, 0.6);
  color: #ffd4da;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 10px;
}

.auth-submit {
  width: 100%;
  padding: 10px 12px;
  border-radius: 22px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-gold));
  color: #050508;
  margin-top: 4px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);
}

.auth-footer-links {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* --------------- FORMS GENERALES --------------- */

.form-section h2 {
  margin-top: 0;
}

.basic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.basic-table th,
.basic-table td {
  border: 1px solid var(--border-subtle);
  padding: 7px 8px;
}
.basic-table thead th {
  background: #181623;
}

.btn-secondary {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #181623;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: var(--accent-pink-soft);
}

.pagination {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

.page-btn, .page-number {
    padding: 8px 14px;
    background: #1f1f2b;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.page-number.active {
    background: #8b5cf6;
    font-weight: bold;
}


/* -------- MODAL GENÉRICO (usado en Agenda) -------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;                 /* oculto por defecto */
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-overlay .modal {
  background: linear-gradient(145deg, var(--bg-card) 0, var(--bg-card-soft) 60%, #151321 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 16px;
  max-width: 900px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
}

.modal-overlay .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-overlay .modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-overlay .modal-close {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-overlay .modal-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-overlay .modal-search input[type="text"] {
  flex: 1;
}

.modal-overlay .modal-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* TIME SLOTS (COLORES CORPORATIVOS ACTUALIZADOS) */

.time-slots-wrapper {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Mensaje */
.time-slots-empty {
  font-size: 12px;
  color: var(--text-muted);
}

/* Base del slot */
button.time-slot {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  background: #181623;          /* base oscuro */
  color: var(--text-main);
}

/* ---------------------------
   DISPONIBLE  (VERDE)
---------------------------- */
button.time-slot.available {
  background: rgba(76, 217, 100, 0.12) !important;
  border-color: rgba(76, 217, 100, 0.35) !important;
  color: var(--success) !important;
}

button.time-slot.available:hover {
  background: rgba(76, 217, 100, 0.22) !important;
  border-color: rgba(76, 217, 100, 0.6) !important;
}

/* ---------------------------
   OCUPADO  (ROJO)
---------------------------- */
button.time-slot.disabled {
  background: rgba(255, 107, 129, 0.12) !important;
  border-color: rgba(255, 107, 129, 0.4) !important;
  color: var(--danger) !important;
  text-decoration: line-through;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---------------------------
   SELECCIONADO
---------------------------- */
button.time-slot.selected {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-gold)) !important;
  border-color: transparent !important;
  color: #050508 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  transform: translateY(-2px);
}

/* Sidebar colapsable */
.app-sidebar {
    width: 220px;
    transition: width .25s ease;
}

.app-sidebar.collapsed {
    width: 60px;
}

/* Ocultar texto cuando está colapsado */
.app-sidebar.collapsed .app-sidebar-logo span,
.app-sidebar.collapsed .sidebar-section-title,
.app-sidebar.collapsed .sidebar-link span:not(.icon),
.app-sidebar.collapsed .sidebar-user div,
.app-sidebar.collapsed .sidebar-user a {
    display: none;
}

/* Centramos los íconos */
.app-sidebar.collapsed .sidebar-link {
    justify-content: center;
}

/* Botón toggle */
.sidebar-toggle {
    cursor: pointer;
    padding: 10px 12px;
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sidebar-toggle:hover {
    color: var(--accent-pink);
}

