/* ═══════════════════════════════════════════════════════
   SmartContacts — site.css v5.0
   Mobile-first · Dark Mode Pro · Premium Polish
   ═══════════════════════════════════════════════════════ */

/* ── 0. Design Tokens ───────────────────────────────── */
:root {
    /* Brand */
    --blue-500:          #2563eb;
    --blue-600:          #1d4ed8;
    --blue-400:          #60a5fa;

    /* Surfaces — light */
    --surface-base:      #eef3f8;
    --surface-card:      #ffffff;
    --surface-card-2:    #f8fafc;
    --surface-overlay:   rgba(255,255,255,0.95);
    --surface-raised:    rgba(255,255,255,0.92);

    /* Text — light */
    --text-primary:      #0f172a;
    --text-secondary:    #334155;
    --text-muted:        #64748b;
    --text-subtle:       #94a3b8;

    /* Border */
    --border:            #e2e8f0;
    --border-strong:     #cbd5e1;

    /* Shadows */
    --shadow-xs:         0 1px 2px rgba(15,23,42,0.05), 0 1px 1px rgba(15,23,42,0.03);
    --shadow-sm:         0 10px 26px rgba(15,23,42,0.06), 0 1px 0 rgba(255,255,255,0.75) inset;
    --shadow-md:         0 22px 55px rgba(15,23,42,0.10), 0 1px 0 rgba(255,255,255,0.82) inset;
    --shadow-hover:      0 18px 38px rgba(15,23,42,0.10);

    /* Radius */
    --r-sm:    6px;
    --r-md:    10px;
    --r-lg:    14px;
    --r-xl:    20px;
    --r-full:  9999px;

    /* Focus */
    --focus-ring:    0 0 0 3px rgba(37,99,235,0.18);
    --focus-border:  #2563eb;

    /* Motion */
    --ease:    all 0.18s cubic-bezier(0.4,0,0.2,1);
    --ease-slow: all 0.3s cubic-bezier(0.4,0,0.2,1);

    /* Navbar */
    --navbar-h: 60px;
}

/* ── 1. Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,0.08), transparent 32rem),
        linear-gradient(180deg, #f8fbff 0%, var(--surface-base) 28rem);
    background-color: var(--surface-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 2. Navbar ───────────────────────────────────────── */
.navbar {
    background: rgba(255,255,255,0.86) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    height: var(--navbar-h);
    padding: 0;
    transition: var(--ease-slow);
    z-index: 1030;
}

.navbar .container { height: 100%; }

.navbar-brand {
    font-size: 1.2rem;
    letter-spacing: -0.6px;
    font-weight: 800;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}
.navbar-brand i {
    color: var(--blue-500);
    font-size: 1.1rem;
}

.navbar-toggler {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 6px 10px;
    color: var(--text-muted);
    transition: var(--ease);
}
.navbar-toggler:focus { box-shadow: none; outline: 2px solid var(--blue-400); }
.navbar-toggler:hover { background: var(--surface-card-2); }

/* Nav links */
.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem !important;
    border-radius: var(--r-md);
    transition: var(--ease);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover {
    color: var(--blue-500) !important;
    background: rgba(37,99,235,0.07);
}
.logout-link {
    border: 0;
    background: transparent;
    cursor: pointer;
}
.active-nav {
    color: var(--blue-500) !important;
    font-weight: 700 !important;
    background: rgba(37,99,235,0.10);
    box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

/* Mobile nav collapse */
@media (max-width: 991.98px) {
    .navbar { height: auto; padding: 0.5rem 0; }

    .navbar-collapse {
        border-top: 1px solid var(--border);
        margin-top: 0.5rem;
        padding: 0.75rem 0 0.5rem;
    }

    .nav-link {
        padding: 0.6rem 0.75rem !important;
        width: 100%;
        border-radius: var(--r-md);
        margin-bottom: 2px;
    }

    .dark-mode-toggle {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        padding: 0.55rem 1rem;
    }

    .btn-add-contact {
        width: 100%;
        justify-content: center;
        margin-top: 0.25rem !important;
        padding: 0.6rem 1rem !important;
    }
}

/* ── 3. Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--r-md);
    transition: var(--ease);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.btn i { line-height: 1; font-size: 0.9em; margin: 0; }
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    box-shadow: 0 10px 20px rgba(37,99,235,0.18);
}
.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1e40af;
    box-shadow: 0 14px 28px rgba(37,99,235,0.24);
}
.btn-outline-primary {
    border-color: rgba(37,99,235,0.34);
    background: rgba(255,255,255,0.72);
    color: var(--blue-600);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(37,99,235,0.08);
    border-color: rgba(37,99,235,0.55);
    color: var(--blue-600);
}

/* Primary gradient button */
.btn-add-contact {
    background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
    color: #fff !important;
    border: none;
    padding: 0.55rem 1.4rem !important;
    box-shadow: 0 4px 14px rgba(37,99,235,0.28);
    border-radius: var(--r-md);
}
.btn-add-contact:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
    color: #fff !important;
}
.btn-add-contact:active { transform: translateY(0); }

.navbar .nav-link.btn-add-contact,
.navbar .nav-link.btn-add-contact:visited,
.navbar .nav-link.btn-add-contact:focus,
.navbar .nav-link.btn-add-contact:hover,
.navbar .nav-link.btn-add-contact:active {
    min-width: 154px;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(37, 99, 235, 0.9) !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
    opacity: 1 !important;
    filter: none !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.18);
}
.navbar .nav-link.btn-add-contact i,
.navbar .nav-link.btn-add-contact:hover i,
.navbar .nav-link.btn-add-contact:focus i {
    color: #ffffff !important;
    opacity: 1 !important;
}
.navbar .nav-link.btn-add-contact:hover,
.navbar .nav-link.btn-add-contact:focus {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.3);
}
.navbar .nav-link.btn-add-contact:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

@media (max-width: 767.98px) {
    .btn-add-contact:hover { transform: none; }
}

/* White/ghost button */
.btn-white {
    background: var(--surface-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-white:hover {
    background: var(--surface-card-2);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Icon action buttons in table */
.btn-group .btn-sm {
    padding: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border) !important;
    background: var(--surface-card);
    transition: var(--ease);
}
.btn-group .btn-sm i { font-size: 0.875rem; margin: 0; }
.btn-group .btn-sm:hover {
    background: var(--surface-card-2);
    border-color: var(--border-strong) !important;
    transform: translateY(-1px);
    z-index: 1;
}
.btn-group .btn-sm:active { transform: translateY(0); }

/* Dark mode toggle */
.dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-card-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--ease);
    line-height: 1.5;
}
.dark-mode-toggle:hover {
    border-color: var(--blue-500);
    color: var(--blue-500);
    background: rgba(37,99,235,0.06);
}

/* ── 4. Forms & Inputs ───────────────────────────────── */
.form-control,
.form-select {
    font-size: 1rem; /* iOS zoom fix */
    font-weight: 400;
    border-radius: 12px;
    border: 1.5px solid #dbe4f0;
    background: var(--surface-card);
    color: var(--text-primary);
    padding: 0.6rem 0.9rem;
    transition: var(--ease);
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    outline: none;
    background: var(--surface-card);
}
.form-control::placeholder { color: var(--text-subtle); }

.form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 14px;
    appearance: none;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.input-group-text {
    border: 1.5px solid #dbe4f0;
    border-right: none;
    background: var(--surface-card-2);
    color: var(--text-subtle);
    border-radius: 12px 0 0 12px;
    padding: 0.6rem 0.85rem;
}
.input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding-left: 0.75rem !important; /* ensure padding even without input-group-text */
}
.input-group .form-control:focus {
    border-left: 1.5px solid var(--blue-500);
}

/* Textarea */
textarea.form-control { resize: vertical; min-height: 80px; }

/* Form validation */
.form-control.is-invalid { border-color: #ef4444; }
.invalid-feedback { font-size: 0.78rem; color: #ef4444; margin-top: 4px; }

/* ── 5. Cards ────────────────────────────────────────── */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border: 1px solid rgba(226,232,240,0.92) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm);
    transition: var(--ease-slow);
}
.card:hover {
    border-color: rgba(203,213,225,0.95) !important;
}

/* ── 6. Table ────────────────────────────────────────── */
.table-wrapper {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border-radius: 18px;
    border: 1px solid rgba(226,232,240,0.95);
    box-shadow: var(--shadow-sm);
    /* do NOT set overflow here — let Bootstrap modal work correctly */
}

/* table-responsive inside wrapper clips only horizontally */
.table-wrapper .table-responsive {
    border-radius: 18px 18px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}
.table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    background: rgba(248,250,252,0.86);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}
.table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr {
    transition: background 0.12s;
}
.table-hover tbody tr:hover {
    background: rgba(37,99,235,0.045) !important;
}

/* Responsive column hiding */
@media (max-width: 991.98px) {
    th.table-col-company, td.table-col-company,
    th.table-col-group,   td.table-col-group   { display: none !important; }
}
@media (max-width: 767.98px) {
    th.table-col-phone, td.table-col-phone,
    th.table-col-last,  td.table-col-last    { display: none !important; }

    .table thead th,
    .table tbody td  { padding: 0.7rem 0.6rem; }
    .table thead th:first-child,
    .table tbody td:first-child { padding-left: 1rem; }
    .table thead th:last-child,
    .table tbody td:last-child  { padding-right: 0.75rem; }

    .table td a { word-break: break-all; font-size: 0.78rem; }
    .dashboard-hero { padding-top: 0.5rem; }
    .metric-card {
        min-height: 104px;
        padding: 0.85rem;
    }
    .metric-value { font-size: 1.65rem; }
    .dashboard-card .card-body { padding: 1rem !important; }
}

/* ── 7. Avatar ───────────────────────────────────────── */
.avatar-circle {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: -0.5px;
    background: #eef2ff;
    color: #4338ca;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: var(--shadow-xs);
}
@media (max-width: 767.98px) {
    .avatar-circle { width: 32px; height: 32px; font-size: 0.72rem; }
}

/* ── 8. Badges ───────────────────────────────────────── */
.custom-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: var(--ease);
}
.badge-uncategorized {
    background: var(--surface-card-2);
    color: var(--text-subtle);
    border-color: var(--border);
}

/* â”€â”€ Dashboard premium shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dashboard-hero {
    padding: 1.4rem 0 0.75rem;
}
.dashboard-eyebrow {
    margin: 0 0 0.35rem;
    color: var(--blue-600);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}
.dashboard-title {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.05rem);
    line-height: 1.12;
    font-weight: 850;
    color: var(--text-primary);
}
.dashboard-copy {
    max-width: 420px;
    margin: 0.75rem 0 1.35rem;
    color: var(--text-muted);
    font-size: 0.96rem;
}
.metric-card {
    min-height: 118px;
    height: 100%;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border: 1px solid rgba(226,232,240,0.92);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--ease-slow);
}
.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--metric-color, var(--blue-500));
}
.metric-card::after {
    content: "";
    position: absolute;
    width: 82px;
    height: 82px;
    right: -30px;
    top: -34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--metric-color, var(--blue-500)) 14%, transparent);
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.metric-value {
    position: relative;
    z-index: 1;
    margin-bottom: 0.35rem;
    color: var(--metric-color, var(--blue-500));
    font-size: 2rem;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -0.04em;
}
.metric-label {
    position: relative;
    z-index: 1;
    color: var(--text-muted);
    font-size: 0.66rem;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.075em;
}
.metric-blue { --metric-color: #2563eb; }
.metric-green { --metric-color: #16a34a; }
.metric-red { --metric-color: #ef4444; }
.metric-amber { --metric-color: #f59e0b; }
.metric-cyan { --metric-color: #0891b2; }
.metric-indigo { --metric-color: #6366f1; }
.metric-slate { --metric-color: #64748b; }
.dashboard-card {
    border-radius: 18px !important;
    overflow: hidden;
}
.dashboard-card .card-body {
    padding: 1.35rem !important;
}
.follow-up-row {
    border: 1px solid transparent;
    background: rgba(248,250,252,0.78);
}
.follow-up-row:hover {
    border-color: rgba(203,213,225,0.8);
    background: #ffffff;
}
.followup-overdue {
    border-color: rgba(239,68,68,0.22);
    background: rgba(254,242,242,0.75);
}
.followup-today {
    border-color: rgba(245,158,11,0.24);
    background: rgba(255,251,235,0.8);
}
.feature-badge-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(226,232,240,0.88);
}

/* ── 9. Index header actions ─────────────────────────── */
@media (max-width: 767.98px) {
    .index-header-actions          { width: 100%; margin-top: 0.75rem; }
    .index-header-actions .btn-group { width: 100%; }
    .index-header-actions .btn-group .btn:first-child { flex: 1; }
    .search-col-input { width: 100% !important; max-width: 100%; }
    .search-col-btn   { width: 100% !important; max-width: 100%; }
}

/* ── 10. Pagination ──────────────────────────────────── */
.page-link {
    border-radius: var(--r-sm) !important;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    transition: var(--ease);
}
.page-link:hover { background: var(--surface-card-2); color: var(--blue-500); }
.page-item.active .page-link {
    background: var(--blue-500);
    border-color: var(--blue-500);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.page-item.disabled .page-link { opacity: 0.4; }

@media (max-width: 575.98px) {
    .pagination { flex-wrap: wrap; gap: 3px !important; }
    .page-link  { padding: 0.3rem 0.55rem; font-size: 0.78rem; }
}

/* ── 11. Modals ──────────────────────────────────────── */
.modal {
    /* ensure modal always on top and centered regardless of parent overflow */
    --bs-modal-zindex: 1055;
    z-index: 1065 !important;
}
.modal-backdrop {
    z-index: 1055 !important;
}
.modal-dialog-centered {
    align-items: center;
    min-height: calc(100% - 1rem);
}
.modal-content {
    border: 1px solid var(--border) !important;
    border-radius: var(--r-xl) !important;
    box-shadow: var(--shadow-md) !important;
    position: relative;
}
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.sc-modal-open {
    overflow: hidden;
}
.sc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.sc-modal-dialog {
    width: min(100%, 520px);
    position: relative;
    z-index: 3001;
}
.sc-import-panel {
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(248,250,252,0.98), rgba(255,255,255,1));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.26),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.sc-import-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}
.sc-import-title {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.25;
    font-weight: 800;
    color: var(--text-primary);
}
.sc-import-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}
.sc-icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-card);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--ease);
}
.sc-icon-button:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: var(--surface-card-2);
}
.sc-import-body {
    padding: 1.25rem 1.5rem 1.1rem;
}
.sc-import-format {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(191, 219, 254, 0.85);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(239,246,255,0.95), rgba(255,255,255,0.88));
}
.sc-import-format-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}
.sc-import-format-icon i { font-size: 1.25rem; }
.sc-import-format-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blue-600);
}
.sc-import-format-text {
    margin-top: 0.1rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 650;
}
.sc-import-format-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.import-file-picker {
    cursor: pointer;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1.5px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--surface-card);
    transition: var(--ease);
}
.import-file-picker:hover {
    border-color: var(--blue-500) !important;
    box-shadow: var(--focus-ring);
    background: #f8fbff;
}
.import-file-copy {
    min-width: 0;
}
.import-file-title {
    display: block;
    font-weight: 800;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.import-file-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.86rem;
}
.import-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 0.9rem;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--blue-600);
    font-weight: 800;
    font-size: 0.86rem;
    flex-shrink: 0;
}
.sc-import-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1rem 1.5rem 1.35rem;
    background: rgba(248, 250, 252, 0.8);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}
.sc-import-footer .btn {
    min-width: 116px;
    border-radius: 10px;
    padding: 0.58rem 1rem;
}

@media (min-width: 576px) {
    .modal-dialog-centered { min-height: calc(100% - 3.5rem); }
}
@media (max-width: 575.98px) {
    .sc-modal-open {
        position: fixed;
        width: 100%;
        min-height: 100%;
        overflow: hidden;
    }
    .sc-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        min-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom)) !important;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sc-modal-dialog {
        width: 100% !important;
        max-width: 390px;
        margin: auto;
    }
    .sc-import-panel {
        max-height: calc(100dvh - 1.5rem);
        overflow: auto;
        border-radius: 16px;
    }
    .sc-import-header {
        padding: 1rem 1rem 0.85rem;
    }
    .sc-import-title {
        font-size: 1rem;
    }
    .sc-import-subtitle {
        font-size: 0.8rem;
    }
    .sc-import-body {
        padding: 1rem;
    }
    .sc-import-format {
        align-items: flex-start;
        padding: 0.85rem;
    }
    .sc-import-format-icon {
        width: 38px;
        height: 38px;
    }
    .import-file-picker {
        min-height: 112px;
        align-items: stretch;
        flex-direction: column;
        padding: 0.95rem;
    }
    .import-file-title {
        white-space: normal;
    }
    .import-file-button {
        width: 100%;
        height: 40px;
    }
    .sc-import-footer {
        padding: 0.85rem 1rem 1rem;
        flex-direction: column-reverse;
    }
    .sc-import-footer .btn {
        width: 100%;
        min-width: 0;
    }
}
@media (max-width: 400px) {
    .modal-dialog { margin: 0.5rem; }
}

/* ── 12. Layout ──────────────────────────────────────── */
.main-container { min-height: calc(100vh - var(--navbar-h) - 120px); padding: 1.5rem 1rem; }

@media (min-width: 768px) { .main-container { padding: 2.5rem 1.5rem; } }
@media (min-width: 1024px) { .main-container { padding: 3rem 0; } }  /* container handles padding at lg+ */

footer {
    background: var(--surface-card);
    border-top: 1px solid var(--border) !important;
    padding: 1.75rem 0;
    margin-top: 4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-shell {
    min-height: calc(100vh - var(--navbar-h) - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-panel {
    width: min(100%, 420px);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    box-shadow:
        0 22px 60px rgba(15, 23, 42, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.75) inset;
    padding: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-brand-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(96,165,250,0.08));
    border: 1px solid rgba(191, 219, 254, 0.78);
    color: var(--blue-500);
    font-size: 1.25rem;
}

.auth-brand h1 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
}

.auth-brand p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-form .form-label {
    letter-spacing: 0.05em;
    color: #334155;
}
.auth-form .input-group {
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
}
.auth-form .input-group-text {
    min-width: 44px;
    justify-content: center;
    border-color: #dbe4f0;
    background: #f8fafc;
    color: #94a3b8;
    border-radius: 12px 0 0 12px;
}
.auth-form .form-control {
    min-height: 46px;
    border-color: #dbe4f0;
    border-radius: 0 12px 12px 0;
    box-shadow: none;
}
.auth-form .form-control:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}
.auth-alert {
    display: none;
}
.auth-alert.validation-summary-errors {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(254,242,242,0.98), rgba(255,247,247,0.92));
    color: #991b1b;
    box-shadow: 0 10px 24px rgba(185, 28, 28, 0.08);
    font-size: 0.9rem;
    line-height: 1.35;
}
.auth-alert.validation-summary-errors i {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    margin-top: -0.1rem;
}
.auth-alert.validation-summary-valid {
    display: none;
}
.auth-alert ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.auth-alert li {
    margin: 0;
}
.auth-form .field-validation-error,
.auth-form .text-danger.small {
    display: block;
    margin-top: 0.45rem;
    color: #e11d48 !important;
    font-size: 0.82rem;
    font-weight: 500;
}
.auth-form .form-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.auth-form .form-check-input {
    width: 1rem;
    height: 1rem;
    border-color: #cbd5e1;
    box-shadow: none;
}
.auth-form .form-check-input:checked {
    background-color: var(--blue-500);
    border-color: var(--blue-500);
}
.auth-form .btn-add-contact {
    min-height: 46px;
    border-radius: 12px;
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.24);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}
.settings-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: 1.35rem;
}
.settings-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}
.settings-card-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 13px;
    background: rgba(37,99,235,0.1);
    color: var(--blue-500);
    border: 1px solid rgba(191, 219, 254, 0.8);
}
.settings-card-icon-danger {
    background: rgba(239,68,68,0.09);
    color: #dc2626;
    border-color: rgba(252,165,165,0.65);
}
.settings-card h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}
.settings-card p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}
.settings-form .form-control {
    min-height: 44px;
    border-radius: 12px;
}
.settings-form .btn {
    min-height: 42px;
    border-radius: 12px;
    padding-inline: 1.1rem;
}
.settings-meta,
.settings-security-note {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-card-2);
    color: var(--text-muted);
    padding: 0.75rem 0.85rem;
    font-size: 0.86rem;
}
.settings-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.settings-meta strong {
    color: var(--text-secondary);
    font-weight: 700;
    text-align: right;
}
.settings-security-note {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(239,246,255,0.9);
    border-color: rgba(191,219,254,0.9);
    color: #1e40af;
}

@media (max-width: 991.98px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 575.98px) {
    .settings-card {
        border-radius: 14px;
        padding: 1rem;
    }
    .settings-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
    .settings-meta strong {
        text-align: left;
    }
}

/* ── 13. Social editor ───────────────────────────────── */
@media (max-width: 575.98px) {
    #socialRows .d-flex { flex-wrap: wrap; }
    #socialRows .social-platform { width: 100% !important; }
    #socialRows .social-handle   { width: calc(100% - 44px) !important; }
}

/* ── 14. Card footer ─────────────────────────────────── */
@media (max-width: 575.98px) {
    .card-footer.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
}

/* ── 15. Dashboard stat cards ────────────────────────── */
.feature-badge-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 0.9rem;
    padding: 1rem;
}
.feature-badge-card > i {
    align-items: center;
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.12);
    border-radius: 12px;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}
.feature-badge-card h3 {
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 0.25rem;
}
.feature-badge-card p {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 575.98px) {
    .main-container { padding: 1rem 0; }
    .feature-badge-card {
        border-radius: 14px;
        padding: 0.9rem;
    }
}

/* ── 16. Animations ──────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    main { animation: fadeUp 0.3s ease both; }
    @keyframes fadeUp {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ── 17. Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }


/* ── Search Input ────────────────────────────────────── */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-subtle);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 2;
    transition: color 0.18s;
}
.search-input {
    padding-left: 38px !important;
    padding-right: 1rem !important;
    border-radius: var(--r-md) !important;
    border: 1.5px solid var(--border) !important;
    width: 100%;
    background: var(--surface-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--ease);
}
.search-input:focus {
    border-color: var(--blue-500) !important;
    box-shadow: var(--focus-ring) !important;
    outline: none;
}
.search-input:focus + .search-input-icon,
.search-input-wrapper:focus-within .search-input-icon {
    color: var(--blue-500);
}
[data-theme="dark"] .search-input {
    background: var(--surface-card-2);
    border-color: var(--border) !important;
    color: var(--text-primary);
}
[data-theme="dark"] .search-input:focus {
    background: var(--surface-card-2);
    border-color: var(--blue-500) !important;
}
[data-theme="dark"] .search-input-icon { color: var(--text-subtle); }


/* ── FollowUp row colors — light + dark aware ────────── */
.followup-row {
    border: 1px solid var(--border);
    background: transparent;
    transition: background 0.15s;
}
.followup-overdue {
    border-color: rgba(239,68,68,0.4) !important;
    background: rgba(239,68,68,0.05) !important;
}
.followup-today {
    border-color: rgba(245,158,11,0.4) !important;
    background: rgba(245,158,11,0.05) !important;
}
[data-theme="dark"] .followup-row   { border-color: var(--border); background: var(--surface-card-2); }
[data-theme="dark"] .followup-overdue { border-color: rgba(239,68,68,0.35) !important; background: rgba(239,68,68,0.08) !important; }
[data-theme="dark"] .followup-today   { border-color: rgba(245,158,11,0.35) !important; background: rgba(245,158,11,0.08) !important; }

/* ── textarea rounded corners fix ────────────────────── */
textarea.form-control {
    border-radius: var(--r-md) !important;
    resize: vertical;
    min-height: 80px;
}

/* ══════════════════════════════════════════════════════
   DARK MODE — Pro Polish
   ══════════════════════════════════════════════════════ */
[data-theme="dark"] {
    /* Surfaces — dark */
    --surface-base:      #080f1a;
    --surface-card:      #0f1929;
    --surface-card-2:    #162032;
    --surface-overlay:   rgba(8,15,26,0.96);

    /* Text — dark */
    --text-primary:      #e8edf5;
    --text-secondary:    #b0bdd0;
    --text-muted:        #7a8fa6;
    --text-subtle:       #4d6175;

    /* Brand in dark */
    --blue-500:          #4d9df0;
    --blue-600:          #3b8ee0;

    /* Border — dark */
    --border:            #1e2d40;
    --border-strong:     #2a3f58;

    /* Shadows — dark (glow, not drop) */
    --shadow-xs:         0 1px 3px rgba(0,0,0,0.4);
    --shadow-sm:         0 4px 12px rgba(0,0,0,0.35);
    --shadow-md:         0 12px 30px rgba(0,0,0,0.5);

    /* Focus */
    --focus-ring:        0 0 0 3px rgba(77,157,240,0.22);
    --focus-border:      #4d9df0;
}

/* Global dark resets */
[data-theme="dark"] body       { background: var(--surface-base); color: var(--text-primary); }

/* Stat cards inner bg fix — prevent Bootstrap white bleed */
[data-theme="dark"] .card.h-100,
[data-theme="dark"] .card.text-center { background: var(--surface-card) !important; }

/* Feature badge cards at bottom of dashboard */
[data-theme="dark"] .rounded-4.bg-white,
[data-theme="dark"] .bg-white { background: var(--surface-card) !important; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: var(--text-primary); }
[data-theme="dark"] .text-dark  { color: var(--text-primary) !important; }
[data-theme="dark"] .text-muted { color: var(--text-muted)   !important; }
[data-theme="dark"] small       { color: var(--text-muted); }

/* Navbar dark */
[data-theme="dark"] .navbar { border-bottom-color: var(--border) !important; }
[data-theme="dark"] .navbar-brand { color: var(--text-primary) !important; }
[data-theme="dark"] .navbar-toggler { border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1) brightness(0.7);
}

/* Mobile collapse dark */
@media (max-width: 991.98px) {
    [data-theme="dark"] .navbar-collapse {
        background: var(--surface-card);
        border: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 var(--r-lg) var(--r-lg);
        padding: 0.5rem 0.75rem 0.75rem;
        margin-top: 0;
        box-shadow: var(--shadow-md);
    }
    [data-theme="dark"] .nav-link {
        border-bottom: 1px solid var(--border) !important;
    }
    [data-theme="dark"] .navbar-collapse .nav-item:last-child .nav-link {
        border-bottom: none !important;
    }
}

/* Cards dark */
[data-theme="dark"] .card {
    background: var(--surface-card) !important;
    border-color: var(--border) !important;
}
[data-theme="dark"] .bg-light { background: var(--surface-card-2) !important; }
[data-theme="dark"] footer {
    background: var(--surface-card);
    border-color: var(--border) !important;
    color: var(--text-muted);
}

/* Table dark */
[data-theme="dark"] .table-wrapper {
    background: var(--surface-card);
    border-color: var(--border);
}
[data-theme="dark"] .table                   { background: var(--surface-card); color: var(--text-primary); }
[data-theme="dark"] .table thead th          {
    background: var(--surface-base) !important;
    color: var(--text-subtle) !important;
    border-bottom: 1px solid var(--border) !important;
}
[data-theme="dark"] .table tbody tr          { background: var(--surface-card); }
[data-theme="dark"] .table tbody td          { border-bottom-color: var(--border); background: inherit; }
[data-theme="dark"] .table tbody tr:last-child td { border-bottom: none; }
[data-theme="dark"] .table-hover tbody tr:hover  {
    background: var(--surface-card-2) !important;
}
[data-theme="dark"] .table-responsive        { background: var(--surface-card); }

/* Forms dark */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--surface-card-2);
    border-color: var(--border);
    color: var(--text-primary);
}
[data-theme="dark"] .form-control::placeholder { color: var(--text-subtle); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--surface-card-2);
    border-color: var(--focus-border);
    box-shadow: var(--focus-ring);
    color: var(--text-primary);
}
[data-theme="dark"] .form-select option { background: var(--surface-card); color: var(--text-primary); }
[data-theme="dark"] .form-label         { color: var(--text-secondary); }
[data-theme="dark"] .input-group-text   { background: var(--surface-base); border-color: var(--border); color: var(--text-subtle); }

/* Buttons dark */
[data-theme="dark"] .btn-white {
    background: var(--surface-card-2);
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .btn-white:hover {
    background: var(--border);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
[data-theme="dark"] .btn-light {
    background: var(--surface-card-2);
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .btn-group .btn-sm {
    background: var(--surface-card-2);
    border-color: var(--border) !important;
    color: var(--text-secondary);
}
[data-theme="dark"] .btn-group .btn-sm:hover {
    background: var(--border);
    color: var(--text-primary);
}
[data-theme="dark"] .btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-muted);
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background: var(--surface-card-2);
    color: var(--text-primary);
}
[data-theme="dark"] .btn-outline-primary {
    border-color: var(--blue-500);
    color: var(--blue-500);
}
[data-theme="dark"] .btn-outline-primary:hover {
    background: rgba(77,157,240,0.12);
}

/* Modals dark */
[data-theme="dark"] .modal-content {
    background: var(--surface-card) !important;
    border-color: var(--border) !important;
    color: var(--text-primary);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: var(--border) !important; }

/* Dropdowns dark */
[data-theme="dark"] .dropdown-menu {
    background: var(--surface-card);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}
[data-theme="dark"] .dropdown-item         { color: var(--text-secondary); }
[data-theme="dark"] .dropdown-item:hover   { background: var(--surface-card-2); color: var(--text-primary); }
[data-theme="dark"] .dropdown-divider      { border-color: var(--border); }

/* Badges dark */
[data-theme="dark"] .badge.bg-light        { background: var(--surface-card-2) !important; color: var(--text-secondary) !important; }
[data-theme="dark"] .badge-uncategorized   { background: var(--surface-card-2); color: var(--text-subtle); border-color: var(--border); }
[data-theme="dark"] .border                { border-color: var(--border) !important; }

/* Pagination dark */
[data-theme="dark"] .page-link             { background: var(--surface-card); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .page-link:hover       { background: var(--surface-card-2); color: var(--blue-500); }
[data-theme="dark"] .page-item.active .page-link  { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
[data-theme="dark"] .page-item.disabled .page-link { background: var(--surface-card); color: var(--text-subtle); opacity: 0.5; }

/* Alert dark */
[data-theme="dark"] .alert-success { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.2);  color: #86efac; }
[data-theme="dark"] .alert-danger  { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.2);  color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); color: #fcd34d; }

/* Scrollbar dark */
[data-theme="dark"] ::-webkit-scrollbar-thumb       { background: var(--border-strong); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* FollowUp danger zone dark */
[data-theme="dark"] .card.border-danger { background: rgba(239,68,68,0.06) !important; }

/* Documentation — code blocks dark */
[data-theme="dark"] .bg-dark { background: #060d18 !important; }

/* Documentation — feature item borders */
[data-theme="dark"] .p-3.rounded-3.border { border-color: var(--border) !important; background: var(--surface-card-2) !important; }

/* Table within docs */
[data-theme="dark"] .table-bordered { border-color: var(--border) !important; }
[data-theme="dark"] .table-bordered td,
[data-theme="dark"] .table-bordered th { border-color: var(--border) !important; }
[data-theme="dark"] .table-light th { background: var(--surface-base) !important; color: var(--text-subtle) !important; }

/* Input group border fix dark */
[data-theme="dark"] .input-group .form-control { border-color: var(--border); border-left: none; }
[data-theme="dark"] .input-group .form-control:focus { border-color: var(--focus-border); border-left: 1.5px solid var(--focus-border); }

[data-theme="dark"] #notesList p.mb-0.mt-1.small { color: var(--text-subtle); }
[data-theme="dark"] #followUpList span.fw-semibold.small { color: #fff; }

button.btn-delete-followup {display: flex; align-items: center; justify-content: center;}

.follow-up-title { color: #212529; }
[data-theme="dark"] .follow-up-title { color: #e8edf5ab; }

.follow-up-row { border: 1px solid #9e9e9e47; }

[data-theme="dark"] .gitlab-title { color: #fff; }
[data-theme="dark"] .gitlab-thead { border-color: inherit; }

[data-theme="dark"] .card-footer.border-top { border-top: var(--bs-border-width) var(--bs-border-style) #1e2d40 !important; }
[data-theme="dark"] .feature-title { color: var(--text-primary); }

/* Dark mode dashboard polish */
[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(37,99,235,0.16), transparent 34rem),
        radial-gradient(circle at top right, rgba(20,184,166,0.08), transparent 30rem),
        linear-gradient(180deg, #070d17 0%, var(--surface-base) 26rem) !important;
    background-color: var(--surface-base) !important;
}

[data-theme="dark"] .navbar {
    background: rgba(8,15,26,0.82) !important;
    border-bottom-color: rgba(42,63,88,0.78) !important;
    box-shadow: 0 1px 0 rgba(148,163,184,0.06) inset;
}
[data-theme="dark"] .active-nav {
    background: rgba(77,157,240,0.14) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
[data-theme="dark"] .nav-link:hover {
    background: rgba(77,157,240,0.10);
}
[data-theme="dark"] .dark-mode-toggle {
    background: rgba(15,25,41,0.94);
    border-color: rgba(77,157,240,0.22);
    color: var(--text-secondary);
}

[data-theme="dark"] .dashboard-hero {
    color: var(--text-primary);
}
[data-theme="dark"] .dashboard-eyebrow {
    color: var(--blue-400);
}
[data-theme="dark"] .dashboard-copy,
[data-theme="dark"] .metric-label {
    color: var(--text-muted);
}

[data-theme="dark"] .metric-card {
    background:
        linear-gradient(180deg, rgba(20,31,48,0.98), rgba(13,23,38,0.98)) !important;
    border-color: rgba(66,88,116,0.78) !important;
    box-shadow:
        0 18px 44px rgba(0,0,0,0.26),
        0 1px 0 rgba(255,255,255,0.06) inset;
}
[data-theme="dark"] .metric-card::after {
    background: color-mix(in srgb, var(--metric-color, var(--blue-500)) 18%, transparent);
    opacity: 0.72;
}
[data-theme="dark"] .metric-card:hover {
    box-shadow:
        0 22px 54px rgba(0,0,0,0.34),
        0 0 0 1px color-mix(in srgb, var(--metric-color, var(--blue-500)) 18%, transparent);
}
[data-theme="dark"] .metric-value {
    color: color-mix(in srgb, var(--metric-color, var(--blue-500)) 78%, #ffffff);
}

[data-theme="dark"] .dashboard-card {
    background:
        linear-gradient(180deg, rgba(15,25,41,0.98), rgba(12,22,36,0.98)) !important;
    border-color: rgba(42,63,88,0.92) !important;
    box-shadow:
        0 18px 44px rgba(0,0,0,0.24),
        0 1px 0 rgba(255,255,255,0.05) inset;
}
[data-theme="dark"] .dashboard-card .card-body {
    background: transparent !important;
}

[data-theme="dark"] .follow-up-row {
    background: rgba(22,32,50,0.92) !important;
    border-color: rgba(51,72,100,0.92) !important;
    color: var(--text-primary);
}
[data-theme="dark"] .follow-up-row:hover {
    background: rgba(28,41,62,0.96) !important;
    border-color: rgba(77,157,240,0.28) !important;
}
[data-theme="dark"] .followup-overdue.follow-up-row {
    background: rgba(127,29,29,0.18) !important;
    border-color: rgba(248,113,113,0.28) !important;
}
[data-theme="dark"] .followup-today.follow-up-row {
    background: rgba(120,53,15,0.18) !important;
    border-color: rgba(251,191,36,0.28) !important;
}
[data-theme="dark"] .follow-up-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .btn-white {
    background: rgba(22,32,50,0.96) !important;
    border-color: rgba(66,88,116,0.88) !important;
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .btn-white:hover,
[data-theme="dark"] .btn-white:focus {
    background: rgba(30,45,64,1) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .feature-badge-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .auth-panel {
    background:
        linear-gradient(180deg, rgba(15,25,41,0.98), rgba(12,22,36,0.98)) !important;
    border-color: rgba(42,63,88,0.92) !important;
    box-shadow: 0 18px 44px rgba(0,0,0,0.24);
}
[data-theme="dark"] .feature-badge-card > i,
[data-theme="dark"] .settings-card-icon,
[data-theme="dark"] .auth-brand-icon {
    background: rgba(77,157,240,0.12);
    border-color: rgba(77,157,240,0.22);
}
[data-theme="dark"] .feature-badge-card h3 {
    color: var(--text-primary);
}
[data-theme="dark"] .feature-badge-card p {
    color: var(--text-muted);
}

[data-theme="dark"] .dashboard-card .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: rgba(42,63,88,0.78);
    --bs-table-striped-bg: rgba(22,32,50,0.5);
    --bs-table-hover-bg: rgba(77,157,240,0.08);
    color: var(--text-primary) !important;
}
[data-theme="dark"] .dashboard-card .table th,
[data-theme="dark"] .dashboard-card .table td {
    background: transparent !important;
    border-color: rgba(42,63,88,0.78) !important;
    color: var(--text-primary) !important;
    padding: 0.9rem 1rem !important;
}
[data-theme="dark"] .dashboard-card .table th {
    background: rgba(22,32,50,0.74) !important;
    color: var(--text-secondary) !important;
    font-weight: 800;
}
[data-theme="dark"] .dashboard-card .table tbody tr:hover th,
[data-theme="dark"] .dashboard-card .table tbody tr:hover td {
    background: rgba(77,157,240,0.07) !important;
}

.demo-mode-banner {
    align-items: center;
    background: linear-gradient(135deg, rgba(239,246,255,0.96), rgba(255,255,255,0.94));
    border: 1px solid rgba(191,219,254,0.92);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    color: #1e40af;
    display: flex;
    font-size: 0.9rem;
    font-weight: 650;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
}
.demo-mode-banner i {
    color: var(--blue-500);
}
.demo-mode-banner a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.requirements-grid {
    display: grid;
    gap: 0.75rem;
}
.requirement-item {
    align-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
    border: 1px solid rgba(226,232,240,0.92);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    display: flex;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
}
.requirement-icon {
    align-items: center;
    background: rgba(37,99,235,0.09);
    border: 1px solid rgba(37,99,235,0.14);
    border-radius: 12px;
    color: var(--blue-500);
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}
.requirement-item strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.15rem;
}
.requirement-item span:not(.requirement-icon) {
    color: var(--text-muted);
    display: block;
    font-size: 0.88rem;
    line-height: 1.45;
}
.requirement-item > div {
    min-width: 0;
}
.demo-mode .dropdown-item:disabled,
.demo-mode .dropdown-item.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
[data-theme="dark"] .demo-mode-banner {
    background: linear-gradient(135deg, rgba(30,64,175,0.22), rgba(15,25,41,0.94));
    border-color: rgba(77,157,240,0.28);
    color: var(--text-secondary);
}
[data-theme="dark"] .demo-mode-banner i {
    color: var(--blue-400);
}
[data-theme="dark"] .requirement-item {
    background: linear-gradient(180deg, rgba(22,32,50,0.92), rgba(15,25,41,0.94));
    border-color: rgba(42,63,88,0.88);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
[data-theme="dark"] .requirement-icon {
    background: rgba(77,157,240,0.12);
    border-color: rgba(77,157,240,0.22);
    color: var(--blue-400);
}
[data-theme="dark"] .requirement-item strong {
    color: var(--text-primary);
}
[data-theme="dark"] .requirement-item span:not(.requirement-icon) {
    color: var(--text-muted);
}
