:root {
    --surface: #ffffff;
    --surface-bright: #f8f9ff;
    --surface-low: #f8fafc;
    --surface-container: #eef4ff;
    --surface-container-high: #e2e8f0;
    --primary: #00658a;
    --primary-action: #00a7e1;
    --primary-soft: #e5f6ff;
    --on-surface: #0b1c30;
    --on-muted: #3e484f;
    --outline: #dbe3eb;
    --outline-strong: #bdc8d1;
    --success: #047857;
    --success-soft: #ecfdf5;
    --warning: #b45309;
    --warning-soft: #fff7ed;
    --error: #ba1a1a;
    --error-soft: #ffdad6;
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --sidebar-width: 264px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    font-family: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--surface);
    color: var(--on-surface);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

button:disabled,
.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
    pointer-events: none;
}

img {
    max-width: 100%;
    display: block;
}

.material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    line-height: 1;
}

.app-shell {
    min-height: 100vh;
    overflow-x: hidden;
}

.side-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 22px 18px;
    background: var(--surface-low);
    border-right: 1px solid rgba(189, 200, 209, 0.55);
}

.brand {
    display: grid;
    gap: 6px;
    padding: 6px 10px 16px;
}

.brand img {
    width: 150px;
    height: auto;
}

.brand span {
    color: rgba(62, 72, 79, 0.72);
    font-size: 12px;
    font-weight: 600;
}

.side-nav nav {
    display: grid;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    color: var(--on-muted);
    border-radius: 12px;
    font-weight: 600;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--primary);
}

.nav-item.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
    border: 1px solid rgba(189, 200, 209, 0.45);
}

.nav-item.is-active .material-symbols-outlined {
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.side-status {
    margin-top: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border: 1px solid rgba(189, 200, 209, 0.5);
    border-radius: var(--radius);
}

.side-status strong,
.side-status small {
    display: block;
}

.side-status strong {
    color: var(--primary);
    font-size: 13px;
}

.side-status small {
    margin-top: 2px;
    color: rgba(62, 72, 79, 0.72);
    font-size: 11px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    background: var(--primary-action);
    box-shadow: 0 0 0 6px rgba(0, 167, 225, 0.12);
}

.main-canvas {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    background: var(--surface);
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 48px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(189, 200, 209, 0.45);
}

.top-bar h1,
.section-heading h2,
.profile-hero h2 {
    margin: 0;
    color: var(--on-surface);
    letter-spacing: 0;
}

.top-bar h1 {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-label {
    color: var(--on-muted);
    font-size: 12px;
    font-weight: 600;
}

.content-area {
    display: grid;
    gap: 24px;
    padding: 32px 48px 48px;
}

.panel-card,
.metric-card {
    background: var(--surface);
    border: 1px solid rgba(219, 227, 235, 0.95);
    border-radius: var(--radius);
}

.panel-card {
    padding: 24px;
}

.metric-card {
    min-height: 152px;
    padding: 24px;
    transition: border-color 180ms ease, transform 180ms ease;
}

.metric-card:hover {
    border-color: rgba(0, 167, 225, 0.35);
    transform: translateY(-1px);
}

.metric-label {
    display: block;
    color: var(--on-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    color: var(--on-surface);
    font-size: 44px;
    line-height: 1;
    letter-spacing: 0;
}

.metric-card small {
    display: block;
    margin-top: 16px;
    color: rgba(62, 72, 79, 0.72);
    font-weight: 600;
}

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

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

.section-heading h2 {
    font-size: 20px;
    line-height: 1.25;
}

.latest-list {
    display: grid;
    gap: 2px;
}

.latest-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(219, 227, 235, 0.8);
    transition: background 180ms ease;
}

.latest-item:hover {
    background: var(--surface-low);
}

.latest-item:last-child {
    border-bottom: 0;
}

.attention-panel {
    display: grid;
    gap: 22px;
}

.attention-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(219, 227, 235, 0.84);
}

.attention-summary div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.attention-summary span,
.agent-row small,
.chart-row small {
    color: rgba(62, 72, 79, 0.74);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.attention-summary strong {
    color: var(--on-surface);
    font-size: 24px;
    line-height: 1.15;
}

.attention-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    gap: 28px;
    align-items: start;
}

.attention-workspace h3 {
    margin: 0 0 14px;
    color: var(--on-surface);
    font-size: 15px;
}

.attention-chart,
.agent-stats {
    display: grid;
    gap: 10px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.55fr) minmax(160px, 1fr) minmax(84px, auto) 36px;
    gap: 10px;
    align-items: center;
    min-height: 36px;
    color: var(--on-muted);
    font-weight: 700;
}

.chart-row.compact-count {
    grid-template-columns: minmax(130px, 0.6fr) minmax(160px, 1fr) minmax(42px, auto);
}

.chart-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-container);
}

.chart-track i {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 6px;
    border-radius: inherit;
    background: var(--primary-action);
}

.agent-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) repeat(3, minmax(70px, auto));
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(219, 227, 235, 0.78);
}

.agent-row:last-child {
    border-bottom: 0;
}

.agent-row > span:not(.avatar) {
    min-width: 0;
}

.agent-row strong {
    display: block;
    color: var(--on-surface);
}

.avatar,
.avatar-xl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.avatar-xl {
    width: 82px;
    height: 82px;
    border-radius: 20px;
    font-size: 26px;
}

.item-title {
    display: block;
    color: var(--on-surface);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-subtitle,
.muted {
    color: var(--on-muted);
}

.item-subtitle {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.primary-button,
.secondary-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    min-height: 42px;
    padding: 0 16px;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
    background: var(--primary);
    color: #ffffff;
}

.primary-button:hover {
    box-shadow: 0 10px 24px rgba(0, 101, 138, 0.18);
    transform: translateY(-1px);
}

.secondary-button {
    background: var(--surface);
    color: var(--on-surface);
    border: 1px solid var(--outline);
}

.secondary-button:hover,
.icon-button:hover {
    border-color: rgba(0, 167, 225, 0.4);
    color: var(--primary);
    background: var(--surface-low);
}

.icon-button {
    width: 42px;
    padding: 0;
    background: var(--surface);
    color: var(--on-muted);
    border: 1px solid rgba(219, 227, 235, 0.95);
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(160px, 200px));
    gap: 14px;
    align-items: end;
}

.search-field,
.compact-field select,
.form-stack input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.note-form textarea {
    width: 100%;
    min-height: 44px;
    color: var(--on-surface);
    background: var(--surface-low);
    border: 1px solid var(--outline);
    border-radius: 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
}

.search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.search-field:focus-within,
.compact-field select:focus,
.form-stack input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.note-form textarea:focus {
    background: #ffffff;
    border-color: var(--primary-action);
    box-shadow: 0 0 0 4px rgba(0, 167, 225, 0.11);
}

.compact-field,
.form-stack label,
.form-grid label {
    display: grid;
    gap: 7px;
}

.compact-field span,
.form-stack label span,
.form-grid label span {
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.compact-field select,
.form-stack input,
.form-grid input,
.form-grid select,
.form-grid textarea {
    padding: 0 13px;
}

.form-grid textarea {
    min-height: 76px;
    padding-top: 12px;
    padding-bottom: 12px;
    resize: vertical;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 1450px;
    border-collapse: collapse;
}

.users-table {
    min-width: 720px;
}

.data-table th {
    padding: 14px 16px;
    color: rgba(62, 72, 79, 0.78);
    background: rgba(248, 250, 252, 0.82);
    border-bottom: 1px solid rgba(219, 227, 235, 0.95);
    font-size: 11px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(219, 227, 235, 0.72);
    color: var(--on-muted);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 160ms ease;
}

.data-table tbody tr:hover {
    background: var(--surface-low);
}

.lead-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 210px;
}

.truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-preview {
    max-width: 260px;
}

.status-pill,
.read-only-pill,
.data-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pill {
    color: var(--primary);
    background: rgba(0, 101, 138, 0.1);
    border: 1px solid rgba(0, 101, 138, 0.16);
}

.status-pill.closed {
    color: var(--success);
    background: var(--success-soft);
}

.status-pill.lost {
    color: var(--error);
    background: var(--error-soft);
}

.status-pill.pending {
    color: var(--warning);
    background: var(--warning-soft);
}

.data-pill {
    color: var(--success);
    background: var(--success-soft);
}

.data-pill.incomplete {
    color: var(--on-muted);
    background: var(--surface-container-high);
}

.read-only-pill {
    color: var(--on-muted);
    background: var(--surface-low);
    border: 1px solid var(--outline);
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 18px;
    color: rgba(62, 72, 79, 0.78);
    background: rgba(248, 250, 252, 0.72);
    border-top: 1px solid rgba(219, 227, 235, 0.86);
    font-weight: 700;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #ffffff;
    background: var(--primary);
    font-weight: 900;
}

.empty-cell {
    height: 140px;
    color: var(--on-muted);
    text-align: center;
}

.empty-cell.compact {
    height: auto;
    min-height: 42px;
    display: grid;
    place-items: center;
}

.profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.avatar-block {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.profile-hero h2 {
    font-size: 30px;
    line-height: 1.16;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.hero-action-stack {
    display: grid;
    gap: 4px;
    min-width: 220px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 24px;
}

.detail-grid.wide-left {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    align-items: start;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 22px;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(219, 227, 235, 0.75);
}

.detail-list dt {
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    color: var(--on-surface);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.span-2 {
    grid-column: span 2;
}

.form-status {
    min-height: 22px;
    margin: 12px 0 0;
    color: var(--on-muted);
    font-size: 13px;
    font-weight: 700;
}

.form-status.compact {
    margin: 0;
    min-height: 18px;
    font-size: 12px;
}

.form-status.is-error {
    color: var(--error);
}

.form-status.is-success {
    color: var(--success);
}

.conversation-card {
    min-height: 560px;
}

.conversation-list {
    display: grid;
    gap: 18px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 6px;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-row.ai {
    justify-content: flex-end;
}

.message-row.system {
    justify-content: center;
}

.message-bubble {
    max-width: min(76%, 720px);
    padding: 14px 16px;
    border-radius: 18px;
    border-top-left-radius: 6px;
    background: var(--surface-low);
    border: 1px solid var(--outline);
    color: var(--on-surface);
}

.message-row.ai .message-bubble {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
    border-top-left-radius: 18px;
    border-top-right-radius: 6px;
}

.message-row.system .message-bubble {
    max-width: 88%;
    color: var(--on-muted);
    background: var(--surface-container);
    border-radius: 999px;
    font-size: 12px;
    text-align: center;
}

.message-meta {
    display: block;
    margin-top: 8px;
    color: rgba(62, 72, 79, 0.72);
    font-size: 11px;
    font-weight: 800;
}

.message-bubble p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.message-row.ai .message-meta {
    color: rgba(255, 255, 255, 0.76);
    text-align: right;
}

.note-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.note-form textarea {
    resize: vertical;
    min-height: 118px;
    padding: 12px;
}

.notes-list {
    display: grid;
    gap: 12px;
}

.step-list {
    display: grid;
    gap: 12px;
}

.step-list strong,
.step-list small {
    display: block;
}

.step-list small {
    margin-top: 4px;
    color: var(--on-muted);
    overflow-wrap: anywhere;
}

.note-item {
    padding: 14px;
    background: var(--surface-low);
    border: 1px solid var(--outline);
    border-radius: 14px;
}

.note-item p {
    margin: 0;
    color: var(--on-surface);
    white-space: pre-wrap;
}

.note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 800;
}

.note-actions {
    display: flex;
    gap: 6px;
}

.note-actions button {
    min-height: 30px;
    padding: 0 10px;
    color: var(--on-muted);
    background: #ffffff;
    border: 1px solid var(--outline);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.note-actions button:hover {
    color: var(--primary);
    border-color: rgba(0, 167, 225, 0.45);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(0, 167, 225, 0.12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    padding: 34px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 227, 235, 0.96);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.login-card.compact {
    text-align: center;
}

.login-logo {
    width: 170px;
    margin-bottom: 24px;
}

.login-card h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
}

.login-copy {
    margin: 10px 0 24px;
    color: var(--on-muted);
}

.form-stack {
    display: grid;
    gap: 14px;
}

.form-stack input {
    padding: 0 14px;
}

.remember-access-row {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 11px !important;
    padding: 13px 14px;
    border: 1px solid var(--outline);
    border-radius: 14px;
    background: #f8fbfd;
    cursor: pointer;
}

.remember-access-row:hover {
    border-color: rgba(0, 126, 168, .38);
    background: #f3faff;
}

.remember-access-row input[type="checkbox"] {
    width: 19px;
    height: 19px;
    min-height: 0;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--primary-action);
    box-shadow: none;
}

.remember-access-row > span {
    display: grid;
    gap: 3px;
    color: var(--on-surface) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.35;
    text-transform: none !important;
}

.remember-access-row strong {
    color: var(--on-surface);
    font-size: 13px;
}

.remember-access-row small {
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 550;
    line-height: 1.45;
}

.notice {
    padding: 12px 14px;
    margin: 18px 0;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.notice.error {
    color: var(--error);
    background: var(--error-soft);
}

.notice.success {
    color: var(--success);
    background: var(--success-soft);
}

.mobile-nav {
    display: none;
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .attention-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar,
    .detail-grid,
    .detail-grid.wide-left,
    .attention-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .side-nav {
        display: none;
    }

    .main-canvas {
        margin-left: 0;
        padding-bottom: 76px;
    }

    .top-bar {
        padding: 14px 18px;
    }

    .session-label {
        display: none;
    }

    .content-area {
        padding: 20px 16px 32px;
    }

    .dashboard-grid,
    .attention-summary,
    .detail-list,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .profile-hero,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .hero-action-stack {
        flex: 1 1 190px;
    }

    .hero-actions .primary-button,
    .hero-actions .secondary-button {
        flex: 1 1 190px;
    }

    .avatar-block {
        align-items: flex-start;
    }

    .profile-hero h2 {
        font-size: 24px;
    }

    .message-bubble {
        max-width: 88%;
    }

    .chart-row,
    .agent-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .mobile-nav {
        position: fixed;
        z-index: 30;
        inset: auto 0 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        min-height: 66px;
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid rgba(189, 200, 209, 0.55);
        backdrop-filter: blur(14px);
    }

    .mobile-nav a {
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 8px 0 6px;
        color: var(--on-muted);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .mobile-nav a:hover,
    .mobile-nav a.is-active {
        color: var(--primary);
    }
}

@media (max-width: 560px) {
    .top-bar h1 {
        font-size: 20px;
    }

    .panel-card {
        padding: 18px;
        border-radius: 18px;
    }

    .metric-card strong {
        font-size: 38px;
    }

    .latest-item {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .latest-item > .status-pill {
        grid-column: 2;
        width: max-content;
    }

    .login-card {
        padding: 26px;
    }
}

/* Dashboard mensual y comparativa por responsable */
.dashboard-controls {
    display: grid;
    gap: 12px;
    padding: 18px 22px;
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) minmax(190px, 0.9fr) auto;
    gap: 14px;
    align-items: end;
}

.compact-field input,
.form-readonly {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    color: var(--on-surface);
    background: var(--surface-low);
    border: 1px solid var(--outline);
    border-radius: 14px;
    outline: none;
}

.compact-field input:focus {
    background: #ffffff;
    border-color: var(--primary-action);
    box-shadow: 0 0 0 4px rgba(0, 167, 225, 0.11);
}

.form-readonly {
    display: flex;
    align-items: center;
    color: var(--on-muted);
    font-weight: 750;
    cursor: not-allowed;
}

.month-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.month-navigation .secondary-button {
    min-height: 44px;
    white-space: nowrap;
}

.icon-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.dashboard-period-label {
    margin: 0;
    color: var(--on-muted);
    font-size: 13px;
    font-weight: 800;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    content: '';
    background: var(--metric-color, var(--primary-action));
}

.metric-accent-blue { --metric-color: #007ea8; }
.metric-accent-cyan { --metric-color: #00a7e1; }
.metric-accent-amber { --metric-color: #f0a31a; }
.metric-accent-green { --metric-color: #13a36f; }
.metric-accent-purple { --metric-color: #7c5ce7; }

.chart-track i {
    background: var(--bar-color, var(--primary-action));
    box-shadow: 0 0 14px color-mix(in srgb, var(--bar-color, var(--primary-action)) 35%, transparent);
}

.colorful-chart .chart-row {
    padding: 4px 0;
}

.agent-avatar {
    color: var(--agent-color, var(--primary));
    background: color-mix(in srgb, var(--agent-color, var(--primary)) 13%, white);
}

.agent-performance-panel {
    display: grid;
    gap: 4px;
}

.agent-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.agent-performance-card {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(219, 227, 235, 0.92);
    border-radius: 18px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--agent-color) 6%, white), white 46%);
}

.agent-performance-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 64px;
    gap: 12px;
    align-items: center;
}

.agent-performance-head > span:nth-child(2) {
    min-width: 0;
}

.agent-performance-head strong {
    display: block;
    overflow: hidden;
    color: var(--on-surface);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-performance-head small {
    display: block;
    margin-top: 4px;
    color: var(--on-muted);
    font-size: 12px;
    font-weight: 700;
}

.conversion-ring {
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--agent-color) var(--conversion), var(--surface-container) 0);
}

.conversion-ring::before {
    position: absolute;
    width: 44px;
    height: 44px;
    content: '';
    border-radius: 50%;
    background: white;
}

.conversion-ring {
    position: relative;
}

.conversion-ring span {
    position: relative;
    z-index: 1;
    color: var(--on-surface);
    font-size: 12px;
    font-weight: 900;
}

.performance-total-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-container);
}

.performance-total-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--agent-color);
}

.performance-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.performance-metrics span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.performance-metrics b {
    color: var(--on-surface);
    font-size: 18px;
}

.performance-metrics small {
    overflow: hidden;
    color: var(--on-muted);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .dashboard-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .month-navigation {
        justify-content: flex-start;
    }
}

@media (max-width: 860px) {
    .dashboard-filter-grid,
    .agent-performance-grid {
        grid-template-columns: 1fr;
    }

    .month-navigation {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
    }

    .performance-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Filtros por rango de días y tablero visual del equipo */
.dashboard-filter-grid.dashboard-filter-grid-dates {
    grid-template-columns: minmax(150px, .75fr) minmax(145px, .7fr) minmax(145px, .7fr) minmax(210px, 1fr) minmax(180px, .85fr);
}

.dashboard-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 4px;
}

.dashboard-filter-actions .month-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.range-presets {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border: 1px solid #dbe5eb;
    border-radius: 12px;
    background: #f5f8fa;
}

.range-preset {
    min-height: 34px;
    padding: 0 12px;
    color: #51616d;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.range-preset:hover,
.range-preset:focus-visible {
    color: #006d91;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(24, 58, 79, .09);
}

.dashboard-filter-actions .dashboard-period-label {
    margin-left: auto;
    text-align: right;
}

.tracking-panel {
    overflow: hidden;
}

.team-dashboard {
    display: grid;
    gap: 20px;
}

.team-dashboard-heading {
    margin-bottom: 0;
}

.section-subtitle {
    margin: 5px 0 0;
    color: #687984;
    font-size: 13px;
    line-height: 1.5;
}

.team-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.team-kpi {
    --kpi-color: #007ea8;
    display: flex;
    min-width: 0;
    min-height: 92px;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #dfe8ed;
    border-top: 4px solid var(--kpi-color);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(24, 58, 79, .05);
}

.team-kpi > .material-symbols-outlined {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    color: var(--kpi-color);
    background: #eef7fa;
    border-radius: 12px;
    font-size: 21px;
}

.team-kpi div {
    min-width: 0;
}

.team-kpi small,
.team-kpi strong {
    display: block;
}

.team-kpi small {
    overflow: hidden;
    color: #6b7a85;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .035em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.team-kpi strong {
    margin-top: 5px;
    color: #10243a;
    font-size: clamp(18px, 1.8vw, 26px);
    line-height: 1;
    white-space: nowrap;
}

.team-kpi-blue { --kpi-color: #007ea8; }
.team-kpi-purple { --kpi-color: #7257d9; }
.team-kpi-green { --kpi-color: #16a06c; }
.team-kpi-amber { --kpi-color: #ee9d18; }
.team-kpi-cyan { --kpi-color: #00a7d6; }
.team-kpi-rose { --kpi-color: #e45d77; }

.team-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 16px;
}

.team-chart-grid-secondary {
    grid-template-columns: minmax(320px, .8fr) minmax(520px, 1.2fr);
}

.team-chart-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #dfe8ed;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(24, 58, 79, .045);
}

.team-chart-card > header {
    display: flex;
    min-height: 46px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.team-chart-card h3 {
    margin: 2px 0 0;
    color: #10243a;
    font-size: 16px;
}

.chart-eyebrow {
    margin: 0;
    color: #7a8993;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chart-legends {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-legend-dot {
    position: relative;
    padding-left: 14px;
    color: #697883;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.chart-legend-dot::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 8px;
    height: 8px;
    content: '';
    border-radius: 3px;
    transform: translateY(-50%);
}

.legend-active::before,
.legend-logins::before { background: #007ea8; }
.legend-contacts::before { background: #64c9e8; }

.team-horizontal-chart {
    display: grid;
    gap: 13px;
}

.team-horizontal-row {
    display: grid;
    grid-template-columns: minmax(135px, .72fr) minmax(140px, 1.3fr) 74px;
    gap: 12px;
    align-items: center;
}

.team-chart-person {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
}

.team-color-dot {
    width: 9px;
    height: 28px;
    border-radius: 8px;
    background: var(--agent-color);
}

.team-chart-person strong,
.team-chart-person small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-chart-person strong {
    color: #213547;
    font-size: 12px;
}

.team-chart-person small {
    margin-top: 2px;
    color: #87939b;
    font-size: 10px;
}

.team-horizontal-track {
    height: 18px;
    overflow: hidden;
    border-radius: 6px;
    background: #edf2f5;
}

.team-horizontal-track i {
    display: block;
    min-width: 5px;
    height: 100%;
    border-radius: inherit;
    background: var(--agent-color);
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .05);
}

.team-chart-value {
    color: #10243a;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}

.team-column-chart {
    display: flex;
    min-height: 205px;
    align-items: stretch;
    justify-content: space-around;
    gap: 10px;
    padding: 8px 6px 0;
    overflow-x: auto;
    border-bottom: 1px solid #dfe8ed;
    background-image: linear-gradient(to top, rgba(222, 232, 237, .65) 1px, transparent 1px);
    background-size: 100% 25%;
}

.team-column-group {
    display: grid;
    min-width: 72px;
    max-width: 110px;
    flex: 1 0 72px;
    grid-template-rows: 1fr auto;
    gap: 9px;
    align-items: end;
}

.team-column-bars {
    display: flex;
    height: 166px;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
}

.team-column-bar {
    position: relative;
    width: min(30%, 28px);
    min-height: 0;
    border-radius: 7px 7px 2px 2px;
    box-shadow: 0 5px 12px rgba(24, 58, 79, .08);
}

.team-column-bar span {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 5px);
    color: #53636e;
    font-size: 10px;
    font-weight: 900;
    transform: translateX(50%);
}

.bar-logins { background: var(--agent-color); }
.bar-contacts { background: #64c9e8; }

.team-column-group > strong {
    overflow: hidden;
    padding-bottom: 8px;
    color: #53636e;
    font-size: 10px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-attention-chart .chart-row {
    grid-template-columns: minmax(90px, .7fr) minmax(120px, 1.4fr) 72px 28px;
}

.agent-summary-list {
    display: grid;
    gap: 10px;
}

.agent-summary-row {
    display: grid;
    grid-template-columns: minmax(165px, .9fr) minmax(300px, 1.5fr) minmax(190px, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid #e1e9ee;
    border-left: 4px solid var(--agent-color);
    border-radius: 14px;
    background: #fbfcfd;
}

.agent-summary-person {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.agent-summary-person strong,
.agent-summary-person small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-summary-person strong {
    color: #1b3043;
    font-size: 12px;
}

.agent-summary-person small {
    margin-top: 2px;
    color: #82909a;
    font-size: 10px;
}

.agent-summary-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(60px, 1fr));
    gap: 8px;
}

.agent-summary-metrics span {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 10px;
    background: #ffffff;
}

.agent-summary-metrics small,
.agent-summary-metrics strong {
    display: block;
}

.agent-summary-metrics small {
    color: #84919a;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.agent-summary-metrics strong {
    margin-top: 3px;
    color: #1b3043;
    font-size: 12px;
    white-space: nowrap;
}

.agent-view-summary {
    min-width: 0;
}

.agent-view-track {
    display: flex;
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #e8eef2;
}

.agent-view-track i {
    display: block;
    height: 100%;
}

.agent-view-track .empty-view-segment {
    width: 100%;
    background: #dfe7ec;
}

.agent-view-summary small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #7d8b95;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-current-view {
    max-width: 135px;
    padding: 6px 9px;
    overflow: hidden;
    color: #50616d;
    background: #eef4f7;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .dashboard-filter-grid.dashboard-filter-grid-dates {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .team-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .agent-summary-row {
        grid-template-columns: minmax(165px, .9fr) minmax(280px, 1.5fr) minmax(170px, 1fr);
    }

    .agent-current-view {
        grid-column: 1 / -1;
        max-width: none;
        width: max-content;
    }
}

@media (max-width: 980px) {
    .dashboard-filter-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-filter-actions .dashboard-period-label {
        margin-left: 0;
        text-align: left;
    }

    .team-chart-grid,
    .team-chart-grid-secondary {
        grid-template-columns: 1fr;
    }

    .agent-summary-row {
        grid-template-columns: 1fr;
    }

    .agent-summary-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .dashboard-filter-grid.dashboard-filter-grid-dates,
    .team-kpi-grid {
        grid-template-columns: 1fr;
    }

    .range-presets {
        width: 100%;
    }

    .range-preset {
        flex: 1;
    }

    .team-horizontal-row {
        grid-template-columns: minmax(120px, .9fr) minmax(100px, 1.1fr) 65px;
        gap: 8px;
    }

    .agent-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-chart-card {
        padding: 14px;
    }

    .team-chart-card > header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* V5 — resumen operativo por usuario */
.team-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding-top: 2px;
}

.team-section-heading h3 {
    margin: 3px 0 0;
    color: #10243a;
    font-size: 19px;
}

.team-section-heading > p {
    max-width: 520px;
    margin: 0;
    color: #74838d;
    font-size: 12px;
    line-height: 1.45;
    text-align: right;
}

.agent-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.agent-telemetry-card {
    --agent-color: #007ea8;
    display: grid;
    min-width: 0;
    gap: 15px;
    padding: 19px;
    border: 1px solid rgba(219, 227, 235, .96);
    border-top: 4px solid var(--agent-color);
    border-radius: 19px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--agent-color) 13%, transparent) 0, transparent 34%),
        linear-gradient(145deg, color-mix(in srgb, var(--agent-color) 5%, white), #ffffff 48%);
    box-shadow: 0 10px 28px rgba(24, 58, 79, .06);
}

.agent-telemetry-head {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 72px;
    gap: 12px;
    align-items: center;
}

.agent-telemetry-head .avatar {
    width: 46px;
    height: 46px;
    font-size: 14px;
}

.agent-telemetry-identity {
    min-width: 0;
}

.agent-telemetry-identity strong,
.agent-telemetry-identity small,
.agent-telemetry-identity em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-telemetry-identity strong {
    color: #10243a;
    font-size: 16px;
}

.agent-telemetry-identity small {
    margin-top: 3px;
    color: #6f7f89;
    font-size: 11px;
    font-weight: 700;
}

.agent-telemetry-identity em {
    margin-top: 6px;
    color: #8a979f;
    font-size: 10px;
    font-style: normal;
}

.utilization-ring {
    position: relative;
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--agent-color) var(--utilization), #e9eff3 0);
}

.utilization-ring::before {
    position: absolute;
    width: 50px;
    height: 50px;
    content: '';
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(219, 227, 235, .72);
}

.utilization-ring > span {
    position: relative;
    z-index: 1;
    display: grid;
    text-align: center;
}

.utilization-ring b {
    color: #10243a;
    font-size: 14px;
    line-height: 1;
}

.utilization-ring small {
    margin-top: 3px;
    color: #7d8b95;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.agent-session-composition {
    display: flex;
    width: 100%;
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef2;
}

.agent-session-composition i,
.agent-session-composition b {
    display: block;
    min-width: 0;
    height: 100%;
}

.agent-session-composition i {
    background: var(--agent-color);
}

.agent-session-composition b {
    background: #f2b25d;
}

.agent-session-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: -8px;
    color: #667680;
    font-size: 10px;
    font-weight: 800;
}

.agent-session-labels span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.agent-session-labels i {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--agent-color);
}

.agent-session-labels span:nth-child(2) i {
    background: #f2b25d;
}

.agent-telemetry-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.agent-telemetry-metrics > span {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid #e3ebef;
    border-radius: 13px;
    background: rgba(255, 255, 255, .88);
}

.agent-telemetry-metrics small {
    overflow: hidden;
    color: #82909a;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .025em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.agent-telemetry-metrics strong {
    overflow: hidden;
    color: #172c3f;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-view-breakdown {
    display: grid;
    gap: 8px;
    padding-top: 2px;
}

.agent-view-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.agent-view-chips span {
    padding: 5px 8px;
    color: #63737d;
    background: #eef4f7;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
}

.agent-view-chips strong {
    color: #183247;
}

.legend-active::before { background: #13a36f; }
.legend-idle::before { background: #f2b25d; }

.team-connection-chart {
    display: grid;
    gap: 15px;
}

.team-connection-row {
    display: grid;
    grid-template-columns: minmax(145px, .8fr) minmax(190px, 1.5fr) 88px;
    gap: 12px;
    align-items: center;
}

.team-connection-scale {
    display: flex;
    height: 20px;
    align-items: stretch;
    overflow: hidden;
    border-radius: 7px;
    background: #edf2f5;
}

.team-connection-volume {
    display: flex;
    min-width: 7px;
    overflow: hidden;
    border-radius: inherit;
}

.team-connection-volume i,
.team-connection-volume b {
    display: block;
    min-width: 0;
    height: 100%;
}

.team-connection-volume i {
    background: var(--agent-color);
}

.team-connection-volume b {
    background: #f2b25d;
}

.team-connection-values {
    display: grid;
    text-align: right;
}

.team-connection-values strong {
    color: #10243a;
    font-size: 12px;
}

.team-connection-values small {
    margin-top: 2px;
    color: #7f8d96;
    font-size: 9px;
    font-weight: 800;
}

.team-attention-card {
    min-width: 0;
}

.attention-summary-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.attention-summary-pills span {
    padding: 7px 10px;
    color: #71808a;
    background: #eef4f7;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.attention-summary-pills strong {
    margin-left: 4px;
    color: #183247;
}

@media (max-width: 1120px) {
    .agent-telemetry-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .team-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-section-heading > p {
        text-align: left;
    }

    .agent-telemetry-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-connection-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .team-connection-values {
        grid-template-columns: auto auto;
        justify-content: space-between;
        text-align: left;
    }

    .attention-summary-pills {
        justify-content: flex-start;
    }
}

/* Evita etiquetas truncadas en las tarjetas operativas. */
.team-kpi small {
    min-height: 22px;
    overflow: visible;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
}

/* V6 — ajuste final de contenido y calendarios sin restricciones */
.team-kpi,
.metric-card,
.agent-telemetry-card,
.agent-telemetry-metrics > span {
    min-width: 0;
    overflow: hidden;
}

.team-kpi {
    gap: 9px;
    padding: 14px 12px;
}

.team-kpi > .material-symbols-outlined {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 19px;
}

.team-kpi div {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.team-kpi small {
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: normal;
}

.team-kpi strong {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    overflow: hidden;
    font-size: clamp(17px, 1.35vw, 22px);
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    word-break: normal;
}

.metric-card strong,
.agent-telemetry-metrics strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}

.agent-telemetry-metrics > span {
    align-content: start;
}

/* Los selectores de fecha no deben aparentar estar bloqueados. */
.compact-field input[type="date"],
.compact-field input[type="month"] {
    color-scheme: light;
    cursor: pointer;
}

.compact-field input[type="date"]:disabled,
.compact-field input[type="month"]:disabled {
    opacity: 1;
}

@media (max-width: 1450px) {
    .team-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .team-kpi strong {
        font-size: clamp(19px, 2vw, 25px);
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    .team-kpi-grid {
        grid-template-columns: 1fr;
    }

    .team-kpi strong {
        white-space: normal;
    }
}

/* ==========================================================
   CIERRE DIARIO · LABORATORIO ADMINISTRATIVO
   ========================================================== */
.daily-close-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
    overflow: hidden;
    padding: 30px;
    border: 0;
    color: #fff;
    background:
        radial-gradient(circle at 82% 8%, rgba(35, 191, 215, .30), transparent 33%),
        linear-gradient(135deg, #00577a 0%, #006d8f 52%, #0a829c 100%);
    box-shadow: 0 22px 55px rgba(0, 78, 108, .20);
}
.daily-close-hero::after {
    content: '';
    position: absolute;
    right: -70px;
    bottom: -115px;
    width: 290px;
    height: 290px;
    border: 44px solid rgba(255,255,255,.07);
    border-radius: 50%;
}
.daily-close-hero-copy,
.daily-close-hero-status { position: relative; z-index: 1; }
.daily-close-hero .eyebrow { color: rgba(255,255,255,.72); }
.daily-close-hero h2 {
    max-width: 760px;
    margin: 7px 0 10px;
    font-size: clamp(27px, 3vw, 42px);
    line-height: 1.04;
    letter-spacing: -.035em;
}
.daily-close-hero p:last-child {
    max-width: 830px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 15px;
    line-height: 1.65;
}
.daily-close-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.11);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    backdrop-filter: blur(10px);
}
.daily-close-badge .material-symbols-outlined { font-size: 18px; }
.daily-close-hero-status {
    align-self: center;
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 26px 20px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 22px;
    background: rgba(255,255,255,.12);
    text-align: center;
    backdrop-filter: blur(14px);
}
.daily-close-hero-status .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(255,255,255,.16);
    font-size: 31px;
}
.daily-close-hero-status strong { font-size: 18px; }
.daily-close-hero-status small { color: rgba(255,255,255,.76); line-height: 1.4; }

.daily-close-control { margin-top: 0; }
.daily-close-control-heading { margin-bottom: 20px; }
.daily-close-filter-grid {
    display: grid;
    grid-template-columns: 190px minmax(210px, .8fr) minmax(280px, 1.2fr) auto;
    gap: 14px;
    align-items: end;
}
.daily-close-recipient-field small {
    display: block;
    margin-top: 5px;
    color: #78919a;
    font-size: 11px;
    line-height: 1.35;
}
.daily-close-actions { display: flex; gap: 9px; align-items: center; padding-bottom: 1px; }
.daily-close-actions button { white-space: nowrap; }
.daily-close-period-strip {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 15px 18px;
    border: 1px solid #dce9ee;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdfe, #f5f9fb);
}
.daily-close-period-strip > div { min-width: 0; }
.daily-close-period-strip span:not(.material-symbols-outlined) {
    display: block;
    color: #78919a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
}
.daily-close-period-strip strong {
    display: block;
    margin-top: 4px;
    color: #173947;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.daily-close-period-strip > .material-symbols-outlined { color: #9cb0b8; }

.daily-close-tabs {
    position: sticky;
    top: 10px;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 18px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
}
.daily-close-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 13px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #5e7882;
    font: inherit;
    font-size: 13px;
    font-weight: 760;
    cursor: pointer;
    transition: .2s ease;
}
.daily-close-tab:hover { background: #f1f7f9; color: #00658a; }
.daily-close-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, #00658a, #0a8098);
    box-shadow: 0 8px 18px rgba(0,101,138,.23);
}
.daily-close-tab .material-symbols-outlined { font-size: 20px; }
.daily-close-panel { display: none; margin-top: 18px; }
.daily-close-panel.is-active { display: block; }

.daily-close-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}
.daily-close-kpi {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0,1fr);
    gap: 12px;
    min-width: 0;
    padding: 17px;
    border: 1px solid #dce8ed;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(21, 68, 84, .06);
}
.daily-close-kpi::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 72px;
    border-radius: 0 0 0 72px;
    background: var(--kpi-soft);
    opacity: .68;
}
.daily-close-kpi > .material-symbols-outlined {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--kpi-color);
    background: var(--kpi-soft);
    font-size: 24px;
}
.daily-close-kpi div { min-width: 0; position: relative; z-index: 1; }
.daily-close-kpi small,
.daily-close-kpi em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.daily-close-kpi small {
    color: #718a94;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: .25px;
}
.daily-close-kpi strong {
    display: block;
    margin: 2px 0 1px;
    color: var(--kpi-color);
    font-size: clamp(26px, 3vw, 37px);
    line-height: 1;
    letter-spacing: -.04em;
}
.daily-close-kpi em { color: #8ba0a8; font-size: 10px; font-style: normal; white-space: nowrap; }
.daily-close-kpi.kpi-blue { --kpi-color:#00658a; --kpi-soft:#e4f2f7; }
.daily-close-kpi.kpi-purple { --kpi-color:#6d3dcc; --kpi-soft:#f0eaff; }
.daily-close-kpi.kpi-cyan { --kpi-color:#087d95; --kpi-soft:#e5f7fa; }
.daily-close-kpi.kpi-sky { --kpi-color:#087bb7; --kpi-soft:#e8f4fb; }
.daily-close-kpi.kpi-violet { --kpi-color:#7c5ce7; --kpi-soft:#f0ecff; }
.daily-close-kpi.kpi-green { --kpi-color:#13835c; --kpi-soft:#e7f7f0; }
.daily-close-kpi.kpi-amber { --kpi-color:#b46d06; --kpi-soft:#fff4db; }
.daily-close-kpi.kpi-rose { --kpi-color:#c6485f; --kpi-soft:#fdecef; }

.daily-close-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
    gap: 18px;
    margin-top: 18px;
}
.daily-close-summary-grid > .panel-card { margin: 0; min-width: 0; }
.daily-close-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.daily-close-card-header h3 { margin: 3px 0 0; font-size: 18px; }
.daily-close-card-header > strong { color:#00658a; font-size:13px; }
.daily-close-legend {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    color: #78919a;
    font-size: 10px;
    font-weight: 700;
}
.daily-close-legend span { width: 9px; height: 9px; border-radius: 50%; }
.daily-close-legend .off { background:#7c5ce7; }
.daily-close-legend .shift { background:#08a4c2; margin-left:4px; }

.daily-close-hourly-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(28px,1fr));
    gap: 8px;
    min-height: 235px;
    align-items: end;
    padding: 18px 4px 0;
    border-top: 1px dashed #dce8ed;
}
.daily-close-hour-column {
    display: grid;
    grid-template-rows: 20px 170px 22px;
    justify-items: center;
    gap: 5px;
    min-width: 0;
}
.daily-close-hour-column strong { color:#496670; font-size:11px; }
.daily-close-hour-column span { color:#81969e; font-size:9px; font-weight:700; transform:rotate(-35deg); white-space:nowrap; }
.daily-close-hour-track {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: min(28px, 72%);
    height: 170px;
    border-radius: 9px 9px 4px 4px;
    background: #edf3f5;
    overflow: hidden;
}
.daily-close-hour-track i { width:100%; min-height:5px; border-radius:9px 9px 3px 3px; transition:height .35s ease; }
.daily-close-hour-column.off .daily-close-hour-track i { background:linear-gradient(180deg,#9874f0,#6e48ca); }
.daily-close-hour-column.shift .daily-close-hour-track i { background:linear-gradient(180deg,#19bdd8,#0588a5); }

.daily-close-status-chart { display:grid; gap:14px; }
.daily-close-status-row {
    display: grid;
    grid-template-columns: 112px minmax(90px,1fr) 34px 42px;
    align-items: center;
    gap: 9px;
}
.daily-close-status-label { display:flex; align-items:center; gap:8px; min-width:0; }
.daily-close-status-label span { width:10px; height:10px; flex:0 0 10px; border-radius:50%; background:var(--status-color); }
.daily-close-status-label strong { overflow:hidden; text-overflow:ellipsis; font-size:11px; white-space:nowrap; }
.daily-close-status-track { height:10px; border-radius:999px; background:#ebf1f3; overflow:hidden; }
.daily-close-status-track i { display:block; height:100%; min-width:2px; border-radius:999px; background:var(--status-color); }
.daily-close-status-row b { text-align:right; font-size:12px; }
.daily-close-status-row small { color:#81969e; text-align:right; font-size:10px; }

.daily-close-agents-section { margin-top:18px; }
.daily-close-agent-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
}
.daily-close-agent-card {
    min-width:0;
    padding:18px;
    border:1px solid #dce8ed;
    border-top:4px solid var(--agent-accent);
    border-radius:18px;
    background:linear-gradient(180deg,#fff,#fbfdfe);
    box-shadow:0 10px 26px rgba(20,64,80,.06);
}
.daily-close-agent-card header {
    display:grid;
    grid-template-columns:48px minmax(0,1fr) auto;
    gap:11px;
    align-items:center;
}
.daily-close-agent-avatar {
    display:grid;
    place-items:center;
    width:48px;
    height:48px;
    border-radius:15px;
    color:var(--agent-accent);
    background:color-mix(in srgb,var(--agent-accent) 12%,white);
    font-size:15px;
    font-weight:850;
}
.daily-close-agent-card h3 { margin:0; font-size:16px; overflow-wrap:anywhere; }
.daily-close-agent-card header p { margin:3px 0 0; color:#81969e; font-size:10px; overflow-wrap:anywhere; }
.daily-close-agent-badge { padding:7px 9px; border-radius:999px; color:var(--agent-accent); background:color-mix(in srgb,var(--agent-accent) 10%,white); font-size:10px; font-weight:800; white-space:nowrap; }
.daily-close-agent-commercial {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
    margin-top:15px;
}
.daily-close-agent-commercial div,
.daily-close-agent-telemetry div {
    min-width:0;
    border-radius:11px;
    background:#f3f8fa;
}
.daily-close-agent-commercial div { padding:9px; }
.daily-close-agent-commercial small,
.daily-close-agent-telemetry small { display:block; color:#7a919a; font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.daily-close-agent-commercial strong { display:block; margin-top:3px; color:#173947; font-size:16px; }
.daily-close-agent-telemetry {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    margin-top:8px;
}
.daily-close-agent-telemetry div { position:relative; padding:9px 8px 9px 31px; }
.daily-close-agent-telemetry .material-symbols-outlined { position:absolute; left:8px; top:10px; color:var(--agent-accent); font-size:17px; }
.daily-close-agent-telemetry strong { display:block; margin-top:3px; font-size:11px; line-height:1.35; overflow-wrap:anywhere; }
.daily-close-agent-usebar { display:flex; height:10px; margin-top:13px; border-radius:999px; background:#eaf0f2; overflow:hidden; }
.daily-close-agent-usebar i.active { background:#13a36f; }
.daily-close-agent-usebar i.idle { background:#f08b55; }
.daily-close-agent-uselegend { display:flex; justify-content:space-between; gap:10px; margin-top:6px; color:#718a94; font-size:9px; font-weight:700; }
.daily-close-agent-uselegend span { display:flex; align-items:center; gap:5px; }
.daily-close-agent-uselegend i { width:7px; height:7px; border-radius:50%; }
.daily-close-agent-uselegend i.active { background:#13a36f; }
.daily-close-agent-uselegend i.idle { background:#f08b55; }
.daily-close-agent-card footer {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:13px;
    padding-top:12px;
    border-top:1px solid #e1ebee;
}
.daily-close-agent-card footer > div { min-width:0; }
.daily-close-agent-card footer span { display:block; color:#81969e; font-size:9px; }
.daily-close-agent-card footer strong { display:block; margin-top:3px; font-size:10px; overflow-wrap:anywhere; }
.daily-close-agent-views { grid-column:1/-1; display:flex; gap:6px; flex-wrap:wrap; }
.daily-close-agent-views span { padding:5px 7px; border-radius:999px; background:#f0f6f8; color:#56727c!important; }

.daily-close-alert-grid { grid-template-columns:1fr 1fr; }
.daily-close-alert-icon { color:#d88b0f; }
.daily-close-calendar-icon { color:#00658a; }
.daily-close-alert-list { display:grid; gap:9px; }
.daily-close-alert-row {
    display:grid;
    grid-template-columns:38px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    padding:11px 12px;
    border:1px solid #e0eaee;
    border-radius:13px;
    background:#fbfdfe;
}
.daily-close-alert-row > .material-symbols-outlined { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; font-size:20px; }
.daily-close-alert-row.warning > .material-symbols-outlined { color:#a86606; background:#fff3d7; }
.daily-close-alert-row.danger > .material-symbols-outlined { color:#bf3c52; background:#fdebef; }
.daily-close-alert-row.neutral > .material-symbols-outlined { color:#087d95; background:#e5f5f8; }
.daily-close-alert-row strong { display:block; font-size:12px; }
.daily-close-alert-row small { display:block; margin-top:2px; color:#81969e; font-size:9px; }
.daily-close-alert-row b { color:#173947; font-size:22px; }
.daily-close-booking-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.daily-close-booking-card { display:flex; align-items:center; gap:11px; min-width:0; padding:14px; border-radius:14px; border:1px solid #dfe9ed; background:#fbfdfe; }
.daily-close-booking-card > .material-symbols-outlined { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; }
.daily-close-booking-card small { display:block; color:#78919a; font-size:10px; }
.daily-close-booking-card strong { display:block; margin-top:2px; font-size:23px; }
.daily-close-booking-card.green > .material-symbols-outlined { color:#13835c; background:#e7f7f0; }
.daily-close-booking-card.amber > .material-symbols-outlined { color:#b46d06; background:#fff4db; }
.daily-close-booking-card.rose > .material-symbols-outlined { color:#c6485f; background:#fdecef; }
.daily-close-booking-card.blue > .material-symbols-outlined { color:#00658a; background:#e4f2f7; }

.daily-close-leads-section { margin-top:18px; }
.daily-close-table-tools { display:flex; align-items:center; gap:9px; }
.daily-close-table-tools input { min-width:260px; }
.daily-close-table-wrap { overflow:auto; border:1px solid #dfe9ed; border-radius:15px; }
.daily-close-table { width:100%; min-width:1080px; border-collapse:collapse; background:#fff; }
.daily-close-table th { position:sticky; top:0; z-index:1; padding:12px; background:#eff6f8; color:#5c7781; font-size:10px; letter-spacing:.35px; text-align:left; text-transform:uppercase; }
.daily-close-table td { padding:12px; border-top:1px solid #e5edef; vertical-align:top; font-size:11px; }
.daily-close-table tbody tr:hover { background:#f9fcfd; }
.daily-close-table td strong,
.daily-close-table td small { display:block; max-width:220px; overflow-wrap:anywhere; }
.daily-close-table td small { margin-top:4px; color:#82969e; font-size:9px; line-height:1.4; }
.daily-close-table td a { color:#00658a; text-decoration:none; }
.daily-close-segment-pill { display:inline-flex!important; width:max-content; margin-top:6px!important; padding:4px 7px; border-radius:999px; font-size:8px!important; font-weight:800; text-transform:uppercase; }
.daily-close-segment-pill.off { color:#6d3dcc; background:#f0eaff; }
.daily-close-segment-pill.shift { color:#087d95; background:#e5f7fa; }
.muted-text { color:#8ba0a8; font-size:10px; }

.daily-close-preview-toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:22px;
    margin-bottom:16px;
}
.daily-close-preview-toolbar h2 { margin:4px 0 5px; }
.daily-close-preview-toolbar p:last-child { margin:0; color:#718a94; font-size:12px; line-height:1.5; }
.daily-close-preview-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.daily-close-preview-actions .is-selected { color:#fff; background:#00658a; border-color:#00658a; }
.daily-close-email-device {
    width:100%;
    max-width:1050px;
    margin:0 auto;
    border:1px solid #cfdde2;
    border-radius:20px;
    overflow:hidden;
    background:#e9eff2;
    box-shadow:0 28px 70px rgba(24,55,66,.18);
    transition:max-width .25s ease;
}
.daily-close-email-device.mobile { max-width:420px; }
.daily-close-email-client-bar { display:flex; align-items:center; gap:7px; min-height:44px; padding:0 15px; background:#253842; color:#dce8ed; font-size:11px; }
.daily-close-email-client-bar span { width:10px; height:10px; border-radius:50%; background:#e85d75; }
.daily-close-email-client-bar span:nth-child(2) { background:#f0a31a; }
.daily-close-email-client-bar span:nth-child(3) { background:#13a36f; }
.daily-close-email-client-bar strong { margin-left:8px; font-weight:700; }
.daily-close-email-device iframe { display:block; width:100%; height:880px; border:0; background:#eef4f7; }
.daily-close-email-device.mobile iframe { height:900px; }
.daily-close-pdf-stage { display:flex; justify-content:center; padding:24px; border-radius:18px; background:#354852; box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); }
.daily-close-pdf-stage iframe { display:block; width:min(100%, 850px); height:1100px; border:0; background:#fff; box-shadow:0 18px 55px rgba(0,0,0,.28); }

.daily-close-history-empty { display:grid; justify-items:center; gap:11px; padding:60px 24px; text-align:center; }
.daily-close-history-empty > .material-symbols-outlined { display:grid; place-items:center; width:76px; height:76px; border-radius:24px; color:#00658a; background:#e5f3f7; font-size:38px; }
.daily-close-history-empty h2 { margin:6px 0 0; }
.daily-close-history-empty p { max-width:660px; margin:0; color:#718a94; line-height:1.65; }
.daily-close-history-steps { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:10px; }
.daily-close-history-steps span { padding:8px 11px; border-radius:999px; background:#f0f6f8; color:#56727c; font-size:10px; font-weight:750; }

.daily-close-loading {
    position:fixed;
    inset:0;
    z-index:100;
    display:grid;
    place-content:center;
    justify-items:center;
    gap:9px;
    background:rgba(232,242,246,.82);
    backdrop-filter:blur(7px);
    color:#173947;
}
.daily-close-loading[hidden] { display:none; }
.daily-close-loading span { color:#718a94; font-size:12px; }
.daily-close-spinner { width:50px; height:50px; border:5px solid #cfe3ea; border-top-color:#00658a; border-radius:50%; animation:daily-close-spin .8s linear infinite; }
@keyframes daily-close-spin { to { transform:rotate(360deg); } }
#dailyCloseSyncStatus[data-state="success"] { color:#0f7a55; background:#e7f7f0; }
#dailyCloseSyncStatus[data-state="error"] { color:#bd4055; background:#fdecef; }
#dailyCloseSyncStatus[data-state="loading"] { color:#087d95; background:#e5f7fa; }

@media (max-width: 1180px) {
    .daily-close-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .daily-close-actions { align-self:end; }
    .daily-close-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .daily-close-agent-grid { grid-template-columns:1fr; }
}
@media (max-width: 900px) {
    .daily-close-hero { grid-template-columns:1fr; }
    .daily-close-hero-status { justify-self:stretch; grid-template-columns:auto 1fr; justify-items:start; text-align:left; }
    .daily-close-hero-status .material-symbols-outlined { grid-row:1/3; }
    .daily-close-summary-grid,
    .daily-close-alert-grid { grid-template-columns:1fr; }
    .daily-close-tabs { position:static; grid-template-columns:repeat(2,1fr); }
    .daily-close-period-strip { grid-template-columns:1fr; }
    .daily-close-period-strip > .material-symbols-outlined { transform:rotate(90deg); justify-self:center; }
    .daily-close-preview-toolbar { align-items:flex-start; flex-direction:column; }
    .daily-close-preview-actions { justify-content:flex-start; }
}
@media (max-width: 660px) {
    .daily-close-hero { padding:23px; }
    .daily-close-filter-grid { grid-template-columns:1fr; }
    .daily-close-actions { flex-wrap:wrap; }
    .daily-close-actions button { flex:1 1 160px; }
    .daily-close-kpi-grid { grid-template-columns:1fr; }
    .daily-close-tabs { grid-template-columns:1fr; }
    .daily-close-hourly-chart { gap:4px; overflow-x:auto; grid-template-columns:repeat(12,38px); }
    .daily-close-agent-commercial { grid-template-columns:repeat(2,1fr); }
    .daily-close-agent-telemetry { grid-template-columns:repeat(2,1fr); }
    .daily-close-agent-card header { grid-template-columns:44px minmax(0,1fr); }
    .daily-close-agent-badge { grid-column:1/-1; width:max-content; }
    .daily-close-booking-grid { grid-template-columns:1fr; }
    .daily-close-table-tools { align-items:stretch; flex-direction:column; }
    .daily-close-table-tools input { min-width:0; width:100%; }
    .daily-close-email-device iframe { height:760px; }
    .daily-close-pdf-stage { padding:8px; }
}

/* Cliente 360 · edición y trazabilidad de datos del prospecto */
.lead-profile-card {
    position: relative;
    overflow: hidden;
}

.lead-profile-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-action), #22c55e);
}

.lead-profile-heading {
    align-items: center;
}

.lead-profile-heading .section-copy {
    margin: 6px 0 0;
    color: var(--on-muted);
    font-size: 13px;
}

.lead-profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.compact-button {
    min-height: 42px;
    padding: 0 16px;
}

.profile-completeness {
    width: 76px;
    height: 76px;
    display: grid;
    place-content: center;
    text-align: center;
    border: 8px solid #e7eef5;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(219, 227, 235, 0.55);
}

.profile-completeness strong,
.profile-completeness span {
    display: block;
}

.profile-completeness strong {
    color: var(--on-surface);
    font-size: 18px;
    line-height: 1;
}

.profile-completeness span {
    margin-top: 4px;
    color: var(--on-muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-completeness.is-complete {
    border-color: rgba(16, 185, 129, 0.32);
    background: var(--success-soft);
}

.profile-completeness.is-incomplete {
    border-color: rgba(245, 158, 11, 0.34);
    background: var(--warning-soft);
}

.profile-progress {
    height: 8px;
    margin: 18px 0 22px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.profile-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-action), #22c55e);
    transition: width 220ms ease;
}

.profile-detail-list div {
    position: relative;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(219, 227, 235, 0.78);
    border-radius: 14px;
    background: #ffffff;
}

.profile-detail-list div.is-missing {
    border-color: rgba(245, 158, 11, 0.34);
    background: var(--warning-soft);
}

.profile-detail-list div.is-missing dd {
    color: var(--warning);
}

.profile-detail-list div.is-protected {
    background: #f8fafc;
}

.profile-detail-list dt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.detail-lock {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #64748b;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.detail-lock .material-symbols-outlined {
    font-size: 13px;
}

.lead-profile-form {
    padding: 18px;
    border: 1px solid rgba(0, 101, 138, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(229, 246, 255, 0.55), rgba(255, 255, 255, 0.95));
}

.lead-profile-form.is-saving {
    opacity: 0.68;
    pointer-events: none;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-form-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.profile-form-grid label > span {
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.profile-form-grid input,
.profile-form-grid textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    color: var(--on-surface);
    background: #ffffff;
    border: 1px solid var(--outline);
    border-radius: 12px;
    outline: none;
}

.profile-form-grid input:focus,
.profile-form-grid textarea:focus {
    border-color: var(--primary-action);
    box-shadow: 0 0 0 3px rgba(0, 167, 225, 0.12);
}

.profile-form-grid textarea {
    resize: vertical;
}

.profile-form-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 14px;
    color: var(--primary);
    background: rgba(229, 246, 255, 0.72);
    border: 1px solid rgba(0, 167, 225, 0.2);
    border-radius: 13px;
}

.profile-form-note .material-symbols-outlined {
    margin-top: 1px;
}

.profile-form-note p {
    margin: 0;
    font-size: 12px;
    font-weight: 650;
}

.profile-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.manual-confirmed-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 13px 15px;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 14px;
    background: var(--success-soft);
}

.manual-confirmed-block > div {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.manual-confirmed-block .material-symbols-outlined {
    color: var(--success);
}

.manual-confirmed-block strong,
.manual-confirmed-block p,
.manual-confirmed-block small {
    display: block;
    margin: 0;
}

.manual-confirmed-block p {
    margin-top: 2px;
    color: var(--on-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.manual-confirmed-block small {
    flex: 0 1 260px;
    color: var(--on-muted);
    font-weight: 700;
    text-align: right;
}

.profile-audit-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--outline);
}

.compact-heading {
    margin-bottom: 12px;
}

.compact-heading h3 {
    margin: 2px 0 0;
    font-size: 18px;
}

.profile-audit-list {
    display: grid;
    gap: 10px;
}

.profile-audit-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(219, 227, 235, 0.86);
    border-radius: 14px;
    background: #ffffff;
}

.profile-audit-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--primary);
    border-radius: 12px;
    background: var(--primary-soft);
}

.profile-audit-content {
    min-width: 0;
}

.profile-audit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-audit-heading span {
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 750;
}

.profile-audit-content > p {
    margin: 3px 0 9px;
    color: var(--on-muted);
    font-size: 12px;
}

.profile-audit-values {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.profile-audit-values > span:not(.material-symbols-outlined) {
    min-width: 0;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    border-radius: 10px;
    background: var(--surface-low);
    font-size: 12px;
    font-weight: 700;
}

.profile-audit-values small {
    display: block;
    margin-bottom: 2px;
    color: var(--on-muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-audit-values > .material-symbols-outlined {
    color: var(--outline-strong);
    font-size: 18px;
}

@media (max-width: 1180px) {
    .lead-profile-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 860px) {
    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-form-grid .span-2 {
        grid-column: span 1;
    }

    .lead-profile-actions,
    .profile-form-actions,
    .manual-confirmed-block,
    .profile-audit-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .manual-confirmed-block small,
    .profile-audit-heading span {
        text-align: left;
    }

    .profile-audit-values {
        grid-template-columns: 1fr;
    }

    .profile-audit-values > .material-symbols-outlined {
        transform: rotate(90deg);
        justify-self: center;
    }
}

/* Cliente 360: teléfono alternativo y resumen de videoconferencia */
.booking-summary {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
        "icon content"
        "actions actions";
    align-items: start;
    gap: 14px 16px;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--outline);
    border-radius: 18px;
    background: var(--surface-low);
}

.booking-summary-icon {
    grid-area: icon;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    color: var(--primary);
    border-radius: 14px;
    background: var(--primary-soft);
}

.booking-summary-icon .material-symbols-outlined {
    font-size: 27px;
}

.booking-summary-content {
    grid-area: content;
    min-width: 0;
    padding-top: 1px;
}

.booking-kicker,
.booking-summary-content strong,
.booking-summary-content p {
    display: block;
}

.booking-kicker {
    margin-bottom: 5px;
    color: var(--on-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.booking-summary-content strong {
    color: var(--on-surface);
    font-size: 18px;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.booking-summary-meta {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 9px;
}

.booking-summary-content p {
    flex: 1 1 220px;
    min-width: 0;
    margin: 0;
    color: var(--on-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
}

.booking-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    color: var(--on-muted);
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: rgba(100, 116, 139, .08);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.booking-status-pill.is-confirmed {
    color: #047857;
    border-color: rgba(16, 185, 129, .2);
    background: rgba(16, 185, 129, .12);
}

.booking-status-pill.is-cancelled,
.booking-status-pill.is-failed {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, .18);
    background: rgba(239, 68, 68, .1);
}

.booking-status-pill.is-past {
    color: #475569;
    border-color: rgba(100, 116, 139, .18);
    background: rgba(100, 116, 139, .1);
}

.booking-summary-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    min-width: 0;
    margin-top: 3px;
    padding-top: 14px;
    border-top: 1px solid rgba(100, 116, 139, .16);
}

.booking-summary-actions[hidden] {
    display: none !important;
}

.booking-summary-actions .compact-button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
}

.booking-summary.is-scheduled {
    border-color: rgba(16, 185, 129, .34);
    background: var(--success-soft);
}

.booking-summary.is-scheduled .booking-summary-icon {
    color: var(--success);
    background: rgba(16, 185, 129, .14);
}

.booking-summary.is-cancelled,
.booking-summary.is-failed {
    border-color: rgba(239, 68, 68, .24);
    background: rgba(254, 242, 242, .8);
}

.booking-summary.is-cancelled .booking-summary-icon,
.booking-summary.is-failed .booking-summary-icon {
    color: #b91c1c;
    background: rgba(239, 68, 68, .12);
}

.booking-summary.is-past {
    border-color: rgba(100, 116, 139, .24);
    background: #f8fafc;
}

.profile-form-grid label small {
    color: var(--on-muted);
    font-size: 11px;
    line-height: 1.35;
}

@media (max-width: 860px) {
    .booking-summary {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px 14px;
        padding: 17px;
    }

    .booking-summary-icon {
        width: 46px;
        height: 46px;
    }

    .booking-summary-actions {
        grid-template-columns: 1fr;
    }
}

/* Configuración: respaldos privados de Supabase */
.backup-panel {
    position: relative;
    overflow: hidden;
}

.backup-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-action), #22c55e);
}

.backup-settings-form {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(0, 101, 138, .16);
    border-radius: 16px;
    background: rgba(247, 251, 252, .85);
}

.backup-check-label {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
    border: 1px solid #d8e7ec;
    border-radius: 14px;
    background: #fff;
}

.backup-check-label input {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
}

.backup-check-label span,
.backup-check-label strong,
.backup-check-label small {
    display: block;
}

.backup-check-label small {
    margin-top: 4px;
    color: var(--on-muted);
}

.backup-capability-wrap {
    margin: 8px 0 14px;
}

.backup-capability {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(16, 185, 129, .24);
    border-radius: 14px;
    background: var(--success-soft);
}

.backup-capability.is-warning {
    border-color: rgba(245, 158, 11, .28);
    background: var(--warning-soft);
}

.backup-capability .material-symbols-outlined {
    color: var(--success);
}

.backup-capability.is-warning .material-symbols-outlined {
    color: var(--warning);
}

.backup-capability strong,
.backup-capability p {
    display: block;
    margin: 0;
}

.backup-capability p {
    margin-top: 3px;
    color: var(--on-muted);
    font-size: 12px;
    line-height: 1.45;
}

.backup-last {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    background: var(--surface-low);
}

.backup-last span {
    color: var(--on-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.backup-last strong {
    text-align: right;
}

.backup-list {
    display: grid;
    gap: 10px;
}

.backup-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--outline);
    border-radius: 14px;
    background: #fff;
}

.backup-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--primary);
    border-radius: 13px;
    background: var(--primary-soft);
}

.backup-main {
    min-width: 0;
}

.backup-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.backup-heading strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.backup-main > p,
.backup-main > small {
    display: block;
    margin: 4px 0 0;
    color: var(--on-muted);
    font-size: 12px;
}

.backup-status {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--on-muted);
    background: var(--surface-low);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.backup-status.completed {
    color: var(--success);
    background: var(--success-soft);
}

.backup-status.failed {
    color: #b91c1c;
    background: #fef2f2;
}

.backup-status.running {
    color: var(--primary);
    background: var(--primary-soft);
}

.backup-error {
    color: #b91c1c !important;
}

.backup-main details {
    margin-top: 7px;
    color: var(--warning);
    font-size: 11px;
}

.backup-main details p {
    margin: 5px 0 0;
    color: var(--on-muted);
    line-height: 1.45;
}

@media (max-width: 860px) {
    .backup-row {
        grid-template-columns: 1fr;
    }

    .backup-actions {
        justify-content: flex-start;
    }

    .backup-last,
    .backup-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .backup-last strong {
        text-align: left;
    }
}

/* 2026-08-05 · Captura manual, estado cancelado y conversación humana */
.status-pill.cancelled {
    color: #6b7280;
    background: #eef1f4;
    border-color: #d6dde3;
}

.message-row.agent {
    justify-content: flex-end;
}

.message-row.agent .message-bubble {
    color: #173947;
    background: #e8f6ef;
    border-color: #b8e3cf;
    border-top-left-radius: 18px;
    border-top-right-radius: 6px;
}

.message-row.agent .message-meta {
    color: #51786a;
    text-align: right;
}

.toolbar-action {
    min-height: 44px;
    align-self: end;
    white-space: nowrap;
}

.app-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: min(90vh, 860px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: transparent;
    box-shadow: 0 28px 90px rgba(16, 44, 58, .28);
}

.app-dialog::backdrop {
    background: rgba(12, 31, 42, .52);
    backdrop-filter: blur(3px);
}

.app-dialog-card {
    display: grid;
    max-height: min(90vh, 860px);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 0;
    overflow: hidden;
    background: var(--surface);
}

.app-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--outline);
}

.app-dialog-header h2 {
    margin: 4px 0 6px;
}

.app-dialog-header p:last-child {
    margin: 0;
    color: var(--on-muted);
}

.manual-lead-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px 26px;
    overflow-y: auto;
}

.manual-lead-grid label {
    display: grid;
    gap: 7px;
    color: var(--on-muted);
    font-size: 12px;
    font-weight: 800;
}

.manual-lead-grid input,
.manual-lead-grid select,
.manual-lead-grid textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--on-surface);
    background: var(--surface-low);
    border: 1px solid var(--outline);
    border-radius: 14px;
    outline: 0;
}

.manual-lead-grid textarea {
    resize: vertical;
}

.manual-lead-grid .span-2 {
    grid-column: 1 / -1;
}

.app-dialog-card > .form-status {
    min-height: 22px;
    margin: 0;
    padding: 0 26px 10px;
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 26px 22px;
    border-top: 1px solid var(--outline);
}

@media (min-width: 1181px) {
    .toolbar {
        grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 190px)) auto;
    }
}

@media (max-width: 720px) {
    .manual-lead-grid {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .manual-lead-grid .span-2 {
        grid-column: auto;
    }

    .app-dialog-header,
    .app-dialog-actions {
        padding-left: 18px;
        padding-right: 18px;
    }
}

.daily-close-kpi.kpi-neutral{--kpi-accent:#64748b;--kpi-soft:#f1f5f9}

/* Lead routing and adjudication */
.assignment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 4px;
    padding-top: 14px;
    border-top: 1px solid #d8e7ec;
}
.assignment-actions[hidden] { display: none !important; }
@media (max-width: 720px) {
    .assignment-actions > button { width: 100%; justify-content: center; }
}
.assignment-target { min-width: 220px; flex: 1 1 240px; }


.user-access-list {
    display: grid;
    gap: 18px;
}

.user-access-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    margin: 0;
    border: 1px solid rgba(216, 231, 236, 0.92);
    border-radius: 22px;
    background: linear-gradient(180deg, #fafdff 0%, #f6fafc 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.user-access-card__header,
.user-access-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.user-access-card__identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.user-access-card__avatar {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    border-radius: 16px;
    background: rgba(14, 165, 233, 0.12);
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
}

.user-access-card__identity h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
}

.user-access-card__identity small {
    display: block;
    margin-top: 4px;
    color: var(--on-muted);
}

.user-access-card__body {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.user-access-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(216, 231, 236, 0.92);
    border-radius: 18px;
    background: #ffffff;
}

.user-access-panel__heading h4 {
    margin: 4px 0 0;
    font-size: 18px;
}

.user-access-fields {
    display: grid;
    gap: 14px;
}

.user-access-fields > label,
.user-access-fields > div {
    display: grid;
    gap: 8px;
}

.user-access-fields span {
    font-weight: 700;
}

.user-access-fields small {
    color: var(--on-muted);
    font-size: 12px;
    line-height: 1.45;
}

.user-toggle-grid {
    display: grid;
    gap: 12px;
}

.user-toggle-card {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 8px 12px;
    padding: 14px;
    border: 1px solid rgba(216, 231, 236, 0.92);
    border-radius: 16px;
    background: #f8fbfd;
}

.user-toggle-card input {
    margin-top: 2px;
}

.user-toggle-card span {
    font-weight: 700;
}

.user-toggle-card small {
    grid-column: 2;
    color: var(--on-muted);
    font-size: 12px;
    line-height: 1.45;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.permission-card {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 8px 12px;
    min-height: 76px;
    padding: 14px;
    border: 1px solid rgba(216, 231, 236, 0.92);
    border-radius: 16px;
    background: #f8fbfd;
}

.permission-card input {
    margin-top: 2px;
}

.permission-card__title {
    font-weight: 700;
    line-height: 1.42;
}

.user-access-card__footer {
    justify-content: flex-end;
}

@media (max-width: 960px) {
    .user-access-card__body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .user-access-card {
        padding: 18px;
    }

    .user-access-card__header,
    .user-access-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }
}
