/* RedoLead ERP - Ana Stil Dosyası */
/* RedoGlobal © 2024 */

:root {
    --primary: #0d2c54;
    --primary-light: #1a4080;
    --primary-dark: #091e3a;
    --accent: #f47c20;
    --accent-light: #f9a05a;
    --accent-dark: #d4651a;
    --bg: #f4f6f9;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-w: 240px;
    --topbar-h: 60px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

/* ==================== LAYOUT ==================== */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .25s ease;
    overflow-y: auto;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title { font-weight: 700; font-size: 16px; flex: 1; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }

.page-content { padding: 24px; flex: 1; }

/* ==================== SIDEBAR ==================== */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-logo {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; color: white; font-size: 18px;
}

.brand-info { display: flex; flex-direction: column; }
.brand-name { color: white; font-weight: 700; font-size: 15px; line-height: 1; }
.brand-sub { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .5px; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section { margin-bottom: 8px; }
.nav-section-label { 
    display: block;
    padding: 6px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255,255,255,.75);
    border-radius: 0;
    transition: all .15s;
    font-size: 13.5px;
    position: relative;
}

.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: rgba(255,255,255,.12); color: white; font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }

.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-label { flex: 1; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}

.user-details { flex: 1; overflow: hidden; }
.user-name { display: block; color: white; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; color: rgba(255,255,255,.5); font-size: 10px; }
.logout-btn { color: rgba(255,255,255,.5); font-size: 18px; transition: color .15s; }
.logout-btn:hover { color: var(--danger); }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dark); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-whatsapp { background: #25d366; color: white; }
.btn-whatsapp:hover { background: #1da851; color: white; }
.btn-icon { padding: 7px 10px; }

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title { font-weight: 700; font-size: 15px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafafa; }

/* ==================== STAT CARDS ==================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }
.stat-card.primary::before { background: var(--primary); }

.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-sub { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.stat-icon { position: absolute; right: 16px; top: 16px; font-size: 22px; opacity: .3; }

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-very-hot { background: #fee2e2; color: #b91c1c; }
.badge-hot { background: #ffedd5; color: #c2410c; }
.badge-medium { background: #fef9c3; color: #a16207; }
.badge-cold { background: #dbeafe; color: #1d4ed8; }
.badge-no-website { background: #fee2e2; color: #b91c1c; }
.badge-website-ok { background: #d1fae5; color: #065f46; }
.badge-website-bad { background: #ffedd5; color: #c2410c; }
.badge-secondary { background: var(--border); color: var(--text-muted); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-accent { background: #fff7ed; color: var(--accent-dark); }

/* ==================== PIPELINE STAGES ==================== */
.stage-new { color: #3b82f6; }
.stage-reviewed { color: #8b5cf6; }
.stage-messaged { color: #f59e0b; }
.stage-called { color: #f97316; }
.stage-analysis { color: #06b6d4; }
.stage-meeting { color: #ec4899; }
.stage-offer { color: #f47c20; }
.stage-negotiating { color: #d97706; }
.stage-won { color: #10b981; }
.stage-lost { color: #ef4444; }
.stage-later { color: #9ca3af; }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text);
    background: white;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,44,84,.1); }
.form-control::placeholder { color: var(--text-light); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* ==================== TABLES ==================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr { transition: background .1s; }
tbody tr:hover { background: #f9fafb; }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }

/* ==================== PROGRESS BAR ==================== */
.progress { background: var(--border); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--accent); transition: width .5s ease; }
.progress-bar.success { background: var(--success); }
.progress-bar.danger { background: var(--danger); }

/* ==================== LEAD CARDS ==================== */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: box-shadow .15s, transform .1s;
}
.lead-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lead-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.lead-card-name { font-weight: 700; font-size: 14px; }
.lead-card-meta { font-size: 12px; color: var(--text-muted); }
.lead-card-info { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); }
.lead-card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ==================== SCORE DISPLAY ==================== */
.score-circle {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.score-very-hot { background: #fee2e2; color: #b91c1c; }
.score-hot { background: #ffedd5; color: #c2410c; }
.score-medium { background: #fef9c3; color: #a16207; }
.score-cold { background: #dbeafe; color: #1d4ed8; }

/* ==================== ALERTS ==================== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ==================== FILTERS ==================== */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }

/* ==================== KANBAN ==================== */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }

.kanban-col {
    min-width: 260px;
    max-width: 280px;
    background: #f1f5f9;
    border-radius: var(--radius);
    padding: 12px;
    flex-shrink: 0;
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
}

.kanban-col-count {
    background: var(--border);
    color: var(--text-muted);
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

.kanban-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow .15s;
}

.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card-name { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.kanban-card-meta { font-size: 11px; color: var(--text-muted); }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ==================== PIPELINE SELECT ==================== */
.stage-select {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    outline: none;
}

/* ==================== SEARCH RESULTS ==================== */
.search-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.search-result-info { flex: 1; }
.search-result-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.search-result-address { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.search-result-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--text-muted); }
.search-result-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-width: 120px; }

.rating-stars { color: #f59e0b; }

/* ==================== ACTIVITY LOG ==================== */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-body { flex: 1; }
.activity-type { font-weight: 600; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.activity-note { font-size: 13.5px; margin: 2px 0; }
.activity-date { font-size: 11px; color: var(--text-light); }

/* ==================== MESSAGE TEMPLATE ==================== */
.template-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--bg-card); }
.template-name { font-weight: 700; margin-bottom: 4px; }
.template-category { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.template-content { font-size: 13px; line-height: 1.6; background: #f9fafb; border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; margin-bottom: 10px; }
.template-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==================== LOADING ==================== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== EMPTY STATE ==================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.empty-desc { font-size: 13px; max-width: 360px; margin: 0 auto 20px; }

/* ==================== TOAST ==================== */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-md); font-size: 13.5px; max-width: 340px; display: flex; align-items: center; gap: 10px; animation: slideIn .25s ease; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
@keyframes slideIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    transform: scale(.96);
    transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ==================== SEARCH PAGE ==================== */
.search-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.search-example-btn {
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
    transition: all .15s;
}
.search-example-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ==================== DETAIL PAGE ==================== */
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-weight: 700; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.detail-item { }
.detail-label { font-size: 11px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.detail-value { font-size: 13.5px; font-weight: 500; margin-top: 2px; }

/* ==================== TABS ==================== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 0; }
.tab-btn { padding: 10px 18px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ==================== GRID ==================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.col-span-2 { grid-column: span 2; }

/* ==================== UTILITIES ==================== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }

/* ==================== LOGIN PAGE ==================== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--primary); padding: 20px; }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-mark { width: 60px; height: 60px; background: var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; color: white; margin: 0 auto 12px; }
.login-title { font-size: 22px; font-weight: 800; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .search-result-card { flex-direction: column; }
    .search-result-actions { align-items: flex-start; flex-direction: row; }
    .kanban-board { flex-direction: column; }
    .kanban-col { max-width: 100%; min-width: auto; }
}

@media (max-width: 480px) {
    .page-content { padding: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .card-header { flex-direction: column; align-items: flex-start; }
}

/* ===== LEADS TABLE ===== */
.score-bar-mini {
    width: 60px; height: 4px; background: #e9ecef; border-radius: 2px; margin-top: 2px;
}
.score-bar-mini div { height: 100%; border-radius: 2px; }

/* ===== PIPELINE TABLE ===== */
.stage-section { border-bottom: 1px solid #e9ecef; }
.stage-header { font-size: .9rem; }

/* ===== KANBAN ===== */
.kanban-wrapper { overflow-x: auto; padding-bottom: 12px; }
.kanban-board { display: flex; gap: 12px; min-width: max-content; align-items: flex-start; }
.kanban-col {
    width: 220px; min-height: 300px;
    background: #f8f9fa; border-radius: 8px; flex-shrink: 0;
}
.kanban-col-header {
    padding: 10px 12px; background: #fff;
    border-radius: 8px 8px 0 0; font-size: .85rem; font-weight: 600;
}
.kanban-cards { padding: 8px; min-height: 100px; }
.kanban-card {
    background: #fff; border: 1px solid #e9ecef; border-radius: 6px;
    padding: 10px; margin-bottom: 8px; cursor: grab; font-size: .82rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: box-shadow .15s;
}
.kanban-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.kanban-card:active { cursor: grabbing; }
.kanban-drop-target { background: #e8f0fe; border-radius: 0 0 8px 8px; }
.kanban-empty { text-align: center; color: #adb5bd; font-size: .8rem; padding: 20px 0; }
.btn-xs { padding: 2px 6px; font-size: 11px; }

/* ===== TEMPLATE CARDS ===== */
.template-card { transition: box-shadow .15s; }
.template-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

/* ===== ACTIVITY LOG ===== */
.activity-item { border-left: 3px solid #e67e22; padding: 8px 12px; margin-bottom: 8px; background: #fff8f0; border-radius: 0 6px 6px 0; }

/* ==================== BOOTSTRAP-LIKE MODAL FALLBACK ==================== */
.modal.fade {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    width: auto;
    max-width: none;
    max-height: none;
    overflow-y: auto;
    background: rgba(15, 23, 42, .55);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    padding: 24px;
    align-items: center;
    justify-content: center;
}
.modal.fade.show { display: flex !important; }
.modal.fade .modal-dialog { width: min(760px, 100%); margin: auto; }
.modal.fade .modal-content { background: #fff; border-radius: var(--radius); box-shadow: 0 24px 80px rgba(15,23,42,.25); overflow: hidden; }
.modal.fade .btn-close { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--text-muted); }
.modal-open { overflow: hidden; }
.form-text { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
