@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800&display=swap");

:root {
    --brand-navy: #051e50;
    --brand-navy-dark: #03152f;
    --brand-yellow: #ffe400;
    --brand-yellow-soft: #fff6bf;
    --bg-page-top: #f8fafc;
    --bg-page-bottom: #eef2f7;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --card-shadow-hover: 0 14px 40px rgba(15, 23, 42, 0.12);
    --font-base-size: 16px;
    --font-title-lg-min: 28px;
    --font-title-lg-max: 28px;
    --font-subtitle-min: 20px;
    --font-subtitle-max: 20px;
    --font-menu-size: 14px;
}

.sales-rep-picker {
    border: 1px solid #d8dee6;
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.6rem;
}

.sales-rep-picker-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sales-rep-picker-toolbar .form-control {
    min-width: 0;
}

.sales-rep-picker-options {
    border: 1px solid #e5e9ef;
    border-radius: 0.55rem;
    max-height: 170px;
    overflow: auto;
    padding: 0.35rem;
    background: #f8fafc;
}

.sales-rep-picker-empty {
    color: #6c757d;
    font-size: 0.88rem;
    padding: 0.35rem 0.45rem;
}

.sales-rep-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.45rem;
    padding: 0.35rem 0.45rem;
    cursor: pointer;
}

.sales-rep-picker-option:hover {
    background: #eef3ff;
}

.sales-rep-picker-option input {
    margin-top: 0;
}

.sales-rep-picker-option-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sales-rep-picker-option-name {
    font-weight: 600;
    color: #1f2937;
}

.sales-rep-picker-option-email {
    color: #6b7280;
    font-size: 0.8rem;
}

.sales-rep-picker-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.sales-rep-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #bfd8ff;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
}

.sales-rep-chip button {
    border: 0;
    background: transparent;
    color: #1e3a8a;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-base-size);
}

body {
    font-family: "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-base-size);
    color: var(--text-primary);
    line-height: 1.5;
    background: linear-gradient(135deg, var(--bg-page-top) 0%, var(--bg-page-bottom) 100%);
    min-height: 100vh;
}

a {
    color: inherit;
}

h1,
.h1 {
    font-size: clamp(var(--font-title-lg-min), 2.2vw, var(--font-title-lg-max));
    line-height: 1.2;
}

h2,
.h2,
.modal-title {
    font-size: clamp(var(--font-subtitle-min), 1.75vw, var(--font-subtitle-max));
    line-height: 1.3;
}

.container-fluid {
    max-width: 1280px;
}

.app-page {
    max-width: 1350px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.app-page-dashboard {
    max-width: 1600px;
}

.page-title {
    color: var(--brand-navy);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: clamp(var(--font-title-lg-min), 2.2vw, var(--font-title-lg-max)) !important;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: clamp(var(--font-subtitle-min), 1.75vw, var(--font-subtitle-max));
    line-height: 1.3;
}

.page-subtitle,
.login-subtitle,
.visit-form-subtitle {
    font-size: clamp(var(--font-subtitle-min), 1.75vw, var(--font-subtitle-max));
    line-height: 1.3;
}

.app-header {
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.app-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

.app-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
}

.app-mobile-toggle {
    border: none;
    background: #f1f5f9;
    color: #334155;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-mobile-toggle:hover {
    background: #e2e8f0;
}

.app-nav-collapse {
    margin-top: 1rem;
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    font-size: var(--font-menu-size);
    background: #f1f5f9;
    color: #334155;
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.app-nav-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.app-nav-btn.active {
    background: var(--brand-yellow);
    color: var(--brand-navy);
}

.app-nav-btn.new {
    background: color-mix(in srgb, var(--brand-yellow) 88%, white 12%);
    color: var(--brand-navy);
}

.app-nav-btn.logout {
    background: #fee2e2;
    color: #b91c1c;
}

.app-user-meta {
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.app-user-role {
    text-transform: capitalize;
    font-size: 0.78rem;
}

.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--card-shadow) !important;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-hover) !important;
}

.card-header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
}

.stat-card {
    border-left: 4px solid var(--brand-yellow) !important;
}

.stat-icon {
    min-width: 58px;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn {
    border-radius: 10px;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

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

.btn-primary {
    border: none !important;
    background: var(--brand-yellow) !important;
    color: var(--brand-navy) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: #f3da00 !important;
    color: var(--brand-navy) !important;
    box-shadow: 0 8px 18px rgba(5, 30, 80, 0.16) !important;
}

.btn-outline-secondary {
    border-color: #cbd5e1;
    color: #475569;
}

.btn-outline-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-outline-primary {
    border-color: #1d4ed8;
    color: #1d4ed8;
    margin-bottom: 4px;
}

.btn-outline-primary:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-outline-danger {
    border-color: #dc2626;
    color: #dc2626;
}

.btn-outline-danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #cbd5e1;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 0.22rem rgba(5, 30, 80, 0.16);
}

.form-label {
    font-weight: 700;
    color: #334155;
}

.input-group-text {
    border-radius: 10px;
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
    min-height: 42px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 800;
    background: #f8fafc;
    white-space: nowrap;
}

.table tbody td {
    border-color: #eef2f7;
    vertical-align: middle;
}

.pipeline-table thead th {
    padding: 0.8rem 1.35rem;
}

.pipeline-table tbody td {
    padding: 1rem 1.35rem;
}

.detail-visits-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.pipeline-table {
    table-layout: auto;
    width: 100%;
    min-width: 980px;
}

.detail-visits-table thead th,
.detail-visits-table tbody td,
.pipeline-table thead th,
.pipeline-table tbody td {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.detail-visits-table tbody td:nth-child(5),
.detail-visits-table tbody td:nth-child(7),
.detail-visits-table tbody td:nth-child(8),
.pipeline-table tbody td:nth-child(6) {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    font-variant-numeric: tabular-nums;
}

.detail-visits-table tbody td:nth-child(5),
.detail-visits-table tbody td:nth-child(6) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-visits-table tbody td:nth-child(5) .detail-code-badge,
.detail-visits-table tbody td:nth-child(6) .detail-cif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.15;
    vertical-align: middle;
}

.detail-visits-table thead th:nth-child(1),
.detail-visits-table tbody td:nth-child(1) { width: 6%; }
.detail-visits-table thead th:nth-child(2),
.detail-visits-table tbody td:nth-child(2) { width: 9%; }
.detail-visits-table thead th:nth-child(3),
.detail-visits-table tbody td:nth-child(3) { width: 10%; }
.detail-visits-table thead th:nth-child(4),
.detail-visits-table tbody td:nth-child(4) { width: 11%; }
.detail-visits-table thead th:nth-child(5),
.detail-visits-table tbody td:nth-child(5) { width: 7%; }
.detail-visits-table thead th:nth-child(6),
.detail-visits-table tbody td:nth-child(6) { width: 7%; }
.detail-visits-table thead th:nth-child(7),
.detail-visits-table tbody td:nth-child(7) { width: 8%; }
.detail-visits-table thead th:nth-child(8),
.detail-visits-table tbody td:nth-child(8) { width: 8%; }
.detail-visits-table thead th:nth-child(9),
.detail-visits-table tbody td:nth-child(9) { width: 8%; }
.detail-visits-table thead th:nth-child(10),
.detail-visits-table tbody td:nth-child(10) { width: 8%; }
.detail-visits-table thead th:nth-child(11),
.detail-visits-table tbody td:nth-child(11) { width: 12%; }
.detail-visits-table thead th:nth-child(12),
.detail-visits-table tbody td:nth-child(12) { width: 6%; }

.detail-visits-table tbody td:nth-child(9),
.detail-visits-table tbody td:nth-child(10),
.detail-visits-table tbody td:nth-child(11),
.detail-visits-table tbody td:nth-child(12),
.pipeline-table tbody td:nth-child(7),
.pipeline-table tbody td:nth-child(8) {
    line-height: 1.3;
}

.detail-visits-table .badge,
.pipeline-table .badge {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
}

.app-page-dashboard .detail-visits-table thead th,
.app-page-dashboard .detail-visits-table tbody td,
.app-page-dashboard .pipeline-table thead th,
.app-page-dashboard .pipeline-table tbody td {
    padding: 0.78rem 0.92rem;
}

.app-page-dashboard .detail-visits-table tbody td,
.app-page-dashboard .pipeline-table tbody td {
    line-height: 1.35;
}

.pipeline-table tbody td:nth-child(5) .badge,
.pipeline-table tbody td:nth-child(8) .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 1.75rem;
    width: min(100%, 10rem);
    min-width: 0;
    max-width: 100%;
    padding: 0.35rem 0.65rem;
    line-height: 1.15;
    border-radius: 999px;
}

@media (max-width: 1200px) {
    .pipeline-table tbody td:nth-child(5) .badge,
    .pipeline-table tbody td:nth-child(8) .badge {
        width: 100%;
        border-radius: 0.75rem;
    }
}

.detail-visits-table tbody td:nth-child(11) .detail-result-badge,
#detailVisitsMobile .detail-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 1.75rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0.35rem 0.65rem;
    line-height: 1.2;
    border-radius: 0.7rem;
    overflow-wrap: break-word;
    word-break: normal;
}

.pipeline-mobile-card {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.detail-mobile-identifiers {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.35rem;
}

.detail-mobile-id-value {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-mobile-id-separator {
    line-height: 1;
}

.pipeline-mobile-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.pipeline-mobile-title {
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.pipeline-mobile-date {
    color: #64748b;
    font-size: 0.82rem;
    white-space: nowrap;
}

.pipeline-mobile-meta {
    display: grid;
    gap: 0.25rem;
    font-size: 0.84rem;
    margin-bottom: 0.55rem;
}

.pipeline-mobile-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.pipeline-mobile-badge-item {
    display: grid;
    gap: 0.2rem;
}

.pipeline-mobile-badge-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
    line-height: 1.1;
}

.pipeline-mobile-badges .badge {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 1.7rem;
    text-align: center;
}

.pipeline-mobile-detail {
    display: grid;
    gap: 0.25rem;
    font-size: 0.84rem;
}

.rep-progress-name {
    min-width: 150px;
    max-width: 320px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rep-progress-trigger {
    text-decoration: none !important;
}

.rep-progress-trigger:hover,
.rep-progress-trigger:focus {
    color: var(--brand-navy) !important;
    text-decoration: underline !important;
}

#repProgressList .rep-progress-metrics {
    min-width: 0;
}

#repProgressList .rep-progress-meta {
    gap: 0.6rem;
}

@media (min-width: 768px) {
    #repProgressList .rep-progress-name {
        flex: 0 0 clamp(180px, 24vw, 320px);
        min-width: 180px;
        max-width: 320px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    #repProgressList .rep-progress-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    #repProgressList .rep-progress-name {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #repProgressList .rep-progress-meta {
        flex-wrap: wrap;
    }
}

.dashboard-clickable-card {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-clickable-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(2, 12, 32, 0.28);
}

.dashboard-clickable-card:focus-visible {
    outline: 3px solid rgba(255, 228, 0, 0.65);
    outline-offset: 2px;
}

.dashboard-visit-clickable-row {
    cursor: pointer;
}

.dashboard-visit-clickable-card {
    cursor: pointer;
}

.dashboard-pending-modal-summary {
    font-size: 0.9rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.8rem;
}

.dashboard-pending-table th {
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.modal-header,
.modal-footer {
    border-color: var(--border-color);
}

.modal-title {
    color: var(--brand-navy);
    font-weight: 800;
}

.logout-modal .modal-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.admin-delete-modal .modal-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.admin-delete-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-delete-details {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.65rem 0.8rem;
}

.admin-delete-detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.6rem;
    padding: 0.25rem 0;
}

.admin-delete-detail-label {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 700;
}

.admin-delete-detail-value {
    font-size: 0.9rem;
    color: #0f172a;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.clients-import-review-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
}

.clients-import-review-stat {
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.55rem 0.7rem;
}

.clients-import-review-stat-label {
    display: block;
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 700;
}

.clients-import-review-stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.clients-import-review-scroll {
    max-height: 240px;
    overflow: auto;
}

.logout-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-yellow) 88%, white 12%);
    color: var(--brand-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress {
    background: #e2e8f0;
    border-radius: 999px;
}

.progress-bar {
    border-radius: 999px;
}

.toast-container {
    z-index: 2000;
}

.text-muted {
    color: var(--text-muted) !important;
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--brand-navy) 0%, #0b2b6e 50%, var(--brand-navy-dark) 100%);
}

.login-wrap {
    width: 100%;
    max-width: 460px;
}

.login-card {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(2, 12, 32, 0.45);
    padding: 2rem;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.login-logo {
    height: 82px;
    width: auto;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-size: clamp(var(--font-title-lg-min), 2.2vw, var(--font-title-lg-max));
    font-weight: 800;
    color: var(--brand-navy);
    margin: 0;
    line-height: 1.2;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin: 0.45rem 0 1.4rem;
    font-size: clamp(var(--font-subtitle-min), 1.75vw, var(--font-subtitle-max));
    line-height: 1.3;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1.15rem 0;
    color: #94a3b8;
    font-size: 0.86rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    background: #dbe2ea;
    flex: 1;
}

.btn-office {
    width: 100%;
    border: 2px solid #d1d9e0;
    background: #ffffff;
    color: #334155;
    font-weight: 700;
    border-radius: 10px;
    padding: 0.7rem 1rem;
}

.btn-office:hover {
    background: #f8fafc;
}

.login-footer-note {
    text-align: center;
    color: #cbd5e1;
    margin-top: 1rem;
    font-size: 0.86rem;
}

.error-page {
    max-width: 980px;
}

.error-card {
    overflow: hidden;
}

.error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 0.25rem 1.1rem;
    border-radius: 999px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--brand-navy);
    background: color-mix(in srgb, var(--brand-yellow) 90%, white 10%);
}

.error-footer-note {
    margin-top: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.analysis-header-card {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    color: #ffffff;
    border-radius: 16px;
    border: none;
}

.analysis-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.18rem 0.6rem;
}

.analysis-pill.code {
    background: var(--brand-yellow);
    color: var(--brand-navy);
}

.analysis-pill.cif {
    background: #dcfce7;
    color: #166534;
}

.analysis-stat {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    background: #ffffff;
}

.analysis-stat-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.analysis-stat-value {
    font-size: 1.6rem;
    color: var(--brand-navy);
    font-weight: 800;
    margin-top: 0.2rem;
}

.analysis-visits-table thead th {
    padding: 0.95rem 1rem;
}

.analysis-visits-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.dropdown-results {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 1200;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    max-height: 320px;
    overflow: auto;
}

.dropdown-item-client {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    padding: 0.95rem 1rem;
}

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

.dropdown-item-client:hover {
    background: #f8fafc;
}

.visits-cards {
    width: 100%;
}

.visit-kpi-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
}

.visit-kpi-label {
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.visit-kpi-value {
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 0.35rem;
}

.visit-kpi-value.is-positive {
    color: #166534;
}

.visit-kpi-value.is-negative {
    color: #b91c1c;
}

.visit-kpi-help {
    color: #64748b;
    font-size: 0.88rem;
}

.visits-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.visits-filter-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.visits-filter-group .form-select {
    min-width: 220px;
    max-width: 290px;
}

.visits-filter-group .form-control {
    min-width: 190px;
    max-width: 250px;
}

.visits-filter-label {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.visit-form-page {
    max-width: 1300px;
}

.visit-form-shell {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1.75rem;
}

.visit-form-header {
    margin-bottom: 1.25rem;
}

.visit-form-title {
    margin: 0;
    color: var(--brand-navy);
    font-size: clamp(var(--font-title-lg-min), 2.2vw, var(--font-title-lg-max));
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.visit-form-subtitle {
    margin: 0.4rem 0 0;
    color: #64748b;
    font-size: clamp(var(--font-subtitle-min), 1.75vw, var(--font-subtitle-max));
    line-height: 1.3;
}

.visit-flow-mode-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 0.7rem;
    border-radius: 999px;
    padding: 0.24rem 0.64rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.visit-flow-mode-badge.is-standalone {
    background: #eef2ff;
    color: #3730a3;
}

.visit-flow-mode-badge.is-linked {
    background: #dcfce7;
    color: #166534;
}

.visit-flow-mode-badge.is-edit {
    background: #e0f2fe;
    color: #0c4a6e;
}

.visit-flow-mode-help {
    margin: 0.38rem 0 0;
    color: #475569;
    font-size: 0.85rem;
}

.visit-flow-origin {
    margin: 0.22rem 0 0;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.visit-form-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.visit-client-mode-btn {
    min-width: 240px;
    flex: 1 1 240px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
}

.visit-form-actions {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.visit-form-shell .form-label {
    color: #374151;
    font-weight: 600;
}

.visit-form-shell .form-control,
.visit-form-shell .form-select {
    padding: 0.58rem 0.85rem;
}

.client-changes-modal .modal-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.client-changes-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-yellow) 90%, white 10%);
    color: var(--brand-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.client-changes-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.client-changes-table {
    margin-bottom: 0;
}

.client-changes-table thead th {
    background: #f8fafc;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.client-changes-table tbody th {
    font-size: 0.85rem;
    color: #475569;
    width: 28%;
}

.client-changes-old {
    color: #334155;
}

.client-changes-new {
    color: var(--brand-navy);
    font-weight: 700;
}

.visit-form-section h6 {
    color: var(--brand-navy);
    font-weight: 700;
}

#selectedClientCard {
    border: 2px solid #fde68a;
    background: #fef9c3;
    color: #0f172a;
}

.selected-client-card {
    display: grid;
    gap: 0.9rem;
}

.selected-client-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.selected-client-title {
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 0.2rem;
}

.selected-client-address {
    font-size: 0.9rem;
    color: #334155;
}

.selected-client-change-btn {
    white-space: nowrap;
}

.selected-client-billing {
    border: 1px solid #fcd34d;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.68);
    padding: 0.75rem;
}

.selected-client-billing-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 0.55rem;
}

.selected-client-billing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.selected-client-billing-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.selected-client-billing-value {
    font-weight: 800;
    color: #111827;
}

.contact-list {
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #ffffff;
    max-height: 360px;
    overflow: auto;
}

.contact-list-empty {
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid #eef2f7;
}

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

.contact-item.is-selected {
    background: #eff6ff;
    box-shadow: inset 3px 0 0 #1d4ed8;
}

.contact-item-main {
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 0;
}

.contact-item-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.2rem;
}

.contact-item-name {
    font-weight: 700;
    color: #0f172a;
}

.contact-item-primary-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
}

.contact-item-meta {
    font-size: 0.84rem;
}

.contact-item-badge-primary {
    color: #92400e;
}

.contact-item-badge-default {
    color: #475569;
}

.contact-item-secondary {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.contact-item-edit-btn {
    flex-shrink: 0;
}

.contact-item-editing {
    display: block;
    background: #eef2ff;
}

.flow-locked {
    opacity: 1;
    background: #f8fafc;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 12px;
    padding: 0.85rem;
}

.flow-locked::before {
    content: attr(data-lock-message);
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    background: #eef2f7;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}

.flow-locked input,
.flow-locked select,
.flow-locked textarea,
.flow-locked button {
    opacity: 0.72;
}

.visits-loading-state,
.visits-empty-state {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 3rem 1.5rem;
    text-align: center;
    background: #f8fafc;
}

.visits-list-grid {
    display: grid;
    gap: 1.5rem;
}

.visit-list-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.2s ease;
    position: relative;
}

.visit-list-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.visit-list-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 4rem 1rem 1.5rem;
}

.visit-list-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
}

.visit-list-sales-rep {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.visit-target-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.visit-list-card-content {
    padding: 0 1.5rem 1.5rem;
}

.visit-list-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.visit-detail-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    font-size: 0.92rem;
    color: #374151;
}

.visit-detail-icon {
    width: 14px;
    color: #9ca3af;
}

.visit-detail-icon.is-blue {
    color: #3b82f6;
}

.visit-detail-icon.is-orange {
    color: #f97316;
}

.visit-detail-strong {
    font-weight: 600;
    color: #374151;
}

.visit-detail-text,
.visit-detail-text-strong {
    color: #111827;
}

.visit-detail-text-strong {
    font-weight: 600;
}

.visit-contact-row {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 0.6rem;
}

.visit-contact-position {
    color: #9ca3af;
}

.visit-right-block {
    display: grid;
    gap: 0.4rem;
    font-size: 0.92rem;
    color: #374151;
}

.visit-text-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.visit-next-action-row {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
}

.visit-result-badge,
.visit-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.visit-header-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.visit-header-reagenda-btn {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.74rem;
    line-height: 1.2;
    padding: 0.25rem 0.62rem;
}

.visit-header-reagenda-btn:hover,
.visit-header-reagenda-btn:focus {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1e40af;
}

.visit-header-timeline-btn {
    border: 1px solid #dbeafe;
    background: #f8fafc;
    color: #1e3a8a;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.74rem;
    line-height: 1.2;
    padding: 0.25rem 0.62rem;
}

.visit-header-timeline-btn:hover,
.visit-header-timeline-btn:focus {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.visit-execution-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.visit-result-badge.is-success,
.visit-execution-badge.is-success,
.visit-pill.is-success {
    background: #dcfce7;
    color: #166534;
}

.visit-result-badge.is-info,
.visit-execution-badge.is-info,
.visit-pill.is-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.visit-result-badge.is-warning,
.visit-execution-badge.is-warning,
.visit-pill.is-warning {
    background: #fef3c7;
    color: #92400e;
}

.visit-result-badge.is-neutral,
.visit-execution-badge.is-neutral,
.visit-pill.is-neutral {
    background: #f3f4f6;
    color: #374151;
}

.visit-execution-badge.is-danger,
.visit-pill.is-danger {
    background: #fee2e2;
    color: #991b1b;
}

.visit-info-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.8rem 0.95rem;
}

.visit-info-block.is-gray {
    background: #f9fafb;
}

.visit-info-block.is-amber {
    background: #fffbeb;
    border-color: #fde68a;
}

.visit-info-block.is-danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.visit-info-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5563;
}

.visit-info-block p,
.visit-next-details p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: #374151;
}

.visit-opportunity-panel {
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: linear-gradient(90deg, #eff6ff 0%, #eef2ff 100%);
    padding: 0.95rem;
}

.visit-opportunity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}

.visit-opportunity-data {
    margin: 0.25rem 0 0;
    font-size: 0.93rem;
    color: #111827;
    font-weight: 500;
}

.visit-opportunity-amount {
    margin: 0.25rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.visit-missing-text {
    font-size: 0.84rem;
    color: #6b7280;
}

.visit-next-details {
    margin-top: 1rem;
    padding-top: 0.95rem;
    border-top: 1px solid #e5e7eb;
}

.visit-more-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

.visit-more-dropdown + .visit-more-dropdown {
    margin-top: 0.75rem;
}

.visit-more-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
    user-select: none;
}

.visit-more-dropdown summary::-webkit-details-marker {
    display: none;
}

.visit-more-dropdown summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.78rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.visit-more-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.visit-more-dropdown-body {
    padding: 0 0.95rem 0.95rem;
}

.visit-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.visit-card-actions-minimal {
    justify-content: flex-end;
}

.visit-actions-trigger {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: #0f4c81;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.visit-card-menu-corner {
    position: absolute;
    top: 0.95rem;
    right: 0.95rem;
    z-index: 3;
}

.visit-actions-trigger:hover {
    background: #eff6ff;
    border-color: #c6d4e8;
    color: #0b3a60;
}

.visit-actions-menu {
    min-width: 220px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 0.35rem;
}

.visit-actions-menu .dropdown-item {
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1f2937;
    padding: 0.5rem 0.65rem;
}

.visit-actions-menu .dropdown-item:hover {
    background: #f1f5f9;
}

.visit-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.visit-timeline-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 0.9rem;
}

.visit-timeline-summary-list,
.visit-timeline-detail-panel {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.75rem;
    min-height: 260px;
}

.visit-timeline-summary-item {
    width: 100%;
    border: 1px solid #dbeafe;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.65rem;
    text-align: left;
    margin-bottom: 0.55rem;
}

.visit-timeline-summary-item:hover,
.visit-timeline-summary-item:focus {
    border-color: #93c5fd;
    background: #eff6ff;
}

.visit-timeline-summary-item.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: #eff6ff;
}

.visit-timeline-summary-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
}

.visit-timeline-summary-meta {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #475569;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.65rem;
}

.visit-timeline-detail-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.6rem;
}

.visit-timeline-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.8rem;
}

.visit-timeline-detail-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.55rem 0.65rem;
}

.visit-timeline-detail-item .visit-info-label {
    display: block;
    margin-bottom: 0.2rem;
}

.visit-action-reason {
    max-width: 280px;
    line-height: 1.35;
    padding: 0.35rem 0.65rem 0.2rem;
}

.visit-audit-icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #0f4c81;
}

.audit-date-filters {
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.65rem;
}

.audit-date-filters .form-label {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 700;
}

.general-audit-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.general-audit-toolbar-copy {
    min-width: min(100%, 520px);
}

.general-audit-export-btn {
    white-space: nowrap;
}

.general-audit-filters {
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.9rem;
}

.general-audit-filters .form-label {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.general-audit-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.general-audit-toolbar-actions {
    margin-left: auto;
    align-self: flex-start;
}

.general-audit-header-actions .btn {
    min-width: 148px;
}

@media (max-width: 1199.98px) {
    .general-audit-header-actions {
        justify-content: flex-start;
    }

    .general-audit-toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
}

.audit-pagination-info {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
}

.audit-pagination-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.role-badge-fixed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 98px;
    text-align: center;
}

.user-security-grid {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    min-width: 185px;
}

.user-security-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    line-height: 1.1;
    border-radius: 999px;
    padding: 0.16rem 0.52rem;
    font-weight: 600;
    width: fit-content;
}

.user-security-chip i {
    font-size: 0.72rem;
}

.user-security-chip.is-on {
    background: #dcfce7;
    color: #166534;
}

.user-security-chip.is-off {
    background: #f3f4f6;
    color: #4b5563;
}

.admin-access-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.24rem 0.58rem;
    border-radius: 999px;
    font-size: 0.74rem;
    line-height: 1.05;
    margin-bottom: 0;
    white-space: nowrap;
}

.admin-access-btn i {
    font-size: 0.7rem;
}

.visit-audit-entry {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.visit-audit-modal .modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    border-bottom: 1px solid #dbe3ee;
}

.visit-audit-intro {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.visit-audit-intro-item {
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.55rem 0.7rem;
}

.visit-audit-intro-item span {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 0.1rem;
}

.visit-audit-intro-item strong {
    display: block;
    font-size: 0.85rem;
    color: #0f172a;
    line-height: 1.28;
}

.visit-audit-entry + .visit-audit-entry {
    margin-top: 0.75rem;
}

.visit-audit-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}

.visit-audit-entry-body {
    padding: 0.85rem 1rem 1rem;
}

.visit-audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.visit-audit-summary-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.55rem 0.65rem;
}

.visit-audit-summary-item span {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.visit-audit-summary-item strong {
    display: block;
    font-size: 0.84rem;
    color: #0f172a;
    line-height: 1.3;
}

.visit-audit-friendly-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #334155;
    margin: 0.15rem 0 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.visit-audit-diff-table th,
.visit-audit-diff-table td {
    font-size: 0.83rem;
    vertical-align: top;
}

.visit-audit-snapshots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.65rem;
}

.visit-audit-snapshot-title {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.visit-audit-pre {
    margin: 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    max-height: 190px;
    overflow: auto;
    font-size: 0.73rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.visit-audit-tech-details summary {
    color: #0f4c81;
}

.next-action-toggle-btn {
    font-size: 0.78rem;
    text-decoration: none;
}

.next-action-detail {
    display: block;
    margin-top: 0.2rem;
    line-height: 1.35;
    max-width: 260px;
    white-space: normal;
}

.visit-client-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.visit-client-meta-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    background: #ffffff;
}

.visit-client-meta-item p {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: #111827;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.admin-section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-tab-btn {
    border: 0;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    border-radius: 0;
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    background: transparent;
    color: #64748b;
    margin-bottom: -1px;
}

.admin-tab-btn:hover {
    background: transparent;
    color: #0f172a;
}

.admin-tab-btn.active {
    background: transparent;
    color: var(--brand-navy);
    border-bottom-color: var(--brand-navy);
}

.dropdown-actions-toolbar {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.dropdown-actions-toolbar .btn {
    min-width: 168px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner-inline {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(5, 30, 80, 0.25);
    border-top-color: var(--brand-navy);
    border-radius: 999px;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 991.98px) {
    .app-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .app-nav-btn {
        justify-content: flex-start;
        width: 100%;
    }

    .brand-logo {
        height: 42px;
    }

    .app-page {
        padding: 1.2rem 0.75rem;
    }
}

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 1rem;
    }

    .app-header-top {
        grid-column: 1;
        grid-row: 1;
        margin-right: 0;
    }

    .app-mobile-toggle {
        display: none;
    }

    .app-nav-collapse {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        height: auto !important;
        visibility: visible !important;
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
        margin-left: 0;
    }

    .app-nav {
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .app-user-meta {
        margin-top: 0.6rem;
       
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 1.4rem;
    }

    .login-logo {
        height: 72px;
    }

    .table {
        font-size: 0.85rem;
    }

    .visits-filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .visit-kpi-value {
        font-size: 1.38rem;
    }

    .visits-filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .visits-filter-group .form-select {
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .visits-filter-group .form-control {
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .visit-form-shell {
        padding: 1rem;
    }

    .visit-client-mode-btn {
        width: 100%;
        min-width: 0;
    }

    .visit-form-actions {
        flex-direction: column-reverse;
    }

    .visit-form-actions .btn {
        width: 100%;
    }

    .dropdown-actions-toolbar {
        width: 100%;
    }

    .dropdown-actions-toolbar .btn {
        width: 100%;
        min-width: 0;
    }

    .visit-list-card-header {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 1.5rem;
    }

    .visit-header-badges {
        width: 100%;
        justify-content: flex-start;
    }

    .visit-header-reagenda-btn {
        font-size: 0.72rem;
        padding: 0.24rem 0.56rem;
    }

    .visit-header-timeline-btn {
        font-size: 0.72rem;
        padding: 0.24rem 0.56rem;
    }

    .visit-list-two-cols {
        grid-template-columns: 1fr;
    }

    .visit-client-meta-grid {
        grid-template-columns: 1fr;
    }

    .visit-opportunity-grid {
        grid-template-columns: 1fr;
    }

    .visit-actions-menu {
        min-width: 190px;
    }

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

    .visit-timeline-detail-grid {
        grid-template-columns: 1fr;
    }

    .visit-action-reason {
        max-width: none;
    }

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

    .visit-audit-intro {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .visit-audit-snapshots {
        grid-template-columns: 1fr;
    }

    .general-audit-toolbar {
        align-items: stretch;
    }

    .general-audit-header-actions {
        justify-content: stretch;
    }

    .general-audit-header-actions .btn {
        width: 100%;
        min-width: 0;
    }
}
