@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --field-border: #d9e3ef;
    --field-border-hover: #9ebfe2;
    --field-accent: #1565C0;
    --field-bg: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    --field-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 1px 2px rgba(15,23,42,0.05);
    --field-shadow-active: 0 0 0 4px rgba(21,101,192,0.12), 0 18px 34px rgba(37,99,235,0.12);
    --sidebar-text-color: #ffffff;
    --sidebar-link-color: #ffffff;

    --logo-size: 200px;
    --logo-name-size: 1.15rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

input, button, select, textarea {
    font-family: inherit;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(160deg, #edeaf8 0%, #e6f4f2 100%) fixed;
    height: 100%;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.sidebar {
    width: 270px;
    min-width: 270px;
    background: #0D1B2A;
    color: var(--sidebar-text-color);
    padding: 0 20px 30px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    transition: width .28s cubic-bezier(.4,0,.2,1),
                min-width .28s cubic-bezier(.4,0,.2,1),
                padding .28s cubic-bezier(.4,0,.2,1);
}

.sidebar-toggle-btn {
    position: sticky;
    top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid rgba(255,255,255,.18);
    cursor: pointer;
    color: rgba(255,255,255,.65);
    padding: 4px;
    border-radius: 7px;
    transition: color .15s, background .15s, border-color .15s;
    flex-shrink: 0;
    z-index: 2;
    margin-bottom: 0;
}
.sidebar-toggle-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.4);
}
.sidebar .stb-icon { flex-shrink: 0; }
.sidebar .stb-hamburger { display: none; }
.sidebar .stb-chevron  { display: block; }

.sidebar.collapsed {
    width: 54px;
    min-width: 54px;
    padding: 16px 7px;
}
.sidebar.collapsed .sidebar-toggle-btn {
    justify-content: center;
    align-self: center;
    padding: 4px;
}
.sidebar.collapsed .stb-hamburger { display: block; }
.sidebar.collapsed .stb-chevron   { display: none; }

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-tagline,
.sidebar.collapsed .sidebar-bottom,
.sidebar.collapsed .sa-brand-block { display: none; }

.sidebar-nav ul li { position: relative; }

.sidebar-nav ul li a span:not(.nav-msg-badge) {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    transition: max-width .22s ease, opacity .18s ease;
}
.sidebar.collapsed .sidebar-nav ul li a span:not(.nav-msg-badge) {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
}
.sidebar.collapsed .sidebar-nav ul li a {
    justify-content: center;
    padding: 11px 8px;
    gap: 0;
}
.sidebar.collapsed .nav-msg-badge { display: none !important; }
.sidebar.collapsed .sidebar-nav { margin-top: 18px; }

.sidebar-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    margin-top: -22px;
}

.sidebar-brand span {
    font-size: var(--logo-name-size);
    font-weight: 600;
    color: #ffffff;
}

.sidebar-logo {
    width: var(--logo-size);
    height: var(--logo-size);
    object-fit: contain;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sidebar-tagline {
    font-size: 0.82rem;
    opacity: 0.7;
    line-height: 1.6;
    text-align: center;
}

.sidebar > .sidebar-tagline {
    padding: 2px 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    margin-bottom: 4px;
}

.sidebar-footer-info {
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.09);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer-copy {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.42);
    line-height: 1.6;
}

.sidebar-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-footer-contact span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.32);
    line-height: 1.55;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    margin-top: 6px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav ul li {
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.18s;
}

.sidebar-nav ul li a {
    text-decoration: none;
    color: var(--sidebar-link-color);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0.72;
    transition: opacity 0.18s, background 0.18s;
}

.sidebar-nav ul li a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.07);
}

.sidebar-nav ul li.active a {
    opacity: 1;
    background: rgba(255,255,255,0.13);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.logout {
    text-decoration: none;
    color: #ff6b6b;
    text-align: center;
}

.content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0d1b2a;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.content-subtitle {
    font-size: 0.82rem;
    color: #9ca3af;
    margin: 0;
}

.card-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1565C0;
    margin: 8px 0 4px;
}

.card-link {
    font-size: 0.78rem;
    color: #1565C0;
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover { text-decoration: underline; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s, opacity 0.18s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary   { background: #1565C0; color: #fff; }
.btn-primary:hover   { background: #1250a0; }

.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }

.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover    { background: #dc2626; }

.btn-warning   { background: #f59e0b; color: #fff; }
.btn-warning:hover   { background: #d97706; }

.btn-success   { background: #10b981; color: #fff; }
.btn-success:hover   { background: #059669; }

.btn-info      { background: #6366f1; color: #fff; }
.btn-info:hover      { background: #4f46e5; }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; }

.alert {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #e0e7ff; color: #3730a3; }
.badge-primary  { background: #dbeafe; color: #1e40af; }
.badge-muted    { background: #f3f4f6; color: #6b7280; }

.table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

.data-table th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9fafb; }

.td-empty {
    text-align: center;
    padding: 48px 16px;
    color: #9ca3af;
    font-size: 0.88rem;
}

.td-actions {
    white-space: nowrap;
}
.td-actions .btn + .btn { margin-left: 4px; }

.td-row-num {
    width: 36px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.02em;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}
.modal-content.cita-resumen {
    background: #fff;
    margin: 0;
    padding: 2em;
    border-radius: 8px;
    width: 420px;
    max-width: 95vw;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}
.modal-content.cita-resumen h3, .modal-content.cita-resumen h4 {
    margin-top: 0;
}
.modal-content.cita-resumen hr {
    margin: 1.5em 0;
}
.modal-content.cita-resumen .close {
    float: right;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
}
.modal-content.cita-resumen .error {
    color: #EF4444;
    font-weight: bold;
    margin: 1em 0;
}
.btn-ver-cita {
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 4px;
}
.btn-ver-cita:hover {
    background: #2563EB;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.modal-content {
    position: relative;
    z-index: 901;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 740px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-sm { max-width: 460px; overflow: visible; }
.modal-content.modal-md { max-width: 600px; overflow: visible; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.modal-close:hover { color: #374151; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid #f3f4f6;
}

.modal-body-text {
    padding: 16px 24px;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px 24px 0;
}

.form-group { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-group-full { grid-column: 1 / -1; }
.cita-order-3 { order: 3; }
.cita-order-4 { order: 4; }
.cita-order-5 { order: 5; }
.cita-order-6 { order: 6; }
.cita-order-7 { order: 7; }

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-select {
    min-height: 44px;
    padding: 10px 13px;
    border: 1.5px solid var(--field-border);
    border-radius: 12px;
    font-size: 0.875rem;
    background: var(--field-bg);
    box-shadow: var(--field-shadow);
    color: #0f172a;
    outline: none;
    transition:
        border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

select.form-select,
.form-group select,
.cal-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 42px;
    background-image:
        linear-gradient(135deg, rgba(21,101,192,0.11), rgba(21,101,192,0.03)),
        url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: right 7px center, right 17px center;
    background-size: 32px 32px, 12px 12px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-select:focus,
.cal-filter-select:focus {
    border-color: var(--field-accent);
    box-shadow: var(--field-shadow-active);
    background-color: #fff;
    transform: translateY(-1px);
}

.form-group input:hover:not(:disabled),
.form-group select:hover:not(:disabled),
.form-group textarea:hover:not(:disabled),
.form-select:hover:not(:disabled),
.cal-filter-select:hover:not(:disabled) {
    border-color: var(--field-border-hover);
    background-color: #fff;
    transform: translateY(-1px);
}

.form-group textarea { resize: vertical; }

.form-group textarea,
textarea.form-select {
    min-height: 92px;
}

input[type="time"].form-select {
    padding-left: 40px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    background-image:
        url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 14'/%3E%3C/svg%3E"),
        linear-gradient(135deg, rgba(21,101,192,0.11), rgba(21,101,192,0.03));
    background-repeat: no-repeat, no-repeat;
    background-position: left 14px center, right 7px center;
    background-size: 15px 15px, 32px 32px;
    cursor: pointer;
}

input[type="time"].form-select::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
}

input[type="time"].form-select::-webkit-datetime-edit-fields-wrapper,
input[type="time"].form-select::-webkit-datetime-edit-hour-field,
input[type="time"].form-select::-webkit-datetime-edit-minute-field,
input[type="time"].form-select::-webkit-datetime-edit-text {
    padding: 0;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled,
.form-select:disabled,
.cal-filter-select:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.req      { color: #ef4444; font-size: 0.75rem; }
.req-note { font-size: 0.72rem; font-weight: 400; color: #9ca3af; }

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1.5px solid;
}
.form-alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
}
.form-alert-warning svg { flex-shrink: 0; margin-top: 1px; }
.form-alert-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 2px;
}
.form-alert-warning .form-alert-title { color: #c2410c; }
.form-alert-body {
    font-size: 0.8rem;
    margin: 0;
}
.form-alert-warning .form-alert-body { color: #9a3412; }

.text-muted { color: #9ca3af; font-size: 0.82rem; }

.modal-content.modal-xl { max-width: 860px; }

.tab-nav {
    display: flex;
    gap: 3px;
    border-bottom: 2px solid #e2e8f0;
    background: #eef2f7;
    padding: 12px 20px 0;
    flex-shrink: 0;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
    padding: 10px 18px 11px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #1e3a5f;
    background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
    color: #1565C0;
    font-weight: 600;
    background: #ffffff;
    border-color: #e2e8f0;
    border-bottom-color: #ffffff;
    box-shadow: inset 0 3px 0 0 #1565C0;
}

.tab-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    background: #d1d5db;
    color: #6b7280;
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
}

.tab-btn.active .tab-step {
    background: #1565C0;
    color: #ffffff;
}

.tab-btn:hover:not(.active) .tab-step {
    background: #9ca3af;
    color: #ffffff;
}

.tab-panel { display: none; }

.tab-panel.active {
    display: block;
    max-height: calc(90vh - 220px);
    min-height: 280px;
    overflow-y: auto;
}

.form-section-title {
    grid-column: 1 / -1;
    font-size: 0.74rem;
    font-weight: 700;
    color: #1565C0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.check-group {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 2px 0 4px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.check-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    min-width: 15px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    margin: 0;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.check-item input[type="checkbox"]:checked {
    background: #1565C0;
    border-color: #1565C0;
}

.check-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.check-item input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.period-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.period-tabs {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.period-tab {
    padding: 8px 22px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.period-tab:hover  { background: #e5e7eb; color: #374151; }

.period-tab.active {
    background: linear-gradient(135deg, #1565C0, #1976d2);
    color: #fff;
    box-shadow: 0 2px 8px rgba(21,101,192,0.35);
}

.custom-range-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    width: fit-content;
}

.custom-range-form .form-group { min-width: 160px; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
    margin-bottom: 28px;
    align-items: stretch;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 4px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.kpi-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 50px;
    margin-bottom: 8px;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 18px;
    height: 18px;
}

.kpi-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    margin-bottom: 0;
    line-height: 1.3;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-sub { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }

.kpi-progress {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    margin: 6px 0;
    overflow: hidden;
}

.kpi-progress-fill {
    height: 100%;
    background: #8b5cf6;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.kpi-success { border-left-color: #10b981; background: linear-gradient(135deg, #fff 60%, rgba(16,185,129,0.06)); }
.kpi-success .kpi-value { color: #059669; }
.kpi-success .kpi-icon { background: rgba(16,185,129,0.12); color: #059669; }

.kpi-danger  { border-left-color: #ef4444; background: linear-gradient(135deg, #fff 60%, rgba(239,68,68,0.06)); }
.kpi-danger  .kpi-value { color: #dc2626; }
.kpi-danger  .kpi-icon { background: rgba(239,68,68,0.12); color: #dc2626; }

.kpi-warning { border-left-color: #f59e0b; background: linear-gradient(135deg, #fff 60%, rgba(245,158,11,0.06)); }
.kpi-warning .kpi-value { color: #d97706; }
.kpi-warning .kpi-icon { background: rgba(245,158,11,0.12); color: #d97706; }

.kpi-info    { border-left-color: #6366f1; background: linear-gradient(135deg, #fff 60%, rgba(99,102,241,0.06)); }
.kpi-info    .kpi-value { color: #4f46e5; }
.kpi-info    .kpi-icon { background: rgba(99,102,241,0.12); color: #4f46e5; }

.kpi-purple  { border-left-color: #8b5cf6; background: linear-gradient(135deg, #fff 60%, rgba(139,92,246,0.06)); }
.kpi-purple  .kpi-value { color: #7c3aed; }
.kpi-purple  .kpi-icon { background: rgba(139,92,246,0.12); color: #7c3aed; }

.kpi-teal    { border-left-color: #0891b2; background: linear-gradient(135deg, #fff 60%, rgba(8,145,178,0.06)); }
.kpi-teal    .kpi-value { color: #0e7490; }
.kpi-teal    .kpi-icon { background: rgba(8,145,178,0.12); color: #0e7490; }

.kpi-card:not([class*='kpi-']) .kpi-icon,
.kpi-card.kpi-default .kpi-icon { background: rgba(21,101,192,0.1); color: #1565C0; }

.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.chart-canvas-wrap {
    position: relative;
    height: 280px;
}

.chart-box h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
}

.report-table-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid #1565C0;
    position: relative;
}

.motivo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.motivo-label {
    font-size: 0.8rem;
    color: #374151;
    min-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.motivo-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.motivo-bar {
    height: 100%;
    background: linear-gradient(90deg, #1565C0, #42a5f5);
    border-radius: 4px;
    width: 0 !important;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.motivo-bar.animated {
    width: var(--bar-target) !important;
}

.motivo-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 24px;
    text-align: right;
}

.insight-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.insight-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 4px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 190px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.insight-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    background: rgba(21,101,192,0.08);
}

.insight-card.ic-blue   { border-left-color: #1565C0; background: linear-gradient(135deg, #fff 60%, rgba(21,101,192,0.06)); }
.insight-card.ic-blue   .insight-icon { background: rgba(21,101,192,0.1); }
.insight-card.ic-indigo { border-left-color: #6366f1; background: linear-gradient(135deg, #fff 60%, rgba(99,102,241,0.06)); }
.insight-card.ic-indigo .insight-icon { background: rgba(99,102,241,0.1); }
.insight-card.ic-teal   { border-left-color: #0891b2; background: linear-gradient(135deg, #fff 60%, rgba(8,145,178,0.06)); }
.insight-card.ic-teal   .insight-icon { background: rgba(8,145,178,0.1); }
.insight-card.ic-green  { border-left-color: #10b981; background: linear-gradient(135deg, #fff 60%, rgba(16,185,129,0.06)); }
.insight-card.ic-green  .insight-icon { background: rgba(16,185,129,0.1); }
.insight-card.ic-red    { border-left-color: #ef4444; background: linear-gradient(135deg, #fff 60%, rgba(239,68,68,0.06)); }
.insight-card.ic-red    .insight-icon { background: rgba(239,68,68,0.1); }

.insight-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 2px;
}

.insight-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.insight-sub { font-size: 0.75rem; color: #9ca3af; }

.content {
    flex: 1;
    padding: 74px 40px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.cards {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 200px;
}

.login-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(160deg, #edeaf8 0%, #e6f4f2 100%);
    position: relative;
}

.login-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-footer-copy {
    font-size: 0.85rem;
    color: #9ca3af;
}

.login-footer-links {
    display: flex;
    gap: 20px;
}

.login-footer-links a {
    font-size: 0.85rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer-links a:hover {
    color: #1565C0;
}

.footer-popover-wrap {
    position: relative;
}

.footer-popover {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: 280px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(21, 101, 192, 0.15), 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 100;
}

.footer-popover::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 3px;
    transform: rotate(45deg);
    box-shadow: 3px 3px 8px rgba(0,0,0,0.06);
}

.footer-popover.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.popover-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.popover-close:hover {
    color: #374151;
}

.popover-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.footer-popover h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.footer-popover p {
    font-size: 0.83rem;
    color: #6b7280;
    margin: 0;
}

.popover-link {
    font-size: 0.83rem;
    color: #1565C0;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s;
}

.popover-link:hover {
    opacity: 0.75;
}

.popover-whatsapp {
    color: #16a34a;
}

.popover-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 3px 10px;
    width: fit-content;
}

.popover-soporte-form { width: 300px; }

.popover-soporte-form form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popover-soporte-form input,
.popover-soporte-form textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-size: 0.82rem;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
}

.popover-soporte-form input:focus,
.popover-soporte-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    background: #fff;
}

.popover-soporte-form button[type="submit"] {
    padding: 8px 14px;
    background: linear-gradient(90deg, #1565C0, #42a5f5);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}

.popover-soporte-form button[type="submit"]:hover { opacity: .88; }
.popover-soporte-form button[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }

.soporte-feedback {
    font-size: 0.78rem;
    min-height: 1rem;
    text-align: center;
    margin: 0;
}
.soporte-ok  { color: #16a34a; }
.soporte-err { color: #dc2626; }

.login-box {
    background: white;
    padding: 40px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(21,101,192,0.12);
    width: 420px;
    position: relative;
    overflow: hidden;
}

.login-box-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1565C0, #42a5f5);
    border-radius: 14px 14px 0 0;
}

.login-box h2 {
    margin-bottom: 6px;
    font-size: 1.5rem;
    color: #111827;
    text-align: center;
}

.login-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.6;
}

.login-box label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.login-box input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.login-box input:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
    background: #fff;
}

.login-box button {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: #1565C0;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.login-box button:hover {
    background: #1250a0;
    transform: translateY(-1px);
}

.login-box button:active {
    transform: translateY(0);
}

.remember-row {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    margin-top: -6px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #4b5563;
    user-select: none;
    margin: 0;
}

.remember-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    margin: 0;
    padding: 0;
    position: relative;
}

.remember-label input[type="checkbox"]:checked {
    background: #1565C0;
    border-color: #1565C0;
}

.remember-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.remember-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.error {
    color: red;
    margin-bottom: 15px;
}

.login-box .error {
    color: #dc2626;
    font-size: 0.78rem;
    margin-top: -14px;
    margin-bottom: 12px;
}

.auth-box-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon {
    font-size: 2.6rem;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1;
}

.login-action-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.82rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.18s;
}

.login-action-link:hover { color: #1565C0; }

.login-msg {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.login-msg-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.login-msg-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.login-box-btn-full {
    display: block;
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    background: #1565C0;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}
.login-box-btn-full:hover  { background: #1250a0; transform: translateY(-1px); }
.login-box-btn-full:active { transform: translateY(0); }

.pw-hint {
    font-size: 0.76rem;
    color: #9ca3af;
    margin-top: -10px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.change-pw-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
    padding: 32px;
}

.change-pw-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(21,101,192,0.12);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.change-pw-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1565C0, #42a5f5);
    border-radius: 14px 14px 0 0;
}

.change-pw-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    text-align: center;
    margin-bottom: 6px;
}

.change-pw-subtitle {
    font-size: 0.84rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 26px;
    line-height: 1.6;
}

.change-pw-card label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.change-pw-card input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.9rem;
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.change-pw-card input[type="password"]:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    background: #fff;
}

.change-pw-card input[type="password"]:hover {
    border-color: #1565C0;
    background: #fff;
}

.change-pw-card .btn-primary {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: #1565C0;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}

.change-pw-card .btn-primary:hover  { background: #1250a0; transform: translateY(-1px); }
.change-pw-card .btn-primary:active { transform: translateY(0); }

.login-flip-wrapper {
    perspective: 1200px;
    width: 420px;
}

.login-flip-card {
    width: 100%;
    height: 540px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.login-flip-card.flipped {
    transform: rotateY(180deg);
}

.login-flip-front,
.login-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
}

.login-flip-front {
    background: linear-gradient(135deg, #0D1B2A 0%, #1565C0 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}

.login-flip-front::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.login-flip-front::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.login-flip-icon {
    font-size: 3.3rem;
    line-height: 1;
    margin-bottom: 24px;
    filter: drop-shadow(0 10px 24px rgba(13, 27, 42, 0.24));
}

.login-flip-logo {
    width: 132px;
    max-width: 48%;
    object-fit: contain;
    margin-bottom: 24px;
    filter: drop-shadow(0 10px 24px rgba(13, 27, 42, 0.28));
}

.login-flip-quote {
    font-size: 1.28rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.55;
    margin-bottom: 30px;
    max-width: 280px;
}

.login-flip-cta {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 8px 24px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.login-flip-front:hover .login-flip-cta {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border-color: rgba(255,255,255,0.6);
}

.login-flip-front:hover {
    animation: heartbeat 0.8s ease-in-out infinite;
}

@keyframes heartbeat {
    0%   { transform: scale(1); box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
    14%  { transform: scale(1.04); box-shadow: 0 14px 44px rgba(21,101,192,0.35); }
    28%  { transform: scale(1); box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
    42%  { transform: scale(1.025); box-shadow: 0 12px 38px rgba(21,101,192,0.25); }
    70%  { transform: scale(1); box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
    100% { transform: scale(1); box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
}

.login-flip-back {
    transform: rotateY(180deg);
    overflow: hidden;
    display: flex;
}

.login-flip-back .login-box {
    width: 100%;
    min-height: 100%;
    margin: 0;
    border-radius: 14px;
}

.login-box-private {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px 40px 30px;
}

.login-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 auto 14px;
    background: #e8f1fb;
    color: #1250a0;
}

.login-private-hint {
    margin: 0 0 22px;
    color: #6b7280;
    text-align: center;
    line-height: 1.65;
    font-size: 0.9rem;
}

.login-box .login-flip-back-link {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 400;
    transform: none;
    box-shadow: none;
}

.login-box .login-flip-back-link:hover {
    background: none;
    color: #1565C0;
    transform: none;
}

.login-box .login-flip-back-link:active {
    transform: none;
}

body.login-shell {
    overflow: auto;
}

.login-shell .layout {
    min-height: 100vh;
    height: auto;
}

.login-shell .login-area {
    min-height: 100vh;
    padding: 32px 24px;
}

.login-shell .sidebar-brand {
    margin-top: 8px;
}

@media (max-width: 900px) {
    .login-shell .layout {
        flex-direction: column;
    }

    .login-shell .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 220px;
        position: relative;
        padding: 20px 24px 28px;
        align-items: center;
    }

    .login-shell .sidebar-brand {
        margin: 0 0 10px;
    }

    .login-shell .sidebar > .sidebar-tagline {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .login-shell .login-area {
        min-height: auto;
        padding: 28px 18px;
    }

    .login-flip-wrapper,
    .login-box {
        width: min(100%, 420px);
    }

    .login-flip-card {
        height: 540px;
    }

    .login-box {
        padding: 32px 24px;
    }

    .login-box-private {
        padding: 32px 24px 28px;
    }
}

.rel-dropdown {
    position: relative;
    width: 100%;
}

.rel-trigger {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #f9fafb;
    color: #111827;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.rel-trigger:focus,
.rel-dropdown.open .rel-trigger {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    background: #fff;
}

.rel-trigger:hover:not(:disabled) {
    border-color: #1565C0;
    background: #fff;
}

.rel-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6b7280;
}

.rel-dropdown.open .rel-arrow {
    transform: rotate(180deg);
}

.rel-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    border: 1.5px solid rgba(217,227,239,0.9);
    border-radius: 12px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.12),
        0 4px 16px rgba(0,0,0,0.06),
        0 0 0 1px rgba(0,0,0,0.04);
    backdrop-filter: blur(20px);
    list-style: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 6px;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top center;
    transition:
        max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform  0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
}

.rel-dropdown.open .rel-menu {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.rel-dropdown.open .rel-menu::-webkit-scrollbar {
    display: none;
}

.rel-menu li {
    padding: 9px 12px;
    font-size: 0.875rem;
    cursor: pointer;
    color: #111827;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.rel-menu li:hover {
    background: #eef2ff;
    color: #1565C0;
}

.rel-menu li.selected {
    background: #dbeafe;
    color: #1565C0;
    font-weight: 500;
}

.rel-selected { flex: 1; text-align: left; color: #9ca3af; }
.rel-selected.rel-has-value { color: #111827; }

.rel-trigger.rel-trig-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.tpicker-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #f9fafb;
    color: #111827;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    user-select: none;
    width: 100%;
    text-align: left;
}

.tpicker-trigger:hover {
    border-color: #1565C0;
    background: #fff;
}

.tpicker-trigger.tpk-active {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    background: #fff;
}

.tpicker-clock-icon {
    color: #9ca3af;
    flex-shrink: 0;
    transition: color 0.2s;
}

.tpicker-trigger:hover .tpicker-clock-icon,
.tpicker-trigger.tpk-active .tpicker-clock-icon { color: #1565C0; }

.tpicker-label-text {
    flex: 1;
    font-weight: 400;
    color: #9ca3af;
}

.tpicker-label-text.tpk-has-value {
    color: #111827;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.tpicker-chevron {
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.tpicker-trigger.tpk-active .tpicker-chevron {
    transform: rotate(180deg);
    color: #1565C0;
}

.tpicker-trigger.tpk-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.tpk-error-msg {
    font-size: 0.73rem;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

.tpk-error-msg.visible { display: block; }

.tpk-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tpk-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13,27,42,0.55);
    animation: tpk-fade 0.2s ease;
}

@keyframes tpk-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.tpk-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 64px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 290px;
    overflow: hidden;
    animation: tpk-panel-in 0.3s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes tpk-panel-in {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.tpk-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 10px;
}

.tpk-panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.tpk-close-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.tpk-close-btn:hover { background: #e5e7eb; color: #374151; }

.tpk-col-labels {
    display: grid;
    grid-template-columns: 1fr 24px 1fr;
    padding: 0 20px 4px;
}

.tpk-col-label {
    text-align: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tpk-drums-wrap {
    position: relative;
    padding: 0 20px;
    height: 200px;
    overflow: hidden;
}

.tpk-highlight {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    background: linear-gradient(135deg, rgba(21,101,192,0.11), rgba(21,101,192,0.06));
    border-radius: 12px;
    border: 1.5px solid rgba(21,101,192,0.22);
    pointer-events: none;
    z-index: 0;
}

.tpk-drums {
    display: grid;
    grid-template-columns: 1fr 24px 1fr;
    height: 200px;
    position: relative;
    z-index: 1;
}

.tpk-col {
    height: 200px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.tpk-col:active  { cursor: grabbing; }
.tpk-col::-webkit-scrollbar { display: none; }

.tpk-spacer { height: 80px; pointer-events: none; }

.tpk-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 400;
    color: #d1d5db;
    scroll-snap-align: center;
    transition: color 0.15s, font-size 0.15s, font-weight 0.15s;
    font-variant-numeric: tabular-nums;
    user-select: none;
    cursor: pointer;
}

.tpk-item.tpk-near-2 { color: #c4c9d4; }
.tpk-item.tpk-near-1 { color: #6b7280; font-size: 1rem; }
.tpk-item.tpk-sel    { color: #1565C0; font-size: 1.22rem; font-weight: 700; }

.tpk-colon {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #d1d5db;
    user-select: none;
    pointer-events: none;
    position: relative;
    z-index: 2;
}

.tpk-drums-wrap::before,
.tpk-drums-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 68px;
    z-index: 5;
    pointer-events: none;
}

.tpk-drums-wrap::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,1) 10%, rgba(255,255,255,0));
}

.tpk-drums-wrap::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,1) 10%, rgba(255,255,255,0));
}

.tpk-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid #f3f4f6;
}

.tpk-actions .btn { flex: 1; justify-content: center; }

.fpk-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fpk-cal-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
    transition: color 0.2s;
    z-index: 1;
}

.fpk-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px 10px 38px !important;
    border: 1.5px solid var(--field-border);
    border-radius: 12px;
    font-size: 0.875rem;
    background: var(--field-bg);
    box-shadow: var(--field-shadow);
    color: #0f172a;
    outline: none;
    cursor: pointer;
    transition:
        border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
}

.fpk-input:focus,
.fpk-input.active {
    border-color: var(--field-accent);
    box-shadow: var(--field-shadow-active);
    background: #fff;
    transform: translateY(-1px);
}

.fpk-wrap:hover .fpk-input,
.fpk-wrap:focus-within .fpk-input {
    border-color: var(--field-border-hover);
    background: #fff;
}

.fpk-wrap:hover .fpk-cal-icon,
.fpk-wrap:focus-within .fpk-cal-icon { color: #1565C0; }

.flatpickr-calendar {
    font-family: 'Poppins', sans-serif !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,250,255,0.98));
    border: 1.5px solid rgba(217,227,239,0.96) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 64px rgba(15,23,42,0.16), 0 6px 18px rgba(15,23,42,0.08) !important;
    backdrop-filter: blur(22px);
    padding: 12px;
    width: 310px !important;
    z-index: 999999 !important;
    animation: fpk-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fpk-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.flatpickr-months {
    padding: 0 4px 8px;
    align-items: center;
    margin-bottom: 2px;
    position: relative;
}

.flatpickr-months::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(21,101,192,0), rgba(21,101,192,0.16), rgba(21,101,192,0));
}

.flatpickr-month {
    height: 36px;
    color: #111827 !important;
    fill: #111827 !important;
}

.flatpickr-current-month {
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    padding-top: 4px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #111827;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}

.flatpickr-current-month input.cur-year {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #111827 !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    color: #6b7280 !important;
    fill: #6b7280 !important;
    transition: background 0.15s, color 0.15s, fill 0.15s !important;
    top: 6px !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: #eef2ff !important;
    color: #1565C0 !important;
    fill: #1565C0 !important;
}

.flatpickr-weekdays { padding: 0 0 4px; }

.flatpickr-weekday {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #9ca3af !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.flatpickr-day {
    font-size: 0.82rem !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400;
    color: #374151;
    border-radius: 10px !important;
    height: 36px !important;
    line-height: 36px !important;
    max-width: 36px !important;
    transition: background 0.15s, color 0.15s, transform 0.12s !important;
    border: none !important;
}

.flatpickr-day:hover {
    background: #eef2ff !important;
    color: #1565C0 !important;
    transform: translateY(-1px) scale(1.06);
    box-shadow: inset 0 0 0 1px rgba(21,101,192,0.08);
    border: none !important;
}

.flatpickr-day.today {
    border: 2px solid #1565C0 !important;
    background: transparent !important;
    color: #1565C0 !important;
    font-weight: 600 !important;
}

.flatpickr-day.today:hover {
    background: #eef2ff !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #1565C0 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(21,101,192,0.35) !important;
    transform: translateY(-1px) scale(1.08);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d1d5db !important;
    opacity: 0.5;
}

.flatpickr-day.flatpickr-disabled:hover {
    background: transparent !important;
    transform: none;
}

.fpk-hdr-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.fpk-hdr-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    padding: 3px 7px;
    border-radius: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    transition: background 0.17s, color 0.17s;
    line-height: 1;
    white-space: nowrap;
}

.fpk-hdr-btn:hover { background: #eef2ff; color: #1565C0; }
.fpk-hdr-wrap.open .fpk-hdr-btn { background: #eef2ff; color: #1565C0; }

.fpk-hdr-chevron {
    color: #9ca3af;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.17s;
    flex-shrink: 0;
}

.fpk-hdr-btn:hover .fpk-hdr-chevron { color: #1565C0; }
.fpk-hdr-wrap.open .fpk-hdr-chevron { transform: rotate(180deg); color: #1565C0; }

.fpk-hdr-menu {
    position: fixed;
    background: rgba(255,255,255,0.96);
    border: 1.5px solid rgba(217,227,239,0.9);
    border-radius: 12px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.12),
        0 4px 16px rgba(0,0,0,0.06),
        0 0 0 1px rgba(0,0,0,0.04);
    backdrop-filter: blur(20px);
    list-style: none;
    padding: 6px;
    min-width: 130px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 999999;
    pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top center;
    transition:
        max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform  0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.fpk-hdr-menu.open {
    max-height: 220px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fpk-hdr-wrap.year .fpk-hdr-menu { min-width: 90px; }

.fpk-hdr-menu::-webkit-scrollbar { width: 4px; }
.fpk-hdr-menu::-webkit-scrollbar-track { background: transparent; }
.fpk-hdr-menu::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }
.fpk-hdr-menu::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

.fpk-hdr-menu li {
    padding: 8px 12px;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    text-transform: capitalize;
}

.fpk-hdr-menu li:hover   { background: #eef2ff; color: #1565C0; }
.fpk-hdr-menu li.fpk-hdr-sel {
    background: #dbeafe;
    color: #1565C0;
    font-weight: 600;
}

.tba-wrap {
    position: fixed;
    top: 16px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 500;
}

.tba-item {
    position: relative;
}

.tba-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: none;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    transition: background 0.18s, color 0.18s, box-shadow 0.22s, transform 0.18s;
    padding: 0;
    position: relative;
    outline: none;
}

.tba-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: color 0.18s;
}

.tba-btn:hover {
    background: #f0f4ff;
    color: #1565C0;
    box-shadow: 0 4px 14px rgba(21,101,192,0.15), 0 0 0 1px rgba(21,101,192,0.1);
    transform: translateY(-2px);
}

.tba-btn:active {
    transform: translateY(0px) scale(0.96);
}

.tba-btn.tba-active {
    background: #e8f0fe;
    color: #1565C0;
    box-shadow: 0 0 0 2px rgba(21,101,192,0.25), 0 4px 14px rgba(21,101,192,0.1);
}

.tba-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #f4f6f9;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}

.tba-badge.visible {
    display: flex;
    animation: tbaBadgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tbaBadgePop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.tba-btn-avatar {
    width: 40px;
    height: 40px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 2px rgba(255,255,255,0.9);
}

.tba-btn-avatar:hover {
    box-shadow: 0 4px 14px rgba(21,101,192,0.2), 0 0 0 2px rgba(21,101,192,0.3);
    transform: translateY(-2px);
}

.tba-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #42a5f5);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    user-select: none;
    overflow: hidden;
}

.tba-avatar:has(img) {
    background: none;
}

.tba-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tba-avatar-lg {
    width: 46px;
    height: 46px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tba-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: rgba(255,255,255,0.96);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.12),
        0 4px 16px rgba(0,0,0,0.06),
        0 0 0 1px rgba(0,0,0,0.05);
    backdrop-filter: blur(20px);
    z-index: 600;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.4,0,0.2,1),
                transform 0.22s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}

.tba-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tba-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 2px 0 0 0;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
    z-index: 1;
}

.tba-dropdown-sm {
    width: 220px;
}

.tbd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #f3f4f6;
}

.tbd-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tbd-link {
    font-size: 0.76rem;
    color: #1565C0;
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s;
    font-family: 'Poppins', sans-serif;
}

.tbd-link:hover { opacity: 0.7; }
.tbd-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tbd-body {
    max-height: 310px;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.tbd-body::-webkit-scrollbar { width: 4px; }
.tbd-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.tbd-empty {
    padding: 32px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.83rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tbd-empty-icon {
    font-size: 2rem;
    line-height: 1;
}

.tbd-skeleton {
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tbd-sk-row {
    height: 12px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e9ebee 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: tbaSkeletonSlide 1.4s linear infinite;
}

.tbd-sk-short { width: 60%; }

@keyframes tbaSkeletonSlide {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tbd-msg-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 18px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 8px;
    margin: 0 6px;
    text-decoration: none;
    color: inherit;
}

.tbd-msg-item:hover { background: #f8fafc; }

.tbd-msg-item.unread { background: #f0f6ff; }
.tbd-msg-item.unread:hover { background: #e8f0fe; }

.tbd-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tbd-msg-body { flex: 1; min-width: 0; }

.tbd-msg-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.tbd-msg-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.tbd-msg-time {
    font-size: 0.7rem;
    color: #9ca3af;
    flex-shrink: 0;
    margin-left: 6px;
}

.tbd-msg-preview {
    font-size: 0.77rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbd-msg-item.unread .tbd-msg-name { color: #1565C0; }
.tbd-msg-item.unread .tbd-msg-preview { color: #374151; font-weight: 500; }

.tbd-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 18px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 8px;
    margin: 0 6px;
    text-decoration: none;
    color: inherit;
}

.tbd-notif-item:hover { background: #f8fafc; }
.tbd-notif-item.unread { background: #f0f6ff; }
.tbd-notif-item.unread:hover { background: #e8f0fe; }

.tbd-notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tbd-notif-icon svg { width: 17px; height: 17px; }

.tbd-notif-info    { background: #dbeafe; color: #1565C0; }
.tbd-notif-warning { background: #fef3c7; color: #d97706; }
.tbd-notif-danger  { background: #fee2e2; color: #dc2626; }
.tbd-notif-success { background: #d1fae5; color: #059669; }

.tbd-notif-content { flex: 1; min-width: 0; }

.tbd-notif-text {
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.45;
    margin-bottom: 3px;
}

.tbd-notif-item.unread .tbd-notif-text { color: #111827; font-weight: 500; }

.tbd-notif-time {
    font-size: 0.7rem;
    color: #9ca3af;
}

.tbd-profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 14px;
}

.tbd-profile-text { min-width: 0; }

.tbd-profile-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.tbd-profile-role {
    font-size: 0.74rem;
    color: #6b7280;
    margin-top: 1px;
}

.tbd-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 4px 0;
}

.tbd-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    font-size: 0.83rem;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
    border-radius: 8px;
    margin: 0 6px;
    background: none;
    border: none;
    width: calc(100% - 12px);
    text-align: left;
    font-family: 'Poppins', sans-serif;
}

.tbd-menu-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #9ca3af;
    transition: color 0.15s;
}

.tbd-menu-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.tbd-menu-item:hover svg { color: #374151; }

.tbd-menu-danger { color: #dc2626; }
.tbd-menu-danger svg { color: #dc2626; }
.tbd-menu-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}
.tbd-menu-danger:hover svg { color: #dc2626; }

.tba-dropdown .tbd-menu-item:last-child,
.tba-dropdown .tbd-divider:last-child { margin-bottom: 6px; }
.tba-dropdown .tbd-menu-item:first-of-type { margin-top: 6px; }

.tba-btn-pill {
    width: auto;
    height: 46px;
    border-radius: 46px;
    padding: 0 12px 0 5px;
    gap: 7px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05);
}

.tba-btn-pill .tba-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.tba-btn-pill .tba-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tba-chevron {
    width: 14px;
    height: 14px;
    color: #6b7280;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s;
}

.tba-btn-pill:hover .tba-chevron { color: #1565C0; }
.tba-btn-pill.tba-active .tba-chevron { transform: rotate(180deg); color: #1565C0; }

.prf-overlay {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 27, 42, 0);
    pointer-events: none;
    transition: background 0.3s ease;
}

.prf-overlay.open {
    background: rgba(13, 27, 42, 0.55);
    pointer-events: auto;
    backdrop-filter: blur(3px);
}

.prf-box {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.18), 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1),
                transform 0.3s cubic-bezier(0.34, 1.30, 0.64, 1);
    position: relative;
}

.prf-overlay.open .prf-box {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.prf-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1565C0, #42a5f5, #6366f1);
    border-radius: 22px 22px 0 0;
    z-index: 1;
}

.prf-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px 28px 20px;
    background: linear-gradient(135deg, #f8faff 0%, #eef4ff 100%);
    border-bottom: 1px solid #e9eef7;
}

.prf-header-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.prf-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    display: block;
}

.prf-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #42a5f5);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(21,101,192,0.25);
    overflow: hidden;
    border: 3px solid #fff;
    position: relative;
}

.prf-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.prf-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    background: #1565C0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    transition: background 0.18s, transform 0.18s;
}

.prf-avatar-edit:hover {
    background: #1250a0;
    transform: scale(1.1);
}

.prf-avatar-edit svg {
    width: 12px;
    height: 12px;
    color: #fff;
    flex-shrink: 0;
}

.prf-header-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.prf-header-role {
    font-size: 0.78rem;
    font-weight: 500;
    color: #1565C0;
    margin-bottom: 4px;
}

.prf-header-hint {
    font-size: 0.72rem;
    color: #9ca3af;
}

.prf-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: #9ca3af;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    margin-top: -2px;
}

.prf-close:hover { color: #374151; background: #f3f4f6; }
.prf-close svg { width: 20px; height: 20px; display: block; }

.prf-form { display: flex; flex-direction: column; gap: 24px; }

.prf-avatar-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.prf-avatar-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}

.prf-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.prf-avatar-initials {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #42a5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
}

.prf-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
}

.prf-avatar-wrap:hover .prf-avatar-overlay { opacity: 1; }

.prf-avatar-input {
    display: none;
}

.prf-avatar-info { display: flex; flex-direction: column; gap: 3px; }

.prf-avatar-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.prf-avatar-role {
    font-size: 0.8rem;
    color: #1565C0;
    font-weight: 500;
}

.prf-avatar-hint {
    font-size: 0.74rem;
    color: #9ca3af;
    margin-top: 4px;
}

.prf-avatar-error {
    font-size: 0.78rem;
    color: #dc2626;
    margin-top: 2px;
}

.prf-divider {
    border: none;
    border-top: 1px solid #e9eef7;
    margin: 0;
}

.prf-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.prf-fields .prf-field { display: flex; flex-direction: column; gap: 6px; }

.prf-fields .prf-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.prf-fields .prf-field input {
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111827;
    background: #f9fafb;
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.prf-fields .prf-field input:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    background: #fff;
}

.prf-field-error {
    font-size: 0.78rem;
    color: #dc2626;
}

.prf-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.prf-saved-msg {
    font-size: 0.84rem;
    color: #16a34a;
    font-weight: 500;
}

.prf-content {
    display: flex;
    flex-direction: column;
}

.prf-page-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    max-width: 960px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.prf-page-card {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(21,101,192,0.10), 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
}

.prf-page-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1565C0, #42a5f5, #6366f1);
    z-index: 1;
}

.prf-body-page {
    max-height: none !important;
    overflow-y: visible !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
    align-items: start;
}

.prf-body-page .prf-col-left  { grid-column: 1; }
.prf-body-page .prf-col-right { grid-column: 2; }
.prf-body-page .prf-section-title { grid-column: 1 / -1; }

.prf-body {
    padding: 22px 28px 6px;
    max-height: 52vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.prf-body::-webkit-scrollbar { width: 4px; }
.prf-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.prf-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1565C0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prf-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9eef7;
}

.prf-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.prf-field-row-3 {
    grid-template-columns: 1fr auto;
}

.prf-field-row-tel {
    grid-template-columns: 1fr 80px;
}

.prf-field { display: flex; flex-direction: column; gap: 5px; }

.prf-field-xs { min-width: 80px; max-width: 100px; }

.prf-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
}

.prf-label svg {
    width: 13px;
    height: 13px;
    color: #9ca3af;
    flex-shrink: 0;
}

.prf-input {
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #111827;
    background: #f9fafb;
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    width: 100%;
}

.prf-input:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    background: #fff;
}

.prf-input:hover:not(:disabled) {
    border-color: #1565C0;
    background: #fff;
}

.prf-input::placeholder { color: #c4cad4; }

.prf-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8faff;
    border: 1px solid #e9eef7;
    margin-bottom: 10px;
    transition: border-color 0.18s;
}

.prf-toggle-row:hover { border-color: #c7d9f8; }

.prf-toggle-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.prf-toggle-info > svg {
    width: 20px;
    height: 20px;
    color: #1565C0;
    flex-shrink: 0;
}

.prf-toggle-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1px;
}

.prf-toggle-desc {
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.4;
}

.prf-switch { position: relative; flex-shrink: 0; cursor: pointer; }
.prf-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.prf-switch-track {
    display: block;
    width: 44px;
    height: 24px;
    border-radius: 24px;
    background: #d1d5db;
    transition: background 0.22s ease;
    position: relative;
}

.prf-switch input:checked + .prf-switch-track {
    background: #1565C0;
}

.prf-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prf-switch input:checked + .prf-switch-track .prf-switch-thumb {
    transform: translateX(20px);
}

.prf-status {
    margin: 10px 0 4px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.prf-status.show {
    max-height: 60px;
    opacity: 1;
    padding: 10px 14px;
}

.prf-status.success { background: #d1fae5; color: #065f46; }
.prf-status.error   { background: #fee2e2; color: #991b1b; }

.prf-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 28px 22px;
    border-top: 1px solid #f3f4f6;
}

.prf-btn-cancel {
    padding: 9px 20px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.15s, border-color 0.15s;
}

.prf-btn-cancel:hover { background: #f3f4f6; border-color: #d1d5db; }

.prf-btn-save {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #1565C0, #1e88e5);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 14px rgba(21,101,192,0.3);
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.prf-btn-save svg { width: 15px; height: 15px; flex-shrink: 0; }

.prf-btn-save:hover {
    background: linear-gradient(135deg, #1250a0, #1565C0);
    box-shadow: 0 6px 18px rgba(21,101,192,0.4);
    transform: translateY(-1px);
}

.prf-btn-save:active { transform: translateY(0); }

.prf-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.prf-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: prfSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes prfSpin { to { transform: rotate(360deg); } }

.prf-avatar-wrap:hover .prf-avatar {
    box-shadow: 0 4px 20px rgba(21,101,192,0.35);
}

.chat-page {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-layout {
    display: flex;
    height: 100%;
    min-height: 0;
    flex: 1;
}

.chat-sidebar {
    width: 360px;
    min-width: 360px;
    border-right: 1px solid #dde6f0;
    border-radius: 0 0 0 12px;
    display: flex;
    flex-direction: column;
    background: #f8fafd;
    overflow: hidden;
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 20px;
    background: linear-gradient(160deg, #edeaf8 0%, #e6f4f2 100%);
    border-bottom: 1px solid #d5d0ee;
    flex-shrink: 0;
    position: relative;
}

.chat-sidebar-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-sidebar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e1b4b;
    margin: 0;
    letter-spacing: -0.02em;
}

.chat-sidebar-sub {
    font-size: 0.72rem;
    color: #4b5563;
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
    flex-shrink: 0;
    animation: statusPulse 2.5s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.25); }
    50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0.12); }
}

.chat-new-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #334155;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
    flex-shrink: 0;
}
.chat-new-btn:hover {
    background: #1e293b;
    border-color: #60a5fa;
    color: #60a5fa;
    transform: scale(1.08);
}
.chat-new-btn:active { transform: scale(0.94); }

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.chat-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #e8eef6;
    background: #f8fafd;
    flex-shrink: 0;
}

.chat-search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.chat-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}

.chat-search {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1.5px solid #e2eaf5;
    border-radius: 20px;
    font-size: 0.845rem;
    outline: none;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    background: #fff;
    color: #374151;
    box-sizing: border-box;
}

.chat-search::placeholder { color: #b0bec5; }

.chat-search:focus {
    border-color: #1565C0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.chat-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;

    scrollbar-width: thin;
    scrollbar-color: #c7daf7 transparent;
}
.chat-conv-list::-webkit-scrollbar { width: 4px; }
.chat-conv-list::-webkit-scrollbar-track { background: transparent; }
.chat-conv-list::-webkit-scrollbar-thumb {
    background: #c7daf7;
    border-radius: 4px;
}
.chat-conv-list::-webkit-scrollbar-thumb:hover { background: #93c5fd; }

.chat-conv-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    position: relative;
    border-bottom: 1px solid #edf2f8;
}
.chat-conv-item:last-child { border-bottom: none; }

.chat-conv-item:hover {
    background: #eef4fd;
}
.chat-conv-item:hover .chat-conv-body {
    transform: translateX(2px);
    transition: transform 0.15s;
}

.chat-conv-item.active {
    background: #deeeff;
    border-left: 3px solid #1565C0;
    padding-left: 11px;
    box-shadow: inset 3px 0 0 0 #1565C0;
}
.chat-conv-item.active .chat-conv-name { color: #1e3a8a; }

.chat-avatar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chat-conv-body {
    flex: 1;
    min-width: 0;
    transition: transform 0.15s;
}

.chat-conv-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.chat-conv-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conv-time {
    font-size: 0.66rem;
    color: #7a92b0;
    flex-shrink: 0;
    background: #e4ecf8;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.chat-conv-preview {
    font-size: 0.795rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.chat-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #1565C0;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(21,101,192,0.4);
}

.chat-conv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 0.85rem;
    text-align: center;
}

.chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
    overflow: hidden;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9ca3af;
    background: linear-gradient(160deg, #edeaf8 0%, #e6f4f2 100%);
}

.chat-empty-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.chat-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.chat-empty-sub {
    font-size: 0.85rem;
}

.chat-thread-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chat-thread-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-thread-avatar { flex-shrink: 0; }

.chat-thread-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-participants {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.chat-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-add-btn:hover {
    background: #f3f4f6;
    border-color: #1565C0;
    color: #1565C0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-date-sep {
    text-align: center;
    margin: 12px 0 8px;
    position: relative;
}

.chat-date-sep span {
    font-size: 0.73rem;
    color: #9ca3af;
    background: #f8fafc;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.chat-date-sep::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: #e5e7eb;
}

.chat-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 2px 0;
}

.chat-msg-row.mine {
    flex-direction: row-reverse;
}

.chat-msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 65%;
}

.chat-msg-row.mine .chat-msg-bubble-wrap {
    align-items: flex-end;
}

.chat-msg-author {
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 3px;
    padding-left: 2px;
}

.chat-msg-bubble {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px 16px 16px 4px;
    padding: 9px 14px;
    font-size: 0.875rem;
    color: #111827;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chat-msg-row.mine .chat-msg-bubble {
    background: #1565C0;
    color: #fff;
    border-color: #1565C0;
    border-radius: 16px 16px 4px 16px;
}

.chat-msg-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 3px;
    padding: 0 2px;
}

.chat-loading-msgs {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.chat-no-msgs {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 0.875rem;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    resize: none;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.18s;
    max-height: 120px;
    overflow-y: hidden;
    background: #f9fafb;
}

.chat-input:focus {
    border-color: #1565C0;
    background: #fff;
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1565C0;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, transform 0.1s;
    flex-shrink: 0;
}

.chat-send-btn:hover    { background: #1250a0; }
.chat-send-btn:active   { transform: scale(0.92); }
.chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.chat-avatar {
    border-radius: 50%;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.chat-loading {
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-sk {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg,#f3f4f6 25%,#e5e7eb 50%,#f3f4f6 75%);
    background-size: 200% 100%;
    animation: chat-shimmer 1.4s infinite;
}

.chat-sk-short { width: 55%; }

@keyframes chat-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.chat-user-picker {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px;
    background: #f9fafb;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.chat-user-item:hover   { background: #eff6ff; }
.chat-user-item.selected { background: #eff6ff; }

.chat-user-info {
    flex: 1;
    min-width: 0;
}

.chat-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.chat-user-role {
    font-size: 0.75rem;
    color: #6b7280;
}

.chat-user-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1565C0;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-user-check.visible { display: flex; }

.nav-msg-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.nav-msg-badge.visible { display: flex; }

.fw-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.fw-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1565C0;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(21,101,192,.45);
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
    flex-shrink: 0;
}
.fw-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(21,101,192,.55); }
.fw-bubble.active { background: #0D47A1; }

.fw-bubble-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}
.fw-bubble-badge.visible { display: flex; }

.fw-panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 340px;
    height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(13,27,42,.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.92) translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
    transform-origin: bottom right;
}
.fw-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.fw-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #1565C0;
    color: #fff;
    flex-shrink: 0;
}
.fw-header-title { flex: 1; font-weight: 700; font-size: .9rem; }
.fw-chat-title { flex: 1; font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-header-actions { display: flex; align-items: center; gap: 4px; }
.fw-icon-btn {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.fw-icon-btn:hover { background: rgba(255,255,255,.32); }

.fw-menu-wrap { position: relative; }
.fw-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 210px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(13,27,42,.14);
    padding: 4px 0;
    z-index: 100;
    transform: translateY(-8px) scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: transform .18s cubic-bezier(.34,1.46,.64,1), opacity .15s ease;
    transform-origin: top right;
}
.fw-menu.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}
.fw-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .82rem;
    color: #374151;
    text-decoration: none;
    transition: background .12s;
    text-align: left;
    font-family: inherit;
}
.fw-menu-item:hover { background: #f3f4f6; }
.fw-menu-item svg { flex-shrink: 0; color: #6b7280; }
.fw-menu-danger { color: #ef4444 !important; }
.fw-menu-danger svg { color: #ef4444 !important; }

.fw-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.fw-conv-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.fw-conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .13s;
    position: relative;
}
.fw-conv-item:hover { background: #f9fafb; }
.fw-conv-body { flex: 1; min-width: 0; }
.fw-conv-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.fw-conv-name { font-size: .82rem; font-weight: 600; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.fw-conv-time { font-size: .68rem; color: #9ca3af; flex-shrink: 0; }
.fw-conv-prev { font-size: .75rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #1565C0;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fw-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: .03em;
}

.fw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f8fafc;
}
.fw-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 88%;
}
.fw-msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.fw-msg-row.theirs { align-self: flex-start; }
.fw-msg-wrap { display: flex; flex-direction: column; gap: 2px; }
.fw-msg-row.mine .fw-msg-wrap { align-items: flex-end; }
.fw-msg-bubble {
    padding: 7px 11px;
    border-radius: 14px;
    font-size: .8rem;
    line-height: 1.45;
    word-break: break-word;
    max-width: 220px;
}
.fw-msg-row.mine .fw-msg-bubble {
    background: #1565C0;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.fw-msg-row.theirs .fw-msg-bubble {
    background: #fff;
    color: #111;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}
.fw-msg-time { font-size: .65rem; color: #9ca3af; padding: 0 2px; }

.fw-input-area {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    flex-shrink: 0;
}
.fw-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: .82rem;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.4;
    max-height: 80px;
    overflow-y: auto;
    transition: border-color .15s;
}
.fw-input:focus { border-color: #1565C0; }
.fw-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #1565C0;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.fw-send-btn:hover { background: #1976D2; }
.fw-send-btn:disabled { opacity: .5; cursor: not-allowed; }

.fw-picker { display: flex; flex-direction: column; gap: 6px; }
.fw-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .13s;
    border: 1.5px solid transparent;
    position: relative;
}
.fw-picker-item:hover { background: #f3f4f6; }
.fw-picker-item.selected { border-color: #1565C0; background: #eff6ff; }
.fw-pick-check {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1565C0;
    color: #fff;
    margin-left: auto;
    flex-shrink: 0;
}
.fw-pick-check.visible { display: flex; }

.fw-loading { padding: 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.fw-sk {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: fwShimmer 1.4s infinite;
}
.fw-sk-s { height: 10px; width: 60%; }
@keyframes fwShimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.chat-filter-bar {
    display: flex;
    gap: 4px;
    padding: 6px 12px 4px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.chat-filter-btn {
    flex: 1;
    padding: 5px 6px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: none;
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.chat-filter-btn:hover { border-color: #1565C0; color: #1565C0; background: #eff6ff; }
.chat-filter-btn.active { background: #1565C0; color: #fff; border-color: #1565C0; }

.chat-del-btn {
    color: #ef4444 !important;
    border-color: #fecaca !important;
}
.chat-del-btn:hover { background: #fef2f2 !important; border-color: #ef4444 !important; }

.chat-header-actions { display: flex; align-items: center; gap: 8px; }

.chat-msg-visto {
    font-size: .64rem;
    color: #60a5fa;
    display: flex;
    align-items: center;
    gap: 1px;
    justify-content: flex-end;
    margin-top: 2px;
    user-select: none;
    opacity: .9;
    animation: vistoFadeIn .3s ease;
}
.fw-msg-visto {
    font-size: .60rem;
    color: #60a5fa;
    display: flex;
    align-items: center;
    gap: 1px;
    justify-content: flex-end;
    margin-top: 1px;
    user-select: none;
    opacity: .9;
    animation: vistoFadeIn .3s ease;
}
@keyframes vistoFadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: .9; transform: translateY(0); }
}

.chat-messages {
    background: linear-gradient(160deg, #edeaf8 0%, #e6f4f2 100%);
}

.chat-conv-item.unread {
    border-left: 3px solid #1565C0;
    background: #f5f8ff;
}
.chat-conv-item.unread .chat-conv-name {
    font-weight: 700;
    color: #1e3a8a;
}
.chat-conv-item.unread .chat-conv-preview {
    color: #374151;
    font-weight: 500;
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg-row.chat-msg-new {
    animation: chatMsgIn 0.2s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

.chat-messages-container {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chat-scroll-down {
    position: absolute;
    bottom: 14px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #d1d5db;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.14);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    z-index: 10;
    flex-shrink: 0;
}
.chat-scroll-down:hover {
    background: #f3f4f6;
    box-shadow: 0 5px 18px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}
.chat-scroll-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 24px 3px;
    min-height: 28px;
    flex-shrink: 0;
}
.chat-typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 5px 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typingBounce 1.2s ease-in-out infinite;
    display: block;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.45; }
    30%            { transform: translateY(-5px); opacity: 1; }
}
.chat-typing-name {
    font-size: 0.72rem;
    color: #6b7280;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-emoji-btn {
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.12s;
    align-self: center;
}
.chat-emoji-btn:hover {
    background: #f3f4f6;
    transform: scale(1.18);
}
.chat-emoji-picker {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px 10px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    animation: chatMsgIn 0.15s ease;
}
.chat-emoji-item {
    font-size: 1.15rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 3px;
    border-radius: 6px;
    text-align: center;
    line-height: 1;
    transition: background 0.1s, transform 0.1s;
}
.chat-emoji-item:hover {
    background: #f1f5f9;
    transform: scale(1.3);
}

.chat-input-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}
.chat-input-wrap .chat-input {
    width: 100%;
    box-sizing: border-box;
}
.chat-char-counter {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 0.65rem;
    color: #9ca3af;
    pointer-events: none;
    user-select: none;
    transition: color 0.15s;
}
.chat-char-counter.chat-char-danger {
    color: #ef4444;
    font-weight: 700;
}

.chat-empty-illustration {
    animation: chatEmptyFloat 3.5s ease-in-out infinite;
}
@keyframes chatEmptyFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-9px); }
}
.chat-empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3a8a;
}
.chat-empty-sub {
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 290px;
    text-align: center;
    line-height: 1.55;
}
.chat-empty-cta {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    font-size: 0.875rem;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(21,101,192,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}
.chat-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(21,101,192,0.42);
}

.dash-content {
    padding-top: 74px;
    padding-bottom: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dash-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
    line-height: 1.25;
}

.dash-sub {
    font-size: 0.83rem;
    color: #9ca3af;
    margin: 0;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 4px;
}

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-strip .kpi-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 16px;
    padding-right: 52px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f2f5;
    border-left: 4px solid var(--kpi-color, #1565C0);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.22s ease;
    cursor: default;
}

.kpi-strip .kpi-card .kpi-arrow {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

.kpi-strip .kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.1);
}

.kpi-strip .kpi-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--kpi-color, #1565C0);
    opacity: var(--kpi-circle-opacity, 0.05);
    pointer-events: none;
}

.kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--kpi-color, #1565C0);
    position: relative;
    overflow: hidden;
}

.kpi-icon-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--kpi-color, #1565C0);
    opacity: 0.12;
    border-radius: inherit;
}

.kpi-icon-wrap > * { position: relative; z-index: 1; }

.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.kpi-val {
    font-size: 1.45rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.kpi-lbl {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-arrow {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}

.kpi-strip .kpi-card:hover .kpi-arrow {
    background: var(--kpi-color, #1565C0);
    color: #fff;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 296px;
    gap: 20px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.cal-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f2f5;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
    flex-wrap: wrap;
    background: #fafbfc;
}

.cal-tb-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-tb-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.cal-nav-btn {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    outline: none;
}

.cal-nav-btn:hover {
    background: #1565C0;
    color: #fff;
}

.cal-today-btn {
    padding: 6px 14px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    outline: none;
}

.cal-today-btn:hover {
    background: #1565C0;
    color: #fff;
}

.cal-title-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    padding-left: 4px;
}

.cal-filter-select {
    padding: 8px 12px;
    border: 1.5px solid var(--field-border);
    border-radius: 12px;
    font-size: 0.8rem;
    color: #0f172a;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    transition:
        border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    max-width: 180px;
}

.cal-filter-select:focus {
    border-color: var(--field-accent);
    box-shadow: var(--field-shadow-active);
    transform: translateY(-1px);
}

.cal-filter-select:hover {
    border-color: var(--field-border-hover);
    transform: translateY(-1px);
}

#ddDocFilter {
    min-width: 170px;
    max-width: 200px;
    font-size: 0.8rem;
}
#ddDocFilter .rel-trigger {
    padding: 6px 10px;
    font-size: 0.8rem;
}
#ddDocFilter .rel-menu {
    z-index: 9999;
}

#ddMHoraIni .rel-menu,
#ddMHoraFin .rel-menu {
    z-index: 9999;
}

#ddMHoraIni.open .rel-menu,
#ddMHoraFin.open .rel-menu {
    max-height: 180px;
}

/* ── Citas time picker (modal) ─────────────────────────── */
.tpk-dropdown { width: 100%; }

.tpk-trigger {
    justify-content: flex-start;
    gap: 10px;
    padding-left: 14px;
}

.tpk-trigger .tpk-icon {
    flex-shrink: 0;
    color: #64758b;
}

.tpk-trigger .rel-selected {
    flex: 1;
    text-align: left;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

.tpk-trigger .rel-selected.rel-has-value {
    color: #0f172a;
}

.tpk-trigger .rel-arrow {
    margin-left: auto;
}

.tpk-menu { z-index: 10000; max-height: 0; }
.tpk-dropdown.open .tpk-menu { max-height: 200px; }

.tbl-filter-input {
    padding: 9px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    font-family: 'Poppins', sans-serif;
}

.tbl-filter-input:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    background: #fff;
}

.cal-view-btns {
    display: flex;
    background: #f3f4f6;
    border-radius: 9px;
    padding: 3px;
    gap: 1px;
}

.cal-view-btn {
    padding: 5px 13px;
    border: none;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    outline: none;
}

.cal-view-btn:hover { color: #374151; }

.cal-view-btn.active {
    background: #ffffff;
    color: #1565C0;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

#fullcalendar {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 8px 14px 8px;
}

.dash-aside {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 12px;
}

.aside-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f2f5;
    overflow: hidden;

    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.aside-card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px 11px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid #f3f4f6;
    background: #fafbfc;
}

.aside-date {
    font-size: 0.72rem;
    font-weight: 500;
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
}

.today-list {
    padding: 6px 0;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.today-list::-webkit-scrollbar { width: 4px; }
.today-list::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.today-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    transition: background 0.15s;
}

.today-item:hover { background: #f8fafc; }

.today-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    min-width: 38px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.today-bar {
    width: 3px;
    min-height: 34px;
    border-radius: 3px;
    flex-shrink: 0;
}

.today-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.today-patient {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-empty {
    text-align: center;
    padding: 26px 16px;
    color: #9ca3af;
    font-size: 0.83rem;
    margin: 0;
}

.today-skeleton {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sk-row {
    height: 13px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e9ebee 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skSlide 1.4s linear infinite;
}

.sk-short { width: 58%; }

@keyframes skSlide {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.quick-links {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 0.83rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.quick-link svg {
    flex-shrink: 0;
    color: #9ca3af;
    transition: color 0.15s;
}

.quick-link:hover {
    background: #eff6ff;
    color: #1565C0;
}

.quick-link:hover svg { color: #1565C0; }

.cal-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #374151;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot-available {
    background: transparent;
    border: 2px dashed #1565C0;
    animation: pulseAvail 1.8s ease-in-out infinite;
}

@keyframes pulseAvail {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.cal-popup {
    position: absolute;
    z-index: 800;
    background: #fff;
    border-radius: 14px;
    box-shadow:
        0 16px 48px rgba(0,0,0,0.14),
        0 4px 12px rgba(0,0,0,0.07),
        0 0 0 1px rgba(0,0,0,0.05);
    width: 258px;
    padding: 14px 16px 16px;
}

.cal-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    outline: none;
}

.cal-popup-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.popup-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
    padding-right: 28px;
    line-height: 1.35;
}

.popup-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: #374151;
    margin-bottom: 6px;
}

.popup-row svg { flex-shrink: 0; color: #9ca3af; }

.popup-status {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ps-color, #1565C0);
    position: relative;
    overflow: hidden;
}

.popup-status::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ps-color, #1565C0);
    opacity: 0.12;
    border-radius: inherit;
}

.popup-link {
    display: block;
    margin-top: 12px;
    font-size: 0.78rem;
    color: #1565C0;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s;
}

.popup-link:hover { opacity: 0.7; }

.act-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
    animation: actLivePulse 2s ease-in-out infinite;
}

@keyframes actLivePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

.act-viewport {
    position: relative;
    overflow: hidden;
    height: 148px;

    isolation: isolate;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.act-slide {
    position: absolute;
    inset: 0;
    padding: 10px 12px;
    display: flex;
    align-items: stretch;
}

.act-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f0f2f5;
    border-left: 3px solid var(--act-color, #1565C0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.act-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
}

.act-card-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.act-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--act-bg, #dbeafe);
    color: var(--act-color, #1565C0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.act-titulo {
    flex: 1;
    font-size: 0.83rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    word-break: break-word;
}

.act-tiempo {
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

.act-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
    padding-left: 39px;
}

.act-slide-enter-right {
    animation: actSlideInRight 0.44s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.act-slide-enter-left {
    animation: actSlideInLeft 0.44s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.act-slide-exit-left {
    animation: actSlideOutLeft 0.38s cubic-bezier(0.55, 0, 0.1, 1) forwards;
    pointer-events: none;
}

.act-slide-exit-right {
    animation: actSlideOutRight 0.38s cubic-bezier(0.55, 0, 0.1, 1) forwards;
    pointer-events: none;
}

.act-slide-visible {
    animation: none;
    transform: translateX(0);
    opacity: 1;
}

@keyframes actSlideInRight {
    from { transform: translateX(110%); opacity: 0.4; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes actSlideInLeft {
    from { transform: translateX(-110%); opacity: 0.4; }
    to   { transform: translateX(0);     opacity: 1; }
}

@keyframes actSlideOutLeft {
    from { transform: translateX(0);     opacity: 1; }
    to   { transform: translateX(-110%); opacity: 0; }
}

@keyframes actSlideOutRight {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}

.act-empty {
    text-align: center;
    padding: 26px 16px;
    color: #9ca3af;
    font-size: 0.83rem;
    margin: 0;
}

.act-skeleton {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.act-sk-row {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e9ebee 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: actSkSlide 1.4s linear infinite;
}

.act-sk-short { width: 55%; }

@keyframes actSkSlide {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.act-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 6px 0 10px;
}

.act-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, width 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-radius 0.25s;
    outline: none;
    flex-shrink: 0;
}

.act-dot.active {
    background: #1565C0;
    width: 18px;
    border-radius: 3px;
}

.act-dot:hover:not(.active) { background: #9ca3af; }

.fc .fc-timegrid-col {
    background: #fff;
}

.fc .fc-timegrid-slot {
    border-color: #dadce0;
    height: 1.6rem;
}

.fc .fc-timegrid-slot-minor {
    border-color: #f1f3f4;
    border-top-style: solid;
}

.fc .fc-timegrid-slot-label {
    font-size: 0.94rem;
    font-weight: 500;
    color: #70757a;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: top;
}
.fc .fc-timegrid-slot-label-cushion {
    padding-top: 2px;
    text-align: center !important;
}

.fc .fc-scrollgrid,
.fc .fc-scrollgrid-section > td,
.fc .fc-scrollgrid td {
    border-color: #dadce0;
}

.fc .fc-col-header-cell {
    background: #fff;
    border-color: #dadce0;
}
.fc .fc-col-header-cell-cushion {
    font-size: 0.70rem;
    font-weight: 600;
    color: #70757a;
    text-decoration: none;
    padding: 8px 4px 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion {
    color: #1a73e8;
    font-weight: 700;
}

.fc .fc-timegrid-col.fc-day-today {
    background: rgba(26, 115, 232, 0.04);
}
.fc .fc-daygrid-day.fc-day-today {
    background: rgba(26, 115, 232, 0.04);
}

.fc .fc-non-business {
    background: rgba(241, 243, 244, 0.85);
}

.fc .fc-highlight {
    background: rgba(26, 115, 232, 0.12);
    border-radius: 4px;
}

.fc .fc-timegrid-now-indicator-line {
    border-color: #ea4335;
    border-width: 2px;
    position: relative;
}
.fc .fc-timegrid-now-indicator-line::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #ea4335;
    border-radius: 50%;
}

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

.fc .fc-timegrid-event {
    border-radius: 4px;
    border-left-width: 3px;
    font-size: 0.74rem;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
}
.fc .fc-timegrid-event .fc-event-main {
    padding: 2px 6px;
}

#ddNrxEst .rel-menu {
    position: fixed;
    top: auto;
    bottom: auto;
    transform-origin: top center;
    transform: translateY(-8px) scale(0.97);
}
#ddNrxEst.open .rel-menu {
    transform: translateY(0) scale(1);
}

.nrx-med-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 18px;
    background: #f9fafb;
    transition: border-color 0.2s;
    animation: nrx-row-in 0.22s ease both;
}
.nrx-med-card:hover { border-color: #bfdbfe; }

.exp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    padding: 0 24px;
    background: #fff;
}
.exp-tab-btn {
    padding: 11px 20px;
    font-size: 0.84rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    white-space: nowrap;
}
.exp-tab-btn.active {
    color: #1565C0;
    border-bottom-color: #1565C0;
}
.exp-tab-btn:hover:not(.active) {
    color: #374151;
    background: #f9fafb;
}
.exp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #374151;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 5px;
    vertical-align: middle;
}
.exp-tab-btn.active .exp-tab-count {
    background: #dbeafe;
    color: #1565C0;
}
.exp-tab-panel {
    display: none;
    padding: 20px 24px;
}
.exp-tab-panel.active {
    display: block;
}
.exp-section-label {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
    margin: 0 0 10px;
}
.exp-field-lbl {
    color: #9ca3af;
    display: block;
    font-size: 0.72rem;
    margin-bottom: 2px;
}

.exp-cita-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: flex-start;
}
.exp-cita-item:last-child { border-bottom: none; }
.exp-cita-left {
    min-width: 130px;
    flex-shrink: 0;
    padding-right: 12px;
    border-right: 2px solid #e5e7eb;
    text-align: right;
}
.exp-cita-fecha {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}
.exp-cita-hora {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}
.exp-cita-body { flex: 1; }
.nrx-med-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.nrx-med-num {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1565C0;
}
.nrx-med-remove {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 700;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.nrx-med-remove:hover { background: #fca5a5; color: #b91c1c; }

@keyframes nrx-row-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-weight: 500;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.1s;
}

.export-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.export-btn:active { transform: scale(0.97); }

.settings-page {
    --settings-surface: rgba(255,255,255,0.78);
    --settings-border: rgba(148,163,184,0.18);
    --settings-ink: #0f172a;
    --settings-muted: #64748b;
    --settings-blue: #1565C0;
    --settings-teal: #0f766e;
    --settings-soft: linear-gradient(135deg, rgba(21,101,192,0.12), rgba(13,148,136,0.10));
}

.settings-header {
    align-items: flex-end;
    gap: 18px;
}

.settings-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--settings-blue);
    margin-bottom: 10px;
}

.settings-banner {
    margin-bottom: 20px;
}

.settings-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.9fr);
    gap: 18px;
    padding: 28px;
    margin-bottom: 22px;
    background:
        radial-gradient(circle at top right, rgba(21,101,192,0.20), transparent 38%),
        radial-gradient(circle at left bottom, rgba(13,148,136,0.14), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
    border: 1px solid var(--settings-border);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(15,23,42,0.08);
}

.settings-hero h2 {
    font-size: 1.7rem;
    line-height: 1.15;
    color: var(--settings-ink);
    margin: 0 0 12px;
    max-width: 12ch;
}

.settings-hero p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--settings-muted);
    max-width: 68ch;
}

.settings-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(148,163,184,0.18);
    color: #334155;
    font-size: 0.76rem;
    font-weight: 600;
}

.settings-chip.is-live {
    background: rgba(16,185,129,0.12);
    color: #047857;
    border-color: rgba(16,185,129,0.18);
}

.settings-hero-meta {
    display: grid;
    gap: 12px;
    align-content: start;
}

.settings-hero-stat {
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(148,163,184,0.16);
    backdrop-filter: blur(8px);
}

.settings-hero-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 8px;
}

.settings-hero-stat strong {
    display: block;
    font-size: 1.15rem;
    color: var(--settings-ink);
    margin-bottom: 4px;
}

.settings-hero-stat small {
    color: #64748b;
    font-size: 0.82rem;
}

.settings-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.82fr);
    gap: 20px;
    align-items: start;
}

.settings-main,
.settings-sidebar {
    display: grid;
    gap: 18px;
}

.settings-panel,
.settings-side-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.86));
    border: 1px solid var(--settings-border);
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
}

.settings-panel {
    padding: 22px;
}

.settings-panel-accent {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9)),
        var(--settings-soft);
}

.settings-panel-head,
.settings-side-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.settings-panel-head {
    margin-bottom: 18px;
}

.settings-panel-head h3,
.settings-side-head h4 {
    color: var(--settings-ink);
    margin: 0;
}

.settings-panel-head h3 {
    font-size: 1.08rem;
    margin-bottom: 6px;
}

.settings-panel-head p,
.settings-side-head + p,
.settings-inline-note {
    color: var(--settings-muted);
    font-size: 0.86rem;
    line-height: 1.7;
}

.settings-section-tag,
.settings-mini-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--settings-blue);
    margin-bottom: 8px;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.settings-form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 16px;
}

.settings-panel .form-group input,
.settings-panel .form-group select,
.settings-panel .form-group textarea {
    background: rgba(248,250,252,0.9);
}

.settings-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.settings-rel-dropdown .rel-menu {
    z-index: 260;
}

.settings-rel-dropdown.is-disabled .rel-trigger {
    opacity: 0.65;
    cursor: not-allowed;
    background: rgba(241,245,249,0.95);
}

.settings-panel .form-group input[readonly] {
    color: #64748b;
    background: rgba(241,245,249,0.95);
}

.settings-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.settings-switch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.settings-switch-card {
    position: relative;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(248,250,252,0.8);
    cursor: pointer;
}

.settings-switch-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-switch-ui {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.18s ease;
    margin-top: 1px;
}

.settings-switch-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15,23,42,0.15);
    transition: transform 0.18s ease;
}

.settings-switch-card input:checked + .settings-switch-ui {
    background: linear-gradient(135deg, #1565C0, #0f766e);
}

.settings-switch-card input:checked + .settings-switch-ui::after {
    transform: translateX(20px);
}

.settings-switch-card strong {
    display: block;
    color: var(--settings-ink);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.settings-switch-card small {
    display: block;
    color: var(--settings-muted);
    font-size: 0.79rem;
    line-height: 1.6;
}

.settings-inline-note {
    margin-top: 16px;
    padding: 13px 15px;
    border-radius: 14px;
    background: rgba(219,234,254,0.58);
    border: 1px solid rgba(147,197,253,0.35);
}

.settings-side-card {
    padding: 18px;
}

.settings-side-card-highlight {
    background: linear-gradient(180deg, rgba(240,249,255,0.96), rgba(236,253,245,0.9));
}

.settings-list {
    list-style: none;
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.settings-list li,
.settings-integration-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(226,232,240,0.8);
}

.settings-list li:last-child,
.settings-integration-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-list span {
    color: #64748b;
    font-size: 0.84rem;
}

.settings-list strong,
.settings-integration-item strong,
.settings-module-pill strong {
    color: var(--settings-ink);
}

.settings-stack,
.settings-integrations,
.settings-checklist {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.settings-module-pill {
    padding: 14px;
    border-radius: 14px;
    background: rgba(248,250,252,0.88);
    border: 1px solid rgba(148,163,184,0.14);
}

.settings-module-pill small,
.settings-integration-item small {
    display: block;
    color: var(--settings-muted);
    font-size: 0.78rem;
    margin-top: 3px;
    line-height: 1.5;
}

.settings-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-size: 0.84rem;
    line-height: 1.5;
}

.settings-checklist input[type="checkbox"] {
    accent-color: #1565C0;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.settings-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    background: #cbd5e1;
    box-shadow: 0 0 0 4px rgba(203,213,225,0.35);
}

.settings-dot.is-good {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
}

@media (max-width: 1280px) {
    .settings-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .settings-hero,
    .settings-form-grid,
    .settings-form-grid-3,
    .settings-switch-grid,
    .settings-kpi-grid {
        grid-template-columns: 1fr;
    }

    .settings-header {
        align-items: flex-start;
    }

    .settings-header-actions,
    .settings-panel-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media print {

    .sidebar,
    .tba-wrap,
    .period-tabs-row,
    .custom-range-form,
    .chart-grid,
    .chart-box,
    .floating-chat-btn { display: none !important; }

    .layout { display: block; }

    .content {
        height: auto !important;
        overflow: visible !important;
        padding: 20px !important;
    }

    .kpi-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        break-inside: avoid;
    }

    .kpi-card,
    .insight-card {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
        break-inside: avoid;
    }

    .insight-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .report-table-grid {
        display: block;
    }

    .data-table { width: 100%; border-collapse: collapse; }
    .data-table th, .data-table td { border: 1px solid #d1d5db; padding: 6px 10px; }

    .content-header { margin-bottom: 12px; }
    .content-header h1 { font-size: 1.4rem; }

    @page { margin: 1.5cm; size: A4 landscape; }
}

.aside-next-card { flex-shrink: 0; }

.next-cita-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.next-cita-hora {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1565C0;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    line-height: 1;
}

.next-cita-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.next-cita-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-cita-motivo {
    font-size: 0.73rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-cita-doc {
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-cita-countdown {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6366F1;
    flex-shrink: 0;
    white-space: nowrap;
    background: #ede9fe;
    padding: 3px 9px;
    border-radius: 20px;
}

.next-cita-countdown.next-cita-soon {
    color: #d97706;
    background: #fef3c7;
}

.next-cita-countdown.next-cita-now {
    color: #059669;
    background: #d1fae5;
    animation: nextNowPulse 1.5s ease-in-out infinite;
}

@keyframes nextNowPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.next-cita-empty {
    text-align: center;
    padding: 14px 16px;
    color: #9ca3af;
    font-size: 0.82rem;
}

.aside-main-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.aside-tabs-hdr {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px 7px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafbfc;
    flex-shrink: 0;
}

.aside-tab {
    padding: 4px 12px;
    border: none;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
    outline: none;
    white-space: nowrap;
}

.aside-tab:hover { color: #374151; }

.aside-tab.active {
    background: #dbeafe;
    color: #1565C0;
}

.aside-tab-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aside-tab-pane .today-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
}

#tabReciente .act-viewport {
    flex: 1;
    min-height: 0;
    height: auto;
}

.aside-legend-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.aside-legend-strip > span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.69rem;
    color: #6b7280;
    white-space: nowrap;
}

.main-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.content {
    padding: 88px 48px 44px;
}

.dash-content {
    width: 100%;
    max-width: 1600px;
    padding-top: 88px;
    padding-bottom: 24px;
    gap: 0;
}

.dash-header,
.kpi-strip,
.dash-grid {
    width: 100%;
}

.dash-header {
    gap: 22px;
    margin-bottom: 22px;
    align-items: center;
}

.dash-title {
    font-size: 2.05rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.dash-sub {
    font-size: 0.98rem;
}

.dash-header-actions {
    gap: 14px;
    padding-top: 0;
}

.dash-header-actions .btn-sm {
    padding: 9px 18px;
    font-size: 0.92rem;
    border-radius: 10px;
}

.kpi-strip {
    gap: 18px;
    margin-bottom: 22px;
}

.kpi-strip .kpi-card {
    min-height: 154px;
    padding: 18px 22px;
    padding-right: 62px;
    border-left-width: 5px;
    border-radius: 20px;
    gap: 18px;
}

.kpi-strip .kpi-card::after {
    width: 86px;
    height: 86px;
}

.kpi-icon-wrap {
    width: 58px;
    height: 58px;
    border-radius: 16px;
}

.kpi-val {
    font-size: 2rem;
}

.kpi-lbl {
    font-size: 0.92rem;
}

.kpi-arrow {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.dash-grid {
    grid-template-columns: minmax(0, 1.65fr) 360px;
    gap: 24px;
}

.cal-panel,
.aside-card {
    border-radius: 20px;
}

.cal-toolbar {
    padding: 18px 22px;
    gap: 16px;
}

.cal-tb-left,
.cal-tb-right {
    gap: 10px;
}

.cal-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.cal-today-btn {
    padding: 8px 16px;
    font-size: 0.92rem;
    border-radius: 10px;
}

.cal-title-text {
    font-size: 1.08rem;
    padding-left: 8px;
}

.cal-filter-select {
    padding: 8px 12px;
    font-size: 0.88rem;
    border-radius: 10px;
    max-width: 220px;
}

.cal-view-btns {
    padding: 4px;
    border-radius: 11px;
}

.cal-view-btn {
    padding: 7px 16px;
    font-size: 0.86rem;
    border-radius: 8px;
}

#fullcalendar {
    padding: 10px 18px 14px;
    min-height: 640px;
}

.aside-card-hdr {
    padding: 16px 18px 14px;
    font-size: 0.78rem;
}

.aside-date {
    font-size: 0.82rem;
}

.today-list {
    max-height: 360px;
}

.today-item {
    gap: 12px;
    padding: 12px 16px;
}

.today-time {
    min-width: 46px;
    font-size: 0.92rem;
}

.today-bar {
    min-height: 42px;
}

.today-patient {
    font-size: 0.96rem;
}

.today-meta,
.today-empty {
    font-size: 0.84rem;
}

.cal-legend {
    gap: 10px;
    padding: 14px 16px 16px;
}

.legend-item {
    font-size: 0.86rem;
}

@media (min-width: 1600px) {
    .content {
        padding-right: 56px;
    }

    .dash-content {
        max-width: none;
    }

    .dash-grid {
        grid-template-columns: minmax(0, 1.8fr) 380px;
    }

    #fullcalendar {
        min-height: 700px;
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content.dash-content {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-width: none;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    padding: 72px 34px 22px;
    overflow: hidden;
}

.content.dash-content .dash-header,
.content.dash-content .kpi-strip,
.content.dash-content .dash-grid {
    min-height: 0;
    margin-bottom: 0;
}

.content.dash-content .dash-header {
    align-items: center;
    gap: 18px;
}

.content.dash-content .dash-title {
    font-size: 1.82rem;
    margin-bottom: 4px;
}

.content.dash-content .dash-sub {
    font-size: 0.92rem;
}

.content.dash-content .dash-header-actions {
    gap: 12px;
}

.content.dash-content .dash-header-actions .btn-sm {
    padding: 8px 16px;
    font-size: 0.88rem;
}

.content.dash-content .kpi-strip {
    gap: 14px;
}

.content.dash-content .kpi-strip .kpi-card {
    min-height: 126px;
    padding: 14px 18px;
    padding-right: 56px;
    gap: 14px;
}

.content.dash-content .kpi-strip .kpi-card::after {
    width: 78px;
    height: 78px;
}

.content.dash-content .kpi-icon-wrap {
    width: 50px;
    height: 50px;
}

.content.dash-content .kpi-val {
    font-size: 1.72rem;
}

.content.dash-content .kpi-lbl {
    font-size: 0.84rem;
}

.content.dash-content .kpi-arrow {
    width: 30px;
    height: 30px;
}

.content.dash-content .dash-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    height: 100%;
}

.content.dash-content .cal-panel,
.content.dash-content .dash-aside,
.content.dash-content .aside-card {
    min-height: 0;
}

.content.dash-content .cal-toolbar {
    padding: 14px 16px;
    gap: 12px;
}

.content.dash-content .cal-nav-btn {
    width: 34px;
    height: 34px;
}

.content.dash-content .cal-today-btn {
    padding: 7px 14px;
    font-size: 0.84rem;
}

.content.dash-content .cal-title-text {
    font-size: 1rem;
}

.content.dash-content .cal-filter-select {
    padding: 7px 10px;
    font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-select,
    .cal-filter-select,
    .rel-trigger,
    .rel-menu,
    .tba-dropdown,
    .flatpickr-calendar,
    .flatpickr-day,
    .fpk-hdr-menu,
    .fpk-hdr-btn {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

.content.dash-content .cal-view-btn {
    padding: 6px 13px;
    font-size: 0.8rem;
}

.content.dash-content #fullcalendar {
    height: 100%;
    min-height: 0;
    padding: 8px 12px 10px;
}

.content.dash-content .fc,
.content.dash-content .fc-media-screen,
.content.dash-content .fc-view-harness,
.content.dash-content .fc-view,
.content.dash-content .fc-scroller,
.content.dash-content .fc-scroller-liquid,
.content.dash-content .fc-scroller-liquid-absolute {
    height: 100% !important;
    min-height: 0 !important;
}

.content.dash-content .dash-aside {
    gap: 12px;
    overflow: hidden;
}

.content.dash-content .dash-aside > .aside-card:first-child {
    flex: 0 0 auto;
}

.content.dash-content .dash-aside > .aside-card:last-child {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
}

.content.dash-content .aside-card-hdr {
    padding: 13px 15px 11px;
    font-size: 0.74rem;
}

.content.dash-content .aside-date {
    font-size: 0.78rem;
}

.content.dash-content .today-list {
    max-height: none;
    overflow: hidden;
}

.content.dash-content .today-item {
    padding: 10px 14px;
    gap: 10px;
}

.content.dash-content .today-time {
    min-width: 42px;
    font-size: 0.84rem;
}

.content.dash-content .today-bar {
    min-height: 38px;
}

.content.dash-content .today-patient {
    font-size: 0.9rem;
}

.content.dash-content .today-meta,
.content.dash-content .today-empty,
.content.dash-content .legend-item {
    font-size: 0.8rem;
}

.content.dash-content .today-empty {
    padding: 18px 14px;
}

.content.dash-content .cal-legend {
    margin-top: auto;
    padding: 12px 14px 14px;
    gap: 8px;
}

@media (max-height: 900px) {
    .content.dash-content {
        padding-top: 66px;
        padding-bottom: 18px;
        gap: 12px;
    }

    .content.dash-content .kpi-strip .kpi-card {
        min-height: 114px;
        padding: 12px 16px;
    }

    .content.dash-content .kpi-val {
        font-size: 1.5rem;
    }

    .content.dash-content .dash-grid {
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 16px;
    }

    .content.dash-content .cal-toolbar {
        padding: 12px 14px;
    }

    .content.dash-content .today-item {
        padding: 8px 12px;
    }

    .content.dash-content .today-empty {
        padding: 14px 12px;
    }
}

.content.chat-page {
    padding: 0;
    overflow: hidden;
    flex: 1;
    height: 100%;
    min-height: 0;
}
