:root {
  /* Paleta "Menta Suave" — base clara monocromática para Neumorphism */
  --bg-base: #eaf1ee;
  --bg-base-rgb: 234, 241, 238;
  --shadow-light: #ffffff;
  --shadow-dark: #c3d1cb;
  --shadow-dark-strong: #aebdb6;

  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #d1fae5;
  --secondary: #0284c7;
  --secondary-light: #e0f2fe;
  --accent: #7c3aed;
  --warning: #d97706;
  --danger: #dc2626;

  --text-main: #1f2b25;
  --text-secondary: #33453c;
  --text-muted: #5c6b63;
  --text-dim: #7c8a83;

  --border-soft: rgba(31, 43, 37, 0.08);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 30px;

  /* Sombra dual neumórfica: elemento "extruido" (relieve) */
  --neu-out-sm: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  --neu-out-md: 7px 7px 15px var(--shadow-dark), -7px -7px 15px var(--shadow-light);
  --neu-out-lg: 10px 10px 22px var(--shadow-dark-strong), -10px -10px 22px var(--shadow-light);
  /* Sombra dual neumórfica: elemento "hundido" (inputs, estados presionados) */
  --neu-in-sm: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  --neu-in-md: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

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

body {
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
.navbar {
  background: var(--bg-base);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(31, 43, 37, 0.07);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary);
  box-shadow: var(--neu-out-sm);
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.nav-badges {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-item {
  background: var(--bg-base);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--neu-out-sm);
}

/* TABS */
.nav-tabs-container {
  background: var(--bg-base);
  padding: 12px 28px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.tab-btn {
  background: var(--bg-base);
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--neu-out-sm);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  box-shadow: var(--neu-in-sm);
  font-weight: 700;
}

/* MAIN CONTAINER */
.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--neu-out-md);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg-base);
  box-shadow: var(--neu-out-sm);
  flex-shrink: 0;
}

.stat-icon.blue { color: var(--secondary); }
.stat-icon.green { color: var(--primary); }
.stat-icon.purple { color: var(--accent); }
.stat-icon.amber { color: var(--warning); }

.stat-info .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-info .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* CARDS */
.card {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--neu-out-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* BUTTONS */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--secondary);
  color: white;
  box-shadow: 5px 5px 10px rgba(2, 132, 199, 0.28), -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-primary:hover {
  background: var(--secondary);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--primary);
  color: white;
  box-shadow: 5px 5px 10px rgba(5, 150, 105, 0.3), -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-success:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 5px 5px 10px rgba(220, 38, 38, 0.28), -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-danger:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-base);
  color: var(--text-secondary);
  box-shadow: var(--neu-out-sm);
}

.btn-secondary:hover {
  box-shadow: var(--neu-in-sm);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* TABLES */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

thead th {
  padding: 12px 14px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-soft);
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: rgba(5, 150, 105, 0.05);
}

/* PILLS & BADGES */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-neps { background: #dbeafe; color: #1d4ed8; }
.badge-sanitas { background: #d1fae5; color: #047857; }
.badge-status { background: #ede9fe; color: #6d28d9; }
.badge-confirmed { background: #d1fae5; color: #047857; }
.badge-canceled { background: #fee2e2; color: #b91c1c; }
.badge-reminder2d { background: #dbeafe; color: #1d4ed8; }
.badge-reschedule { background: #fef3c7; color: #b45309; }

/* INPUTS */
input, select, textarea {
  background: var(--bg-base);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: var(--neu-in-sm);
  transition: box-shadow 0.2s ease;
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}

input:focus, select:focus, textarea:focus {
  box-shadow: var(--neu-in-sm), 0 0 0 2px rgba(5, 150, 105, 0.35);
}

input:disabled {
  opacity: 0.65;
}

label {
  color: var(--text-secondary);
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 30, 26, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 10px 28px rgba(20, 30, 26, 0.22);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-base);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--neu-out-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid var(--secondary);
}

.toast.success { border-left-color: var(--primary); }
.toast.error { border-left-color: var(--danger); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* BOTONES DE ACCIÓN RÁPIDA DEDICADOS */
.btn-sanitas {
  background: var(--primary);
  color: white;
  font-weight: 700;
  box-shadow: 5px 5px 10px rgba(5, 150, 105, 0.3), -3px -3px 8px rgba(255, 255, 255, 0.6);
}
.btn-sanitas:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-neps {
  background: var(--secondary);
  color: white;
  font-weight: 700;
  box-shadow: 5px 5px 10px rgba(2, 132, 199, 0.3), -3px -3px 8px rgba(255, 255, 255, 0.6);
}
.btn-neps:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-appointment {
  background: var(--accent);
  color: white;
  font-weight: 700;
  box-shadow: 5px 5px 10px rgba(124, 58, 237, 0.3), -3px -3px 8px rgba(255, 255, 255, 0.6);
}
.btn-appointment:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* BANNER INSTITUCIONAL */
.institution-banner {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: var(--neu-out-md);
  border-left: 4px solid var(--primary);
}

.doc-pill {
  background: var(--bg-base);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 12px;
  box-shadow: var(--neu-out-sm);
}

/* PANEL HUNDIDO (bloques de resultado/feedback dentro de modales) */
.panel-inset {
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--neu-in-sm);
}
