/* ============================================
   SoftTouch Prospect Dashboard
   Brand colors from softtouch.eu
   ============================================ */

:root {
    --st-primary: #0EA5E9;
    --st-secondary: #14B8A6;
    --st-dark: #1F2937;
    --st-darker: #111827;
    --st-light: #F9FAFB;
    --st-logo-blue: #0071BB;
    --st-text: #1F2937;
    --st-muted: #6B7280;
    --st-border: #E5E7EB;
}

/* Override Bootstrap primary */
[data-bs-theme="light"] {
    --bs-primary: #0EA5E9;
    --bs-primary-rgb: 14, 165, 233;
    --bs-link-color: #0EA5E9;
    --bs-link-hover-color: #0284C7;
    --bs-body-bg: #F9FAFB;
}

[data-bs-theme="dark"] {
    --bs-primary: #38BDF8;
    --bs-primary-rgb: 56, 189, 248;
    --bs-link-color: #38BDF8;
    --bs-link-hover-color: #7DD3FC;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Navbar ---- */
.navbar-st {
    background-color: var(--st-dark);
    border-bottom: 3px solid var(--st-primary);
}

[data-bs-theme="dark"] .navbar-st {
    background-color: var(--st-darker);
}

.navbar-st .navbar-brand img {
    height: 32px;
    width: auto;
}

.navbar-st .nav-link {
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: color 0.15s;
}

.navbar-st .nav-link:hover,
.navbar-st .nav-link.active {
    color: #fff;
}

.navbar-st .nav-link.active {
    border-bottom: 2px solid var(--st-primary);
}

.navbar-st .dropdown-toggle::after {
    color: rgba(255,255,255,0.6);
}

.navbar-st .navbar-toggler {
    border-color: rgba(255,255,255,0.2);
}

.navbar-st .navbar-toggler-icon {
    filter: invert(1);
}

/* ---- Buttons ---- */
.btn-primary {
    background-color: var(--st-primary);
    border-color: var(--st-primary);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #0284C7;
    border-color: #0284C7;
    color: #fff;
}

.btn-outline-primary {
    color: var(--st-primary);
    border-color: var(--st-primary);
}

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

.btn-secondary {
    background-color: var(--st-secondary);
    border-color: var(--st-secondary);
    color: #fff;
}

.btn-secondary:hover {
    background-color: #0D9488;
    border-color: #0D9488;
    color: #fff;
}

/* ---- Login page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--st-dark) 0%, #0f172a 100%);
}

[data-bs-theme="dark"] .login-wrapper {
    background: linear-gradient(135deg, #0f172a 0%, #000 100%);
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 420px;
    width: 100%;
}

[data-bs-theme="dark"] .login-card {
    background: var(--st-dark);
}

.login-header {
    background: var(--st-primary);
    padding: 2rem;
    text-align: center;
}

.login-header img {
    height: 36px;
}

.login-header h5 {
    color: #fff;
    margin: 0.75rem 0 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.login-body {
    padding: 2rem;
}

/* ---- Status badges ---- */
.badge-open { background-color: #EF4444; }
.badge-to_follow_up { background-color: #F97316; }
.badge-hot_prospect { background-color: #EAB308; color: #000; }
.badge-customer { background-color: var(--st-secondary); }
.badge-no_response { background-color: #6B7280; }
.badge-other_program { background-color: var(--st-primary); }
.badge-not_our_sector { background-color: #8B5CF6; }
.badge-too_expensive { background-color: #EC4899; }
.badge-other { background-color: #9CA3AF; color: #000; }

/* ---- Sortable table headers ---- */
.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover { text-decoration: underline; }
.sort-asc::after { content: ' \25B2'; font-size: 0.75em; }
.sort-desc::after { content: ' \25BC'; font-size: 0.75em; }

/* ---- Table ---- */
.table-leads td { vertical-align: middle; }
.table-leads tbody tr { transition: background-color 0.1s; }
.table-leads tbody tr:hover { background-color: rgba(14, 165, 233, 0.06); }

[data-bs-theme="dark"] .table-leads tbody tr:hover {
    background-color: rgba(56, 189, 248, 0.08);
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-header {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

/* ---- Filter bar ---- */
.filter-bar {
    background-color: var(--bs-tertiary-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--bs-border-color);
}

/* ---- Inline dropdowns in grid ---- */
.assign-form { margin: 0; }
.assign-select {
    min-width: 140px;
    padding: 0.15rem 1.8rem 0.15rem 0.4rem;
    font-size: 0.8rem;
    border-color: transparent;
    background-color: transparent;
}
.assign-select:hover, .assign-select:focus {
    border-color: var(--st-primary);
    background-color: var(--bs-body-bg);
}

/* Status select: colored background matching current status */
select.status-select {
    color: #fff;
    font-weight: 600;
    min-width: 120px;
    border-radius: 4px;
}
select.status-select:focus {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
}
select.status-select.badge-open { background-color: #EF4444; }
select.status-select.badge-to_follow_up { background-color: #F97316; }
select.status-select.badge-hot_prospect { background-color: #EAB308; color: #000; }
select.status-select.badge-customer { background-color: var(--st-secondary); }
select.status-select.badge-no_response { background-color: #6B7280; }
select.status-select.badge-other_program { background-color: var(--st-primary); }
select.status-select.badge-not_our_sector { background-color: #8B5CF6; }
select.status-select.badge-too_expensive { background-color: #EC4899; }
select.status-select.badge-other { background-color: #9CA3AF; color: #000; }

/* ---- Question column truncation ---- */
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Comment timeline ---- */
.comment-timeline { position: relative; padding-left: 1.5rem; }
.comment-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--bs-border-color);
}
.comment-item {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.comment-item::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--st-primary);
}
.comment-item.status-change::before { background-color: #EAB308; }
.comment-item.assignment::before { background-color: var(--st-secondary); }

/* ---- Theme toggle ---- */
#themeToggle {
    border: none;
    background: none;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    color: rgba(255,255,255,0.7);
}
#themeToggle:hover {
    color: #fff;
}

/* ---- Footer ---- */
.footer-st {
    background-color: var(--st-dark);
    color: rgba(255,255,255,0.5);
    padding: 1rem 0;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 2rem;
}

[data-bs-theme="dark"] .footer-st {
    background-color: var(--st-darker);
}

/* ---- Page heading accent ---- */
h2 {
    color: var(--st-text);
    font-weight: 700;
}

[data-bs-theme="dark"] h2 {
    color: #F3F4F6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .table-leads .d-none-mobile { display: none; }
    .login-card { margin: 1rem; }
}
