:root {
    --primary: #1a73e8;
    --primary-dark: #1a56db;
    --primary-light: #e8f0fe;
    --success: #34a853;
    --danger: #ea4335;
    --warning: #fbbc04;
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
}

body {
    font-size: 0.85rem;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Navbar ── */
.navbar-crm {
    background-color: var(--primary-dark);
    padding: 0 1rem;
    min-height: 48px;
}
.navbar-crm .navbar-brand {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0;
}
.navbar-crm .nav-link {
    color: rgba(255,255,255,.8);
    font-size: 0.85rem;
    padding: 0.65rem 0.9rem;
    transition: color .15s, background .15s;
    border-radius: 4px;
}
.navbar-crm .nav-link:hover,
.navbar-crm .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,.12);
}
.navbar-crm .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.85);
    font-size: 0.82rem;
}
.navbar-crm .nav-right a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
}
.navbar-crm .nav-right a:hover { color: #fff; }

/* ── Notification bell ── */
.bell-wrapper {
    position: relative;
    cursor: pointer;
}
.bell-wrapper .badge {
    position: absolute;
    top: -4px;
    right: -6px;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
}

/* ── Login ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}
.login-card {
    width: 380px;
    max-width: 92vw;
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.login-card h4 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ── Cards ── */
.card-crm {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card-crm .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
}

/* ── Summary stats ── */
.stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card .stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Status badges ── */
.badge-pending   { background-color: var(--warning); color: #333; }
.badge-approved  { background-color: var(--success); color: #fff; }
.badge-rejected  { background-color: var(--danger);  color: #fff; }

/* ── Follow-up stage ── */
.stage-bar {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}
.stage-bar .stage-step {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    transition: background .2s;
}
.stage-bar .stage-step.active { background: var(--primary); }
.stage-bar .stage-step.done   { background: var(--success); }

/* ── Follow-up timeline ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--border);
}
.timeline-item.type-initial  { background: #e3f2fd; }
.timeline-item.type-progress { background: #e8f5e9; }
.timeline-item.type-feedback { background: #fff8e1; }
.timeline-item .tl-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.timeline-item .tl-user {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* ── Table ── */
.table-crm th {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border);
}
.table-crm td {
    font-size: 0.82rem;
    vertical-align: middle;
}
.table-crm tbody tr { cursor: pointer; transition: background .1s; }
.table-crm tbody tr:hover { background: var(--primary-light); }

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    align-items: center;
}

/* ── Section panel ── */
.panel { display: none; }
.panel.active { display: block; }

/* ── Required marker ── */
.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 700;
}

/* ── Pagination ── */
.pagination-crm .page-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    color: var(--primary);
}
.pagination-crm .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .navbar-crm .nav-link { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
    .stat-card .stat-number { font-size: 1.2rem; }
    .filter-bar { flex-direction: column; }
}

/* ── Small button ── */
.btn-xs {
    padding: 1px 6px;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 3px;
}

/* ── Utilities ── */
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.text-primary-crm { color: var(--primary) !important; }
.btn-primary-crm {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary-crm:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* ── Notification dropdown ── */
.notification-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 1050;
    display: none;
}
.notification-dropdown.show { display: block; }
.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background .1s;
}
.notif-item:hover { background: var(--primary-light); }
.notif-item.unread { background: #f0f7ff; font-weight: 500; }
.notif-item .notif-time { font-size: 0.72rem; color: var(--text-secondary); }

/* ── Modal tweaks ── */
.modal-header { background: var(--primary); color: #fff; }
.modal-header .btn-close { filter: invert(1); }
