/* PRAS — flowdash-style layout */
:root {
    --pras-font-sans: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --pras-font-heading: "Montserrat", "Lato", system-ui, sans-serif;
    --pras-sidebar-bg: #1e293b;
    --pras-sidebar-text: #94a3b8;
    --pras-sidebar-active: #f1f5f9;
    --pras-sidebar-width: 260px;
    --pras-header-height: 64px;
    --pras-header-bg: #fff;
    --pras-header-border: #e2e8f0;
    /* Themed buttons / accent */
    --pras-primary: #609c35;
    --pras-primary-hover: #4d7d2a;
    --pras-primary-light: rgba(96, 156, 53, 0.1);
    --pras-primary-dark: #6bab3d;
    --pras-primary-gradient: linear-gradient(135deg, var(--pras-primary-dark) 0%, var(--pras-primary) 50%, var(--pras-primary-hover) 100%);
    --pras-secondary: #4270bd;
    --pras-secondary-hover: #33558a;
    --pras-secondary-light: rgba(66, 112, 189, 0.1);
    --pras-outline-border: #cbd5e1;
    --pras-outline-text: #475569;
    --pras-gray: #64748b;
}

/* Headings: Montserrat (pairs with Lato) */
.pras-app h1, .pras-app h2, .pras-app h3, .pras-app h4, .pras-app h5, .pras-app h6,
.pras-app .pras-page-title,
.pras-login-page h1, .pras-login-page h2, .pras-login-page h3, .pras-login-page h4, .pras-login-page h5, .pras-login-page h6,
.pras-login-page .pras-login-heading {
    font-family: var(--pras-font-heading);
    font-weight: 700;
}

body.pras-app {
    font-family: var(--pras-font-sans);
    margin: 0;
    min-height: 100vh;
    display: flex;
    background: #f8fafc;
    /* Safe area for notched devices when launched from home screen */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Sidebar */
.pras-sidebar {
    width: var(--pras-sidebar-width);
    min-height: 100vh;
    background: var(--pras-sidebar-bg);
    color: var(--pras-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.75);
    z-index: 1;
    position: relative;
}

/* .pras-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 1px;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
} */

.pras-sidebar-header {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pras-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    width: 100%;
    text-align: center;
}

.pras-sidebar-brand:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.pras-sidebar-logo {
    display: block;
    height: 2rem;
    width: auto;
    max-width: 140px;
    margin: 0 auto;
}

.pras-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--pras-sidebar-text);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
}

.pras-sidebar-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.pras-sidebar-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    font-size: 1.25rem;
}

.pras-sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    min-height: 0;
    overflow-y: auto;
}

.pras-sidebar-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--pras-sidebar-text);
    opacity: 0.8;
    letter-spacing: 3px;
}

.pras-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 1.5rem;
    color: var(--pras-sidebar-text);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.15s, color 0.15s;
}

@media (max-width: 991.98px) {
    .pras-sidebar-link {
        font-size: 1.15rem;
    }
}

.pras-sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}

.pras-sidebar-link.active {
    background: var(--pras-primary-gradient);
    color: #fff;
}

.pras-sidebar-link.active i {
    color: #fff;
}

.pras-sidebar-link i {
    font-size: 1.2em;
    width: 1.5rem;
    text-align: center;
    color: var(--pras-primary);
}

.pras-sidebar-footer {
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.pras-sidebar-footer-links {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

.pras-sidebar-footer-link {
    color: var(--pras-sidebar-text);
    opacity: 0.85;
    text-decoration: none;
}

.pras-sidebar-footer-link:hover {
    color: #fff;
    opacity: 1;
}

.pras-sidebar-footer-sep {
    margin: 0 0.35rem;
    opacity: 0.6;
}

.pras-sidebar-footer-text {
    font-size: 0.7rem;
    color: var(--pras-sidebar-text);
    opacity: 0.7;
}

.pras-sidebar-footer-version {
    font-size: 0.65rem;
    color: var(--pras-sidebar-text);
    opacity: 0.5;
    margin-top: 0.2rem;
}

/* Main area */
.pras-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pras-header {
    height: var(--pras-header-height);
    background: var(--pras-header-bg);
    border-bottom: 1px solid var(--pras-header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
    flex-shrink: 0;
}

.pras-header-left .pras-breadcrumb {
    font-size: 0.8rem;
    color: var(--pras-gray);
    font-weight: 500;
}

/* Mobile: breadcrumb bar below header, above page title */
.pras-breadcrumb-bar {
    flex-shrink: 0;
    padding: 0.75rem 1.5rem;
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
    background: #fff;
    border-bottom: 1px solid var(--pras-header-border);
}

.pras-breadcrumb-bar .pras-breadcrumb {
    font-size: 0.8rem;
    color: var(--pras-gray);
    font-weight: 500;
}

.pras-breadcrumb a {
    color: var(--pras-gray) !important;
    text-decoration: none;
    font-weight: 500;
}

.pras-breadcrumb a:hover {
    color: var(--pras-primary) !important;
    text-decoration: underline;
}

.pras-back-to-list {
    color: var(--pras-primary) !important;
    text-decoration: none;
    font-weight: 500;
}
.pras-back-to-list:hover {
    color: var(--pras-primary-hover) !important;
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .pras-main .pras-content {
        padding-top: 1.5rem;
    }
}

.pras-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pras-user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    color: #334155;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.pras-user-menu:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.pras-user-avatar {
    font-size: 1.5rem;
    color: var(--pras-gray);
    width: 1.9rem;
    height: 1.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    overflow: hidden;
}

.pras-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
}

.pras-user-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pras-user-unread {
    font-size: 0.7rem;
    min-width: 1.25rem;
    line-height: 1.25;
}

.pras-content {
    flex: 1 1 auto;
    padding: 1.5rem;
    overflow: auto;
}

/* Mobile: avoid horizontal page scroll; wide tables scroll inside .table-responsive only */
@media (max-width: 991.98px) {
    body.pras-app .pras-content .card .card-body {
        overflow-x: auto;
    }
}

/* Companies list: prevent flex/grid children from forcing page-wide overflow */
.pras-companies-page {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.pras-companies-page .pras-page-title {
    min-width: 0;
}

.pras-companies-page .row > [class*="col-"] {
    min-width: 0;
}

.pras-companies-page .table-responsive {
    max-width: 100%;
}

/* Mobile: give company column room so names don’t crush; table scrolls horizontally */
@media (max-width: 991.98px) {
    .pras-companies-page .pras-col-company {
        min-width: 14rem;
    }
}

/* Main content footer: legal links, centered at bottom */
.pras-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--pras-header-border);
    background: #fafbfc;
}

.pras-footer-links {
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .pras-footer-links {
        gap: 0;
    }
}

.pras-footer-link {
    color: var(--pras-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.pras-footer-link:hover {
    color: var(--pras-primary-hover);
    text-decoration: underline;
}

.pras-footer-sep {
    margin: 0 0.5rem;
    color: var(--pras-outline-text);
}

/* Messages: new-message autocomplete */
.pras-message-new-wrap {
    position: relative;
}
.pras-message-new-wrap .pras-message-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    display: none;
    z-index: 1050;
}
.pras-message-new-wrap .pras-message-autocomplete-dropdown.show {
    display: block;
}
    font-size: 0.875rem;
}

/* ----- Uniform button styling (PRAS theme) ----- */
.pras-app .btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pras-app .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}
.pras-app .btn-primary {
    background-color: var(--pras-primary);
    border-color: var(--pras-primary);
    color: #fff;
}
.pras-app .btn-primary:hover,
.pras-app .btn-primary:focus {
    background-color: var(--pras-primary-hover);
    border-color: var(--pras-primary-hover);
    color: #fff;
}
.pras-app .btn-outline-primary {
    color: var(--pras-primary);
    border-color: var(--pras-primary);
}
.pras-app .btn-outline-primary:hover,
.pras-app .btn-outline-primary:focus {
    background-color: var(--pras-primary-light);
    border-color: var(--pras-primary);
    color: var(--pras-primary-hover);
}
.pras-app .btn-outline-secondary {
    color: var(--pras-outline-text);
    border-color: var(--pras-outline-border);
}
.pras-app .btn-outline-secondary:hover,
.pras-app .btn-outline-secondary:focus {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}
/* CRM status button group: extra space below so not cramped with content */
.pras-app .pras-crm-status-buttons {
    margin-bottom: 1.25rem;
}
.pras-crm-status-bar .pras-crm-status-buttons {
    margin-bottom: 0;
}

/* Dashboard / cards */
.pras-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.5rem;
}

.pras-user-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.pras-profile-avatar {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--pras-outline-border);
}

.pras-profile-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--pras-gray);
    font-size: 2rem;
}

.pras-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.pras-card {
    background: var(--pras-primary-gradient);
    border-radius: 0.875rem;
    padding: 1.5rem;
    box-shadow: 0 4px 14px rgba(96, 156, 53, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: none;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pras-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.pras-card-label i {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85) !important;
    margin-left: 0.25rem;
}

.pras-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.pras-card-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.35rem;
}

/* In-app links: match PRAS theme (no default blue/underline) */
.pras-content a:not(.btn):not(.dropdown-item):not(.page-link):not(.pras-user-menu):not(.pras-sidebar-brand):not(.pras-sidebar-link) {
    color: var(--pras-secondary);
    text-decoration: none;
    font-weight: 500;
}
.pras-content a:not(.btn):not(.dropdown-item):not(.page-link):not(.pras-user-menu):not(.pras-sidebar-brand):not(.pras-sidebar-link):hover {
    color: var(--pras-secondary-hover);
    text-decoration: underline;
}

.pras-welcome-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pras-welcome-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.pras-welcome-card .text-muted {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Mobile: collapse sidebar + overlay + menu toggle */
.pras-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1025;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
}

.pras-sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.pras-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 0.5rem 0 0;
    padding: 0;
    border: none;
    background: #f1f5f9;
    color: #334155;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.35rem;
}

.pras-menu-toggle:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@media (max-width: 991.98px) {
    .pras-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1030;
        transform: translateX(-100%);
        transition: transform 0.2s;
        max-height: 100vh;
    }
    .pras-sidebar.show {
        transform: translateX(0);
    }
    .pras-main {
        width: 100%;
    }
}

/* ========== Login page — full-page dark blue, centered form ========== */
body.pras-login-page {
    font-family: var(--pras-font-sans);
    margin: 0;
    min-height: 100vh;
    background: var(--pras-sidebar-bg);
    color: rgba(255, 255, 255, 0.9);
}

.pras-login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1.5rem 1rem;
}

.pras-login-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.pras-login-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.pras-login-wrap .pras-page-title {
    color: #fff;
}

/* Auth pages footer (login, forgot-password, reset-password, legal when guest) */
.pras-auth-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.pras-auth-footer-links {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.pras-auth-footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.pras-auth-footer-link:hover {
    color: #fff;
}

.pras-auth-footer-sep {
    margin: 0 0.4rem;
    opacity: 0.7;
}

.pras-auth-footer-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
}

.pras-login-logo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
}

.pras-login-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1.5rem 0;
}

.pras-login-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0 0 1.25rem 0;
}

.pras-login-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.pras-login-error {
    background: rgba(185, 28, 28, 0.2);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.pras-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
    min-width: 380px;
}

.pras-login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pras-login-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.pras-login-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-sizing: border-box;
}

.pras-login-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.pras-login-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.pras-login-remember {
    margin-top: 0.15rem;
}
.pras-login-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}
.pras-login-remember-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--pras-primary);
}

.pras-login-btn {
    margin-top: 0.25rem;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--pras-primary);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.pras-login-btn:hover {
    background: var(--pras-primary-hover);
}

.pras-login-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--pras-primary-light);
}

.pras-login-footer-link {
    margin: 1.25rem 0 0;
}

.pras-login-footer-link a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    text-decoration: none;
}

.pras-login-footer-link a:hover {
    color: #fff;
}

@media (max-width: 767.98px) {
    .pras-login-wrap {
        padding: 1.5rem;
    }
    .pras-login-logo {
        max-width: 160px;
        margin-bottom: 1.5rem;
    }
}

/* ========== Toast (flash messages) ========== */
.pras-toast-container {
    position: fixed;
    top: calc(var(--pras-header-height, 64px) + 1rem);
    right: 1.5rem;
    z-index: 1090;
    max-width: 380px;
    animation: pras-toast-in 0.3s ease-out;
}

@keyframes pras-toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pras-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-size: 0.9375rem;
    font-weight: 500;
}

.pras-toast-success {
    background: #fff;
    color: #166534;
    border: 1px solid #86efac;
    background-color: #f0fdf4;
}

.pras-toast-error {
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fecaca;
    background-color: #fef2f2;
}

.pras-toast-info {
    background: #fff;
    color: var(--pras-primary);
    border: 1px solid rgba(96, 156, 53, 0.4);
    background-color: rgba(96, 156, 53, 0.08);
}

.pras-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pras-toast-success .pras-toast-icon { color: #16a34a; }
.pras-toast-error .pras-toast-icon { color: #dc2626; }
.pras-toast-info .pras-toast-icon { color: var(--pras-primary); }

.pras-toast-message {
    flex: 1;
    line-height: 1.4;
}

.pras-toast-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.pras-toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

/* Score color-coding (company list, dashboard): green ≥0.7, yellow 0.4–<0.7, red <0.4 */
.pras-score {
    font-weight: 600;
    background-color: var(--pras-primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}
.pras-score-highest {
    background-color: #16a34a;
    color: #fff;
}
.pras-score-high {
    background-color: #84a541;
    color: #fff;
}
.pras-score-mid {
    background-color: #ca8a04;
    color: #fff;
}
.pras-score-low {
    background-color: #dc2626;
    color: #fff;
}

/* CRM status color dots (company list) */
.pras-status-dot {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    background: #64748b; /* fallback */
    box-sizing: border-box;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}
.pras-status-new { background: #64748b; }         /* slate */
.pras-status-qualified { background: #2563eb; }  /* blue */
.pras-status-contacted { background: #f59e0b; }  /* amber */
.pras-status-proposal { background: #8b5cf6; }    /* violet */
.pras-status-won { background: #16a34a; }         /* green */
.pras-status-lost { background: #dc2626; }        /* red */
.pras-status-rejected { background: #ef4444; }    /* red-light */

.pras-juridical-badge {
    font-weight: 600;
    border: 1px solid transparent;
    padding: .35rem .55rem;
}
.pras-juridical-normal {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}
.pras-juridical-warning {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}
.pras-juridical-critical {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Tier circle before company name (company list) */
.pras-tier-circle {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    box-sizing: border-box;
    vertical-align: middle;
    margin-right: .35rem;
    border: 2px solid currentColor;
}
.pras-tier-1 { color: #16a34a; }
.pras-tier-2 { color: #ca8a04; }
.pras-tier-3 { color: #dc2626; }

/* Reports funnel */
.pras-funnel { min-height: 80px; }
.pras-funnel-step { text-align: center; }
.pras-funnel-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    min-width: 2.5rem;
}
.pras-funnel-label {
    font-size: 0.75rem;
    color: var(--pras-gray);
    text-transform: capitalize;
}

@media (max-width: 575.98px) {
    .pras-toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* Mini icon buttons (company list actions) */
.pras-mini-icon-btn {
    width: 2.4rem;
    height: 2.0rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Leaflet map containers */
.pras-map-container { border-radius: 0 0 var(--bs-border-radius, 0.375rem); }
.pras-map-container .leaflet-container { font-family: inherit; }
.pras-map-popup .btn { font-size: 0.875rem; }

/* Pagination: override Bootstrap's default blue background */
.pagination .page-item > .page-link {
    color: var(--pras-secondary) !important;
}
.pagination .page-item.active > .page-link {
    background-color: var(--pras-primary) !important;
    border-color: var(--pras-primary) !important;
    color: #fff !important;
}

/* Dropdown menu: override Bootstrap's default blue background */
.dropdown-menu .dropdown-item:hover {
    background-color: var(--pras-primary-hover) !important;
    color: #fff !important;
}
.dropdown-menu .dropdown-divider {
    margin: 0;
}

/* Company detail: Assigned to prominence */
.pras-assigned-to-badge {
    background: var(--pras-primary-light, rgba(96, 156, 53, 0.12));
    border: 1px solid var(--pras-outline-border, #e2e8f0);
    color: var(--pras-outline-text, #475569);
}
.pras-assigned-to-badge .fw-semibold {
    color: var(--pras-sidebar-bg, #1e293b);
}

/* Company detail: Contact box – 2-row table, icon cell primary, value cell padded */
.pras-contact-table {
    width: 100%;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--pras-outline-border, #e2e8f0);
}
.pras-contact-table tbody tr:first-child {
    border-bottom: 1px dotted var(--pras-gray);
}
.pras-contact-icon-cell,
table tr td.pras-contact-icon-cell {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 0.4rem !important;
    background: var(--pras-gray);
    color: #fff;
    text-align: center;
    vertical-align: middle;
}
.pras-contact-icon-cell .bi {
    font-size: 1.1rem;
    display: block;
}
.pras-contact-value-cell {
    padding: 0.5rem 0.6rem !important;
    vertical-align: middle;
}
.pras-contact-value-cell a {
    color: var(--pras-sidebar-bg, #1e293b);
    text-decoration: none;
}
.pras-contact-value-cell a:hover {
    text-decoration: underline;
    color: var(--pras-primary);
}
.pras-contact-value-cell.pras-contact-phone a {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Company detail: Timeline (center-oriented, scrollable, latest at top) */
.pras-timeline-wrap {
    max-height: 420px;
    overflow-y: auto;
    padding: 0 0.5rem;
}
.pras-timeline {
    position: relative;
    padding: 0.5rem 0;
}
/* Vertical line down the center */
.pras-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    margin-left: -1px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--pras-outline-border, #cbd5e1);
    border-radius: 1px;
}
.pras-timeline-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    align-items: start;
    position: relative;
    padding-top: 0.5rem;
    padding-bottom: 3.5rem;
    min-height: 2.5rem;
}
.pras-timeline-item:last-child {
    padding-bottom: 1rem;
}
.pras-timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #94a3b8;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--pras-outline-border, #cbd5e1);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.pras-timeline-dot .bi {
    font-size: 1.125rem;
    color: #fff;
    line-height: 1;
}
/* Dot colors by event type */
.pras-timeline-dot--company-created { background: var(--pras-gray); }
.pras-timeline-dot--add-note { background: #0ea5e9; }
.pras-timeline-dot--communicated { background: #8b5cf6; }
.pras-timeline-dot--assign { background: #f59e0b; }
.pras-timeline-dot--update-contact { background: #06b6d4; }
/* Dot colors by status (update_status events) */
.pras-timeline-dot--new { background: #94a3b8; }
.pras-timeline-dot--qualified { background: #22c55e; }
.pras-timeline-dot--contacted { background: #3b82f6; }
.pras-timeline-dot--proposal { background: #8b5cf6; }
.pras-timeline-dot--won { background: var(--pras-primary, #609c35); }
.pras-timeline-dot--lost { background: #ef4444; }
.pras-timeline-dot--rejected { background: #78716c; }
.pras-timeline-content {
    position: relative;
    max-width: 280px;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--pras-outline-border, #e2e8f0);
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* Left side: content in first column, aligned right; connector to the dot */
.pras-timeline-item-left .pras-timeline-content {
    grid-column: 1;
    justify-self: end;
}
.pras-timeline-item-left .pras-timeline-content::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 1.4rem;
    width: 1rem;
    height: 2px;
    background: var(--pras-outline-border, #cbd5e1);
}
/* Right side: content in second column, aligned left; connector to the dot */
.pras-timeline-item-right .pras-timeline-content {
    grid-column: 2;
    justify-self: start;
}
.pras-timeline-item-right .pras-timeline-content::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 1.4rem;
    width: 1rem;
    height: 2px;
    background: var(--pras-outline-border, #cbd5e1);
}
.pras-timeline-item-right .pras-timeline-content::after {
    display: none;
}
.pras-timeline-meta {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
}
.pras-timeline-label {
    font-size: 0.875rem;
    line-height: 1.4;
}
.pras-timeline-note {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--pras-outline-border);
    font-size: 0.8125rem;
}
/* Mobile: line and dot on the left (dot stays absolute), single column content */
@media (max-width: 767.98px) {
    .pras-timeline::before {
        left: 1.5rem;
        margin-left: 0;
    }
    .pras-timeline-item {
        grid-template-columns: 1fr;
    }
    .pras-timeline-dot {
        left: 1.5rem;
        transform: translateX(-50%);
    }
    .pras-timeline-item-left .pras-timeline-content,
    .pras-timeline-item-right .pras-timeline-content {
        grid-column: 1;
        justify-self: start;
        max-width: none;
        margin-left: 3rem;
    }
    .pras-timeline-item-left .pras-timeline-content::after,
    .pras-timeline-item-right .pras-timeline-content::before {
        left: -1.5rem;
        right: auto;
        width: 1.5rem;
        top: 1.4rem;
    }
    .pras-timeline-item-right .pras-timeline-content::after {
        display: none;
    }
}

.pras-inline-user {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.pras-inline-user-avatar {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}

.pras-inline-user-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pras-gray);
    background: #eef2f7;
}

.pras-inline-user--xs .pras-inline-user-avatar { width: 1rem; height: 1rem; }
.pras-inline-user--sm .pras-inline-user-avatar { width: 1.25rem; height: 1.25rem; }
.pras-inline-user--md .pras-inline-user-avatar { width: 1.6rem; height: 1.6rem; }