:root {
    --spm-primary:   #1a56db;
    --spm-dark:      #111827;
    --spm-sidebar-w: 230px;
    --spm-nav-h:     52px;
}

/* ── Base ─────────────────────────────────────────── */
body { background:#f3f4f8; font-size:.925rem; }

/* ── Navbar ───────────────────────────────────────── */
.spm-navbar {
    height: var(--spm-nav-h);
    background: var(--spm-dark);
    position: fixed; top:0; left:0; right:0; z-index:1040;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.spm-navbar .navbar-brand { font-size:1rem; letter-spacing:.02em; }

/* ── Layout ───────────────────────────────────────── */
.spm-body {
    margin-top: var(--spm-nav-h);
    min-height: calc(100vh - var(--spm-nav-h));
}
.spm-sidebar {
    width: var(--spm-sidebar-w);
    min-width: var(--spm-sidebar-w);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    top: var(--spm-nav-h);
    left: 0; bottom: 0;
    overflow-y: auto;
    transition: transform .25s ease;
    z-index: 1030;
}
.spm-main { margin-left: var(--spm-sidebar-w); transition: margin .25s ease; }
.spm-content { padding: 1.5rem; }

/* ── Sidebar nav ─────────────────────────────────── */
.spm-sidebar .nav-link {
    color: #374151;
    padding: .55rem 1rem;
    border-radius: 6px;
    margin: 1px 8px;
    display: flex; align-items: center; gap: 10px;
    font-size: .875rem; font-weight: 500;
    transition: background .15s, color .15s;
}
.spm-sidebar .nav-link i { font-size: 1rem; width: 18px; }
.spm-sidebar .nav-link:hover { background: #f0f4ff; color: var(--spm-primary); }
.spm-sidebar .nav-link.active { background: #e8effd; color: var(--spm-primary); font-weight:600; }
.spm-sidebar .nav-link.active i { color: var(--spm-primary); }

/* ── Sidebar collapsed ───────────────────────────── */
body.sidebar-collapsed .spm-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .spm-main    { margin-left: 0; }

/* ── Cards ───────────────────────────────────────── */
.spm-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.stat-card .stat-num { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: .8rem; color: #6b7280; }

/* ── Avatar circle ────────────────────────────────── */
.avatar-circle {
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; flex-shrink: 0;
}

/* ── Notification badge ──────────────────────────── */
.notif-badge { font-size:.6rem; min-width:16px; height:16px; padding:0 4px; line-height:16px; }

/* ── Notification dropdown ───────────────────────── */
.notif-dropdown .notif-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: .65rem 1rem; border-bottom: 1px solid #f3f4f6;
    text-decoration: none; color: inherit;
    transition: background .1s;
}
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { background: #f0f4ff; }
.notif-item .notif-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; flex-shrink: 0;
}

/* ── Page header ─────────────────────────────────── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.page-header h1 { font-size: 1.35rem; font-weight: 700; margin: 0; color: #111827; }
.page-breadcrumb { font-size: .8rem; color: #6b7280; margin-top: 2px; }

/* ── Priority/Status colors ──────────────────────── */
.priority-urgent { border-left: 3px solid #ef4444 !important; }
.priority-high   { border-left: 3px solid #f59e0b !important; }
.priority-medium { border-left: 3px solid #3b82f6 !important; }
.priority-low    { border-left: 3px solid #10b981 !important; }

/* ── Task card ────────────────────────────────────── */
.task-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 10px; padding: 1rem 1.2rem;
    transition: box-shadow .15s;
}
.task-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.task-card .task-title { font-weight: 600; color: #111827; text-decoration: none; }
.task-card .task-title:hover { color: var(--spm-primary); }

/* ── Progress bar thin ────────────────────────────── */
.progress-xs { height: 6px; }

/* ── Table ────────────────────────────────────────── */
.table-clean { border: none; }
.table-clean thead th {
    background: #f9fafb; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em;
    color: #6b7280; border-bottom: 1px solid #e5e7eb;
    font-weight: 600; padding: .65rem 1rem;
}
.table-clean td { padding: .75rem 1rem; border-color: #f3f4f6; vertical-align: middle; }
.table-clean tr:last-child td { border-bottom: 0; }

/* ── Form ─────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .875rem; color: #374151; margin-bottom: .35rem; }
.form-control, .form-select {
    border: 1px solid #d1d5db; border-radius: 7px;
    font-size: .9rem; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--spm-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ── Buttons ─────────────────────────────────────── */
.btn { border-radius: 7px; font-size: .875rem; font-weight: 500; }
.btn-primary { background: var(--spm-primary); border-color: var(--spm-primary); }
.btn-primary:hover { background: #1648c0; border-color: #1648c0; }

/* ── Search bar ───────────────────────────────────── */
.search-bar { position: relative; }
.search-bar .form-control { padding-left: 2.2rem; }
.search-bar .bi-search { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }

/* ── WhatsApp indicator ──────────────────────────── */
.wa-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .78rem; padding: 3px 8px; border-radius: 20px;
}
.wa-status-badge.enabled  { background: #d1fae5; color: #065f46; }
.wa-status-badge.disabled { background: #fee2e2; color: #991b1b; }

/* ── Timeline (task updates) ──────────────────────── */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before {
    content: ''; position: absolute;
    left: 15px; top: 0; bottom: 0; width: 2px; background: #e5e7eb;
}
.timeline-item { display: flex; gap: 12px; margin-bottom: 1rem; position: relative; }
.timeline-dot {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; z-index: 1; font-size: .85rem;
}
.timeline-body {
    background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 8px; padding: .65rem .9rem; flex: 1;
}

/* ── Login page ────────────────────────────────────── */
.login-page { background: linear-gradient(135deg, #111827 0%, #1a56db 100%); min-height: 100vh; }
.login-card {
    background: #fff; border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,.3);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .spm-sidebar { transform: translateX(-100%); }
    .spm-main    { margin-left: 0; }
    body.sidebar-open .spm-sidebar { transform: translateX(0); }
    .spm-content { padding: 1rem; }
    .stat-card .stat-num { font-size: 1.4rem; }
}

/* ── Utilities ───────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.border-dashed { border-style: dashed !important; }
.fs-7 { font-size: .78rem; }
