/* ===================================================================
   CLINICA ESTETICA — Sistema de diseño "Couture"
   Paleta: grafito + crema cálido + dorado champagne
   Tipografía: Playfair Display (títulos) + Inter (UI/cuerpo)
   =================================================================== */

:root {
    /* Paleta couture */
    --bg: #FAF8F5;                     /* crema cálido (papel) */
    --bg-elev: #FFFFFF;                /* superficies elevadas */
    --bg-sidebar: #F4F0EA;             /* paneles secundarios */
    --bg-hover: rgba(26,26,26,0.035);
    --bg-active: rgba(184,153,104,0.10);

    --text-primary: #1A1A1A;
    --text-secondary: #5C5650;
    --text-tertiary: #908A82;
    --text-link: #1A1A1A;

    --border: rgba(26,26,26,0.08);
    --border-strong: rgba(26,26,26,0.16);
    --border-hairline: rgba(26,26,26,0.05);

    --accent: #B89968;                 /* dorado champagne */
    --accent-hover: #9A7E52;
    --accent-light: rgba(184,153,104,0.12);
    --accent-dark: #6E5638;

    --green: #5C7050;                  /* verde sage */
    --orange: #C89B5C;                 /* dorado mostaza */
    --red: #B85450;                    /* terracota */
    --yellow: #D4B255;
    --pink: #C88BA0;
    --purple: #7B6889;
    --teal: #6A8E94;
    --indigo: #4B5560;

    /* Radios sutiles */
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 10px;
    --r-xl: 14px;

    /* Sombras casi imperceptibles */
    --shadow-sm: 0 1px 2px rgba(26,26,26,0.03);
    --shadow-md: 0 1px 3px rgba(26,26,26,0.04), 0 4px 12px rgba(26,26,26,0.04);
    --shadow-lg: 0 4px 12px rgba(26,26,26,0.06), 0 16px 32px rgba(26,26,26,0.05);
    --shadow-xl: 0 8px 24px rgba(26,26,26,0.08), 0 32px 64px rgba(26,26,26,0.08);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    --font-serif: 'Playfair Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --t-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --t-base: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --t-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
    margin: 0;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    line-height: 1.2;
}
h1 { font-weight: 500; }

.serif { font-family: var(--font-serif); }
.sans { font-family: var(--font-sans); }

a { color: var(--text-link); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }

/* Scrollbar minimalista */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(26,26,26,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,26,26,0.22); }

/* Selección de texto */
::selection { background: var(--accent-light); color: var(--text-primary); }

/* ---------- Navbar superior ---------- */
.app-navbar {
    background: rgba(250,248,245,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.app-navbar .brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 19px;
    margin-right: var(--space-7);
    letter-spacing: 0.01em;
    text-decoration: none;
}
.app-navbar .brand i {
    color: var(--accent);
    font-size: 22px;
}
.app-navbar .brand-logo {
    height: 38px;
    width: auto;
    display: block;
    transition: opacity var(--t-fast);
}
.app-navbar .brand:hover .brand-logo { opacity: 0.85; }
.app-navbar .nav-links {
    display: flex;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}
.app-navbar .nav-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
    font-weight: 500;
    letter-spacing: 0.01em;
}
.app-navbar .nav-link-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.app-navbar .nav-link-item.active {
    color: var(--accent-dark);
    background: var(--accent-light);
}
.app-navbar .right-zone {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.app-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12.5px;
}
.app-navbar .date-info {
    color: var(--text-tertiary);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    font-style: italic;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--r-sm);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.btn-logout:hover { background: var(--text-primary); color: var(--bg); border-color: var(--text-primary); }

/* ---------- Layout ---------- */
.app-content { padding: var(--space-6); max-width: 1700px; margin: 0 auto; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: none;
    overflow: hidden;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-hairline);
    padding: var(--space-4) var(--space-5);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: var(--space-5); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-sans);
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-light); }
.btn-primary {
    background: var(--text-primary);
    color: var(--bg);
    border-color: var(--text-primary);
}
.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--bg);
}
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    background: var(--text-primary);
    color: var(--bg);
    border-color: var(--text-primary);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 6px 10px;
    text-transform: none;
    letter-spacing: 0;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-success { background: var(--green); color: white; border-color: var(--green); }
.btn-success:hover { filter: brightness(0.92); color: white; }
.btn-danger { background: var(--red); color: white; border-color: var(--red); }
.btn-danger:hover { filter: brightness(0.92); color: white; }
.btn-outline-primary {
    background: transparent;
    color: var(--accent-dark);
    border-color: var(--accent);
}
.btn-outline-primary:hover { background: var(--accent); color: white; }
.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-outline-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline-danger:hover { background: var(--red); color: white; }
.btn-outline-success { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline-success:hover { background: var(--green); color: white; }
.btn-outline-info {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-outline-info:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 10.5px; }
.btn-lg { padding: 12px 24px; font-size: 13px; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    transition: all var(--t-fast);
    font-family: var(--font-sans);
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    display: block;
}
.form-check-input { border-color: var(--border-strong); border-radius: 3px; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    background: transparent;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-hairline);
    font-size: 13px;
    vertical-align: middle;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(0,0,0,0.012); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges (píldoras finas, case original, look couture) ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: white;
    text-transform: none;
}
/* Forzar colores propios (Bootstrap usa !important en .bg-*) */
.bg-success { background-color: var(--green) !important; background: var(--green) !important; color: #ffffff !important; }
.bg-primary { background-color: var(--accent) !important; background: var(--accent) !important; color: #ffffff !important; }
.bg-warning { background-color: var(--orange) !important; background: var(--orange) !important; color: #ffffff !important; }
.bg-danger  { background-color: var(--red) !important;    background: var(--red) !important;    color: #ffffff !important; }
.bg-info    { background-color: var(--teal) !important;   background: var(--teal) !important;   color: #ffffff !important; }
.bg-secondary { background-color: var(--text-tertiary) !important; background: var(--text-tertiary) !important; color: #ffffff !important; }

/* Override de Bootstrap text-dark dentro de badges */
.badge.text-dark { color: #ffffff !important; }

/* ---------- Tabs ---------- */
.nav-tabs {
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: var(--space-1);
    margin: 0;
    padding: 0 var(--space-4);
    list-style: none;
}
.nav-tabs .nav-link {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-bottom: 1px solid transparent;
    background: transparent;
    border-radius: 0;
    transition: all var(--t-fast);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); }
.nav-tabs .nav-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
    background: transparent;
}

/* ---------- Modales ---------- */
.modal-content {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: var(--space-5) var(--space-5);
    background: var(--bg-elev);
    color: var(--text-primary);
}
.modal-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.modal-body { padding: var(--space-5); }
.modal-footer {
    border-top: 1px solid var(--border-hairline);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-sidebar);
}

/* ---------- KPI cards ---------- */
.kpi-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-5);
    box-shadow: none;
    transition: transform var(--t-base), border-color var(--t-base);
}
.kpi-card:hover {
    border-color: var(--accent);
}
.kpi-card .kpi-label {
    color: var(--text-tertiary);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 6px;
}
.kpi-card .kpi-value {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.kpi-card .kpi-icon { color: var(--accent); opacity: 0.7; font-size: 20px; }
.kpi-card .kpi-trend { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }

/* ===================================================================
   CALENDARIO
   =================================================================== */
.cal-wrap {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 170px);
}

.cal-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    flex-shrink: 0;
}
.cal-toolbar .cal-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    min-width: 240px;
    letter-spacing: -0.015em;
}
.cal-nav-group {
    display: flex;
    align-items: center;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.cal-nav-group button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 7px 13px;
    font-size: 11.5px;
    cursor: pointer;
    transition: background var(--t-fast);
    border-right: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.cal-nav-group button:last-child { border-right: none; }
.cal-nav-group button:hover { background: var(--bg-hover); }

.cal-view-switcher {
    display: flex;
    background: var(--bg-sidebar);
    border-radius: var(--r-sm);
    padding: 3px;
    margin-left: auto;
    border: 1px solid var(--border);
}
.cal-view-switcher button {
    background: transparent;
    border: none;
    padding: 5px 14px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 3px;
    font-weight: 500;
    transition: all var(--t-fast);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cal-view-switcher button.active {
    background: var(--bg-elev);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.cal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: auto;
    position: relative;
    align-items: flex-start;
}
.cal-body.is-month {
    display: block;
}

.cal-time-col {
    position: sticky; left: 0;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    z-index: 3;
    flex-shrink: 0;
    width: 68px;
    display: flex;
    flex-direction: column;
}
.cal-time-col .col-header,
.cal-day-col .col-header {
    height: 68px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    position: sticky; top: 0;
    z-index: 2;
    display: flex; align-items: center; justify-content: center;
}
.cal-time-col .col-header { z-index: 4; }

.cal-times {
    display: flex;
    flex-direction: column;
}
.cal-time-col .time-cell {
    height: 24px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    font-size: 10.5px;
    text-align: right;
    padding-right: 8px;
    padding-top: 1px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    box-sizing: border-box;
    letter-spacing: 0.02em;
}
.cal-time-col .time-cell.half { color: transparent; }

.cal-cols-wrap {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: flex-start;
}
.cal-day-col {
    flex: 1;
    min-width: 100px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
}
.cal-day-col:last-child { border-right: none; }
.cal-day-col .col-header {
    text-align: center;
    flex-direction: column;
    gap: 3px;
    padding: 8px 4px;
}
.cal-day-col .col-header .header-label {
    font-size: 10.5px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.cal-day-col .col-header .header-num {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.cal-day-col .col-header.is-today .header-num {
    background: var(--text-primary);
    color: var(--bg);
    width: 34px; height: 34px;
    line-height: 34px;
    border-radius: 50%;
    margin: 0 auto;
    font-size: 15px;
}
.cal-day-col .col-header .prof-name {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-serif);
}

.cal-slots {
    position: relative;
    display: flex;
    flex-direction: column;
}
.cal-slot {
    height: 24px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-hairline);
    cursor: pointer;
    transition: background var(--t-fast);
    box-sizing: border-box;
}
.cal-slot.hour { border-bottom-color: var(--border); }
.cal-slot:hover { background: var(--accent-light); }
.cal-slots.col-today { background: rgba(184,153,104,0.025); }
.cal-slot.drag-over { background: var(--accent-light); }

.cal-event {
    position: absolute;
    left: 3px; right: 3px;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11.5px;
    color: white;
    overflow: hidden;
    cursor: grab;
    transition: filter var(--t-fast), box-shadow var(--t-fast);
    border-left: 3px solid rgba(0,0,0,0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    line-height: 1.35;
    user-select: none;
    z-index: 2;
}
.cal-event:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    z-index: 5;
}
.cal-event:active { cursor: grabbing; }
.cal-event .ev-time { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 10.5px; opacity: 0.95; }
.cal-event .ev-name { font-weight: 500; }
.cal-event .ev-type { opacity: 0.85; font-size: 10.5px; font-style: italic; }
.cal-event.is-realizada { opacity: 0.6; }
.cal-event.is-cancelada { opacity: 0.5; text-decoration: line-through; }
.cal-event .ev-resizer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 5px;
    cursor: ns-resize;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.5));
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transition: opacity var(--t-fast);
}
.cal-event:hover .ev-resizer { opacity: 1; }
.cal-event.is-dragging { opacity: 0.4; }

.cal-now-line {
    position: absolute;
    left: 0; right: 0;
    height: 1.5px;
    background: var(--red);
    z-index: 6;
    pointer-events: none;
}
.cal-now-line::before {
    content: '';
    position: absolute;
    left: -4px; top: -3px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
}

/* Vista mes */
.cal-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(110px, 1fr);
    gap: 1px;
    background: var(--border);
    flex: 1;
    overflow: auto;
}
.cal-month .m-header {
    background: var(--bg-elev);
    text-align: center;
    padding: 10px 0;
    font-size: 10.5px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.cal-month .m-day {
    background: var(--bg-elev);
    padding: 8px 10px;
    cursor: pointer;
    transition: background var(--t-fast);
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}
.cal-month .m-day:hover { background: var(--bg-hover); }
.cal-month .m-day.other-month { background: var(--bg-sidebar); opacity: 0.55; }
.cal-month .m-day .m-num {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    align-self: flex-end;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.cal-month .m-day.is-today .m-num {
    background: var(--text-primary);
    color: var(--bg);
    width: 26px; height: 26px;
    line-height: 26px;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
}
.cal-month .m-event {
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--bg-sidebar);
    color: var(--text-primary);
    border-left: 2px solid var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.cal-month .m-more {
    font-size: 10px;
    color: var(--text-tertiary);
    padding: 1px 6px;
    font-style: italic;
}

/* ---- Sidebar ---- */
.cal-sidebar {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-5);
    width: 240px;
    flex-shrink: 0;
    box-shadow: none;
}
.cal-sidebar h6 {
    font-family: var(--font-sans);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin: var(--space-5) 0 var(--space-3);
}
.cal-sidebar h6:first-of-type { margin-top: 0; }
.prof-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 7px 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    transition: background var(--t-fast);
}
.prof-item:hover { background: var(--bg-hover); }
.prof-item input[type=checkbox] { cursor: pointer; }
.prof-item .prof-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0;
}

/* Mini calendar */
.mini-cal {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--space-3);
}
.mini-cal-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-2);
}
.mini-cal-head .mini-title {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.mini-cal-head button {
    background: transparent; border: none;
    padding: 2px 6px; color: var(--text-secondary);
    cursor: pointer; border-radius: 4px;
}
.mini-cal-head button:hover { background: var(--bg-hover); }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-cal-grid .mc-h {
    text-align: center;
    font-size: 9.5px;
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 3px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mini-cal-grid .mc-d {
    text-align: center;
    padding: 5px 0;
    font-size: 11.5px;
    border-radius: 4px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background var(--t-fast);
    color: var(--text-primary);
}
.mini-cal-grid .mc-d:hover { background: var(--bg-elev); }
.mini-cal-grid .mc-d.other-month { color: var(--text-tertiary); }
.mini-cal-grid .mc-d.is-today { background: var(--text-primary); color: var(--bg); font-weight: 600; }
.mini-cal-grid .mc-d.is-selected { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }

/* ---- Toast ---- */
.toast {
    background: rgba(26,26,26,0.95);
    backdrop-filter: blur(10px);
    color: var(--bg);
    border-radius: var(--r-md);
    font-size: 12.5px;
    border: none;
}

/* ---- Ficha paciente ---- */
.ficha-header {
    background: var(--bg-elev);
    color: var(--text-primary);
    border-radius: var(--r-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border);
    box-shadow: none;
    position: relative;
}
.ficha-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.ficha-header h3 {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 26px;
    letter-spacing: -0.02em;
}
.ficha-header .avatar { font-size: 56px; color: var(--accent); opacity: 0.85; }
.ficha-header .badge { font-size: 10.5px; }

/* ---- Login ---- */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #1A1A1A 0%, #2C2520 50%, #3D342B 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184,153,104,0.15), transparent);
    top: -200px; right: -200px;
}
.login-bg::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184,153,104,0.1), transparent);
    bottom: -100px; left: -100px;
}

/* ---- Color dot ---- */
.color-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; margin-right: 6px;
    vertical-align: middle;
}

/* ---- Autocomplete ---- */
.autocomplete-list {
    position: absolute; z-index: 1050;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-md); box-shadow: var(--shadow-lg);
    max-height: 240px; overflow-y: auto;
    width: 100%; margin-top: 4px;
}
.autocomplete-item {
    padding: 9px 14px; cursor: pointer;
    font-size: 13px; transition: background var(--t-fast);
    border-bottom: 1px solid var(--border-hairline);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--accent-light); color: var(--accent-dark); }

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .cal-sidebar { display: none; }
}
@media (max-width: 768px) {
    .app-content { padding: var(--space-3); }
    .cal-toolbar { flex-wrap: wrap; }
    .cal-toolbar .cal-title { min-width: auto; font-size: 17px; }
    .kpi-card .kpi-value { font-size: 26px; }
}

/* ---- Animaciones ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp var(--t-base) ease-out; }

/* ---- Dashboard ---- */
.section-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 var(--space-3);
}
.list-citas .item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 14px 0;
    border-bottom: 1px solid var(--border-hairline);
    transition: background var(--t-fast);
}
.list-citas .item:last-child { border-bottom: none; }
.list-citas .item .time {
    font-family: var(--font-serif);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 17px;
    width: 64px;
    flex-shrink: 0;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.list-citas .item .info { flex: 1; min-width: 0; }
.list-citas .item .info .name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}
.list-citas .item .info .meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
    font-style: italic;
}

/* ---------- Editor rich text (Quill) ---------- */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    background: var(--bg-sidebar);
    padding: 6px 8px;
}
.ql-container.ql-snow {
    border: 1px solid var(--border-strong);
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    font-family: var(--font-sans);
    font-size: 13.5px;
    background: var(--bg-elev);
    min-height: 120px;
}
.ql-editor {
    min-height: 120px;
    padding: 12px 14px;
    line-height: 1.55;
    color: var(--text-primary);
}
.ql-editor.ql-blank::before {
    color: var(--text-tertiary);
    font-style: italic;
    font-family: var(--font-sans);
}
.ql-snow .ql-stroke { stroke: var(--text-secondary); }
.ql-snow .ql-fill { fill: var(--text-secondary); }
.ql-snow .ql-picker { color: var(--text-secondary); }
.ql-snow.ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button:focus {
    color: var(--accent-dark);
}
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent-dark);
}
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent-dark);
}
.ql-container.ql-snow:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.ql-editor-small + .ql-toolbar.ql-snow,
.rich-editor-small .ql-container.ql-snow { min-height: 80px; }
.rich-editor-small .ql-editor { min-height: 80px; }

/* Separadores decorativos */
.divider-ornament {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-tertiary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: var(--space-4) 0;
}
.divider-ornament::before,
.divider-ornament::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
