/* Design values live in css/tokens.css. This file is screen layout only. */
body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
}

.crm-dashboard-body {
    margin: 0;
    background: #f8f9fa;
}

.crm-calendar-shell {
    font-family: var(--font-body);
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    color: var(--text-primary);
}

.icon-sidebar {
    width: 210px;
    background-color: #fff;
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 12px;
    flex-shrink: 0;
    z-index: 20;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
    overflow-y: auto;
}

.brand-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 18px;
}

.brand-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--brand-primary);
    letter-spacing: -0.3px;
}

.nav-icon {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    padding: 0 12px;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    box-sizing: border-box;
}

.nav-icon i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-icon:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.nav-icon:hover {
    background-color: var(--brand-primary-light);
    color: var(--brand-primary);
    transform: translateX(2px);
}

.nav-icon.active {
    background-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 162, 154, 0.25);
}

.bottom-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    width: 100%;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s;
}

.user-avatar-link:hover {
    background-color: #f1f5f9;
}

.user-avatar {
    width: 30px;
    height: 30px;
    background-color: var(--brand-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

/* =============================================
   COMMAND PALETTE (CTRL+K) STYLES
   ============================================= */
.cmd-palette-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.cmd-palette-card {
    background: #ffffff;
    width: 90%;
    max-width: 620px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    border: 1px solid var(--border-default);
    animation: cmdSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdSlideDown {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-palette-search {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
    background: #fafafa;
}

.cmd-palette-search i {
    font-size: 18px;
    color: var(--brand-primary);
}

.cmd-palette-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 16px;
    font-family: var(--font-body);
    color: var(--text-primary);
}

.cmd-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 0;
}

.cmd-group-title {
    padding: 8px 18px 4px 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.cmd-item:hover, .cmd-item.active {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

.cmd-item i {
    font-size: 15px;
    width: 20px;
    text-align: center;
    color: var(--brand-primary);
}

.cmd-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #edf2f7;
    color: #4a5568;
    font-weight: 600;
}

.user-avatar-link {
    text-decoration: none;
}

.user-avatar-link.active {
    box-shadow: 0 0 0 4px var(--brand-primary-light);
}

.controls-panel {
    width: 270px;
    background-color: #fff;
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.month-title {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 12px;
}

.main-view {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    overflow: hidden;
}

.crm-content {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.doctor-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 12px;
    padding: 16px;
}

.doctor-name {
    font-weight: 700;
    color: #253041;
}

.chat-list {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 12px;
    padding: 10px;
    overflow: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
}

.chat-item:hover {
    background: #f6f8fb;
}

.chat-name {
    font-size: 14px;
    font-weight: 700;
    color: #243243;
}

.chat-last {
    font-size: 12px;
    color: #788392;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #4185d8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #1f2a39;
}

.crm-fc {
    flex: 1;
    min-height: 0;
}

.crm-fc .fc {
    height: 100%;
}

.crm-fc .fc-theme-standard td,
.crm-fc .fc-theme-standard th,
.crm-fc .fc-scrollgrid,
.crm-fc .fc-timegrid-slot {
    border-color: #edf0f4;
}

.crm-fc .fc-timegrid-slot {
    height: 60px;
}

.crm-fc .fc-timegrid-axis-cushion {
    color: #8d96a3;
    font-size: 11px;
}

.crm-fc .fc-col-header-cell-cushion {
    color: #5f6368;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 0 8px;
}

.crm-fc .fc-event {
    border-radius: 4px;
    border: none;
    border-left: 3px solid rgba(0, 0, 0, 0.15);
    padding: 5px 7px;
}

.crm-fc .fc-event-time {
    font-size: 11px;
    font-weight: 500;
}

.crm-fc .fc-event-title {
    font-size: 12px;
    font-weight: 600;
}

.crm-fc .fc-timegrid-now-indicator-line,
.crm-fc .fc-timegrid-now-indicator-arrow {
    display: none;
}

@media (max-width: 1200px) {
    .controls-panel {
        width: 220px;
    }
    
}

@media (max-width: 900px) {
    .controls-panel {
        display: none;
    }
    
    
    
    
}

.crm-calendar-shell {
    background: var(--bg-card);
}

.icon-sidebar {
    width: 68px;
    border-right: 1px solid #edf1f6;
    padding-top: 10px;
}

.brand-icon {
    width: 46px;
    height: 24px;
    margin-bottom: 18px;
}

.nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 10px;
    color: #6b7483;
}

.nav-icon.active {
    background: #ddfbf5;
    color: var(--brand-primary);
}

.user-avatar {
    width: 34px;
    height: 34px;
    margin-top: 10px;
    background: #2f80ed;
}

.controls-panel {
    width: 252px;
    border-right: 1px solid #edf1f6;
    padding: 12px 14px;
}

.panel-header {
    margin-bottom: 10px;
}

.brand-mini-icon {
    color: var(--brand-primary);
    font-size: 18px;
}

.month-title {
    font-size: 22px;
    font-weight: 700;
    transform: scale(0.48);
    transform-origin: left center;
    margin-left: -40px;
}

.crm-fc .fc-timegrid-slot {
    height: 30px;
}

.crm-fc .fc-timegrid-axis-cushion {
    font-size: 10px;
    color: #9aa3b1;
}

.crm-fc .fc-col-header-cell-cushion {
    font-size: 10px;
    color: #5e6675;
}

.crm-fc .fc-day-today {
    background: #fffdf4 !important;
}

.crm-fc .fc-timegrid-col {
    cursor: pointer;
}

.crm-fc .fc-event {
    border-left: 2px solid var(--brand-primary);
    background: #f0fbfa !important;
    border-radius: 0;
}

.crm-fc .fc-event-title {
    font-size: 11px;
    font-weight: 700;
}

.crm-fc .fc-event-time {
    font-size: 10px;
}

.crm-fc .fc-event-main-custom {
    line-height: 1.15;
}

.crm-fc .fc-event-title-custom {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
}

.crm-fc .fc-event-meta {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.95;
}

.crm-fc .fc-event-status {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.doctor-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.doctor-card.ref {
    border: 1px solid #dce3ea;
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
}

.doctor-thumb {
    height: 130px;
    background-size: cover;
    background-position: center;
}

.doctor-body {
    padding: 12px 12px 14px;
    text-align: center;
}

.doctor-name {
    font-size: 28px;
    font-weight: 700;
    transform: scale(0.5);
    transform-origin: center top;
    margin-top: -6px;
}

.doctor-role {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    background: #f3f6fa;
    color: #667180;
    font-size: 10px;
    margin: -2px 0 6px;
}

.doctor-actions {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.chat-reference {
    padding: 0;
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 52px);
}

.chat-window-live {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #efeae2;
    background-image:
        radial-gradient(circle at 18px 18px, rgba(37, 211, 102, 0.10) 2px, transparent 2px),
        radial-gradient(circle at 42px 42px, rgba(18, 140, 126, 0.08) 2px, transparent 2px),
        radial-gradient(circle at 10px 48px, rgba(7, 94, 84, 0.06) 1.8px, transparent 1.8px),
        linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.08));
    background-size: 64px 64px;
}

.chat-messages {
    flex: 1;
    overflow: auto;
    padding: 14px;
}

.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.chat-row.own {
    justify-content: flex-end;
}

.chat-row.own .chat-avatar-mini {
    order: 2;
}

.chat-bubble-live {
    max-width: 65%;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: #334052;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-row.own .chat-bubble-live {
    background: #dcf8c6;
}

.chat-avatar-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid #e6ecf4;
}

.chat-avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1px solid #dbe4ee;
}

.chat-send-form {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #edf1f6;
}

.chat-send-form input {
    border: 1px solid #d9e0e8;
    border-radius: 8px;
    padding: 9px 10px;
}

.chat-list.ref {
    border-right: 1px solid #edf1f6;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    padding: 8px;
}

.chat-item {
    border-bottom: 1px solid #f3f6fa;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca5b2;
    font-size: 24px;
    transform: scale(0.5);
}

.quick-appointment-form {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.quick-appointment-form input,
.quick-appointment-form select,
.quick-appointment-form textarea {
    border: 1px solid #d9e0e8;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
}

.quick-appointment-form textarea {
    min-height: 54px;
    resize: vertical;
}

.calendar-modal-close {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}

.crud-record-row {
    transition: background-color 180ms ease, transform 180ms ease;
    cursor: pointer;
}

.crud-record-row:hover {
    background: #f8fbff;
    transform: translateY(-1px);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Role chips (users table) — rendered via Lexicon::roleClass */

.panel-record {
    cursor: pointer;
}

.panel-detail-description {
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 10px;
    padding: 10px 12px;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
}

#calendar-modal-delete {
    display: none;
}

.fc-event-main-custom {
    animation: fadeInQuick 220ms ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInQuick {
    from {
        opacity: 0.2;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 1100px) {
    .chat-reference {
        grid-template-columns: 1fr;
    }
    .controls-panel {
        display: none;
    }
}

/* =============================================
   PATIENT WIZARD MODAL STYLES
   ============================================= */

.wizard-steps-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    overflow-x: auto;
    gap: 10px;
}
.wizard-step-indicator {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    transition: all 0.2s ease;
}
.wizard-step-indicator.active {
    color: var(--action-text);
    background: var(--action);
}
.wizard-step-indicator.visited {
    color: var(--action);
}
.wizard-step-content {
    display: none;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}
.wizard-step-content.active {
    display: block;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}
.segmented-control {
    display: inline-flex;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    min-height: 44px;
    align-items: center;
}
.segmented-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.segmented-btn.active-si {
    background: #FEE2E2 !important;
    color: #991B1B !important;
    border: 1.5px solid #FCA5A5 !important;
    box-shadow: 0 2px 4px rgba(153, 27, 27, 0.1);
}
.segmented-btn.active-no {
    background: #D1FAE5 !important;
    color: #065F46 !important;
    border: 1.5px solid #6EE7B7 !important;
    box-shadow: 0 2px 4px rgba(6, 95, 70, 0.1);
}
.segmented-btn.active-unset {
    background: #F3F4F6 !important;
    color: #374151 !important;
    border: 1.5px solid #D1D5DB !important;
    box-shadow: 0 2px 4px rgba(55, 65, 81, 0.1);
}
.option-chips-container {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.option-chip {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #4A5568;
    background: #F7FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.option-chip:hover {
    border-color: #CBD5E0;
    background: #EDF2F7;
}
.option-chip.active {
    background: var(--brand-accent) !important;
    color: #fff !important;
    border-color: var(--brand-accent) !important;
    box-shadow: 0 4px 6px rgba(232, 160, 172, 0.2) !important;
}
.spec-input-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, margin-top 0.2s ease-out;
    margin-top: 0;
}
.spec-input-container.active {
    max-height: 100px;
    opacity: 1;
    margin-top: 8px;
}
.tinetti-segmented-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.tinetti-option-card {
    display: block;
    cursor: pointer;
    border: 1.5px solid var(--border-default);
    border-radius: 8px;
    background: #fff;
    padding: 10px 14px;
    transition: all 0.2s ease-in-out;
    min-height: 44px;
    box-sizing: border-box;
}
.tinetti-option-card:hover {
    border-color: #CBD5E0;
    background: var(--bg-input);
}
.tinetti-option-card:has(input[type="radio"]:checked) {
    background: #EBF8FF !important;
    border-color: #3182CE !important;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.08) !important;
}
.tinetti-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.tinetti-card-score {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: bold;
    color: #2B6CB0;
    background: #EBF8FF;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.tinetti-card-desc {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-primary);
    text-align: right;
}
.warning-badge-alert {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: bold;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.autosave-glow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(127, 184, 166, 0.6);
}
.autosave-glow-dot.saving {
    background: var(--color-warning) !important;
    box-shadow: 0 0 8px rgba(229, 168, 123, 0.8) !important;
    animation: pulse-orange 1s infinite alternate;
}
.autosave-glow-dot.error {
    background: var(--color-danger) !important;
    box-shadow: 0 0 8px rgba(214, 111, 124, 0.8) !important;
}
@keyframes pulse-orange {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 1; }
}
.wizard-scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}
.wizard-scroll-indicator.visible {
    opacity: 1;
}
.eva-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-top: 15px;
    text-align: center;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.eva-face {
    font-size: 48px;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}
.eva-slider {
    width: 100%;
    accent-color: var(--brand-accent);
    cursor: pointer;
    height: 8px;
    border-radius: 4px;
}
.gait-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 10px;
}
.repeatable-row {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.repeatable-row-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

/* =============================================
   AUTH PAGES — Login / Register
   ============================================= */
.auth-page {
    background: linear-gradient(135deg, var(--bg-page) 0%, var(--brand-primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand img {
    width: 64px;
    height: auto;
    margin-bottom: 12px;
}

.auth-brand h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.auth-brand p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    border: 1px solid var(--border-light);
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-card > p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.auth-card label {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================
   EMPTY STATES
   ============================================= */

/* =============================================
   FLASH MESSAGES
   ============================================= */

/* =============================================
   RESPONSIVE — Tablet (≤ 768px)
   ============================================= */
@media (max-width: 768px) {
    .doctor-grid {
        grid-template-columns: 1fr;
    }
    
    
    
    
    
    
    
    
    
    
    
    .wizard-steps-progress {
        font-size: 11px;
        gap: 4px;
    }
    
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   RESPONSIVE — Phone (≤ 600px)
   ============================================= */
@media (max-width: 600px) {
    /* The icon-sidebar is hidden ≤1023px (single mobile bar system:
       mobile-bottom-nav + "Más" sheet — roadmap step 06). The old
       sidebar→bottom-bar conversion here was dead code and is removed. */
    
    
    /* Toolbar stacks */
    
    
    
    
    
    
    
    
    /* Tables scroll horizontally */
    
    
    /* Cards and panels */
    
    
    
    
    .chat-list {
        max-height: 200px;
    }
    
    /* Profile */
    
    
    
    
    /* Calendar modal fills screen */
    
    
    
    
    /* Wizard modal full-screen on mobile */
    
    
    /* Form inputs min size to prevent iOS zoom */
    input, select, textarea {
        font-size: 16px;
    }
    
    /* Auth pages */
    .auth-container {
        padding: 0 8px;
    }
    
    .auth-card {
        padding: 24px 20px;
    }

    /* FullCalendar mobile */
    .crm-fc {
        font-size: 12px;
    }
    
    .fc-header-toolbar {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1rem;
    }
}

/* =============================================
   RESPONSIVE — Small Phone (≤ 400px)
   ============================================= */
@media (max-width: 400px) {
    .wizard-steps-progress {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    
    .wizard-step-indicator {
        white-space: nowrap;
        font-size: 10px;
        padding: 4px 8px;
    }
    
    
    
    
}

/* =============================================
   DUAL-EXPERIENCE LAYER — Mobile Remote & Workbench
   ============================================= */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid var(--border-default);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 12px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    flex: 1 1 0;
    min-width: 48px;   /* Barrio Law 2: thumb targets never under 48px */
    min-height: 48px;
    padding: 4px 2px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav-item i {
    font-size: 18px;
}

.mobile-nav-item.active {
    color: var(--brand-primary);
}

.mobile-nav-fab {
    background: var(--brand-primary);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 162, 154, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    margin-top: -18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-nav-fab:active {
    transform: scale(0.92);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 1023px) {
    /* Sidebar icon-mode con tooltips también en tablet/desktop-angosto:
     * el toggle + tooltips funcionan en cualquier ancho (queja del dueño).
     * La barra inferior móvil se reserva para teléfonos (≤600px). */
    .icon-sidebar {
        display: flex;
        width: 68px;
        align-items: center;
    }
    .icon-sidebar .nav-label {
        display: block;
        position: absolute;
        left: calc(100% + 14px);
        top: 50%;
        transform: translateY(-50%);
        background: #1c2733;
        color: #fff;
        padding: 7px 13px;
        border-radius: 8px;
        white-space: nowrap;
        font-size: 13px;
        font-weight: 600;
        opacity: 0;
        pointer-events: none;
        transition: opacity .16s ease .05s;
        z-index: 3000;
        box-shadow: 0 6px 18px rgba(0,0,0,.3);
    }
    .icon-sidebar .nav-label::before {
        content: '';
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-right-color: #1c2733;
    }
    .icon-sidebar .nav-icon:hover .nav-label,
    .icon-sidebar .nav-icon:focus-visible .nav-label,
    .icon-sidebar .user-avatar-link:hover .nav-label { opacity: 1; }
    .icon-sidebar .nav-icon,
    .icon-sidebar .user-avatar-link { position: relative; justify-content: center; }
}
    
    


/* =============================================
   DOCTORIA TOAST — unified feedback (step 02)
   ============================================= */
#doctoria-toast-root {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 84px; /* above the mobile bottom nav (thumb zone edge) */
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 12000;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.doctoria-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md, 10px);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.14));
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 280ms ease, transform 280ms ease;
    pointer-events: auto;
}

.doctoria-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.doctoria-toast i { font-size: 16px; margin-top: 1px; }

.doctoria-toast-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.doctoria-toast-success i { color: #0f5132; }

.doctoria-toast-error { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.doctoria-toast-error i { color: #842029; }

.doctoria-toast-info { background: #e7f0ff; color: #2f5faa; border: 1px solid #c9dcf7; }
.doctoria-toast-info i { color: #2f5faa; }

/* =============================================
   JOURNEY STRIP — viaje de recepción (cita completa)
   ============================================= */
.journey-dot {
    font-size: 10.5px;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
    white-space: nowrap;
}
.journey-dot-done { background: #e6f6ed; color: #1f7a4f; }
.journey-dot-current { background: var(--brand-primary); color: #fff; }
.journey-dot-future { background: #f1f5f9; color: #94a3b8; }

/* =============================================
   SIDEBAR TOGGLE + TOOLTIPS (colores doctor route)
   ============================================= */
.icon-sidebar { position: relative; transition: width .2s ease; }

.sidebar-toggle-btn {
    position: absolute;
    right: -11px;
    top: 70px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.28);
    transition: transform .2s ease, background .2s ease;
    min-width: 24px;
    padding: 0;
}
.sidebar-toggle-btn:hover { background: var(--brand-primary-dark); transform: scale(1.12); }
.sidebar-toggle-btn i { transition: transform .2s ease; }

body.sidebar-collapsed .icon-sidebar { width: 64px; align-items: center; padding-left: 0; padding-right: 0; }
@media (min-width: 1024px) {
    body:not(.sidebar-collapsed) .icon-sidebar { width: 210px; }
}
body.sidebar-collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }
body.sidebar-collapsed .icon-sidebar .brand-title{ display: none; }
body.sidebar-collapsed .icon-sidebar .nav-icon,
body.sidebar-collapsed .icon-sidebar .user-avatar-link,
body.sidebar-collapsed .icon-sidebar .bottom-actions .nav-icon { position: relative; justify-content: center; width: 100%; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .icon-sidebar .user-avatar-link { margin: 0 auto; }

/* Tooltip: la nav-label se convierte en burbuja flotante al comprimir */
body.sidebar-collapsed .icon-sidebar .nav-label {
    display: block;
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #1c2733;
    color: #fff;
    padding: 7px 13px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease .05s;
    z-index: 3000;
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
body.sidebar-collapsed .icon-sidebar .nav-label::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1c2733;
}
body.sidebar-collapsed .icon-sidebar .nav-icon:hover .nav-label,
body.sidebar-collapsed .icon-sidebar .nav-icon:focus-visible .nav-label,
body.sidebar-collapsed .icon-sidebar .user-avatar-link:hover .nav-label,
body.sidebar-collapsed .icon-sidebar button:hover .nav-label { opacity: 1; }

/* ============================== fin sidebar toggle ============================== */

/* Labels del sidebar visibles en expandido (el <a> flex colapsaba el span a 0px) */
.icon-sidebar .nav-icon { width: 100%; box-sizing: border-box; }
.icon-sidebar .user-avatar-link { width: 100%; box-sizing: border-box; }

/* Cerrar Sesión en el sidebar — rojo, separado del resto */
.icon-sidebar .nav-logout { margin-top: 6px; }
.icon-sidebar .nav-logout i { color: #b83a4b; }
.icon-sidebar .nav-logout:hover i,
.icon-sidebar .nav-logout:hover { color: #8f2d3a; }
body.sidebar-collapsed .icon-sidebar .nav-logout .nav-label { background: #fdecea; color: #8f2d3a; }
body.sidebar-collapsed .icon-sidebar .nav-logout .nav-label::before { border-right-color: #fdecea; }

/* =============================================
   FRAME — one navigation at a time (una-sola-voz step 02)
   ≥1024px  full sidebar, four labelled places
   768–1023 icon sidebar (labels become tooltips)
   ≤767px   no sidebar: the bottom bar is the navigation
   ============================================= */
.nav-group { width: 100%; margin-top: var(--sp-3); }
.nav-group-label {
    display: block;
    padding: 0 12px var(--sp-1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
}
.nav-search { background: var(--bg-subtle); border: 1px solid var(--border-default); cursor: pointer; text-align: left; }
.nav-search i { color: var(--brand-primary); }
.nav-search .nav-label { font-size: var(--fs-sm); color: var(--text-secondary); }
.nav-search kbd { font-size: 10px; background: var(--lock-bg); color: var(--lock-fg); padding: 1px 4px; border-radius: 3px; }
.nav-logout { color: var(--fail-fg); }
.user-avatar-link .nav-label { font-size: var(--fs-sm); font-weight: 600; }
.user-avatar-link.active { background: var(--brand-primary-light); }

/* Icon mode: a group label turns into a hairline between groups. */
body.sidebar-collapsed .nav-group-label { height: 1px; padding: 0; margin: 6px 14px; background: var(--border-default); text-indent: -999px; }
@media (max-width: 1023px) {
    .nav-group-label { height: 1px; padding: 0; margin: 6px 14px; background: var(--border-default); text-indent: -999px; }
}

@media (max-width: 767px) {
    .icon-sidebar { display: none; }
    .mobile-bottom-nav { display: flex; }
    .main-view { padding-bottom: calc(var(--bar-h) + var(--sab)); }
}
.mobile-bottom-nav { height: calc(var(--bar-h) + var(--sab)); padding-bottom: var(--sab); z-index: var(--z-nav); }
.mobile-nav-item { font-size: 11px; color: var(--text-muted); }
.mobile-nav-item.active { color: var(--action); font-weight: 700; }
.mobile-nav-fab { background: var(--action); width: 56px; height: 56px; flex: 0 0 56px; box-shadow: 0 4px 12px var(--action-ring); }

.cmd-palette-kbd { font-size: 11px; background: var(--lock-bg); padding: 2px 6px; border-radius: 4px; color: var(--lock-fg); font-weight: 600; }/* The sidebar holds 14 destinations: keep it compact, never scroll sideways,
   and keep the profile + sign-out pinned at the bottom. */
.icon-sidebar { overflow-x: hidden; scrollbar-width: thin; padding-bottom: 0; }
.icon-sidebar .nav-icon { height: 38px; margin-bottom: 2px; }
.icon-sidebar .brand-icon { margin-bottom: var(--sp-2); }
.icon-sidebar .bottom-actions { position: sticky; bottom: 0; background: var(--bg-card); padding-bottom: var(--sp-3); z-index: 1; }
@media (pointer: coarse) {
    .icon-sidebar .nav-icon { height: var(--tap); }
}

/* Agenda: the empty state covers the grid (shown by calendar.js when there is nothing to draw). */
.calendar-card { position: relative; }
.calendar-empty-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
}.icon-sidebar .nav-icon { height: 34px; font-size: 14px; }
.icon-sidebar .nav-group { margin-top: var(--sp-2); }
.icon-sidebar .brand-icon { margin-bottom: var(--sp-1); }

.office-main-view { overflow: auto; }
.office-main-view { padding: var(--sp-4) var(--sp-5); background: var(--bg-page); }
@media (max-width: 767px) { .office-main-view { padding: var(--sp-3) var(--sp-4); } }

/* Body map: an illustration, drawn with the same neutrals as the rest of the app. */
.body-map-container { display: flex; align-items: flex-start; justify-content: center; gap: var(--sp-5); margin: var(--sp-4) 0; padding: var(--sp-4); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-subtle); }
.body-map-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-secondary); }
.body-map-front { fill: var(--border-strong); stroke: var(--text-muted); }
.body-map-back { fill: var(--text-muted); stroke: var(--text-secondary); }