/* CandC AI Agent — Light/Dark Theme */

:root {
    /* Light theme (default) — monday.com palette */
    --bg-body:            #F8FAFC;
    --bg-surface:         #FFFFFF;
    --bg-surface-raised:  #F1F5F9;
    --bg-input:           #FFFFFF;
    --bg-sidebar:         #292F4C;
    --bg-code:            #F1F5F9;
    --text-primary:       #1E293B;
    --text-secondary:     #475569;
    --text-muted:         #94A3B8;
    --accent:             #0073EA;
    --accent-hover:       #0060C2;
    --accent-glow:        rgba(0, 115, 234, 0.10);
    --accent-glow-strong: rgba(0, 115, 234, 0.20);
    --danger:             #E2445C;
    --success:            #00C875;
    --warning:            #FDAB3D;
    --border:             rgba(148, 163, 184, 0.25);
    --border-accent:      rgba(0, 115, 234, 0.30);
    --shadow-sm:          0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md:          0 4px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg:          0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow:        0 0 20px rgba(0, 0, 0, 0.06);
    --radius-card:        12px;
    --radius-btn:         8px;
    --radius-input:       8px;
    --radius-pill:        20px;
    --status-empty:       #C4C4C4;
    --sidebar-width:      240px;
    --sidebar-collapsed-width: 64px;
    --sidebar-transition: 0.25s ease;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg-body:            #0B0F19;
    --bg-surface:         #111827;
    --bg-surface-raised:  #1A2235;
    --bg-input:           #1A2235;
    --bg-sidebar:         #1E2240;
    --bg-code:            #0D1117;
    --text-primary:       #F1F5F9;
    --text-secondary:     #CBD5E1;
    --text-muted:         #94A3B8;
    --accent:             #579BFC;
    --accent-hover:       #80B4FE;
    --accent-glow:        rgba(87, 155, 252, 0.10);
    --accent-glow-strong: rgba(87, 155, 252, 0.20);
    --danger:             #E2445C;
    --success:            #00C875;
    --warning:            #FDAB3D;
    --border:             rgba(148, 163, 184, 0.12);
    --border-accent:      rgba(87, 155, 252, 0.25);
    --shadow-sm:          0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md:          0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg:          0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow:        0 0 20px rgba(87, 155, 252, 0.06);
    --status-empty:       #6B6B6B;
    --radius-pill:        20px;
    color-scheme: dark;
}

/* ---- Base ---- */
html {
    font-size: 13px;
}

html, body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.auth-page {
    font-size: 15px;
}

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

hr {
    border-color: var(--border);
    opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

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

/* Dark-mode Bootstrap close button fix */
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--sidebar-transition);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand:hover { color: var(--text-primary); }

.sidebar-logo {
    max-width: 190px;
    height: auto;
    transition: opacity var(--sidebar-transition);
}

.sidebar-brand-text {
    color: var(--text-primary);
    transition: opacity var(--sidebar-transition);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.sidebar-toggle:hover { color: var(--text-primary); }

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
    border: none;
    background: none;
    width: calc(100% - 1rem);
    cursor: pointer;
    font-size: 1.05rem;
    font-family: inherit;
    border-radius: 8px;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background-color: rgba(240, 55, 92, 0.10);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-link.active {
    background-color: #F0375C;
    color: #FFFFFF;
    font-weight: 600;
}

.sidebar-link-text {
    overflow: hidden;
    transition: opacity var(--sidebar-transition);
}

.sidebar-section-label {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--sidebar-transition);
}

/* Dark mode sidebar adjustments */
[data-theme="dark"] .sidebar {
    background-color: var(--bg-surface);
    border-right-color: var(--border);
}

.sidebar-collapsed .sidebar-section-label {
    opacity: 0;
    pointer-events: none;
}

/* ---- Sidebar Collapsed ---- */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-link-text,
.sidebar-collapsed .sidebar-logo {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .sidebar-header {
    padding: 0.75rem 0;
    justify-content: center;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar-collapsed .sidebar-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.625rem 0;
    gap: 0;
}

/* ---- Top Action Bar (Theme / Profile / Logout) ---- */
.top-action-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    padding: 0.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.top-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-size: 1.1rem;
}

.top-action-btn:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.top-action-btn i {
    transition: transform 0.3s ease;
}

#theme-toggle:hover i {
    transform: rotate(15deg);
}

/* ---- Content Wrapper ---- */
.content-wrapper {
    padding-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: padding-left var(--sidebar-transition);
}

.sidebar-collapsed .content-wrapper {
    padding-left: var(--sidebar-collapsed-width);
}

.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
}

.main-footer {
    padding: 0 2rem 1rem;
}

/* ---- Mobile Topbar ---- */
.topbar {
    display: none;
}

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
    display: none;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        transition: transform var(--sidebar-transition);
    }

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

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1035;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }

    .sidebar-mobile-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .content-wrapper {
        padding-left: 0 !important;
    }

    .main-content {
        padding: 1rem;
    }

    .top-action-bar {
        padding: 0.5rem 1rem;
    }

    .topbar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.625rem 1rem;
        background-color: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        color: var(--text-primary);
    }

    .topbar .sidebar-toggle {
        color: var(--text-secondary);
        font-size: 1.25rem;
    }

    .topbar-brand {
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--text-primary);
    }
}

/* ---- Dropdown ---- */
.dropdown-menu {
    background-color: var(--bg-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--accent-glow);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border);
}

/* ---- Cards ---- */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.card-header {
    background-color: var(--bg-surface-raised);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-card) var(--radius-card) 0 0 !important;
    color: var(--text-primary);
}

.card-title { color: var(--text-primary); }
.card-text { color: var(--text-secondary); }

/* ---- Buttons ---- */
.btn {
    border-radius: var(--radius-btn);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border: none;
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow-strong);
}

.btn-secondary {
    background-color: var(--bg-surface-raised);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-input);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

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

.btn-outline-success {
    border-color: var(--success);
    color: var(--success);
    background: transparent;
}

.btn-outline-success:hover {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-outline-info {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

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

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-primary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-surface-raised);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-link {
    color: var(--accent);
}

.btn-link:hover {
    color: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    border: none;
    color: #fff;
}

.btn-success:hover {
    background: #00B468;
    color: #fff;
}

/* Dark mode: blue accent is dark enough for white text */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover {
    color: #fff;
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-info:hover {
    color: #fff;
}

[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .btn-primary:active,
[data-theme="dark"] .btn-primary:focus-visible {
    color: #fff !important;
}

[data-theme="dark"] .btn-outline-primary:focus,
[data-theme="dark"] .btn-outline-primary:active,
[data-theme="dark"] .btn-outline-info:focus,
[data-theme="dark"] .btn-outline-info:active {
    color: #fff !important;
}

/* Kill Bootstrap's blue focus/active flash — use a subtle lightened version instead */
.btn:focus,
.btn:active,
.btn:focus-visible,
.btn:active:focus {
    box-shadow: none !important;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary:focus-visible {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: #fff !important;
}

.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary:focus-visible {
    background-color: var(--bg-surface-raised) !important;
    border-color: var(--border-accent) !important;
    color: var(--text-primary) !important;
}

.btn-success:focus,
.btn-success:active,
.btn-success:focus-visible {
    background: #00B468 !important;
    border-color: #00B468 !important;
    color: #fff !important;
}

.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary:focus-visible {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.btn-outline-success:focus,
.btn-outline-success:active,
.btn-outline-success:focus-visible {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-outline-danger:focus-visible {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}

.btn-outline-info:focus,
.btn-outline-info:active,
.btn-outline-info:focus-visible {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary:focus-visible {
    background-color: var(--bg-surface-raised) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-primary) !important;
}

.btn-outline-light:focus,
.btn-outline-light:active,
.btn-outline-light:focus-visible {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #fff !important;
}

/* ---- Forms ---- */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

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

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border);
}

.form-check-label {
    color: var(--text-primary);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ---- Tables ---- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-active-color: var(--text-primary);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-hover-bg: var(--accent-glow);
    color: var(--text-primary);
}

.table th,
.table td {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
    vertical-align: middle;
}

.table > thead {
    border-bottom: 1px solid var(--border);
}

.table-light,
.table-light th,
.table-light td {
    --bs-table-bg: var(--bg-surface-raised) !important;
    --bs-table-color: var(--text-muted) !important;
    --bs-table-border-color: var(--border) !important;
    background-color: var(--bg-surface-raised) !important;
}

.table-light th {
    color: var(--text-muted) !important;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table > tbody > tr {
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    transition: border-left-color 0.15s;
}

.table > tbody > tr:hover {
    border-left-color: #0073EA;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(0, 115, 234, 0.04) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(87, 155, 252, 0.06) !important;
}

[data-theme="dark"] .table > tbody > tr:hover {
    border-left-color: #579BFC;
}

.table-responsive {
    border-radius: var(--radius-card);
}

/* ---- Badges (monday.com solid pills) ---- */
.badge {
    font-weight: 600;
    padding: 0.35em 0.85em;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    letter-spacing: 0.2px;
}

.badge.bg-success {
    background-color: #00C875 !important;
    color: #fff !important;
}

.badge.bg-danger {
    background-color: #E2445C !important;
    color: #fff !important;
}

.badge.bg-primary {
    background-color: #0073EA !important;
    color: #fff !important;
}

.badge.bg-secondary {
    background-color: #C4C4C4 !important;
    color: #fff !important;
}

.badge.bg-warning {
    background-color: #FDAB3D !important;
    color: #fff !important;
}

.badge.bg-info {
    background-color: #579BFC !important;
    color: #fff !important;
}

/* ---- Alerts ---- */
.alert {
    border-radius: var(--radius-btn);
    border: none;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(0, 200, 117, 0.08);
    border-left-color: #00C875;
    color: #00C875;
}

.alert-danger {
    background-color: rgba(226, 68, 92, 0.08);
    border-left-color: #E2445C;
    color: #E2445C;
}

/* ---- Auth pages (LoginLayout) ---- */
body.auth-page {
    background-color: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Auth top bar — dark strip matching the sidebar palette */
.auth-topbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.auth-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.625rem 1.5rem;
}

.auth-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.auth-topbar-brand:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.auth-topbar-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.auth-topbar-links a:not(.btn),
body.auth-page .auth-topbar-links a:not(.btn) {
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-topbar-links a:not(.btn):hover,
body.auth-page .auth-topbar-links a:not(.btn):hover {
    color: var(--text-primary) !important;
}

body.auth-page .card {
    border: 1px solid var(--border);
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-glow);
}

body.auth-page h2 {
    color: var(--text-primary);
}

body.auth-page a:not(.btn) {
    color: var(--accent);
}

body.auth-page a:not(.btn):hover {
    color: var(--accent-hover);
}

/* ---- Tooltip info icons ---- */
.bi-info-circle[data-bs-toggle="tooltip"] {
    cursor: help;
    font-size: 0.85rem;
}

/* ---- Dashboard icons ---- */
.dashboard-icon {
    color: var(--accent);
}

/* ---- Footer ---- */
.main-footer hr {
    border-color: var(--border);
}

/* ---- Utilities ---- */
.letter-spacing-wide {
    letter-spacing: 8px;
}

/* intl-tel-input full width + theme */
.iti {
    width: 100%;
}

.iti__selected-flag {
    background-color: var(--bg-input) !important;
    border-radius: var(--radius-input) 0 0 var(--radius-input);
}

.iti__selected-flag:hover {
    background-color: var(--bg-surface-raised) !important;
}

.iti__country-list {
    background-color: var(--bg-surface-raised);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-btn);
}

.iti__country:hover, .iti__country.iti__highlight {
    background-color: var(--accent-glow);
}

.iti__dial-code {
    color: var(--text-muted);
}

.iti__divider {
    border-bottom-color: var(--border);
}

/* ---- Description lists (Profile) ---- */
dt {
    color: var(--text-muted);
}

dd {
    color: var(--text-primary);
}

/* ---- Code blocks ---- */
code {
    color: var(--accent);
    background-color: var(--accent-glow);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.85em;
}

pre {
    background-color: var(--bg-code) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

/* ---- Scrollbar (Webkit) ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ---- Selection ---- */
::selection {
    background-color: var(--accent-glow-strong);
    color: var(--text-primary);
}

/* ---- Low Credit Alert ---- */
.credit-alert-pulse {
    color: #dc3545 !important;
    font-size: 1.25rem;
    animation: credit-pulse 1.5s ease-in-out infinite;
}

@keyframes credit-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.2); }
}

/* ---- Dashboard ---- */
.dashboard-stat-card .card-body { padding: 1.25rem; }
.dashboard-stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.dashboard-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-primary);
}
.dashboard-stat-card .stat-value .stat-sub {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}
.dashboard-stat-card .stat-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0;
}
.dashboard-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-feed {
    max-height: 380px;
    overflow-y: auto;
}
.activity-feed .list-group-item {
    background-color: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    transition: background-color 0.15s;
}
.activity-feed .list-group-item:hover {
    background-color: var(--bg-surface-raised);
}
.activity-feed .activity-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ====================================================================
   PUBLIC MARKETING PAGES
   ==================================================================== */

body.public-page {
    background-color: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    font-size: 15px;
}

/* ---- Public Topbar ---- */
.public-topbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.public-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.625rem 1.5rem;
}

/* Collapse takes its own full-width row on mobile */
@media (max-width: 991.98px) {
    .public-topbar-inner .navbar-collapse {
        width: 100%;
        flex-basis: 100%;
    }
}

/* Desktop: horizontal links row */
.public-topbar-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: flex-end;
}

.public-topbar-links a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.15s;
}

.public-topbar-links a:not(.btn):hover {
    color: var(--text-primary);
}

.public-topbar-cta {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

/* Mobile: links collapse into a vertical dropdown */
@media (max-width: 991.98px) {
    .public-topbar-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 0 1rem;
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
    }
    .public-topbar-cta {
        display: none; /* shown separately in the always-visible mobile row */
    }
}

/* ---- Hero Section ---- */
.public-hero {
    padding: 5rem 0 4rem;
    position: relative;
    background-color: #0f172a;
    background-image:
        linear-gradient(rgba(0, 115, 234, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 115, 234, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    overflow: hidden;
}

.public-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 70% 50%, rgba(0, 115, 234, 0.15), transparent);
    pointer-events: none;
}

.public-hero .container {
    position: relative;
    z-index: 1;
}

.public-hero h1 {
    line-height: 1.15;
    color: #fff;
}

.public-hero .lead {
    color: rgba(255, 255, 255, 0.85);
}

.public-hero .text-muted {
    color: rgba(255, 255, 255, 0.55) !important;
}

.public-hero .btn-outline-secondary {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
}

.public-hero .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.public-watch-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2rem;
}

.public-watch-demo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 0 0 rgba(0, 115, 234, 0.4);
    animation: pulse-ring 2s ease-out infinite;
    transition: transform 0.2s;
}

.public-watch-demo-icon i {
    font-size: 2rem;
    color: #fff;
    margin-left: 3px;
}

.public-watch-demo:hover .public-watch-demo-icon {
    transform: scale(1.08);
}

.public-watch-demo-text {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 115, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 115, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 115, 234, 0);
    }
}

[data-theme="dark"] .public-watch-demo-icon {
    box-shadow: 0 0 0 0 rgba(87, 155, 252, 0.4);
}

@keyframes pulse-ring-dark {
    0% { box-shadow: 0 0 0 0 rgba(87, 155, 252, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(87, 155, 252, 0); }
    100% { box-shadow: 0 0 0 0 rgba(87, 155, 252, 0); }
}

[data-theme="dark"] .public-watch-demo-icon {
    animation-name: pulse-ring-dark;
}

/* ---- Stats Strip ---- */
.public-stats {
    padding: 3rem 0;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* ---- Sections ---- */
.public-section {
    padding: 4.5rem 0;
}

.public-section-alt {
    padding: 4.5rem 0;
    background-color: var(--bg-surface);
}

/* ---- Step Cards (How It Works) ---- */
.public-step-card {
    padding: 2rem 1.5rem;
}

.public-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.public-step-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

/* ---- Feature Cards ---- */
.public-feature-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.75rem;
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
}

.public-feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.public-section-alt .public-feature-card {
    background-color: var(--bg-surface-raised);
}

.public-feature-icon {
    font-size: 1.75rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.public-feature-icon-lg {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.public-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.public-feature-list li {
    padding: 0.375rem 0;
    font-size: 0.9rem;
}

.public-feature-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: var(--bg-surface-raised);
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
}

/* ---- Pricing Cards ---- */
.public-pricing-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}

.public-pricing-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.public-pricing-card.highlighted {
    border-color: var(--accent);
    border-width: 2px;
    box-shadow: var(--shadow-glow);
}

.public-section-alt .public-pricing-card {
    background-color: var(--bg-body);
}

.public-pricing-badge {
    display: inline-block;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.public-pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.public-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
    width: 100%;
}

.public-pricing-features li {
    padding: 0.375rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---- Trial Banner ---- */
.public-trial-banner {
    background-color: var(--accent-glow);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-card);
    padding: 1.5rem 2rem;
}

/* ---- Use Case Example ---- */
.public-usecase-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.public-usecase-example {
    background-color: var(--accent-glow);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* ---- Contact Cards ---- */
.public-contact-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 2rem 1.5rem;
    height: 100%;
    transition: box-shadow 0.2s;
}

.public-contact-card:hover {
    box-shadow: var(--shadow-md);
}

/* ---- Testimonials ---- */
.public-testimonials {
    position: relative;
    min-height: 220px;
}

.public-testimonial {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.public-testimonial.active {
    opacity: 1;
    pointer-events: auto;
}

.public-testimonial-quote {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
    border: none;
    padding: 0;
}

.public-testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.public-testimonial-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--accent-glow);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent);
    flex-shrink: 0;
}

.public-testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.public-testimonial-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    border: none;
    background-color: var(--border);
    padding: 0;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.public-testimonial-dot.active {
    background-color: var(--accent);
    transform: scale(1.3);
}

/* ---- CTA Section ---- */
.public-cta {
    padding: 4.5rem 0;
    background: linear-gradient(
        160deg,
        var(--accent-glow) 0%,
        var(--bg-body) 100%
    );
}

/* ---- Public Footer ---- */
.public-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 0;
}

.public-footer h6 {
    color: var(--text-primary);
}

.public-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.public-footer a:hover {
    color: var(--accent);
}

.public-footer hr {
    border-color: var(--border);
    margin: 1.5rem 0;
}

/* ---- Accordion Theming (Pricing FAQ) ---- */
body.public-page .accordion-item {
    background-color: var(--bg-surface);
    border-color: var(--border);
}

body.public-page .accordion-button {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 500;
}

body.public-page .accordion-button:not(.collapsed) {
    background-color: var(--accent-glow);
    color: var(--text-primary);
    box-shadow: none;
}

body.public-page .accordion-button::after {
    filter: var(--text-primary);
}

body.public-page .accordion-body {
    background-color: var(--bg-surface);
}

/* ---- Chatty Mail — Chat Bubbles ---- */
.chattymail-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chattymail-bubble-row {
    display: flex;
}

.chattymail-bubble-row.is-user {
    justify-content: flex-end;
}

.chattymail-bubble-row.is-admin {
    justify-content: flex-start;
}

.chattymail-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-card);
    font-size: 0.9rem;
}

.is-user .chattymail-bubble {
    background-color: var(--bg-surface-raised);
    border: 1px solid var(--border);
    border-bottom-right-radius: 4px;
}

.is-admin .chattymail-bubble {
    background-color: var(--accent-glow);
    border: 1px solid var(--border-accent);
    border-bottom-left-radius: 4px;
}

.chattymail-bubble-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chattymail-bubble-time {
    font-weight: 400;
    color: var(--text-muted);
}

.chattymail-bubble-body {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
