:root {
    --sidebar-w: 230px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --accent: #3b82f6;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    margin: 0;
}

/* ── Sidebar ── */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
    transition: transform .2s;
}

.sidebar-brand {
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; gap: .6rem;
}
.sidebar-brand .brand-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--accent); display: flex;
    align-items: center; justify-content: center;
    font-size: 1rem; color: #fff; flex-shrink: 0;
}
.sidebar-brand span { font-weight: 700; font-size: .95rem; color: #f8fafc; }

.sidebar-nav { flex: 1; padding: .5rem 0; list-style: none; margin: 0; }
.sidebar-nav .nav-section {
    font-size: .65rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: #475569;
    padding: 1rem 1rem .35rem;
}
.sidebar-nav li a {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem 1rem; color: var(--sidebar-text);
    text-decoration: none; font-size: .87rem;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-nav li a:hover { color: #f1f5f9; background: rgba(255,255,255,.05); }
.sidebar-nav li a.active {
    color: #fff; background: rgba(59,130,246,.15);
    border-left-color: var(--accent);
}
.sidebar-nav li a i { width: 18px; text-align: center; font-size: .95rem; }

.sidebar-footer {
    padding: .9rem 1rem;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; gap: .6rem;
    font-size: .82rem; color: var(--sidebar-text);
}
.sidebar-footer .user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.sidebar-footer .user-name { font-weight: 500; color: #e2e8f0; font-size: .84rem; }

.logout-btn {
    display: flex; align-items: center;
    padding: .6rem 1rem;
    color: #94a3b8; text-decoration: none;
    font-size: .84rem;
    border-top: 1px solid rgba(255,255,255,.04);
    transition: all .15s;
}
.logout-btn:hover { color: #f87171; background: rgba(248,113,113,.08); }

/* ── Main ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

.page-header {
    background: #fff; border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }

.content-body { padding: 1.5rem; }

/* ── Flash ── */
.flash-wrap { padding: .75rem 1.5rem 0; }

/* ── Stat cards ── */
.stat-card {
    background: #fff; border-radius: 12px;
    padding: 1.2rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex; align-items: center; gap: 1rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
a.stat-card-link {
    display: block; text-decoration: none; color: inherit;
}
a.stat-card-link:hover .stat-card,
a.stat-card-link:focus .stat-card {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
    cursor: pointer;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.stat-value { font-size: 1.7rem; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-label { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; margin-top: .2rem; }

/* ── Cards ── */
.crm-card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden;
}
.crm-card-header {
    padding: .85rem 1.25rem; border-bottom: 1px solid #f1f5f9;
    font-weight: 600; font-size: .9rem; color: #0f172a;
    display: flex; align-items: center; justify-content: space-between;
}

/* ── Status badges ── */
.status-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .65rem; border-radius: 20px;
    font-size: .75rem; font-weight: 600;
}
.status-new        { background: #f1f5f9; color: #475569; }
.status-contacted  { background: #dbeafe; color: #1d4ed8; }
.status-interested { background: #ffedd5; color: #c2410c; }
.status-negotiating{ background: #f3e8ff; color: #7e22ce; }
.status-invested   { background: #dcfce7; color: #15803d; }
.status-lost       { background: #fee2e2; color: #b91c1c; }

/* ── Outcome badges ── */
.outcome-badge {
    display: inline-block; padding: .18rem .55rem;
    border-radius: 20px; font-size: .72rem; font-weight: 600;
}
.outcome-answered      { background: #dbeafe; color: #1d4ed8; }
.outcome-interested    { background: #dcfce7; color: #15803d; }
.outcome-not_interested{ background: #fee2e2; color: #b91c1c; }
.outcome-callback      { background: #fef3c7; color: #92400e; }
.outcome-no_answer     { background: #f1f5f9; color: #475569; }
.outcome-voicemail     { background: #f3e8ff; color: #7e22ce; }

/* ── Table ── */
.table-crm th {
    font-size: .73rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; color: #64748b; border-top: none;
    background: #f8fafc; white-space: nowrap;
}
.table-crm td { vertical-align: middle; font-size: .875rem; }
.table-crm tbody tr:hover { background: #f8fafc; }

/* ── Pipeline ── */
.pipeline-board {
    display: flex; gap: .75rem; overflow-x: auto;
    padding-bottom: 1rem; align-items: flex-start;
}
.pipeline-col {
    min-width: 210px; width: 210px; flex-shrink: 0;
    background: #f8fafc; border-radius: 10px;
    padding: .65rem;
    max-height: calc(100vh - 140px); overflow-y: auto;
}
.pipeline-col-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .35rem .25rem .65rem;
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #475569;
}
.col-count {
    background: #e2e8f0; color: #475569;
    border-radius: 20px; padding: .1rem .5rem;
    font-size: .72rem; font-weight: 700;
}
.pipeline-card {
    background: #fff; border-radius: 8px;
    padding: .7rem .75rem; margin-bottom: .45rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    border-left: 3px solid transparent;
    cursor: grab; transition: box-shadow .15s;
    font-size: .84rem;
}
.pipeline-card:active { cursor: grabbing; }
.pipeline-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.pipeline-card.drag-over-indicator { outline: 2px dashed var(--accent); }
.pipeline-card .card-name { font-weight: 600; color: #0f172a; margin-bottom: .2rem; }
.pipeline-card .card-meta { color: #64748b; font-size: .78rem; }
.pipeline-col.drag-target { background: #eff6ff; outline: 2px dashed var(--accent); }

/* ── Call log ── */
.call-entry {
    border-left: 3px solid #e2e8f0; padding: .65rem 1rem;
    margin-bottom: .4rem; background: #f8fafc; border-radius: 0 8px 8px 0;
    font-size: .85rem;
}
.call-entry.oc-interested   { border-left-color: #22c55e; }
.call-entry.oc-not_interested{ border-left-color: #ef4444; }
.call-entry.oc-callback     { border-left-color: #f59e0b; }
.call-entry.oc-answered     { border-left-color: #3b82f6; }
.call-entry.oc-voicemail    { border-left-color: #8b5cf6; }

/* ── Schedule ── */
.overdue-badge {
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 8px; padding: .65rem 1rem;
    margin-bottom: .4rem; font-size: .85rem;
}

/* ── Forms ── */
.form-card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 1.5rem;
}
.form-label { font-weight: 500; font-size: .875rem; color: #374151; }
.form-control, .form-select {
    font-size: .875rem;
    border-color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── Login page ── */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.login-card {
    background: #fff; border-radius: 16px; padding: 2.5rem;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--accent); display: flex;
    align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; margin: 0 auto 1.25rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ── Days since contact ── */
.days-badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .18rem .55rem; border-radius: 20px;
    font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.days-fresh   { background: #dcfce7; color: #15803d; }
.days-ok      { background: #d1fae5; color: #065f46; }
.days-warm    { background: #fef3c7; color: #92400e; }
.days-stale   { background: #ffedd5; color: #c2410c; }
.days-cold    { background: #fee2e2; color: #b91c1c; }
.days-never   { background: #f1f5f9; color: #64748b; }

/* ── Hot flag ── */
.hot-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; opacity: .2; padding: 2px 4px;
    border-radius: 4px; transition: opacity .15s, transform .15s;
    line-height: 1;
}
.hot-btn:hover { opacity: .6; transform: scale(1.2); }
.hot-btn-on { opacity: 1 !important; }
.hot-row { background: #fffbeb !important; }
.hot-row:hover { background: #fef3c7 !important; }

.hot-filter-label {
    display: inline-flex; align-items: center;
    padding: .25rem .65rem; border-radius: 20px;
    font-size: .8rem; font-weight: 600; cursor: pointer;
    border: 1px solid #e2e8f0; background: #fff;
    color: #94a3b8; transition: all .15s; white-space: nowrap;
}
.hot-filter-label:hover { border-color: #f59e0b; color: #92400e; }
.hot-filter-label.active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

.hot-badge {
    font-size: .85rem; line-height: 1;
    position: absolute; top: 6px; right: 6px;
}

/* ── Quick Log Modal ── */
.outcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .4rem;
}
.outcome-opt {
    padding: .4rem .3rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: .75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    text-align: center;
    transition: all .12s;
    line-height: 1.2;
}
.outcome-opt:hover { border-color: #94a3b8; background: #f1f5f9; color: #0f172a; }
.outcome-opt.selected                     { border-color: transparent; color: #fff; }
.outcome-opt.outcome-answered.selected    { background: #1d4ed8; }
.outcome-opt.outcome-interested.selected  { background: #15803d; }
.outcome-opt.outcome-not_interested.selected { background: #b91c1c; }
.outcome-opt.outcome-callback.selected    { background: #92400e; }
.outcome-opt.outcome-no_answer.selected   { background: #475569; }
.outcome-opt.outcome-voicemail.selected   { background: #7e22ce; }

/* ── Utilities ── */
.text-muted-sm { color: #94a3b8; font-size: .78rem; }
.fw-600 { font-weight: 600; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
