/*
  app.css depurado
  Corrección aplicada: sidebar fijo sin doble desplazamiento, iconos SVG premium,
  responsive móvil conservado y bloques duplicados de acciones eliminados.
*/

:root{
  --primario:#00A9B7;
  --primario-oscuro:#047A85;
  --fondo:#F4F8FA;
  --card:#FFFFFF;
  --texto:#111827;
  --muted:#6B7280;
  --border:#E5E7EB;
  --soft:#F8FAFC;
  --danger:#EF4444;
  --warning:#F59E0B;
  --success:#10B981;
  --blue:#3B82F6;
  --shadow:0 18px 45px rgba(15,23,42,.08);
  --shadow-sm:0 10px 28px rgba(15,23,42,.06);
  --radius:22px;
  --radius-sm:14px;
  --sidebar:286px;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  overflow-x:hidden;
  background:var(--fondo);
  color:var(--texto);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px;
  line-height:1.45;
}

a{
  color:inherit;
  text-decoration:none;
}

button,
input,
select,
textarea{
  font:inherit;
}

img{
  max-width:100%;
  display:block;
}

/* ==========================================================
   LAYOUT GENERAL
========================================================== */

.app-shell{
  min-height:100vh;
  display:block;
  background:
    radial-gradient(circle at top left,rgba(0,169,183,.16),transparent 34%),
    var(--fondo);
}


.main-panel{
  margin-left:var(--sidebar);
  width:calc(100% - var(--sidebar));
  padding:24px 28px 34px;
  min-height:100vh;
  overflow-x:hidden;
}

/* ==========================================================
   SIDEBAR
========================================================== */


.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: var(--sidebar);
  height: 100dvh;
  min-height: 100dvh;
  padding: 18px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
      radial-gradient(circle at top left, rgba(255,255,255,.24), transparent 34%),
      linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.94));
  border-right: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 12px 0 35px rgba(15, 23, 42, .06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background:
      linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,255,255,.72)),
      linear-gradient(135deg, rgba(0,169,183,.10), rgba(15,23,42,.03));
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
      radial-gradient(circle at 30% 20%, rgba(255,255,255,.38), transparent 30%),
      linear-gradient(135deg, var(--primario), color-mix(in srgb, var(--primario) 72%, #0f172a));
  color: #fff;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--primario) 30%, transparent);
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  color: #0f172a;
  font-size: .96rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 4px;
}

.side-link {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 17px;
  color: #475569;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 800;
  isolation: isolate;
  overflow: hidden;
  transition:
      color .22s ease,
      background .22s ease,
      transform .22s ease,
      box-shadow .22s ease;
}

.side-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
      linear-gradient(135deg, color-mix(in srgb, var(--primario) 14%, transparent), rgba(255,255,255,.88));
  opacity: 0;
  transition: opacity .22s ease;
}

.side-link::after {
  content: "";
  position: absolute;
  width: 44px;
  height: 44px;
  right: -22px;
  top: 50%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primario) 16%, transparent);
  transform: translateY(-50%) scale(.4);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}

.side-link:hover {
  color: #0f172a;
  transform: translateX(4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.side-link:hover::before {
  opacity: 1;
}

.side-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.side-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--primario);
  background: color-mix(in srgb, var(--primario) 10%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--primario) 15%, transparent);
  transition:
      transform .26s ease,
      color .22s ease,
      background .22s ease,
      box-shadow .22s ease;
}

.side-icon svg {
  display: block;
  transition: transform .45s cubic-bezier(.2,.9,.2,1.25);
  transform-origin: center;
}

.side-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-link:hover .side-icon {
  color: #fff;
  background:
      radial-gradient(circle at 30% 18%, rgba(255,255,255,.35), transparent 34%),
      linear-gradient(135deg, var(--primario), color-mix(in srgb, var(--primario) 72%, #0f172a));
  box-shadow: 0 14px 24px color-mix(in srgb, var(--primario) 28%, transparent);
}

.side-link:hover .side-icon svg {
  animation: sidebarIconSpin .58s cubic-bezier(.2,.9,.2,1.25) both;
}

.side-link.active,
.side-link.activo,
.side-link.is-active {
  color: #fff;
  background:
      radial-gradient(circle at top left, rgba(255,255,255,.30), transparent 34%),
      linear-gradient(135deg, var(--primario), color-mix(in srgb, var(--primario) 70%, #0f172a));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primario) 28%, transparent);
}

.side-link.active::before,
.side-link.activo::before,
.side-link.is-active::before {
  opacity: 0;
}

.side-link.active .side-icon,
.side-link.activo .side-icon,
.side-link.is-active .side-icon {
  color: var(--primario);
  background: rgba(255, 255, 255, .94);
  border-color: rgba(255, 255, 255, .46);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.side-link.active:hover,
.side-link.activo:hover,
.side-link.is-active:hover {
  color: #fff;
  transform: translateX(3px);
}

.side-footer-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 22px;
  background:
      linear-gradient(135deg, rgba(15,23,42,.94), rgba(30,41,59,.92));
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .18);
  overflow: hidden;
  position: relative;
}

.side-footer-card::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -60px;
  top: -60px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primario) 45%, transparent);
}

.side-footer-card .mini-label {
  position: relative;
  color: rgba(255,255,255,.58);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .10em;
}

.side-footer-card strong {
  position: relative;
  display: block;
  margin-top: 6px;
  font-size: .96rem;
  line-height: 1.2;
}

.side-footer-card span {
  position: relative;
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.82);
  font-size: .76rem;
  font-weight: 800;
}

@keyframes sidebarIconSpin {
  0% {
      transform: rotate(0deg) scale(1);
  }
  40% {
      transform: rotate(-18deg) scale(1.08);
  }
  72% {
      transform: rotate(390deg) scale(1.03);
  }
  100% {
      transform: rotate(360deg) scale(1);
  }
}


@media (prefers-reduced-motion: reduce) {
  .side-link,
  .side-icon,
  .side-icon svg,
  .side-link::before,
  .side-link::after {
      transition: none !important;
      animation: none !important;
  }

  .side-link:hover {
      transform: none;
  }
}

/* ==========================================================
   TOPBAR
========================================================== */

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
}

.topbar h1{
  font-size:30px;
  line-height:1.1;
  margin:2px 0 0;
  letter-spacing:-.04em;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.icon-button,
.notification-pill,
.user-pill{
  border:1px solid var(--border);
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(10px);
  border-radius:999px;
  min-height:44px;
}

.icon-button{
  width:44px;
  display:grid;
  place-items:center;
  cursor:pointer;
}

.notification-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 14px;
}

.notification-pill strong{
  display:grid;
  place-items:center;
  min-width:22px;
  height:22px;
  border-radius:999px;
  background:var(--primario);
  color:#fff;
  font-size:12px;
}

.user-pill{
  display:flex;
  align-items:center;
  gap:10px;
  padding:5px 12px 5px 5px;
}

.avatar{
  width:34px;
  height:34px;
  border-radius:999px;
  background:#E6FAFC;
  color:var(--primario-oscuro);
  display:grid;
  place-items:center;
  font-weight:900;
}

.user-text{
  display:grid;
}

.user-text span{
  font-size:11px;
  color:var(--muted);
}

/* ==========================================================
   GRID / CARDS
========================================================== */

.content-grid{
  display:grid;
  gap:18px;
}

.grid-2,
.grid-3,
.grid-4,
.grid-auto{
  display:grid;
  gap:18px;
}

.grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.grid-4{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

.grid-auto{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}

.card{
  background:rgba(255,255,255,.9);
  border:1px solid rgba(229,231,235,.86);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  padding:20px;
}

.card-premium{
  background:linear-gradient(135deg,#fff,rgba(255,255,255,.76));
  box-shadow:var(--shadow);
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:16px;
}

.section-head h2,
.section-head h3{
  margin:0;
  font-size:20px;
  letter-spacing:-.03em;
}

.section-head p{
  margin:4px 0 0;
  color:var(--muted);
}

/* ==========================================================
   KPI BASE
========================================================== */

.kpi{
  position:relative;
  overflow:hidden;
}

.kpi::after{
  content:"";
  position:absolute;
  right:-24px;
  top:-24px;
  width:92px;
  height:92px;
  border-radius:999px;
  background:rgba(0,169,183,.1);
}

.kpi span{
  display:block;
  color:var(--muted);
  font-weight:700;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.kpi strong{
  display:block;
  font-size:30px;
  letter-spacing:-.04em;
  margin-top:8px;
}

.kpi small{
  color:var(--muted);
}

/* ==========================================================
   BUTTONS
========================================================== */

.btn{
  border:0;
  border-radius:14px;
  min-height:42px;
  padding:0 16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:800;
  cursor:pointer;
  transition:.2s ease;
  white-space:nowrap;
}

.btn:hover{
  transform:translateY(-1px);
}

.btn-primary{
  background:linear-gradient(135deg,var(--primario),#25c4d0);
  color:#fff;
  box-shadow:0 12px 25px rgba(0,169,183,.22);
}

.btn-dark{
  background:#111827;
  color:#fff;
}

.btn-ghost{
  background:#fff;
  border:1px solid var(--border);
  color:#334155;
}

.btn-danger{
  background:#fee2e2;
  color:#b91c1c;
}

.btn-success{
  background:#dcfce7;
  color:#166534;
}

.btn-small{
  min-height:34px;
  padding:0 12px;
  border-radius:12px;
  font-size:12px;
}

.btn-full{
  width:100%;
}

/* ==========================================================
   FORMS / TABLES
========================================================== */

.table-toolbar{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
}

.search-input{
  position:relative;
  flex:1;
}

.search-input input,
.form-control,
input,
select,
textarea{
  width:100%;
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  min-height:44px;
  padding:10px 13px;
  outline:none;
  color:#111827;
}

.search-input input{
  padding-left:38px;
}

.search-input::before{
  content:"⌕";
  position:absolute;
  left:14px;
  top:10px;
  color:var(--muted);
}

textarea{
  min-height:100px;
  resize:vertical;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.form-grid-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

label{
  display:grid;
  gap:6px;
  color:#334155;
  font-weight:800;
  font-size:12px;
}

.form-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:16px;
}

.data-table-wrap{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
}

.data-table{
  width:100%;
  border-collapse:collapse;
  min-width:860px;
}

.data-table th{
  background:#F8FAFC;
  color:#475569;
  text-align:left;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.data-table th,
.data-table td{
  padding:14px;
  border-bottom:1px solid #eef2f7;
  vertical-align:middle;
}

.data-table tr:last-child td{
  border-bottom:0;
}

.data-table tbody tr:hover{
  background:#fbfdff;
}

.row-title{
  font-weight:900;
}

.row-sub{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

/* ==========================================================
   BADGES / ALERTS
========================================================== */

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.estado-pendiente{
  background:#FEF3C7;
  color:#92400E;
}

.estado-confirmada{
  background:#D1FAE5;
  color:#065F46;
}

.estado-atendida{
  background:#DBEAFE;
  color:#1D4ED8;
}

.estado-cancelada{
  background:#FEE2E2;
  color:#B91C1C;
}

.estado-no-asistio{
  background:#E5E7EB;
  color:#374151;
}

.badge-soft{
  background:#F1F5F9;
  color:#334155;
}

.empty-state{
  text-align:center;
  padding:30px;
  color:var(--muted);
}

.alert{
  border-radius:16px;
  padding:13px 15px;
  margin-bottom:16px;
  font-weight:700;
}

.alert-ok{
  background:#D1FAE5;
  color:#065F46;
  border:1px solid #A7F3D0;
}

.alert-error{
  background:#FEE2E2;
  color:#991B1B;
  border:1px solid #FECACA;
}

.alert-info{
  background:#E0F2FE;
  color:#075985;
  border:1px solid #BAE6FD;
}

/* ==========================================================
   MODALS
========================================================== */

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.44);
  backdrop-filter:blur(8px);
  z-index:80;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal-backdrop.show{
  display:flex;
}

.modal{
  width:min(760px,100%);
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border-radius:26px;
  box-shadow:0 28px 80px rgba(15,23,42,.22);
  padding:22px;
}

.modal-lg{
  width:min(980px,100%);
}

.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.modal-head h3{
  margin:0;
  font-size:22px;
  letter-spacing:-.04em;
}

.modal-head p{
  margin:4px 0 0;
  color:var(--muted);
}

.modal-close{
  width:38px;
  height:38px;
  border:0;
  border-radius:999px;
  background:#F1F5F9;
  cursor:pointer;
  font-size:20px;
}

/* ==========================================================
   APPOINTMENTS BASE
========================================================== */

.agenda-list{
  display:grid;
  gap:10px;
}

.appointment-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  padding:13px;
  border-radius:18px;
  background:#fff;
  border:1px solid var(--border);
}

.time-dot{
  width:54px;
  height:54px;
  border-radius:18px;
  background:#E6FAFC;
  color:var(--primario-oscuro);
  display:grid;
  place-items:center;
  font-weight:900;
}

.appointment-card h4{
  margin:0;
  font-size:15px;
}

.appointment-card p{
  margin:3px 0 0;
  color:var(--muted);
  font-size:12px;
}

/* ==========================================================
   CALENDAR
========================================================== */

.calendar-board{
  display:grid;
  grid-template-columns:repeat(7,minmax(160px,1fr));
  gap:12px;
  overflow:auto;
  padding-bottom:4px;
}

.day-column{
  background:#fff;
  border:1px solid var(--border);
  border-radius:20px;
  min-height:520px;
  padding:12px;
}

.day-column.today{
  box-shadow:inset 0 0 0 2px rgba(0,169,183,.28);
}

.day-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-bottom:10px;
  margin-bottom:10px;
  border-bottom:1px solid #eef2f7;
}

.day-name{
  font-weight:900;
}

.day-date{
  color:var(--muted);
  font-size:12px;
}

.cal-event{
  display:block;
  border-radius:15px;
  padding:10px;
  margin-bottom:8px;
  color:#fff;
  background:var(--primario);
  box-shadow:0 10px 18px rgba(0,169,183,.16);
}

.cal-event strong{
  display:block;
  font-size:13px;
}

.cal-event span{
  display:block;
  font-size:11px;
  opacity:.9;
  margin-top:2px;
}

.cal-event.estado-pendiente{
  background:#F59E0B;
  color:#fff;
}

.cal-event.estado-confirmada{
  background:#10B981;
  color:#fff;
}

.cal-event.estado-atendida{
  background:#3B82F6;
  color:#fff;
}

.cal-event.estado-cancelada{
  background:#EF4444;
  color:#fff;
}

.cal-event.estado-no-asistio{
  background:#6B7280;
  color:#fff;
}

/* ==========================================================
   TIMELINE / PROFILE
========================================================== */

.timeline{
  display:grid;
  gap:12px;
}

.timeline-item{
  position:relative;
  padding:15px 15px 15px 48px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
}

.timeline-item::before{
  content:"";
  position:absolute;
  left:18px;
  top:19px;
  width:14px;
  height:14px;
  border-radius:999px;
  background:var(--primario);
  box-shadow:0 0 0 6px rgba(0,169,183,.1);
}

.timeline-item h4{
  margin:0;
}

.timeline-item p{
  margin:6px 0 0;
  color:#475569;
}

.timeline-meta{
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}

.profile-head{
  display:flex;
  align-items:center;
  gap:16px;
}

.profile-avatar{
  width:72px;
  height:72px;
  border-radius:24px;
  background:linear-gradient(135deg,var(--primario),#53d7df);
  color:white;
  display:grid;
  place-items:center;
  font-size:24px;
  font-weight:900;
}

.stat-strip{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.stat-strip .badge{
  background:#F8FAFC;
  color:#334155;
}

/* ==========================================================
   DASHBOARD PREMIUM
========================================================== */

.dashboard-page{
  display:grid;
  gap:20px;
}

.dashboard-page .grid-2,
.dashboard-page .grid-3,
.dashboard-page .grid-4,
.dashboard-page .grid-auto{
  display:grid !important;
  gap:18px;
}

.dashboard-page .grid-4{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
}

.dashboard-page .grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

.dashboard-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
  color:var(--primario-oscuro);
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.card.dashboard-hero,
.dashboard-hero{
  position:relative;
  overflow:hidden;
  display:grid !important;
  grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr) !important;
  gap:22px;
  padding:28px !important;
  border:0 !important;
  color:#fff !important;
  background:
    radial-gradient(circle at 8% 15%,rgba(255,255,255,.18),transparent 28%),
    radial-gradient(circle at 85% 18%,rgba(0,169,183,.38),transparent 30%),
    linear-gradient(135deg,#0f172a 0%,#123f47 54%,#00A9B7 100%) !important;
  box-shadow:0 28px 70px rgba(15,23,42,.18) !important;
}

.dashboard-hero::after{
  content:"";
  position:absolute;
  right:-90px;
  bottom:-120px;
  width:280px;
  height:280px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
}

.dashboard-hero-main,
.dashboard-hero-card{
  position:relative;
  z-index:1;
}

.dashboard-hero .dashboard-eyebrow{
  color:rgba(255,255,255,.72);
}

.dashboard-hero h2{
  margin:0;
  max-width:650px;
  font-size:34px;
  line-height:1.05;
  letter-spacing:-.05em;
  color:#fff;
}

.dashboard-hero p{
  max-width:620px;
  margin:10px 0 0;
  color:rgba(255,255,255,.78);
  font-size:14px;
}

.hero-metrics{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:10px;
  margin-top:24px;
}

.hero-metrics div{
  padding:14px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:20px;
  background:rgba(255,255,255,.1);
  backdrop-filter:blur(14px);
}

.hero-metrics strong{
  display:block;
  font-size:24px;
  line-height:1;
  letter-spacing:-.04em;
  color:#fff;
}

.hero-metrics span{
  display:block;
  margin-top:6px;
  color:rgba(255,255,255,.72);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.dashboard-hero-card{
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:190px;
  padding:20px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:24px;
  background:rgba(255,255,255,.12);
  backdrop-filter:blur(18px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14);
}

.dashboard-hero-card .mini-label{
  color:rgba(255,255,255,.72);
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.dashboard-hero-card h3{
  margin:9px 0 0;
  font-size:23px;
  letter-spacing:-.04em;
  color:#fff;
}

.dashboard-hero-card p{
  margin:7px 0 13px;
  color:rgba(255,255,255,.76);
}

.dashboard-hero-card .badge{
  align-self:flex-start;
  background:rgba(255,255,255,.16);
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
}

.hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:16px;
}

.hero-actions .btn-ghost{
  background:rgba(255,255,255,.1);
  color:#fff;
  border-color:rgba(255,255,255,.2);
}

.hero-actions .btn-dark{
  background:#fff;
  color:#0f172a;
}

.dashboard-kpis .card{
  min-height:156px;
}

.dash-kpi{
  position:relative;
  overflow:hidden;
  display:grid !important;
  align-content:space-between;
  gap:10px;
  transition:.22s ease;
}

.dash-kpi:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow);
}

.dash-kpi::after{
  content:"";
  position:absolute;
  right:-34px;
  top:-34px;
  width:115px;
  height:115px;
  border-radius:999px;
  background:rgba(0,169,183,.09);
}

.dash-kpi-top{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.dash-kpi-top span{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.dash-kpi-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:15px;
  color:var(--primario-oscuro);
  background:#E6FAFC;
  font-size:11px;
  font-weight:1000;
  letter-spacing:-.02em;
}

.dash-kpi strong{
  position:relative;
  z-index:1;
  display:block;
  font-size:36px;
  line-height:1;
  letter-spacing:-.06em;
}

.dash-kpi small{
  position:relative;
  z-index:1;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.dash-kpi-success .dash-kpi-icon{
  color:#047857;
  background:#D1FAE5;
}

.metric-line{
  position:relative;
  z-index:1;
  overflow:hidden;
  width:100%;
  height:8px;
  border-radius:999px;
  background:#E5E7EB;
}

.metric-line span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--success),#6EE7B7);
}

.dashboard-shortcuts{
  display:grid !important;
  grid-template-columns:minmax(220px,.7fr) minmax(0,1.3fr) !important;
  gap:18px;
  align-items:center;
}

.shortcut-copy h2{
  margin:0;
  font-size:22px;
  letter-spacing:-.04em;
}

.shortcut-copy p{
  margin:5px 0 0;
  color:var(--muted);
}

.shortcut-actions{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:12px;
}

.shortcut-card{
  position:relative;
  overflow:hidden;
  display:grid;
  gap:4px;
  min-height:92px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:20px;
  background:linear-gradient(135deg,#fff,#F8FAFC);
  transition:.22s ease;
}

.shortcut-card::after{
  content:"";
  position:absolute;
  right:-26px;
  bottom:-26px;
  width:74px;
  height:74px;
  border-radius:999px;
  background:rgba(0,169,183,.08);
}

.shortcut-card:hover{
  transform:translateY(-2px);
  border-color:rgba(0,169,183,.28);
  box-shadow:var(--shadow-sm);
}

.shortcut-card strong{
  position:relative;
  z-index:1;
  font-size:14px;
  letter-spacing:-.02em;
}

.shortcut-card span{
  position:relative;
  z-index:1;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.dashboard-layout{
  display:grid !important;
  grid-template-columns:minmax(0,1.18fr) minmax(360px,.82fr) !important;
  gap:18px;
  align-items:start;
}

.agenda-panel{
  min-height:100%;
}

.agenda-summary{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:10px;
  margin-bottom:16px;
}

.agenda-summary div{
  padding:12px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#F8FAFC;
}

.agenda-summary strong{
  display:block;
  font-size:22px;
  line-height:1;
  letter-spacing:-.04em;
}

.agenda-summary span{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.appointment-card-pro{
  position:relative;
  display:grid !important;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:14px;
  border-radius:20px;
  background:linear-gradient(135deg,#fff,#FBFDFF);
  transition:.2s ease;
}

.appointment-card-pro:hover{
  transform:translateY(-1px);
  border-color:rgba(0,169,183,.26);
  box-shadow:0 14px 34px rgba(15,23,42,.07);
}

.appointment-card-pro.is-next{
  border-color:rgba(0,169,183,.45);
  box-shadow:0 16px 36px rgba(0,169,183,.12);
}

.appointment-card-pro.is-next::before{
  content:"";
  position:absolute;
  left:0;
  top:16px;
  bottom:16px;
  width:4px;
  border-radius:999px;
  background:var(--primario);
}

.time-dot-stack{
  width:62px;
  height:62px;
  display:grid !important;
  place-items:center;
  align-content:center;
  gap:2px;
}

.time-dot-stack strong{
  display:block;
  font-size:14px;
  line-height:1;
}

.time-dot-stack span{
  display:block;
  color:var(--primario-oscuro);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
}

.appointment-main{
  min-width:0;
}

.appointment-title-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.appointment-main h4{
  margin:0;
  font-size:15px;
  letter-spacing:-.02em;
}

.appointment-main p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
}

.appointment-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:9px;
}

.next-chip,
.contact-pill{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:0 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
}

.next-chip{
  color:var(--primario-oscuro);
  background:#E6FAFC;
}

.contact-pill{
  color:#166534;
  background:#DCFCE7;
}

.agenda-list-compact .appointment-card-pro{
  grid-template-columns:auto 1fr auto;
}

.empty-state-dash{
  display:grid;
  gap:4px;
  padding:34px 20px;
  border:1px dashed #CBD5E1;
  border-radius:20px;
  background:#F8FAFC;
}

.empty-state-dash strong{
  color:#334155;
  font-size:14px;
}

.empty-state-dash span{
  color:var(--muted);
  font-size:12px;
}

.patients-card .data-table-wrap{
  border-radius:22px;
}

.patient-cell{
  display:flex;
  align-items:center;
  gap:11px;
}

.patient-avatar{
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border-radius:15px;
  color:var(--primario-oscuro);
  background:#E6FAFC;
  font-size:12px;
  font-weight:1000;
}

.whatsapp-link{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  color:#166534;
  background:#DCFCE7;
  font-size:12px;
  font-weight:900;
}

/* ==========================================================
   MOBILE
========================================================== */

.mobile-only{
  display:none;
}

.mobile-tabbar{
  display:none;
}

@media (max-width:1200px){
  .dashboard-hero,
  .dashboard-layout,
  .dashboard-shortcuts{
    grid-template-columns:1fr !important;
  }

  .shortcut-actions{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .dashboard-page .grid-4{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

@media (max-width:1100px){
  .grid-4{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .grid-3{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:860px){
  .mobile-only{
    display:grid;
  }

  .desktop-only{
    display:none!important;
  }

  .sidebar{
    width: var(--sidebar);
    max-width: min(286px, 88vw);
    transform:translateX(-105%);
    transition:transform .25s ease;
  }

  .sidebar-open .sidebar{
    transform:translateX(0);
  }

  .main-panel{
    margin-left:0;
    width:100%;
    padding:18px 14px 92px;
  }

  .topbar{
    align-items:flex-start;
  }

  .topbar h1{
    font-size:24px;
  }

  .grid-2,
  .grid-3,
  .grid-4{
    grid-template-columns:1fr;
  }

  .form-grid,
  .form-grid-3{
    grid-template-columns:1fr;
  }

  .table-toolbar{
    align-items:stretch;
    flex-direction:column;
  }

  .appointment-card{
    grid-template-columns:auto 1fr;
  }

  .appointment-card .actions{
    grid-column:1/-1;
  }

  .calendar-board{
    grid-template-columns:repeat(7,210px);
  }

  .modal{
    padding:18px;
    border-radius:22px;
  }

  .card.dashboard-hero,
  .dashboard-hero{
    grid-template-columns:1fr !important;
    padding:22px !important;
    border-radius:22px;
  }

  .dashboard-hero h2{
    font-size:27px;
  }

  .hero-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .dashboard-hero-card{
    min-height:auto;
  }

  .shortcut-actions,
  .agenda-summary{
    grid-template-columns:1fr 1fr !important;
  }

  .agenda-list-compact .appointment-card-pro,
  .appointment-card-pro{
    grid-template-columns:auto 1fr !important;
  }

  .appointment-card-pro .actions{
    grid-column:1 / -1;
  }

  .section-head{
    align-items:stretch;
    flex-direction:column;
  }

  .section-head .btn{
    width:100%;
  }

  .mobile-tabbar{
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:70;
    background:rgba(255,255,255,.92);
    backdrop-filter:blur(18px);
    border:1px solid var(--border);
    border-radius:24px;
    box-shadow:0 20px 50px rgba(15,23,42,.16);
    display:grid;
    grid-template-columns:repeat(4,1fr);
    padding:8px;
  }

  .mobile-tabbar a{
    display:grid;
    place-items:center;
    gap:2px;
    font-size:11px;
    color:var(--muted);
    font-weight:900;
  }

  .mobile-tabbar a span{
    font-size:18px;
  }

  .mobile-tabbar a.is-active{
    color:var(--primario-oscuro);
  }
}

@media (max-width:520px){
  .hero-metrics,
  .shortcut-actions,
  .agenda-summary,
  .dashboard-page .grid-4{
    grid-template-columns:1fr !important;
  }

  .dashboard-hero h2{
    font-size:24px;
  }

  .dash-kpi strong{
    font-size:32px;
  }
}

/* ==========================================================
   PRINT
========================================================== */

@media print{
  .sidebar,
  .topbar,
  .mobile-tabbar,
  .btn,
  .table-toolbar{
    display:none!important;
  }

  .main-panel{
    margin:0;
    width:100%;
    padding:0;
    overflow:visible;
  }

  .card{
    box-shadow:none;
    border:1px solid #ddd;
  }
}

/* ==========================================================
 ALERTAS INTERNAS DEL SISTEMA
========================================================== */

.alertas-sistema-root {
position: fixed !important;
right: 24px !important;
bottom: 24px !important;
z-index: 999999 !important;
}

.alerta-sonido-btn {
display: block !important;
border: 0 !important;
padding: 12px 18px !important;
border-radius: 999px !important;
background: #4b0714 !important;
color: #ffffff !important;
font-size: 13px !important;
font-weight: 900 !important;
cursor: pointer !important;
box-shadow: 0 20px 50px rgba(15, 23, 42, .25) !important;
}

.alerta-sonido-btn.is-active {
background: #0f766e !important;
}

.alertas-sistema-panel {
width: 430px !important;
max-width: calc(100vw - 32px) !important;
margin-bottom: 14px !important;
border-radius: 24px !important;
background: #ffffff !important;
border: 1px solid rgba(229, 231, 235, .95) !important;
box-shadow: 0 32px 90px rgba(15, 23, 42, .28) !important;
overflow: hidden !important;
}

.alertas-sistema-head {
display: flex !important;
justify-content: space-between !important;
align-items: center !important;
padding: 18px 20px !important;
background: linear-gradient(135deg, #4b0714, #7A0F22) !important;
color: #ffffff !important;
}

.alertas-sistema-head strong {
display: block !important;
font-size: 16px !important;
font-weight: 900 !important;
}

.alertas-sistema-head span {
display: block !important;
margin-top: 2px !important;
font-size: 12px !important;
font-weight: 700 !important;
opacity: .85 !important;
}

.alertas-sistema-head button {
width: 34px !important;
height: 34px !important;
border: 0 !important;
border-radius: 999px !important;
background: rgba(255, 255, 255, .15) !important;
color: #ffffff !important;
font-size: 22px !important;
cursor: pointer !important;
}

.alertas-sistema-lista {
padding: 14px !important;
max-height: 440px !important;
overflow-y: auto !important;
background: #ffffff !important;
}

.alerta-sistema-card {
display: grid !important;
grid-template-columns: 44px 1fr !important;
gap: 12px !important;
padding: 14px !important;
border-radius: 18px !important;
background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
border: 1px solid #e5e7eb !important;
box-shadow: 0 12px 28px rgba(15, 23, 42, .08) !important;
}

.alerta-sistema-card + .alerta-sistema-card {
margin-top: 12px !important;
}

.alerta-sistema-icon {
width: 44px !important;
height: 44px !important;
border-radius: 16px !important;
display: grid !important;
place-items: center !important;
background: rgba(75, 7, 20, .08) !important;
color: #4b0714 !important;
font-size: 18px !important;
font-weight: 900 !important;
}

.alerta-sistema-body strong {
display: block !important;
margin-bottom: 5px !important;
color: #0f172a !important;
font-size: 15px !important;
font-weight: 900 !important;
}

.alerta-sistema-body p {
margin: 0 !important;
color: #475569 !important;
font-size: 13px !important;
line-height: 1.45 !important;
}

.alerta-sistema-body p + p {
margin-top: 6px !important;
}

.alerta-sistema-body b {
color: #4b0714 !important;
font-weight: 900 !important;
}

.alerta-sistema-meta {
display: flex !important;
flex-wrap: wrap !important;
gap: 7px !important;
margin-top: 10px !important;
}

.alerta-sistema-meta span {
display: inline-flex !important;
align-items: center !important;
min-height: 26px !important;
padding: 0 9px !important;
border-radius: 999px !important;
background: #f1f5f9 !important;
border: 1px solid #e2e8f0 !important;
color: #475569 !important;
font-size: 11px !important;
font-weight: 900 !important;
}

.alerta-sistema-actions {
display: flex !important;
gap: 8px !important;
flex-wrap: wrap !important;
margin-top: 12px !important;
}

.btn-alerta {
border: 0 !important;
min-height: 34px !important;
padding: 8px 12px !important;
border-radius: 12px !important;
font-size: 12px !important;
font-weight: 900 !important;
cursor: pointer !important;
text-decoration: none !important;
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
transition: .2s ease !important;
}

.btn-alerta-primary {
background: #4b0714 !important;
color: #ffffff !important;
}

.btn-alerta-light {
background: #f1f5f9 !important;
color: #334155 !important;
}

.btn-alerta:hover {
transform: translateY(-1px) !important;
}

.btn-alerta:disabled {
opacity: .65 !important;
cursor: not-allowed !important;
transform: none !important;
}

.alerta-sistema-empty {
padding: 22px !important;
text-align: center !important;
color: #64748b !important;
font-size: 13px !important;
font-weight: 700 !important;
}

.alertas-sistema-root.tiene-alertas .alerta-sonido-btn {
animation: alertaPulse 1.2s infinite !important;
}

@keyframes alertaPulse {
0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, .35); }
70% { box-shadow: 0 0 0 14px rgba(15, 118, 110, 0); }
100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

@media (max-width: 768px) {
.alertas-sistema-root {
  left: 14px !important;
  right: 14px !important;
  bottom: calc(14px + env(safe-area-inset-bottom)) !important;
}

.alertas-sistema-panel {
  width: 100% !important;
}

.alerta-sonido-btn {
  width: 100% !important;
}
}

/* ==========================================================
   ACCIONES COMPACTAS - TABLAS
========================================================== */

#tablaRecordatorios .actions-cell,
#tablaPacientes .actions-cell {
    position: relative !important;
    width: 150px !important;
    min-width: 150px !important;
    overflow: visible !important;
}

#tablaRecordatorios .actions-compact,
#tablaPacientes .actions-compact {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

#tablaRecordatorios .action-primary,
#tablaPacientes .action-primary {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 13px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

#tablaRecordatorios .actions-menu-wrap,
#tablaPacientes .actions-menu-wrap {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
}

#tablaRecordatorios .actions-more-btn,
#tablaPacientes .actions-more-btn {
    width: 36px !important;
    height: 34px !important;
    min-width: 36px !important;
    min-height: 34px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    padding: 0 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
    transition: .2s ease !important;
}

#tablaRecordatorios .actions-more-btn:hover,
#tablaRecordatorios .actions-more-btn.is-open,
#tablaPacientes .actions-more-btn:hover,
#tablaPacientes .actions-more-btn.is-open {
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    transform: translateY(-1px) !important;
}

#tablaRecordatorios .actions-menu,
#tablaPacientes .actions-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    z-index: 999999 !important;
    width: 205px !important;
    padding: 8px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18) !important;
}

#tablaRecordatorios .actions-menu::before,
#tablaPacientes .actions-menu::before {
    content: "" !important;
    position: absolute !important;
    top: -6px !important;
    right: 14px !important;
    width: 12px !important;
    height: 12px !important;
    background: #ffffff !important;
    border-left: 1px solid #e2e8f0 !important;
    border-top: 1px solid #e2e8f0 !important;
    transform: rotate(45deg) !important;
}

#tablaRecordatorios .actions-menu form,
#tablaPacientes .actions-menu form {
    margin: 0 !important;
}

#tablaRecordatorios .actions-menu-item,
#tablaPacientes .actions-menu-item {
    width: 100% !important;
    height: 38px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-align: left !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

#tablaRecordatorios .actions-menu-item:hover,
#tablaPacientes .actions-menu-item:hover {
    background: #f8fafc !important;
}

#tablaRecordatorios .actions-menu-item.danger,
#tablaPacientes .actions-menu-item.danger {
    color: #b42318 !important;
}

#tablaRecordatorios .actions-menu-item.danger:hover,
#tablaPacientes .actions-menu-item.danger:hover {
    background: #fff1f1 !important;
}

#tablaRecordatorios,
#tablaRecordatorios tbody,
#tablaRecordatorios tr,
#tablaRecordatorios td,
#tablaPacientes,
#tablaPacientes tbody,
#tablaPacientes tr,
#tablaPacientes td,
.data-table-wrap {
    overflow: visible !important;
}

.data-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* =========================================================
   CALENDARIO SEMANAL COMPACTO
   Scroll interno invisible por día
========================================================= */

.calendar-page-card {
  padding: 22px;
  overflow: hidden;
}

.calendar-section-head {
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.calendar-section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primario);
}

.calendar-section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  color: #0f172a;
}

.calendar-section-head p {
  margin: 6px 0 0;
  font-size: 14px;
  color: #64748b;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.calendar-board-compact {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  gap: 12px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-board-compact::-webkit-scrollbar {
  height: 0;
}

.calendar-day-compact {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  height: 620px;
  max-height: calc(100vh - 260px);
  min-height: 440px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.calendar-day-compact.today {
  border-color: color-mix(in srgb, var(--primario) 42%, transparent);
  box-shadow: 
      0 18px 42px rgba(15, 23, 42, .08),
      0 0 0 3px color-mix(in srgb, var(--primario) 12%, transparent);
}

.calendar-day-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}

.calendar-day-head .day-name {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.calendar-day-head .day-date {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.day-count {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.day-add-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
}

.day-events-scroll {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scroll-behavior: smooth;

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.day-events-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.day-events-scroll::after {
  content: "";
  position: sticky;
  bottom: -10px;
  display: block;
  height: 24px;
  margin-top: -24px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(251, 253, 255, 0), #fbfdff 85%);
}

.calendar-event-compact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
  padding: 11px 10px;
  border-radius: 15px;
  text-decoration: none;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.calendar-event-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
  filter: saturate(1.05);
}

.calendar-event-compact strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 900;
}

.calendar-event-compact span {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  opacity: .95;
}

.calendar-event-compact small {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #ffffff;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.calendar-empty {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 1280px) {
  .calendar-board-compact {
      grid-template-columns: repeat(7, 180px);
  }

  .calendar-day-compact {
      height: 580px;
  }
}

@media (max-width: 900px) {
  .calendar-page-card {
      padding: 16px;
  }

  .calendar-section-head {
      flex-direction: column;
  }

  .calendar-actions {
      width: 100%;
      justify-content: flex-start;
  }

  .calendar-actions .btn {
      flex: 1 1 auto;
  }

  .calendar-board-compact {
      grid-template-columns: repeat(7, 180px);
      overflow-x: auto;
  }

  .calendar-day-compact {
      height: 560px;
      max-height: none;
  }
}

@media (max-width: 560px) {
  .calendar-actions .btn {
      width: 100%;
  }

  .calendar-board-compact {
      grid-template-columns: repeat(7, 82vw);
      gap: 10px;
  }

  .calendar-day-compact {
      min-width: 82vw;
      height: 560px;
  }
}

/* ==========================================================
   FIX RESPONSIVE FINAL - DASHBOARD / CARDS / TABLAS
   Pegar al final de app.css
========================================================== */

@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .app-shell,
  .main-panel,
  .content-grid,
  .dashboard-page {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .main-panel {
    margin-left: 0 !important;
    padding: 16px 12px calc(96px + env(safe-area-inset-bottom)) !important;
  }

  .card {
    min-width: 0 !important;
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .dashboard-page {
    gap: 14px !important;
  }

  .card.dashboard-hero,
  .dashboard-hero,
  .dashboard-layout,
  .dashboard-shortcuts {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .card.dashboard-hero,
  .dashboard-hero {
    padding: 20px !important;
    border-radius: 22px !important;
  }

  .dashboard-hero h2 {
    font-size: clamp(22px, 7vw, 27px) !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere !important;
  }

  .dashboard-hero p,
  .dashboard-hero-card p {
    font-size: 13px !important;
    overflow-wrap: anywhere !important;
  }

  .dashboard-hero-card {
    min-height: auto !important;
    padding: 16px !important;
  }

  .dashboard-hero-card h3 {
    font-size: 21px !important;
    overflow-wrap: anywhere !important;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 16px !important;
  }

  .hero-metrics div {
    min-width: 0 !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }

  .hero-metrics strong {
    font-size: 22px !important;
  }

  .hero-metrics span {
    font-size: 10px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }

  .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    text-align: center !important;
  }

  .shortcut-copy h2,
  .section-head h2 {
    font-size: 20px !important;
    line-height: 1.15 !important;
  }

  .shortcut-copy p,
  .section-head p {
    font-size: 13px !important;
  }

  .shortcut-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .shortcut-card {
    min-width: 0 !important;
    min-height: auto !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .shortcut-card strong,
  .shortcut-card span {
    overflow-wrap: anywhere !important;
  }

  .section-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .section-head .btn {
    width: 100% !important;
  }

  .agenda-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .agenda-summary div {
    padding: 11px !important;
    border-radius: 16px !important;
    min-width: 0 !important;
  }

  .agenda-summary strong {
    font-size: 21px !important;
  }

  .agenda-summary span {
    font-size: 10px !important;
    overflow-wrap: anywhere !important;
  }

  .appointment-card,
  .appointment-card-pro,
  .agenda-list-compact .appointment-card-pro {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
    padding: 14px !important;
    min-width: 0 !important;
  }

  .appointment-card-pro.is-next::before {
    top: 14px !important;
    bottom: 14px !important;
  }

  .time-dot,
  .time-dot-stack {
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border-radius: 16px !important;
  }

  .time-dot-stack strong,
  .time-dot-stack span {
    line-height: 1 !important;
  }

  .appointment-main {
    width: 100% !important;
    min-width: 0 !important;
  }

  .appointment-title-row {
    align-items: flex-start !important;
  }

  .appointment-main h4,
  .appointment-main p,
  .appointment-tags,
  .badge,
  .contact-pill,
  .next-chip {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }

  .appointment-card-pro .actions,
  .appointment-card .actions,
  .actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .appointment-card-pro .actions .btn,
  .appointment-card .actions .btn,
  .actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 10px !important;
    white-space: normal !important;
    text-align: center !important;
  }

  /* Tabla de pacientes convertida en cards en móvil */
  .patients-card .data-table-wrap {
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  .patients-card .data-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
  }

  .patients-card .data-table thead {
    display: none !important;
  }

  .patients-card .data-table tbody,
  .patients-card .data-table tr,
  .patients-card .data-table td {
    display: block !important;
    width: 100% !important;
  }

  .patients-card .data-table tr {
    margin-bottom: 12px !important;
    padding: 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--shadow-sm) !important;
  }

  .patients-card .data-table td {
    padding: 8px 0 !important;
    border-bottom: 1px solid #eef2f7 !important;
  }

  .patients-card .data-table td:last-child {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .patients-card .data-table td:nth-child(2)::before,
  .patients-card .data-table td:nth-child(3)::before,
  .patients-card .data-table td:nth-child(4)::before,
  .patients-card .data-table td:nth-child(5)::before {
    display: block !important;
    margin-bottom: 4px !important;
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
  }

  .patients-card .data-table td:nth-child(2)::before {
    content: "Documento";
  }

  .patients-card .data-table td:nth-child(3)::before {
    content: "WhatsApp";
  }

  .patients-card .data-table td:nth-child(4)::before {
    content: "Registro";
  }

  .patients-card .data-table td:nth-child(5)::before {
    content: "Acciones";
  }

  .patients-card .data-table td.actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .patients-card .data-table td.actions::before {
    grid-column: 1 / -1 !important;
  }

  .patient-cell {
    align-items: flex-start !important;
    min-width: 0 !important;
  }

  .patient-cell > div:last-child {
    min-width: 0 !important;
  }

  .row-title,
  .row-sub,
  .whatsapp-link {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 520px) {
  .main-panel {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .card {
    padding: 14px !important;
  }

  .hero-metrics,
  .shortcut-actions,
  .agenda-summary {
    grid-template-columns: 1fr !important;
  }

  .dashboard-hero h2 {
    font-size: 23px !important;
  }

  .dashboard-hero-card h3 {
    font-size: 20px !important;
  }

  .appointment-card-pro .actions,
  .appointment-card .actions,
  .actions,
  .patients-card .data-table td.actions {
    grid-template-columns: 1fr !important;
  }

  .btn {
    width: 100% !important;
    min-height: 44px !important;
    white-space: normal !important;
    text-align: center !important;
  }

  .notification-pill,
  .user-pill {
    max-width: 100% !important;
  }

  .user-text {
    min-width: 0 !important;
  }
}

/* ==========================================================
   FIX RESPONSIVE CALENDARIO COMPACTO
========================================================== */

@media (max-width: 560px) {
  .calendar-page-card {
    padding: 14px !important;
    overflow: hidden !important;
  }

  .calendar-section-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .calendar-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .calendar-actions .btn {
    width: 100% !important;
  }

  .calendar-board-compact {
    display: flex !important;
    gap: 12px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    padding-bottom: 8px !important;
  }

  .calendar-day-compact {
    flex: 0 0 calc(100vw - 48px) !important;
    min-width: 0 !important;
    width: calc(100vw - 48px) !important;
    height: min(560px, calc(100dvh - 190px)) !important;
    max-height: none !important;
    scroll-snap-align: start !important;
  }
}

/* ==========================================================
   SIDEBAR COLLAPSABLE
   Breakpoint único:
   - Escritorio: desde 861px
   - Móvil: hasta 860px
========================================================== */

:root {
    --sidebar-collapsed: 76px;
}

/*
|--------------------------------------------------------------------------
| TRANSICIONES GENERALES
|--------------------------------------------------------------------------
*/

.sidebar {
    transition:
        width .24s ease,
        padding .24s ease,
        transform .24s ease,
        box-shadow .24s ease !important;
}

.sidebar-inner {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-panel {
    min-width: 0;
    transition:
        margin-left .24s ease,
        width .24s ease !important;
}

.sidebar-backdrop {
    display: none;
}

/*
|--------------------------------------------------------------------------
| ESCRITORIO
|--------------------------------------------------------------------------
*/

@media (min-width: 861px) {

    /*
    | Sidebar contraído
    */

    .app-shell.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed) !important;
        padding-right: 10px !important;
        padding-left: 10px !important;
    }

    .app-shell.sidebar-collapsed .main-panel {
        width: calc(
            100% - var(--sidebar-collapsed)
        ) !important;

        margin-left:
            var(--sidebar-collapsed) !important;
    }

    /*
    | Logo
    */

    .app-shell.sidebar-collapsed
    .brand-card {
        min-height: 58px !important;
        justify-content: center !important;
        gap: 0 !important;
        padding: 8px 0 !important;
        border-radius: 20px !important;
    }

    .app-shell.sidebar-collapsed
    .brand-logo {
        width: 42px !important;
        height: 42px !important;
        flex: 0 0 42px !important;
        border-radius: 15px !important;
    }

    .app-shell.sidebar-collapsed
    .brand-copy {
        display: none !important;
    }

    /*
    | Navegación
    */

    .app-shell.sidebar-collapsed
    .side-nav {
        gap: 8px !important;
        padding: 0 !important;
    }

    .app-shell.sidebar-collapsed
    .side-link {
        min-height: 50px !important;
        justify-content: center !important;
        gap: 0 !important;
        padding: 6px 0 !important;
        border-radius: 17px !important;
        transform: none !important;
    }

    .app-shell.sidebar-collapsed
    .side-link:hover {
        transform: none !important;
    }

    .app-shell.sidebar-collapsed
    .side-link::after {
        display: none !important;
    }

    .app-shell.sidebar-collapsed
    .side-icon {
        width: 40px !important;
        height: 40px !important;
        flex: 0 0 40px !important;
        margin: 0 !important;
    }

    .app-shell.sidebar-collapsed
    .side-text {
        display: none !important;
    }

    /*
    | Información del usuario
    */

    .app-shell.sidebar-collapsed
    .side-footer-card {
        display: none !important;
    }

    /*
    | Botones del topbar
    */

    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: inline-flex;
    }

    .icon-button.desktop-only {
        display: inline-grid !important;
    }
}

/*
|--------------------------------------------------------------------------
| MÓVIL
|--------------------------------------------------------------------------
*/

@media (max-width: 860px) {

    /*
    | En móvil nunca se utiliza
    | sidebar-collapsed.
    */

    .app-shell.sidebar-collapsed {
        display: block !important;
    }

    .sidebar,
    .app-shell.sidebar-collapsed
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        z-index: 100 !important;

        width: var(--sidebar) !important;
        max-width: min(
            286px,
            88vw
        ) !important;

        height: 100dvh !important;
        min-height: 100dvh !important;

        padding:
            18px
            14px !important;

        transform:
            translateX(-105%) !important;

        transition:
            transform .25s ease,
            box-shadow .25s ease !important;
    }

    /*
    | Sidebar abierto
    */

    .app-shell.sidebar-open
    .sidebar {
        transform:
            translateX(0) !important;

        box-shadow:
            20px 0 60px
            rgba(15, 23, 42, .22) !important;
    }

    /*
    | Contenido principal
    */

    .main-panel,
    .app-shell.sidebar-collapsed
    .main-panel {
        width: 100% !important;
        margin-left: 0 !important;
    }

    /*
    | Restaurar logo y textos completos.
    */

    .app-shell.sidebar-collapsed
    .brand-card {
        min-height: auto !important;
        justify-content:
            flex-start !important;
        gap: 12px !important;
        padding: 14px !important;
    }

    .app-shell.sidebar-collapsed
    .brand-logo {
        width: 48px !important;
        height: 48px !important;
        flex: 0 0 48px !important;
    }

    .app-shell.sidebar-collapsed
    .brand-copy {
        display: block !important;
    }

    .app-shell.sidebar-collapsed
    .side-nav {
        padding: 4px !important;
        gap: 7px !important;
    }

    .app-shell.sidebar-collapsed
    .side-link {
        min-height: 48px !important;
        justify-content:
            flex-start !important;
        gap: 12px !important;
        padding: 10px 12px !important;
    }

    .app-shell.sidebar-collapsed
    .side-icon {
        width: 38px !important;
        height: 38px !important;
        flex: 0 0 38px !important;
    }

    .app-shell.sidebar-collapsed
    .side-text {
        display: block !important;
    }

    .app-shell.sidebar-collapsed
    .side-footer-card {
        display: block !important;
    }

    /*
    | Fondo oscuro al abrir.
    */

    .app-shell.sidebar-open
    .sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 90 !important;

        display: block !important;

        background:
            rgba(15, 23, 42, .42) !important;

        backdrop-filter:
            blur(3px) !important;
    }

    body.body-sidebar-open {
        overflow: hidden !important;
    }

    /*
    | Botones responsive.
    */

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: inline-grid !important;
    }

    .icon-button.desktop-only {
        display: none !important;
    }

    .icon-button.mobile-only {
        display: inline-grid !important;
    }
}

/* ==========================================================
   TOPBAR PREMIUM
========================================================== */

.topbar.topbar-premium {
  position: sticky !important;
  top: 16px !important;
  z-index: 45 !important;
  min-height: 78px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin: 0 0 22px !important;
  padding: 14px 16px !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at top left, rgba(0, 169, 183, .10), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.88)) !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  box-shadow:
    0 22px 55px rgba(15, 23, 42, .08),
    inset 0 1px 0 rgba(255,255,255,.78) !important;
  backdrop-filter: blur(18px) !important;
}

.topbar-left {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.topbar-title-block {
  min-width: 0 !important;
  display: grid !important;
  gap: 2px !important;
}

.page-kicker {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin: 0 !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  letter-spacing: .10em !important;
  text-transform: uppercase !important;
  line-height: 1.1 !important;
}

.kicker-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 999px !important;
  background: var(--primario) !important;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primario) 14%, transparent) !important;
}

.topbar h1 {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: clamp(22px, 2vw, 30px) !important;
  line-height: 1.05 !important;
  font-weight: 950 !important;
  letter-spacing: -.055em !important;
}

.icon-button {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid rgba(148, 163, 184, .20) !important;
  border-radius: 17px !important;
  background:
    linear-gradient(135deg, #ffffff, #f1f8fa) !important;
  color: #0f172a !important;
  cursor: pointer !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06) !important;
  transition:
    transform .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease !important;
}

.icon-button:hover {
  transform: translateY(-1px) !important;
  color: var(--primario) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .09) !important;
}

.topbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.notification-pill {
  min-height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 11px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.86) !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05) !important;
}

.notification-icon {
  width: 28px !important;
  height: 28px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: #fff7ed !important;
  font-size: 13px !important;
}

.notification-pill strong {
  min-width: 24px !important;
  height: 24px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: var(--primario) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

.user-pill {
  min-height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 14px 6px 7px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.88) !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05) !important;
}

.avatar {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.38), transparent 32%),
    linear-gradient(135deg, var(--primario), color-mix(in srgb, var(--primario) 70%, #0f172a)) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primario) 26%, transparent) !important;
}

.user-text {
  min-width: 0 !important;
  display: grid !important;
  line-height: 1.1 !important;
}

.user-text strong {
  max-width: 120px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

.user-text span {
  margin-top: 3px !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
}

.btn-logout {
  min-height: 46px !important;
  padding: 0 18px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid rgba(148, 163, 184, .24) !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 950 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05) !important;
}

.btn-logout:hover {
  background: #0f172a !important;
  color: #ffffff !important;
}

/* Cuando el sidebar está colapsado, el header respira mejor */
.app-shell.sidebar-collapsed .topbar.topbar-premium {
  margin-left: 0 !important;
}

/* Responsive */
@media (max-width: 860px) {
  .topbar.topbar-premium {
    position: sticky !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    min-height: 68px !important;
    padding: 11px 12px !important;
    border-radius: 22px !important;
    gap: 10px !important;
  }

  .topbar-left {
    gap: 10px !important;
  }

  .icon-button {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 15px !important;
  }

  .page-kicker {
    font-size: 9px !important;
    letter-spacing: .08em !important;
  }

  .kicker-dot {
    display: none !important;
  }

  .topbar h1 {
    font-size: 21px !important;
  }

  .topbar-actions {
    gap: 6px !important;
  }

  .notification-pill {
    min-height: 40px !important;
    padding: 5px 8px !important;
  }

  .notification-icon {
    width: 25px !important;
    height: 25px !important;
  }

  .notification-pill strong {
    min-width: 22px !important;
    height: 22px !important;
  }

  .user-pill {
    min-height: 40px !important;
    padding: 5px !important;
  }

  .avatar {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 520px) {
  .topbar.topbar-premium {
    align-items: center !important;
  }

  .topbar-actions {
    flex-shrink: 0 !important;
  }

  .notification-icon {
    display: none !important;
  }

  .notification-pill {
    gap: 0 !important;
  }
}

/* ==========================================================
   FIX DEFINITIVO: EVITAR DOBLE BOTÓN HAMBURGER
========================================================== */

/* Desktop: solo se ve el botón collapsable */
.icon-button.mobile-only {
  display: none !important;
}

.icon-button.desktop-only {
  display: inline-grid !important;
}

/* Móvil: solo se ve el botón para abrir sidebar */
@media (max-width: 860px) {
  .icon-button.mobile-only {
    display: inline-grid !important;
  }

  .icon-button.desktop-only {
    display: none !important;
  }
}

/* ==========================================================
   AJUSTE FINO TOPBAR + SEPARACIÓN CON HERO
========================================================== */

/* Desktop */
@media (min-width: 861px) {
  .main-panel {
    padding-top: 14px !important;
    padding-left: 22px !important;
    padding-right: 22px !important;
  }

  .topbar.topbar-premium {
    top: 10px !important;
    margin-bottom: 20px !important;
  }

  .dashboard-page,
  .content-grid {
    gap: 20px !important;
  }

  .dashboard-hero,
  .card.dashboard-hero {
    margin-top: 0 !important;
  }
}

/* Cuando el sidebar está colapsado, mantiene el mismo aire */
@media (min-width: 861px) {
  .app-shell.sidebar-collapsed .main-panel {
    padding-top: 14px !important;
  }
}

/* Móvil */
@media (max-width: 860px) {
  .main-panel {
    padding-top: max(10px, env(safe-area-inset-top)) !important;
  }

  .topbar.topbar-premium {
    top: max(8px, env(safe-area-inset-top)) !important;
    margin-bottom: 16px !important;
  }
}