:root {
    --primary: #0c1222;
    --primary-soft: #151d32;
    --accent: #c9a227;
    --accent-hover: #b8921f;
    --accent-glow: rgba(201, 162, 39, 0.25);
    --surface: #ffffff;
    --bg: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #eef2f7 50%, #f1f5f9 100%);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 268px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Vazirmatn, Tahoma, sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── App Shell ─────────────────────────────────────────── */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, #0a0f1c 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.75rem 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-close-btn,
.btn-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

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

.btn-menu-toggle {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-menu-toggle:hover {
    background: #f8fafc;
    color: var(--text);
}

.sidebar-backdrop {
    display: none;
}

.sidebar-brand .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent) 0%, #e8c547 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.sidebar-nav {
    padding: 1.25rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: #94a3b8;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    opacity: 0.8;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(-2px);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.2) 0%, rgba(201, 162, 39, 0.05) 100%);
    border-right: 3px solid var(--accent);
}

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

.sidebar-footer .nav-link {
    color: #f87171;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-footer .nav-link:hover {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

.app-main {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #e8c547 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
}

.user-info .user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.content-area {
    padding: 2rem;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

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

/* ─── Page Header ─────────────────────────────────────── */

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.page-header .page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ─── Cards ─────────────────────────────────────────────── */

.card-modern {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.card-modern .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-modern .card-body {
    padding: 1.5rem;
}

/* ─── Stat Cards ──────────────────────────────────────── */

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.stat-card.stat-primary::before { background: var(--info); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-accent::before { background: var(--accent); }
.stat-card.stat-secondary::before { background: #94a3b8; }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.stat-primary .stat-icon { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.stat-success .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.stat-warning .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.stat-accent .stat-icon { background: var(--accent-glow); color: var(--accent-hover); }
.stat-secondary .stat-icon { background: rgba(148, 163, 184, 0.15); color: #64748b; }

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* ─── Tables ──────────────────────────────────────────── */

.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: none;
    padding: 1rem 1.25rem;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.table-modern tbody tr {
    transition: var(--transition);
}

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

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Badges & Status ─────────────────────────────────── */

.badge-role {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

.badge-seller { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.badge-agent { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-office { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-admin { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.status-pending { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.status-matched { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.status-fulfilled { background: rgba(16, 185, 129, 0.15); color: #059669; }
.status-cancelled { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.status-available { background: rgba(16, 185, 129, 0.15); color: #059669; }
.status-reserved { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.status-sold { background: rgba(148, 163, 184, 0.2); color: #64748b; }

/* ─── Buttons ─────────────────────────────────────────── */

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #ddb83a 100%);
    color: var(--primary);
    border: none;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-ghost:hover {
    background: #f8fafc;
    color: var(--text);
    border-color: #cbd5e1;
}

.btn-outline-accent {
    border: 1.5px solid var(--accent);
    color: var(--accent-hover);
    background: transparent;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-outline-accent:hover {
    background: var(--accent-glow);
    color: var(--accent-hover);
    border-color: var(--accent);
}

/* ─── Forms ───────────────────────────────────────────── */

.form-modern .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-modern .form-control,
.form-modern .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-modern .form-control:focus,
.form-modern .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Request Cards ───────────────────────────────────── */

.request-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.request-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.request-card .request-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.request-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.request-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.match-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.match-box .match-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.match-box ul {
    margin: 0;
    padding-right: 1.25rem;
    font-size: 0.85rem;
    color: var(--text);
}

/* ─── Action Cards ────────────────────────────────────── */

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.action-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 32px var(--accent-glow);
    transform: translateY(-4px);
}

.action-card .action-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: var(--accent-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-hover);
}

.action-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ─── Alerts ──────────────────────────────────────────── */

.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.alert-success { background: rgba(16, 185, 129, 0.12); color: #059669; }
.alert-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.alert-info { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.alert-warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }

/* ─── Login Page ──────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201, 162, 39, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.06) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    animation: fadeIn 0.6s ease;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand .brand-icon-lg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, #e8c547 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.login-brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.demo-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}

.demo-box .demo-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.demo-box code {
    background: #e2e8f0;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 1rem;
}

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(100%);
        box-shadow: -12px 0 40px rgba(15, 23, 42, 0.35);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-main {
        margin-right: 0;
    }

    .content-area {
        padding: 1rem;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    .btn-menu-toggle,
    .sidebar-close-btn {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .sidebar-backdrop.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .app-topbar {
        padding: 0.65rem 0.85rem;
        gap: 0.5rem;
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    .page-header-row {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header-row > .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header-row .btn {
        flex: 1 1 auto;
        min-height: 44px;
        justify-content: center;
        display: inline-flex;
        align-items: center;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .smart-fab {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        left: 1rem;
        width: 52px;
        height: 52px;
    }

    .table-responsive {
        margin: 0 -0.25rem;
    }

    .form-modern .form-control,
    .form-modern .form-select,
    .form-modern .btn {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}

@media (max-width: 576px) {
    .content-area {
        padding: 0.85rem;
    }

    .page-breadcrumb {
        max-width: 42vw;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }
}

/* ─── CRM Pipeline ────────────────────────────────────── */

.pipeline-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-column {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 400px;
}

.pipeline-header {
    padding: 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipeline-count {
    background: var(--surface);
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pipeline-cards {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pipeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

.pipeline-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.15);
    transform: translateY(-2px);
    color: inherit;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.priority-hot { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.priority-warm { background: #f59e0b; }
.priority-medium { background: #3b82f6; }
.priority-cold { background: #94a3b8; }

.stage-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(201, 162, 39, 0.12);
    color: var(--accent-hover);
}

/* ─── Customer 360 ────────────────────────────────────── */

.crm-profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1a2540 100%);
    border-radius: var(--radius);
    padding: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.crm-profile-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.12) 0%, transparent 70%);
}

.crm-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #e8c547);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    border: 3px solid rgba(255,255,255,0.2);
}

.crm-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
}

.crm-tabs .nav-link.active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
    background: transparent;
}

.timeline {
    position: relative;
    padding-right: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.quote-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
    transition: var(--transition);
}

.quote-card:hover {
    border-color: var(--accent);
}

.quote-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-hover);
}

/* ─── AI Features ─────────────────────────────────────── */

.ai-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(201, 162, 39, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.ai-insight {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.ai-insight:last-child { border-bottom: none; }

.ai-glow {
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.15); }
}

.ai-typing::after {
    content: '▋';
    animation: blink 1s step-end infinite;
    color: #6366f1;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ─── SMS Panel ───────────────────────────────────────── */

.sms-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 1rem;
    height: calc(100vh - 180px);
    min-height: 500px;
}

.sms-contacts, .sms-ai-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sms-chat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sms-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9rem;
}

.sms-contact-list {
    overflow-y: auto;
    flex: 1;
}

.sms-contact {
    display: block;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.sms-contact:hover, .sms-contact.active {
    background: rgba(201, 162, 39, 0.08);
    color: inherit;
}

.sms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sms-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}

.sms-bubble.outbound {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--accent) 0%, #ddb83a 100%);
    color: var(--primary);
    border-bottom-right-radius: 4px;
}

.sms-bubble.inbound {
    align-self: flex-end;
    background: #fff;
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.sms-bubble .sms-time {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.35rem;
}

.sms-bubble .ai-tag {
    font-size: 0.6rem;
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.sms-compose {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.sms-compose textarea {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.sms-compose textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.sms-suggestion {
    background: #f8fafc;
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.sms-suggestion:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: #6366f1;
}

.hot-customer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.hot-customer-row:last-child { border-bottom: none; }

.score-ring {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    border: 3px solid;
}

.score-hot { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }
.score-warm { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.08); }
.score-medium { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.08); }

@media (max-width: 1200px) {
    .sms-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .sms-contacts, .sms-ai-panel { max-height: 300px; }
}

/* ─── Inventory Grid & Filters ────────────────────────── */

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.inventory-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.inventory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
    border-color: #cbd5e1;
}

.inventory-card.status-available { border-top: 3px solid var(--success); }
.inventory-card.status-reserved { border-top: 3px solid var(--warning); }
.inventory-card.status-sold { border-top: 3px solid #94a3b8; opacity: 0.85; }

.inv-card-visual {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
}

.inv-card-visual i {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.35;
}

.inv-card-visual .status-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
}

.inv-card-body {
    padding: 1.25rem;
}

.inv-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.inv-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.inv-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-hover);
}

.inv-card-price small {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    background: rgba(201, 162, 39, 0.12);
    color: var(--accent-hover);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(201, 162, 39, 0.25);
}

.view-toggle .btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.inv-stat {
    transition: var(--transition);
}

.inv-stat:hover {
    transform: translateY(-3px);
    cursor: pointer;
}

.input-group-text {
    border: 1.5px solid var(--border);
    border-left: none;
}

.input-group .form-control {
    border-right: none;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: var(--accent);
}

.inv-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.inv-card-link:hover {
    color: inherit;
}

.import-visual {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, #e2e8f0 100%);
}

.import-card.status-available {
    border-top: 3px solid var(--info);
}

.car-detail-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1a2540 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.car-detail-hero.import-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1a2540 100%);
}

.car-detail-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
}

.car-detail-hero .car-detail-price {
    color: #e8c547;
}

.detail-spec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    height: 100%;
}

.detail-spec-card i {
    font-size: 1.5rem;
    color: var(--accent-hover);
    margin-bottom: 0.5rem;
}

.detail-spec-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.detail-spec-card .value {
    font-weight: 700;
    font-size: 1.1rem;
}

.detail-mini-card {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.detail-mini-card:hover {
    border-color: var(--accent);
    color: inherit;
    box-shadow: var(--shadow);
}

.inv-row-link:hover {
    background: #f8fafc;
}

/* ── Smart UI ── */
.smart-search-wrap {
    position: relative;
    max-width: 420px;
}

.smart-search-input .form-control {
    border-radius: 24px 0 0 24px;
    background: #f8fafc;
}

.smart-search-input .input-group-text {
    border-radius: 0 24px 24px 0;
    background: #f8fafc;
}

.smart-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
}

.smart-search-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.smart-search-item:hover {
    background: #f8fafc;
    color: inherit;
}

.smart-search-item i {
    font-size: 1.1rem;
    color: var(--accent-hover);
    margin-top: 0.15rem;
}

.smart-notif-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-notif-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.smart-notif-menu {
    min-width: 300px;
    max-height: 360px;
    overflow-y: auto;
}

.smart-notif-item {
    white-space: normal;
}

.smart-fab {
    position: fixed;
    bottom: 1.75rem;
    left: 1.75rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #e8c547 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.45);
    z-index: 1040;
    text-decoration: none;
    transition: var(--transition);
}

.smart-fab:hover {
    transform: scale(1.08);
    color: var(--primary);
    box-shadow: 0 12px 32px rgba(201, 162, 39, 0.55);
}

.ai-briefing-card {
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 60%, #2d1b4e 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
}

.briefing-metric {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

.ai-briefing-card .briefing-metric {
    color: #e8c547;
}

.smart-action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.smart-action-item:hover {
    background: #f8fafc;
    color: inherit;
}

.smart-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(201, 162, 39, 0.12);
    color: var(--accent-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.smart-action-icon.overdue {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.smart-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.funnel-step {
    background: rgba(201, 162, 39, 0.2);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    text-align: center;
    margin: 0 auto;
    transition: var(--transition);
}

.ai-chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: 400px;
    background: #f8fafc;
}

.ai-chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-chat-bubble.user {
    background: var(--primary);
    color: #fff;
    margin-right: auto;
    border-bottom-right-radius: 4px;
}

.ai-chat-bubble.ai {
    background: var(--surface);
    border: 1px solid var(--border);
    margin-left: auto;
    border-bottom-left-radius: 4px;
}

.ai-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-hover);
    margin-bottom: 0.35rem;
}

.ai-typing {
    font-size: 0.85rem;
    color: var(--text-muted);
    animation: ai-pulse 1.2s ease infinite;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.ai-price-result {
    background: rgba(201, 162, 39, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: var(--radius-sm);
}

.win-prob-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.win-prob-ring span {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.win-prob-ring small {
    font-size: 0.55rem;
    opacity: 0.85;
}

.win-prob-mini {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: #e2e8f0;
    color: var(--text-muted);
}

.win-prob-mini.hot {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.win-prob-mini.warm {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.score-bar-row {
    display: grid;
    grid-template-columns: 100px 1fr 32px;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.score-bar-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #e8c547 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.match-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.match-item:last-child {
    border-bottom: none;
}

.match-item a {
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
}

.match-item a:hover {
    color: var(--accent-hover);
}

.match-score {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    background: #e2e8f0;
    color: var(--text-muted);
    white-space: nowrap;
}

.match-score.hot {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.match-score.warm {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.inventory-analysis-card.urgency-hot {
    border-right: 4px solid #dc2626;
}

.inventory-analysis-card.urgency-warm {
    border-right: 4px solid #d97706;
}

.ai-glow {
    position: relative;
    overflow: hidden;
}

.ai-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Customer Portal ── */
.portal-body {
    font-family: Vazirmatn, system-ui, sans-serif;
    background: linear-gradient(180deg, #f4f6fb 0%, #eef1f8 100%);
    min-height: 100vh;
    color: #1a2540;
}

.portal-nav {
    background: #fff;
    border-bottom: 1px solid rgba(26, 37, 64, 0.08);
    box-shadow: 0 4px 20px rgba(26, 37, 64, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-nav-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 0;
    flex-wrap: wrap;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}

.portal-brand strong {
    display: block;
    font-size: 1rem;
}

.portal-brand small {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
}

.portal-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a2540, #2d3a5c);
    color: #e8c547;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.portal-nav-links {
    display: flex;
    gap: 0.35rem;
    flex-grow: 1;
}

.portal-nav-links a {
    text-decoration: none;
    color: #64748b;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s ease;
}

.portal-nav-links a:hover,
.portal-nav-links a.active {
    background: rgba(201, 162, 39, 0.12);
    color: #1a2540;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.portal-logout-btn {
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
}

.portal-main {
    padding: 1.75rem 0 3rem;
}

.portal-footer {
    padding: 1.5rem 0 2rem;
}

.portal-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(201, 162, 39, 0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(26, 37, 64, 0.08), transparent 40%),
        #f4f6fb;
}

.portal-login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(26, 37, 64, 0.1);
    border: 1px solid rgba(26, 37, 64, 0.06);
}

.portal-login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #1a2540, #2d3a5c);
    color: #e8c547;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.portal-demo-hint {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    border: 1px dashed #cbd5e1;
}

.portal-hero {
    background: linear-gradient(135deg, #1a2540 0%, #2d3a5c 60%, #3d2b1f 100%);
    color: #fff;
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-hero.investment-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #312e81 100%);
}

.portal-hero-badge {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.portal-stat {
    background: #fff;
    border-radius: 16px;
    padding: 1.1rem;
    border: 1px solid rgba(26, 37, 64, 0.06);
    box-shadow: 0 8px 24px rgba(26, 37, 64, 0.04);
    height: 100%;
}

.portal-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    font-size: 1rem;
}

.portal-stat-icon.orders { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.portal-stat-icon.invest { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.portal-stat-icon.aed { background: rgba(201, 162, 39, 0.15); color: #b45309; }
.portal-stat-icon.profit { background: rgba(34, 197, 94, 0.12); color: #16a34a; }

.portal-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.portal-stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.portal-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(26, 37, 64, 0.06);
    box-shadow: 0 8px 24px rgba(26, 37, 64, 0.04);
    overflow: hidden;
}

.portal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
}

.portal-card-body {
    padding: 1.25rem;
}

.portal-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    color: inherit;
}

.portal-list-item:last-child {
    border-bottom: none;
}

.portal-list-item:hover {
    background: #f8fafc;
}

.portal-quote-box {
    background: rgba(201, 162, 39, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.portal-mini-stat {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.85rem;
    height: 100%;
}

.portal-mini-stat.highlight {
    background: rgba(201, 162, 39, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.2);
}

.tiny {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Step tracker */
.step-tracker {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 70px;
    flex: 1;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    transition: 0.25s ease;
}

.step-label {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.3;
}

.step-line {
    flex: 0.4;
    height: 3px;
    background: #e2e8f0;
    margin-top: 16px;
    border-radius: 2px;
    min-width: 16px;
}

.step-item.done .step-dot,
.step-line.done {
    background: #22c55e;
    color: #fff;
}

.step-item.done .step-label {
    color: #16a34a;
}

.step-item.current .step-dot {
    background: linear-gradient(135deg, #c9a227, #e8c547);
    color: #1a2540;
    box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.2);
}

.step-item.current .step-label {
    color: #1a2540;
    font-weight: 700;
}

.step-tracker-sm .step-dot {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
}

.step-tracker-sm .step-label {
    font-size: 0.68rem;
}

/* Investment cards & pool */
.investment-card {
    display: block;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(26, 37, 64, 0.06);
    box-shadow: 0 8px 24px rgba(26, 37, 64, 0.04);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: 0.25s ease;
}

.investment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(26, 37, 64, 0.1);
    color: inherit;
    border-color: rgba(201, 162, 39, 0.35);
}

.investment-card-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.investment-metric {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.65rem;
    text-align: center;
}

.investment-metric.profit {
    background: rgba(34, 197, 94, 0.08);
}

.pool-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.pool-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c9a227, #e8c547);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.pool-ring {
    --pct: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(#c9a227 calc(var(--pct) * 1%), #e2e8f0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.pool-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: #fff;
    border-radius: 50%;
}

.pool-ring span,
.pool-ring small {
    position: relative;
    z-index: 1;
}

.pool-ring span {
    font-weight: 800;
    font-size: 0.85rem;
}

.pool-ring-lg {
    width: 140px;
    height: 140px;
    flex-direction: column;
}

.pool-ring-lg::before {
    inset: 12px;
}

.pool-ring-lg span {
    font-size: 1.6rem;
    line-height: 1;
}

.pool-ring-lg small {
    font-size: 0.7rem;
    color: #64748b;
}

.inv-status-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    white-space: nowrap;
}

.inv-status-pill.large {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.inv-status-pill.status-open { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.inv-status-pill.status-funded { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.inv-status-pill.status-purchased { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.inv-status-pill.status-delivered { background: rgba(14, 83, 165, 0.12); color: #1d4ed8; }
.inv-status-pill.status-sold { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.inv-status-pill.status-profit_paid { background: rgba(201, 162, 39, 0.18); color: #92400e; }

.inv-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.inv-timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.inv-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.inv-timeline-item.done:not(:last-child)::before {
    background: #22c55e;
}

.inv-timeline-item.current:not(:last-child)::before {
    background: linear-gradient(#c9a227, #e2e8f0);
}

.inv-timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 1;
}

.inv-timeline-item.done .inv-timeline-dot {
    background: #22c55e;
    color: #fff;
}

.inv-timeline-item.current .inv-timeline-dot {
    background: linear-gradient(135deg, #c9a227, #e8c547);
    color: #1a2540;
    box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.2);
}

.inv-timeline-content {
    padding-top: 0.2rem;
}

/* Wallet */
.wallet-callout {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #065f46, #047857);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(4, 120, 87, 0.18);
}

.wallet-callout-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.25rem;
}

.wallet-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 1.8rem;
    color: #fff;
    background:
        radial-gradient(circle at 15% 15%, rgba(232, 197, 71, 0.22), transparent 34%),
        linear-gradient(135deg, #0f172a, #1e3a5f);
    border-radius: 22px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.wallet-balance {
    margin: 0.2rem 0;
    color: #e8c547;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.wallet-balance small {
    font-size: 0.9rem;
    letter-spacing: 0;
}

.wallet-hero-icon {
    width: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 2rem;
}

.wallet-status {
    display: inline-flex;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.wallet-status.status-pending {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.wallet-status.status-approved {
    color: #15803d;
    background: rgba(34, 197, 94, 0.12);
}

.wallet-status.status-rejected {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 768px) {
    .portal-nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .step-item {
        min-width: 58px;
    }

    .wallet-callout {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

/* ─── Cars App — Import Lifecycle UI ──────────────────── */

.car-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}

.car-status-pill.status-ordered {
    background: rgba(15, 23, 42, 0.1);
    color: #334155;
}

.car-status-pill.status-in_transit {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.car-status-pill.status-available {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.car-status-pill.status-reserved {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.car-status-pill.status-sold {
    background: rgba(148, 163, 184, 0.22);
    color: #64748b;
}

.car-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.car-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.car-filter-chip:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}

.car-filter-chip.active {
    background: linear-gradient(135deg, var(--primary) 0%, #1a2540 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.car-filter-chip .chip-count {
    background: rgba(148, 163, 184, 0.2);
    color: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
}

.car-filter-chip.active .chip-count {
    background: rgba(201, 162, 39, 0.35);
    color: #e8c547;
}

.inventory-card.status-ordered { border-top: 3px solid #475569; }
.inventory-card.status-in_transit { border-top: 3px solid var(--info); }
.inventory-card.status-available { border-top: 3px solid var(--success); }
.inventory-card.status-reserved { border-top: 3px solid var(--warning); }
.inventory-card.status-sold { border-top: 3px solid #94a3b8; opacity: 0.88; }

.car-card-key {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-hover);
    background: rgba(201, 162, 39, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: 8px;
    padding: 0.25rem 0.55rem;
}

.car-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.car-hero-actions .btn {
    border-radius: 10px;
}

.car-hero-actions .btn-light {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.car-hero-actions .btn-light:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.car-hero-spec {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.car-hero-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.key-manager-card {
    background:
        radial-gradient(circle at 10% 0%, rgba(201, 162, 39, 0.18), transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1a2540 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(201, 162, 39, 0.25);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    height: 100%;
}

.key-manager-card .key-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, #e8c547 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 20px var(--accent-glow);
}

.key-manager-card .key-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.15rem;
}

.key-manager-card .key-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #e8c547;
}

.key-manager-card .key-holder {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.form-section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.35rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1a2540 100%);
    color: #fff;
    font-weight: 700;
}

.form-section-header.accent {
    background: linear-gradient(135deg, #3d2b1f 0%, #1a2540 60%, #0f172a 100%);
}

.form-section-header .section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.2);
    color: #e8c547;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-section-body {
    padding: 1.35rem;
}

.status-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.status-radio-card {
    position: relative;
    cursor: pointer;
}

.status-radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.status-radio-card .status-radio-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    padding: 1rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    transition: var(--transition);
    height: 100%;
}

.status-radio-card .status-radio-face i {
    font-size: 1.35rem;
    color: var(--text-muted);
}

.status-radio-card .status-radio-face span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.status-radio-card:hover .status-radio-face {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.status-radio-card input:checked + .status-radio-face {
    border-color: var(--accent);
    background: rgba(201, 162, 39, 0.1);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.status-radio-card input:checked + .status-radio-face i,
.status-radio-card input:checked + .status-radio-face span {
    color: var(--accent-hover);
}

.car-lifecycle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.car-lifecycle-title {
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.helper-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.mobile-action-bar {
    display: none;
}

@media (max-width: 991px) {
    .car-filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
        margin-inline: -0.25rem;
        padding-inline: 0.25rem;
        scrollbar-width: none;
    }

    .car-filter-chips::-webkit-scrollbar {
        display: none;
    }

    .car-filter-chip {
        flex: 0 0 auto;
        min-height: 42px;
    }

    .car-detail-hero {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .car-detail-hero h1 {
        font-size: 1.35rem !important;
    }

    .car-detail-price {
        font-size: 1.35rem;
        margin-bottom: 0.75rem !important;
    }

    .car-hero-actions {
        display: none;
    }

    .mobile-action-bar {
        display: flex;
        position: sticky;
        bottom: 0;
        z-index: 50;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.75rem;
        margin: 1rem -1rem -1rem;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .mobile-action-bar .btn,
    .mobile-action-bar form {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }

    .mobile-action-bar .btn {
        min-height: 44px;
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
    }

    .mobile-action-bar form .btn {
        width: 100%;
    }

    .car-lifecycle-card {
        padding: 1rem;
        overflow-x: auto;
    }

    .car-lifecycle-card .step-tracker {
        min-width: 520px;
    }

    .status-radio-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-section-body {
        padding: 1rem;
    }

    .form-section-header {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }

    .key-manager-card {
        padding: 1.15rem;
    }

    .detail-spec-card {
        padding: 1rem 0.75rem;
    }

    .detail-spec-card .value {
        font-size: 0.95rem;
    }

    .cars-list-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .cars-list-toolbar .btn-group {
        align-self: flex-end;
    }
}

@media (max-width: 576px) {
    .status-radio-group {
        grid-template-columns: 1fr 1fr;
    }

    .mobile-action-bar .btn-primary-action {
        flex: 1 1 100%;
        order: -1;
    }
}

/* ─── Key Board ───────────────────────────────────────── */

.key-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.key-board-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    box-shadow: var(--shadow);
    border-top: 3px solid #94a3b8;
    transition: var(--transition);
}

.key-board-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.key-board-card.key-status-in_box { border-top-color: var(--success); }
.key-board-card.key-status-checked_out { border-top-color: var(--warning); }
.key-board-card.key-status-unregistered { border-top-color: #94a3b8; }

.key-board-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.key-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.key-status-badge.status-in_box {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.key-status-badge.status-checked_out {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.key-status-badge.status-unregistered {
    background: rgba(148, 163, 184, 0.22);
    color: #64748b;
}

.key-status-badge.status-check_out {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.key-status-badge.status-check_in {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.key-status-badge.status-transfer {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

.key-status-badge.status-note {
    background: rgba(148, 163, 184, 0.2);
    color: #64748b;
}

@media (max-width: 991px) {
    .key-board-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Additional Mobile / Responsive Fixes ──────────────── */

/* CRM Customer Profile Header — stack on mobile */
@media (max-width: 767px) {
    .crm-profile-header {
        padding: 1.25rem;
    }

    .crm-profile-header .d-flex.align-items-center.gap-4 {
        flex-wrap: wrap;
        gap: 0.75rem !important;
    }

    .crm-profile-header .crm-avatar {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
    }

    /* Action buttons row in profile header */
    .crm-profile-header .d-flex.gap-2.align-items-center {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem !important;
    }

    .crm-profile-header .win-prob-ring {
        width: 52px;
        height: 52px;
    }

    .crm-profile-header .win-prob-ring span { font-size: 0.85rem; }
    .crm-profile-header .win-prob-ring small { font-size: 0.48rem; }
}

/* CRM Tabs — scrollable on mobile */
@media (max-width: 767px) {
    .crm-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 0;
    }

    .crm-tabs::-webkit-scrollbar { display: none; }

    .crm-tabs .nav-item { flex: 0 0 auto; }

    .crm-tabs .nav-link {
        padding: 0.6rem 0.85rem;
        white-space: nowrap;
        font-size: 0.82rem;
    }
}

/* SMS Panel — mobile layout */
@media (max-width: 767px) {
    .sms-layout {
        grid-template-columns: 1fr;
        height: auto;
        gap: 0.75rem;
    }

    .sms-contacts {
        max-height: 180px;
    }

    .sms-messages {
        min-height: 280px;
        max-height: 400px;
    }

    .sms-ai-panel {
        max-height: 280px;
    }

    .sms-chat {
        min-height: 420px;
    }
}

/* Pipeline board — horizontal scroll on mobile */
@media (max-width: 767px) {
    .pipeline-board {
        grid-template-columns: repeat(6, minmax(230px, 1fr));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.75rem;
    }

    .pipeline-column {
        min-height: 300px;
    }
}

/* AI Briefing metrics — compact on mobile */
@media (max-width: 576px) {
    .briefing-metric {
        font-size: 1.35rem;
    }

    .ai-briefing-card {
        padding: 1rem 1.1rem;
    }
}

/* Customers table — hide low-priority columns on mobile */
@media (max-width: 767px) {
    .customers-table th.col-budget,
    .customers-table td.col-budget,
    .customers-table th.col-latest-quote,
    .customers-table td.col-latest-quote,
    .customers-table th.col-win-prob,
    .customers-table td.col-win-prob {
        display: none;
    }
}

/* Needs / Agent requests table — hide less-important cols on mobile */
@media (max-width: 767px) {
    .requests-table th.col-notes,
    .requests-table td.col-notes,
    .requests-table th.col-date,
    .requests-table td.col-date {
        display: none;
    }
}

/* Seller dashboard recent-requests table — compact on mobile */
@media (max-width: 767px) {
    .recent-requests-table th.col-date,
    .recent-requests-table td.col-date {
        display: none;
    }
}

/* Agent dashboard table — hide color + date on mobile */
@media (max-width: 767px) {
    .agent-requests-table th.col-color,
    .agent-requests-table td.col-color,
    .agent-requests-table th.col-date,
    .agent-requests-table td.col-date {
        display: none;
    }
}

/* Investment add-investor inline form — stack on mobile */
@media (max-width: 576px) {
    .add-investor-form {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .add-investor-form > div {
        width: 100%;
    }

    .add-investor-form select,
    .add-investor-form input {
        width: 100% !important;
        min-width: unset !important;
    }
}

/* Portal nav on small phones */
@media (max-width: 400px) {
    .portal-nav-links a {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }
}

/* General touch-friendly tap target for all buttons */
@media (max-width: 991px) {
    .btn {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 36px;
    }

    select.form-select,
    input.form-control {
        font-size: 16px; /* prevents iOS zoom */
    }
}

/* Portal wallet hero on mobile */
@media (max-width: 576px) {
    .wallet-hero {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }

    .wallet-balance {
        font-size: 2rem;
    }

    .wallet-hero-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
}

/* Score bar row on mobile */
@media (max-width: 576px) {
    .score-bar-row {
        grid-template-columns: 80px 1fr 28px;
    }
}

/* Page header row wrapping on mobile */
@media (max-width: 576px) {
    .page-header-row {
        gap: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.2rem;
    }

    .page-header .page-subtitle {
        font-size: 0.82rem;
    }
}

/* Portal stat value — clamp on very small screens */
@media (max-width: 360px) {
    .portal-stat-value {
        font-size: 1.1rem;
    }
}

.brand-icon img{width:34px;height:34px;object-fit:contain;border-radius:50%;background:#fff}.login-brand .brand-icon-lg img{width:54px;height:54px;object-fit:contain;border-radius:50%;background:#fff}.portal-brand-icon img{width:38px;height:38px;object-fit:contain;border-radius:50%;background:#fff}
