/* =========================================================
   CONTROL MÉDICO — DASHBOARD
   Estilos independientes para agenda y calendario
   ========================================================= */

.dashboard-page {
    padding: 26px 30px 32px;
    color: var(--text-primary, #1f2937);
}

.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-eyebrow {
    margin: 0 0 6px;
    color: var(--primary, #3568d4);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.dashboard-heading h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 32px);
    letter-spacing: -.035em;
}

.dashboard-subtitle {
    margin: 7px 0 0;
    color: var(--text-muted, #778196);
    font-size: 14px;
}

.dashboard-primary-btn,
.dashboard-outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.dashboard-primary-btn {
    color: #fff;
    background: var(--primary, #3568d4);
    box-shadow: 0 5px 14px rgba(53, 104, 212, .18);
}

.dashboard-primary-btn:hover { transform: translateY(-1px); }

.dashboard-outline-btn {
    color: var(--primary, #3568d4);
    background: #fff;
    border-color: #dce4f1;
}

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

.dashboard-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 19px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e8edf4);
    border-radius: 15px;
    box-shadow: 0 4px 18px rgba(25, 42, 70, .035);
}

.dashboard-stat-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    font-size: 20px;
}

.stat-icon-blue { background: #eaf1ff; }
.stat-icon-amber { background: #fff4dc; }
.stat-icon-green { background: #e5f8ef; }
.stat-icon-violet { background: #f0eaff; }

.dashboard-stat > div:last-child { min-width: 0; }
.dashboard-stat span {
    display: block;
    color: var(--text-muted, #778196);
    font-size: 12px;
    font-weight: 600;
}
.dashboard-stat strong {
    display: block;
    margin: 4px 0 2px;
    font-size: 27px;
    line-height: 1.1;
    letter-spacing: -.04em;
}
.dashboard-stat small {
    display: block;
    color: var(--text-muted, #8992a3);
    font-size: 10px;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(310px, .92fr) minmax(360px, 1.08fr);
    align-items: start;
    gap: 20px;
}

.dashboard-panel {
    min-width: 0;
    padding: 22px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e8edf4);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(25, 42, 70, .035);
}

.dashboard-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-panel-heading h2 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.02em;
}

.dashboard-panel-heading p {
    margin: 6px 0 0;
    color: var(--text-muted, #8992a3);
    font-size: 12px;
    line-height: 1.5;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}
.calendar-nav button {
    display: grid;
    min-width: 25px;
    height: 25px;
    place-items: center;
    padding: 0 8px;
    color: #475569;
    background: #f6f8fb;
    border: 1px solid #e7ecf3;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.calendar-nav button:first-child,
.calendar-nav button:last-child { font-size: 21px; line-height: 1; }
.calendar-nav button:hover { background: #eaf1ff; }

.calendar-month-title {
    margin: 21px 0 14px;
    font-size: 15px;
    font-weight: 800;
    text-transform: capitalize;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.calendar-weekdays { margin-bottom: 7px; }
.calendar-weekdays span {
    padding: 5px 0;
    color: #8a94a6;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
}

.calendar-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    color: #344054;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.calendar-day:not(.calendar-day-empty):hover { background: #f1f5fc; }
.calendar-day-empty { cursor: default; }
.calendar-day.is-today { color: var(--primary, #3568d4); font-weight: 800; border-color: #c9d9fb; }
.calendar-day.is-selected {
    color: #fff;
    background: var(--primary, #3568d4);
    border-color: var(--primary, #3568d4);
    box-shadow: 0 4px 10px rgba(53, 104, 212, .2);
}
.calendar-day.is-selected.is-today { color: #fff; }
.calendar-day-count {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: block;
    min-width: 17px;
    height: 17px;
    padding: 1 3px;
    background: #b60B0B; 
    color: #fff;    
    border-radius: 10px;
    font-size: 10px;
    font-style: normal;
    font-weight:600;
    line-height: 17px;
    text-align: center;
}
.calendar-day.is-selected .calendar-day-count { color: var(--primary, #3568d4); background: #fff; }
/*.calendar-day.is-selected .calendar-day-count { color: #FFA500; background: #1a1a1a; }*/

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid #edf0f5;
    color: #7b8495;
    font-size: 10px;
}
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot, .legend-selected {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B60B0B;
}
.legend-selected { background: var(--primary, #3568d4); }

.dashboard-text-link {
    flex: 0 0 auto;
    padding-top: 2px;
    color: var(--primary, #3568d4);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-agenda-content { margin-top: 20px; }
.agenda-item {
    display: grid;
    grid-template-columns: 44px 12px minmax(0, 1fr);
    gap: 10px;
    padding: 0 0 20px;
}
.agenda-item:last-child { padding-bottom: 0; }
.agenda-time {
    padding-top: 2px;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.agenda-timeline {
    position: relative;
    display: flex;
    justify-content: center;
}
.agenda-timeline::after {
    position: absolute;
    top: 12px;
    bottom: -20px;
    width: 1px;
    background: #e4eaf2;
    content: "";
}
.agenda-item:last-child .agenda-timeline::after { display: none; }
.agenda-timeline span {
    z-index: 1;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    background: var(--primary, #3568d4);
    border: 2px solid #eaf1ff;
    border-radius: 50%;
}
.agenda-item-body { min-width: 0; }
.agenda-item-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px;
}
.agenda-item-topline strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #273449;
    font-size: 12px;
    line-height: 1.45;
}
.appointment-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}
.status-pending { color: #966400; background: #fff4d7; }
.status-confirmed { color: #1764bd; background: #e7f1ff; }
.status-attended { color: #13754a; background: #e3f8ed; }
.status-cancelled { color: #a63333; background: #ffebeb; }
.status-no-show { color: #6841a5; background: #f0eaff; }
.status-other { color: #566174; background: #edf0f5; }

.agenda-meta, .agenda-observations {
    margin: 5px 0 0;
    color: #8992a3;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.agenda-observations { color: #596579; }
.agenda-open-link {
    display: inline-block;
    margin-top: 7px;
    color: var(--primary, #3568d4);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}
.dashboard-empty, .dashboard-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 34px 15px;
    text-align: center;
}
.dashboard-empty-icon { margin-bottom: 10px; font-size: 28px; }
.dashboard-empty strong, .dashboard-error strong { color: #344054; font-size: 13px; }
.dashboard-empty p, .dashboard-error p {
    max-width: 270px;
    margin: 8px 0 16px;
    color: #8992a3;
    font-size: 11px;
    line-height: 1.6;
}
.dashboard-error { color: #a63333; }
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 150px;
    color: #8992a3;
    font-size: 12px;
}
.dashboard-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid #dce5f5;
    border-top-color: var(--primary, #3568d4);
    border-radius: 50%;
    animation: dashboard-spin .7s linear infinite;
}
@keyframes dashboard-spin { to { transform: rotate(360deg); } }
.dashboard-data-note {
    margin: 15px 2px 0;
    color: #929aaa;
    font-size: 10px;
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-main-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-calendar-panel { max-width: none; }
}

@media (max-width: 640px) {
    .dashboard-page { padding: 20px 15px 26px; }
    .dashboard-heading { align-items: flex-start; gap: 12px; }
    .dashboard-heading h1 { font-size: 25px; }
    .dashboard-subtitle { max-width: 240px; font-size: 12px; }
    .dashboard-primary-btn { min-height: 36px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
    .dashboard-stats { gap: 10px; }
    .dashboard-stat { gap: 10px; padding: 13px 11px; border-radius: 12px; }
    .dashboard-stat-icon { flex-basis: 36px; width: 36px; height: 36px; font-size: 17px; }
    .dashboard-stat strong { font-size: 23px; }
    .dashboard-stat span { font-size: 11px; }
    .dashboard-stat small { font-size: 9px; }
    .dashboard-panel { padding: 17px 13px; border-radius: 13px; }
    .dashboard-panel-heading h2 { font-size: 15px; }
    .dashboard-panel-heading p { font-size: 10px; }
    .calendar-nav { gap: 3px; }
    .calendar-nav button { min-width: 27px; height: 29px; padding: 0 6px; }
    .calendar-weekdays, .calendar-grid { gap: 3px; }
    .calendar-day { border-radius: 8px; font-size: 11px; }
    .calendar-day-count { right: 1px; bottom: 1px; min-width: 11px; height: 11px; font-size: 7px; line-height: 11px; }
    .agenda-item { grid-template-columns: 38px 10px minmax(0, 1fr); gap: 7px; }
    .agenda-item-topline { flex-direction: column; gap: 5px; }
    .agenda-item-topline strong { font-size: 12px; }
}
