/* =========================
   BASE GENERAL
   ========================= */

html,
body {
  margin: 0 !important;
  padding: 0 !important;
  background: #eef4f5;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #333;
  height: auto !important;
  min-height: 0 !important;
}

/* Contenedores principales */
.container,
.container-fluid,
.content {
  margin-top: 5px !important;
  margin-bottom: 5px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  min-height: unset !important;
  height: auto !important;
}

/* Footer */
footer,
.footer,
.page-footer {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* =========================
   TIPOGRAFÍA
   ========================= */

h1,
h2,
h3,
h4 {
  margin-top: 5px !important;
  margin-bottom: 5px !important;
  font-weight: 600;
}

/* =========================
   TABLAS
   ========================= */

.table {
  margin-bottom: 5px !important;
  font-size: 13px;
}

.table th,
.table td {
  padding: 4px 6px !important;
  vertical-align: middle;
}

/* =========================
   FORMULARIOS Y BOTONES
   ========================= */

.form-control {
  padding: 4px 6px !important;
  height: auto !important;
}

.btn {
  padding: 3px 8px !important;
  font-size: 13px !important;
}

/* =========================
   JUMBOTRON / BLOQUES
   ========================= */

.jumbotron {
  background: #fff;
  border: 1px solid #eee;
  margin-top: 5px !important;
  margin-bottom: 5px !important;
  padding: 10px !important;
}

/* =========================
   NAVBAR BRINTER / PRISMA
   ========================= */

.navbar {
  margin-bottom: 5px !important;
  min-height: 40px !important;
  border-radius: 0 !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 16px;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  height: auto !important;
}

/* Fondo principal del navbar */
.navbar-inverse {
  background-color: #0b1f33 !important;
  border-color: #061423 !important;
}

/* Marca y enlaces */
.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
  color: #ffffff !important;
}

/* Espaciado para que los items respiren mejor */
.navbar-inverse .navbar-nav > li > a {
  padding: 10px 14px !important;
  margin: 6px 4px !important;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover / focus */
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus,
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
  background-color: rgba(232, 106, 166, 0.16) !important;
  color: #ffffff !important;
}

/* Ítem activo */
.navbar-inverse .navbar-nav > li.active > a,
.navbar-inverse .navbar-nav > li.active > a:hover,
.navbar-inverse .navbar-nav > li.active > a:focus,
.navbar-inverse .navbar-nav > li > a.active {
  background-color: #e86aa6 !important;
  color: #ffffff !important;
  border-radius: 999px !important;
}

/* Toggle móvil */
.navbar-inverse .navbar-toggle {
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.navbar-inverse .navbar-toggle .icon-bar {
  background-color: #ffffff !important;
}

/* Texto del usuario / zona derecha */
.navbar-text,
.navbar-inverse .navbar-text,
.navbar-inverse .navbar-link {
  color: #ffffff !important;
}

/* =========================
   DROPDOWNS
   ========================= */

.navbar-inverse .dropdown-menu {
  background-color: #10263d !important;
  border: 1px solid #1b3550 !important;
  border-radius: 10px !important;
  padding: 6px 0;
}

.navbar-inverse .dropdown-menu > li > a {
  color: #ffffff !important;
  padding: 8px 16px !important;
}

.navbar-inverse .dropdown-menu > li > a:hover,
.navbar-inverse .dropdown-menu > li > a:focus {
  background-color: #e86aa6 !important;
  color: #ffffff !important;
}

/* =========================
   SUBMENÚS
   ========================= */

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -6px;
}

.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

.dropdown-submenu > a:after {
  content: "";
  float: right;
  width: 0;
  height: 0;
  border-color: transparent;
  border-style: solid;
  border-width: 5px 0 5px 5px;
  border-left-color: #ccc;
  margin-top: 5px;
  margin-right: -10px;
}

.dropdown-submenu:hover > a:after {
  border-left-color: #fff;
}

/* =========================
   TARJETAS / PANELES
   ========================= */

.panel,
.card,
.well {
  border-radius: 8px;
}

/* =========================
   AJUSTES RESPONSIVE
   ========================= */

@media (max-width: 767px) {
  .navbar-inverse .navbar-nav > li > a {
    margin: 2px 8px !important;
    padding: 10px 12px !important;
  }

  .navbar-brand {
    font-size: 15px;
  }
}

/* =========================
   DASHBOARD PRISMA MED
   ========================= */

.dashboard-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 30px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
  padding: 20px;
  border: 1px solid #d5e3e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(30, 48, 58, 0.07);
}

.dashboard-kicker {
  margin: 0 0 4px;
  color: #1f7a72;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-header h1 {
  margin: 0 !important;
  color: #11232f;
  font-size: 32px;
  line-height: 1.15;
}

.dashboard-subtitle {
  max-width: 620px;
  margin: 7px 0 0;
  color: #64717d;
}

.dashboard-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d9e4e8;
  border-radius: 8px;
  background: #f7fbfb;
  color: #2b3a42;
  font-weight: 700;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  position: relative;
  display: block;
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #dce6e9;
  border-radius: 8px;
  background: #fff;
  color: #26333b;
  text-decoration: none !important;
  box-shadow: 0 12px 26px rgba(25, 38, 52, 0.07);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.metric-card:hover,
.metric-card:focus {
  border-color: #b7ccd4;
  color: #26333b;
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(25, 38, 52, 0.1);
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
}

.metric-label {
  display: block;
  color: #5d6b75;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 2px;
  color: #122431;
  font-size: 28px;
  line-height: 1.15;
}

.metric-card small {
  display: block;
  margin-top: 5px;
  color: #697782;
}

.metric-blue .metric-icon { background: #2f6fed; }
.metric-green .metric-icon { background: #2d9d78; }
.metric-teal .metric-icon { background: #16818a; }
.metric-amber .metric-icon { background: #d78625; }

.dashboard-main {
  margin-top: 0;
}

.dashboard-panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #dce6e9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(25, 38, 52, 0.06);
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-panel-head.compact {
  margin-bottom: 10px;
}

.dashboard-panel h2 {
  margin: 0 !important;
  color: #132532;
  font-size: 18px;
  line-height: 1.25;
}

.dashboard-panel p {
  margin: 4px 0 0;
  color: #6d7a84;
}

.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 11px;
  border: 1px solid #e1eaed;
  border-radius: 8px;
  color: #27343d;
  text-decoration: none !important;
}

.timeline-item:hover,
.timeline-item:focus {
  border-color: #b8ccd2;
  background: #f8fbfc;
  color: #27343d;
}

.timeline-time {
  min-width: 0;
  color: #22303a;
  font-weight: 700;
}

.timeline-time small {
  display: block;
  margin-top: 2px;
  color: #6e7c86;
  font-weight: 400;
}

.timeline-body strong,
.timeline-body small {
  display: block;
}

.timeline-body small {
  margin-top: 3px;
  color: #71808b;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8eef2;
  color: #354650;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
  text-transform: capitalize;
}

.status-pendiente { background: #fff2d8; color: #8a5c08; }
.status-confirmada { background: #e2f4ff; color: #17617e; }
.status-llego,
.status-triage,
.status-consulta { background: #e1f7ed; color: #187247; }
.status-finalizada { background: #e8eef2; color: #3d4b55; }
.status-cancelada,
.status-no_asistio { background: #fde5e6; color: #9b2c33; }

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

.compact-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f4;
}

.compact-list li:last-child {
  border-bottom: 0;
}

.compact-list strong,
.compact-list small {
  display: block;
}

.compact-list small {
  margin-top: 2px;
  color: #71808b;
}

.compact-list em {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5f4;
  color: #24746f;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-stats div {
  min-height: 72px;
  padding: 10px;
  border-radius: 8px;
  background: #f4f8f9;
  text-align: center;
}

.mini-stats strong,
.mini-stats span {
  display: block;
}

.mini-stats strong {
  color: #16212c;
  font-size: 24px;
}

.mini-stats span {
  color: #66757f;
  font-size: 12px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dce6e9;
  border-radius: 8px;
  background: #f8fbfc;
  color: #24333c;
  font-weight: 700;
  text-decoration: none !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.quick-actions a:hover,
.quick-actions a:focus {
  border-color: #24746f;
  background: #eef8f6;
  color: #123f3d;
  transform: translateY(-1px);
}

.role-callout {
  min-height: 110px;
  padding: 15px;
  border-radius: 8px;
  color: #fff;
}

.role-callout strong,
.role-callout span {
  display: block;
}

.role-callout strong {
  margin-bottom: 6px;
  font-size: 18px;
}

.role-admin { background: #9f3e5f; }
.role-medico { background: #2866b1; }
.role-enfermera { background: #2e8b68; }
.role-secretaria { background: #227486; }
.role-caja { background: #a6641d; }

.empty-state {
  padding: 18px;
  border: 1px dashed #cfdde2;
  border-radius: 8px;
  background: #f8fbfc;
  color: #6d7a84;
  text-align: center;
}

@media (max-width: 991px) {
  .metric-grid,
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .dashboard-shell {
    width: min(100% - 16px, 640px);
    margin-top: 8px;
  }

  .dashboard-header {
    display: block;
  }

  .dashboard-date {
    margin-top: 10px;
  }

  .dashboard-header h1 {
    font-size: 24px;
  }

  .timeline-item {
    grid-template-columns: 58px 1fr;
  }

  .status-pill {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .metric-grid,
  .quick-actions,
  .mini-stats {
    grid-template-columns: 1fr;
  }
}
