/* === CarlCRM - Pico CSS Overrides === */

/* Layout */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.page-header h1 { margin-bottom: 0; }

/* Login */
.login-container { max-width: 420px; margin: 2rem auto; }
.error-message { color: var(--pico-del-color); font-weight: 600; }
.required { color: var(--pico-del-color); }

/* Tables: tight padding + sticky header */
.table-wrapper { overflow-x: auto; }
table th, table td { padding: 0.5rem 0.75rem; }
thead th { position: sticky; top: 0; background: var(--pico-card-background-color); z-index: 1; }
thead th a { text-decoration: none; white-space: nowrap; }
tbody tr:hover { background: var(--pico-card-sectioning-background-color); }

/* Action cells */
.actions { white-space: nowrap; }
.btn-small {
    display: inline-block; padding: 0.25rem 0.6rem; font-size: 0.8rem;
    border-radius: 4px; cursor: pointer; border: 1px solid var(--pico-primary);
    background: transparent; color: var(--pico-primary); text-decoration: none; line-height: 1.5;
}
.btn-small:hover { background: var(--pico-primary); color: #fff; }
.btn-danger { border-color: var(--pico-del-color); color: var(--pico-del-color); }
.btn-danger:hover { background: var(--pico-del-color); color: #fff; }

/* Badges (shared base) */
.badge {
    display: inline-block; padding: 0.15rem 0.5rem; border-radius: 12px;
    font-size: 0.78rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
}

/* Deal stage badges */
.stage-lead        { background: #6b7280; color: #fff; }
.stage-contacted   { background: #3b82f6; color: #fff; }
.stage-qualified   { background: #06b6d4; color: #fff; }
.stage-proposal    { background: #f59e0b; color: #fff; }
.stage-negotiation { background: #8b5cf6; color: #fff; }
.stage-won         { background: #10b981; color: #fff; }
.stage-lost        { background: #ef4444; color: #fff; }

/* Task priority badges */
.priority-low    { background: #d1d5db; color: #374151; }
.priority-medium { background: #fbbf24; color: #374151; }
.priority-high   { background: #f97316; color: #fff; }
.priority-urgent { background: #ef4444; color: #fff; }

/* Task status badges */
.status-open        { background: #3b82f6; color: #fff; }
.status-in_progress { background: #8b5cf6; color: #fff; }
.status-done        { background: #10b981; color: #fff; }
.status-cancelled   { background: #6b7280; color: #fff; }

/* Interaction type badges */
.interaction-note    { background: #6b7280; color: #fff; }
.interaction-email   { background: #3b82f6; color: #fff; }
.interaction-call    { background: #10b981; color: #fff; }
.interaction-meeting { background: #8b5cf6; color: #fff; }

/* Overdue highlight */
.overdue { color: #ef4444; font-weight: 600; }

/* Dashboard stats */
.stat-number { font-size: 2.2rem; font-weight: 700; margin: 0.5rem 0; }
.stat-subtitle { display: block; color: var(--pico-muted-color); }
.stat-warning { color: #ef4444; }

/* Pipeline chart */
.pipeline-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.pipeline-bar-wrapper { display: grid; grid-template-columns: 100px 1fr 90px; align-items: center; gap: 0.5rem; }
.pipeline-label { text-align: right; font-size: 0.85rem; font-weight: 500; }
.pipeline-bar-track { background: var(--pico-card-sectioning-background-color); border-radius: 4px; height: 1.6rem; overflow: hidden; }
.pipeline-bar {
    height: 100%; border-radius: 4px; min-width: 2rem;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.8rem; font-weight: 600;
}
.pipeline-value { font-size: 0.85rem; color: var(--pico-muted-color); }

/* Toast notifications */
.toast { position: relative; padding: 0.75rem 2.5rem 0.75rem 1rem; margin-bottom: 1rem; border-radius: 6px; animation: toast-in 0.3s ease-out; }
.toast-success { border-left: 4px solid #10b981; }
.toast-error   { border-left: 4px solid #ef4444; }
.toast-close {
    position: absolute; top: 0.5rem; right: 0.5rem; background: none; border: none;
    font-size: 1.1rem; cursor: pointer; padding: 0; margin: 0; width: auto; color: inherit;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Search bar */
.search-bar { margin-bottom: 1rem; }
.search-bar input[type="search"] { margin-bottom: 0; }

/* Form actions */
.form-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--pico-muted-color); }

/* Pagination */
.pagination ul { display: flex; justify-content: center; gap: 0.25rem; list-style: none; padding: 0; margin: 1.5rem 0; }
.pagination a, .pagination span { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.pagination .disabled { opacity: 0.4; cursor: default; }
