/* ==========================================================================
   Social Bloom Workflow CRM — Design System
   Brand tokens extracted from socialbloom.io (primary #5F5FFF, secondary
   #2A3282, accent #10B99A, Figtree typeface, 16px card radius, colored-glow
   button shadows). Loaded after bootstrap.min.css — Bootstrap supplies grid,
   flex/spacing utilities and JS-driven behavior (modal/dropdown/tab), every
   visible component below is deliberately overridden to the brand system.
   ========================================================================== */

@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../vendor/fonts/figtree/figtree-variable.woff2') format('woff2');
}

:root {
    /* ---- Brand ---- */
    --sb-primary: #5F5FFF;
    --sb-primary-dark: #4A47E0;
    --sb-primary-darker: #2A3282;
    --sb-primary-light: #EEF0FF;
    --sb-primary-lighter: #F5F6FF;
    --sb-secondary: #2A3282;
    --sb-accent: #10B99A;
    --sb-accent-light: #E3F9F4;
    --sb-accent-dark: #0C8F76;

    /* ---- Neutrals (navy-tinted, matches the site's --text/--border system) ---- */
    --sb-text: #0D1B2A;
    --sb-text-secondary: rgba(13, 27, 42, .58);
    --sb-text-muted: rgba(13, 27, 42, .38);
    --sb-text-inverse: #FFFFFF;
    --sb-border: rgba(42, 50, 130, .10);
    --sb-border-strong: rgba(42, 50, 130, .20);
    --sb-bg-card: #FFFFFF;
    --sb-bg-tint: rgba(42, 50, 130, .04);
    --sb-bg-page: #F7F8FC;
    --sb-bg-sidebar: #14163A;
    --sb-bg-sidebar-hover: rgba(255, 255, 255, .08);
    --sb-bg-sidebar-active: rgba(95, 95, 255, .22);

    /* ---- Semantic status (harmonized with brand) ---- */
    --sb-success: #10B99A;
    --sb-success-light: #E3F9F4;
    --sb-warning: #F5A524;
    --sb-warning-light: #FEF3DE;
    --sb-danger: #EF4459;
    --sb-danger-light: #FDE8EC;
    --sb-info: #5F5FFF;
    --sb-info-light: #EEF0FF;
    --sb-neutral: #64748B;
    --sb-neutral-light: #F1F3F8;

    /* ---- Radius ---- */
    --sb-radius-sm: 8px;
    --sb-radius-md: 12px;
    --sb-radius-lg: 16px;
    --sb-radius-xl: 22px;
    --sb-radius-pill: 999px;

    /* ---- Shadows ---- */
    --sb-shadow-xs: 0 1px 2px rgba(13, 27, 42, .05);
    --sb-shadow-sm: 0 2px 8px rgba(13, 27, 42, .06);
    --sb-shadow-md: 0 8px 24px rgba(13, 27, 42, .08);
    --sb-shadow-lg: 0 16px 40px rgba(13, 27, 42, .12);
    --sb-shadow-glow: 0 4px 16px rgba(95, 95, 255, .35);
    --sb-shadow-glow-lg: 0 8px 28px rgba(95, 95, 255, .38);

    --sb-font: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

html, body {
    font-family: var(--sb-font);
    background: var(--sb-bg-page);
    color: var(--sb-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sb-font);
    font-weight: 700;
    color: var(--sb-text);
    letter-spacing: -0.01em;
}

a { color: var(--sb-primary); }
a:hover { color: var(--sb-primary-dark); }

.text-muted { color: var(--sb-text-muted) !important; }
.text-secondary-sb { color: var(--sb-text-secondary); }

::selection { background: var(--sb-primary-light); color: var(--sb-primary-darker); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(42, 50, 130, .18); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(42, 50, 130, .3); }

/* ==========================================================================
   App shell — sidebar + topbar
   ========================================================================== */

.sbcrm-sidebar {
    background: var(--sb-bg-sidebar);
    background-image:
        radial-gradient(720px circle at 0% 0%, rgba(95, 95, 255, .35), transparent 55%),
        radial-gradient(480px circle at 100% 100%, rgba(16, 185, 154, .12), transparent 60%);
    color: #E4E6F5;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sbcrm-sidebar .brand {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.sbcrm-sidebar .brand img { height: 28px; width: auto; display: block; }

.sbcrm-sidebar .nav-section-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(228, 230, 245, .38);
    padding: .5rem .75rem .35rem;
    margin-top: .5rem;
}

.sbcrm-sidebar .nav-link {
    color: rgba(228, 230, 245, .78);
    font-weight: 500;
    font-size: .92rem;
    border-radius: var(--sb-radius-sm);
    padding: .6rem .75rem;
    display: flex;
    align-items: center;
    transition: background .15s ease, color .15s ease;
}

.sbcrm-sidebar .nav-link i { font-size: 1rem; width: 1.35rem; opacity: .9; }

.sbcrm-sidebar .nav-link:hover {
    color: #fff;
    background: var(--sb-bg-sidebar-hover);
}

.sbcrm-sidebar .nav-link.active {
    color: #fff;
    background: var(--sb-bg-sidebar-active);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(95, 95, 255, .35);
}

.sbcrm-topbar {
    background: rgba(247, 248, 252, .85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--sb-border);
    padding: .85rem 1.5rem;
}

.sbcrm-topbar .page-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--sb-text);
}

.sbcrm-main { padding: 1.75rem 2rem 3rem; max-width: 1440px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    font-family: var(--sb-font);
    font-weight: 600;
    font-size: .875rem;
    border-radius: var(--sb-radius-sm);
    padding: .55rem 1.1rem;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
    letter-spacing: -0.005em;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--sb-primary);
    border-color: var(--sb-primary);
    box-shadow: var(--sb-shadow-glow);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--sb-primary-dark);
    border-color: var(--sb-primary-dark);
    box-shadow: var(--sb-shadow-glow-lg);
}
.btn-primary:disabled, .btn-primary.disabled { background: var(--sb-primary); opacity: .5; box-shadow: none; }

.btn-outline-primary {
    color: var(--sb-primary);
    border-color: var(--sb-border-strong);
    background: #fff;
}
.btn-outline-primary:hover {
    background: var(--sb-primary-light);
    border-color: var(--sb-primary);
    color: var(--sb-primary-dark);
}

.btn-outline-secondary {
    color: var(--sb-text-secondary);
    border-color: var(--sb-border-strong);
    background: #fff;
}
.btn-outline-secondary:hover { background: var(--sb-bg-tint); color: var(--sb-text); border-color: var(--sb-border-strong); }

.btn-outline-danger { color: var(--sb-danger); border-color: rgba(239, 68, 89, .3); background: #fff; }
.btn-outline-danger:hover { background: var(--sb-danger-light); border-color: var(--sb-danger); color: var(--sb-danger); }

.btn-outline-warning { color: #B7791F; border-color: rgba(245, 165, 36, .35); background: #fff; }
.btn-outline-warning:hover { background: var(--sb-warning-light); border-color: var(--sb-warning); color: #92600F; }

.btn-danger { background: var(--sb-danger); border-color: var(--sb-danger); box-shadow: 0 4px 14px rgba(239, 68, 89, .3); }
.btn-danger:hover { background: #D93A50; border-color: #D93A50; }

.btn-light { background: var(--sb-bg-tint); border-color: transparent; color: var(--sb-text); }
.btn-light:hover { background: var(--sb-border); }

.btn-sm { padding: .38rem .75rem; font-size: .8rem; border-radius: var(--sb-radius-sm); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-label { font-weight: 600; font-size: .82rem; color: var(--sb-text); margin-bottom: .35rem; }

.form-control, .form-select {
    font-family: var(--sb-font);
    border: 1.5px solid var(--sb-border-strong);
    border-radius: var(--sb-radius-sm);
    padding: .55rem .8rem;
    font-size: .9rem;
    color: var(--sb-text);
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 4px var(--sb-primary-light);
}

.form-control::placeholder { color: var(--sb-text-muted); }
.form-text { color: var(--sb-text-muted); font-size: .78rem; }

.form-check-input { border-color: var(--sb-border-strong); width: 1.1em; height: 1.1em; }
.form-check-input:checked { background-color: var(--sb-primary); border-color: var(--sb-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--sb-primary-light); }
.form-check-label { font-size: .88rem; color: var(--sb-text-secondary); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    box-shadow: var(--sb-shadow-xs);
    background: var(--sb-bg-card);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--sb-border);
    font-weight: 700;
    font-size: .92rem;
    padding: 1rem 1.25rem;
    border-top-left-radius: var(--sb-radius-lg) !important;
    border-top-right-radius: var(--sb-radius-lg) !important;
}

.card-body { padding: 1.25rem; }

.shadow-sm { box-shadow: var(--sb-shadow-sm) !important; }

/* KPI / stat card */
.stat-card {
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    background: var(--sb-bg-card);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--sb-shadow-xs);
    transition: box-shadow .18s ease, transform .18s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { box-shadow: var(--sb-shadow-md); transform: translateY(-2px); }
.stat-card .stat-label {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sb-text-muted);
    margin-bottom: .5rem;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--sb-text); }
.stat-card .stat-icon {
    position: absolute; top: 1.1rem; right: 1.1rem;
    width: 40px; height: 40px; border-radius: var(--sb-radius-sm);
    display: flex; align-items: center; justify-content: center;
    background: var(--sb-primary-light); color: var(--sb-primary);
    font-size: 1.05rem;
}
.stat-card .stat-trend { font-size: .78rem; font-weight: 600; margin-top: .35rem; }

/* Icon badge (used for feature rows / step markers, small rounded-square) */
.icon-badge {
    width: 38px; height: 38px; border-radius: var(--sb-radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sb-primary-light); color: var(--sb-primary);
    flex-shrink: 0; font-size: 1rem;
}
.icon-badge.icon-badge-success { background: var(--sb-accent-light); color: var(--sb-accent-dark); }
.icon-badge.icon-badge-warning { background: var(--sb-warning-light); color: #92600F; }
.icon-badge.icon-badge-danger { background: var(--sb-danger-light); color: var(--sb-danger); }
.icon-badge.icon-badge-neutral { background: var(--sb-neutral-light); color: var(--sb-neutral); }

/* Avatar (initials-based, used in topbar + timeline) */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 700; flex-shrink: 0;
    background: var(--sb-primary-light); color: var(--sb-primary-darker);
    font-size: .8rem;
}
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar-md { width: 38px; height: 38px; font-size: .85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-admin { background: linear-gradient(135deg, var(--sb-primary), var(--sb-secondary)); color: #fff; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table {
    --bs-table-bg: transparent;
    font-size: .875rem;
    color: var(--sb-text);
    margin-bottom: 0;
}
.table thead th {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sb-text-muted);
    background: var(--sb-bg-tint);
    border-bottom: 1px solid var(--sb-border);
    padding: .8rem 1rem;
}
.table td { padding: .85rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--sb-border); }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--sb-bg-tint); }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ==========================================================================
   Badges / status pills
   ========================================================================== */

.badge {
    font-family: var(--sb-font);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .01em;
    padding: .34em .7em;
    border-radius: var(--sb-radius-pill);
}

.badge.bg-primary { background: var(--sb-primary-light) !important; color: var(--sb-primary-darker) !important; }
.badge.bg-secondary { background: var(--sb-neutral-light) !important; color: var(--sb-neutral) !important; }
.badge.bg-success { background: var(--sb-accent-light) !important; color: var(--sb-accent-dark) !important; }
.badge.bg-danger { background: var(--sb-danger-light) !important; color: var(--sb-danger) !important; }
.badge.bg-warning { background: var(--sb-warning-light) !important; color: #92600F !important; }
.badge.bg-info { background: var(--sb-info-light) !important; color: var(--sb-primary-darker) !important; }
.badge.bg-light { background: var(--sb-bg-tint) !important; color: var(--sb-text-secondary) !important; }
.badge.bg-dark { background: var(--sb-text) !important; color: #fff !important; }

.badge-priority-Urgent { background: var(--sb-danger-light) !important; color: var(--sb-danger) !important; }
.badge-priority-High { background: #FFE8DA !important; color: #C2410C !important; }
.badge-priority-Medium { background: var(--sb-primary-light) !important; color: var(--sb-primary-darker) !important; }
.badge-priority-Low { background: var(--sb-neutral-light) !important; color: var(--sb-neutral) !important; }

/* Workflow step status pill */
.status-pill { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .72rem; padding: .3em .75em .3em .55em; border-radius: var(--sb-radius-pill); }
.status-pill i { font-size: .85rem; }
.status-pill.status-done { background: var(--sb-accent-light); color: var(--sb-accent-dark); }
.status-pill.status-inprogress { background: var(--sb-primary-light); color: var(--sb-primary-darker); }
.status-pill.status-notstarted { background: var(--sb-neutral-light); color: var(--sb-neutral); }
.status-pill.status-blocked { background: var(--sb-danger-light); color: var(--sb-danger); }
.status-pill.status-na { background: var(--sb-bg-tint); color: var(--sb-text-muted); }
.status-pill.status-locked { background: var(--sb-bg-tint); color: var(--sb-text-muted); }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    border: 1px solid transparent;
    border-radius: var(--sb-radius-md);
    font-size: .875rem;
    padding: .85rem 1.1rem;
}
.alert-success { background: var(--sb-accent-light); color: var(--sb-accent-dark); border-color: rgba(16, 185, 154, .2); }
.alert-danger { background: var(--sb-danger-light); color: var(--sb-danger); border-color: rgba(239, 68, 89, .2); }
.alert-warning { background: var(--sb-warning-light); color: #92600F; border-color: rgba(245, 165, 36, .25); }
.alert-info { background: var(--sb-info-light); color: var(--sb-primary-darker); border-color: rgba(95, 95, 255, .2); }

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-content { border: none; border-radius: var(--sb-radius-lg); box-shadow: var(--sb-shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--sb-border); padding: 1.1rem 1.4rem; }
.modal-header .modal-title { font-weight: 700; font-size: 1.02rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top: 1px solid var(--sb-border); padding: 1rem 1.4rem; }
.modal-backdrop.show { opacity: .55; background: var(--sb-text); }

/* ==========================================================================
   Nav tabs / pills
   ========================================================================== */

.nav-tabs { border-bottom: 1px solid var(--sb-border); gap: .25rem; }
.nav-tabs .nav-link {
    border: none; color: var(--sb-text-secondary); font-weight: 600; font-size: .875rem;
    padding: .65rem 1rem; border-radius: var(--sb-radius-sm) var(--sb-radius-sm) 0 0;
}
.nav-tabs .nav-link:hover { background: var(--sb-bg-tint); color: var(--sb-text); }
.nav-tabs .nav-link.active { color: var(--sb-primary); background: var(--sb-primary-light); border: none; }

.nav-pills .nav-link { color: var(--sb-text-secondary); font-weight: 600; font-size: .875rem; border-radius: var(--sb-radius-sm); }
.nav-pills .nav-link.active { background: var(--sb-primary); color: #fff; }

/* ==========================================================================
   Notifications dropdown
   ========================================================================== */

.notif-bell-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sb-bg-tint); border: 1px solid var(--sb-border); color: var(--sb-text-secondary);
}
.notif-bell-btn:hover { background: var(--sb-primary-light); color: var(--sb-primary); }
.notif-item {
    border-radius: var(--sb-radius-sm); padding: .65rem .7rem;
    /* Bootstrap's .dropdown-item sets white-space:nowrap for typical short menu
       labels; notification titles are full sentences and need to wrap instead
       of overflowing past the dropdown's fixed width. */
    white-space: normal;
}
.notif-item.unread { background: var(--sb-primary-lighter); }
.notif-item .notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sb-primary); display: inline-block; margin-right: .4rem; }

/* ==========================================================================
   File upload / dropzone
   ========================================================================== */

.dropzone {
    border: 2px dashed var(--sb-border-strong);
    border-radius: var(--sb-radius-md);
    background: var(--sb-bg-tint);
    padding: 1.75rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--sb-primary);
    background: var(--sb-primary-light);
}
.dropzone .dropzone-icon { font-size: 1.8rem; color: var(--sb-primary); margin-bottom: .5rem; }
.dropzone .dropzone-title { font-weight: 700; font-size: .9rem; color: var(--sb-text); }
.dropzone .dropzone-sub { font-size: .78rem; color: var(--sb-text-muted); margin-top: .2rem; }
.dropzone input[type="file"] { display: none; }

.file-preview-list { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.file-preview-item {
    display: flex; align-items: center; gap: .5rem;
    border: 1px solid var(--sb-border); border-radius: var(--sb-radius-sm);
    background: #fff; padding: .4rem .6rem .4rem .4rem; font-size: .78rem; max-width: 220px;
}
.file-preview-item .file-thumb {
    width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--sb-bg-tint);
    display: flex; align-items: center; justify-content: center; color: var(--sb-primary); font-size: .9rem;
}
.file-preview-item .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--sb-text); }
.file-preview-item .file-remove { color: var(--sb-text-muted); cursor: pointer; border: none; background: none; padding: 0 .2rem; }
.file-preview-item .file-remove:hover { color: var(--sb-danger); }

.upload-progress { height: 5px; border-radius: 999px; background: var(--sb-border); overflow: hidden; margin-top: .5rem; }
.upload-progress .upload-progress-bar { height: 100%; background: var(--sb-primary); width: 0%; transition: width .2s ease; }

/* ==========================================================================
   Progress bars
   ========================================================================== */

.progress { height: 8px; border-radius: 999px; background: var(--sb-border); overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--sb-primary), var(--sb-accent)); }

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline { position: relative; }
.timeline-entry {
    position: relative;
    padding: 0 0 1.5rem 2.75rem;
    border-left: 2px solid var(--sb-border);
    margin-left: 18px;
}
.timeline-entry:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-entry .timeline-avatar {
    position: absolute; left: -19px; top: 0;
    box-shadow: 0 0 0 4px var(--sb-bg-page);
}
.timeline-card {
    background: var(--sb-bg-card); border: 1px solid var(--sb-border); border-radius: var(--sb-radius-md);
    padding: .9rem 1.05rem; box-shadow: var(--sb-shadow-xs);
}
.timeline-card .timeline-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.timeline-card .timeline-user { font-weight: 700; font-size: .87rem; color: var(--sb-text); }
.timeline-card .timeline-role { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sb-text-muted); }
.timeline-card .timeline-meta { font-size: .74rem; color: var(--sb-text-muted); }
.timeline-card .timeline-diff { font-size: .8rem; margin: .4rem 0; }
.timeline-card .timeline-diff code { background: var(--sb-bg-tint); border-radius: 5px; padding: .1rem .4rem; color: var(--sb-secondary); font-size: .76rem; }
.timeline-card .timeline-comment { font-size: .85rem; color: var(--sb-text-secondary); margin-top: .3rem; white-space: pre-wrap; }
.timeline-card .timeline-files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.timeline-file-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--sb-bg-tint); border-radius: var(--sb-radius-pill);
    padding: .28rem .65rem; font-size: .72rem; font-weight: 600; color: var(--sb-secondary); text-decoration: none;
}
.timeline-file-chip:hover { background: var(--sb-primary-light); color: var(--sb-primary-darker); }
.timeline-action-tag { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .18rem .55rem; border-radius: var(--sb-radius-pill); }
.timeline-action-tag.tag-create { background: var(--sb-accent-light); color: var(--sb-accent-dark); }
.timeline-action-tag.tag-update, .timeline-action-tag.tag-status_change { background: var(--sb-primary-light); color: var(--sb-primary-darker); }
.timeline-action-tag.tag-admin_override, .timeline-action-tag.tag-correction { background: var(--sb-warning-light); color: #92600F; }
.timeline-action-tag.tag-approval { background: var(--sb-accent-light); color: var(--sb-accent-dark); }
.timeline-action-tag.tag-migration_seed { background: var(--sb-neutral-light); color: var(--sb-neutral); }

/* ==========================================================================
   Workflow step cards
   ========================================================================== */

.stage-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--sb-primary); margin: 1.75rem 0 .6rem; display: flex; align-items: center; gap: .5rem;
}
.stage-label::after { content: ''; flex: 1; height: 1px; background: var(--sb-border); }
.stage-label:first-child { margin-top: 0; }

.step-item {
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-md);
    padding: 1rem 1.15rem;
    margin-bottom: .65rem;
    background: var(--sb-bg-card);
    box-shadow: var(--sb-shadow-xs);
    transition: box-shadow .15s ease, border-color .15s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.step-item:hover { box-shadow: var(--sb-shadow-sm); border-color: var(--sb-border-strong); }

.step-item .step-status-icon {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.step-item.step-done .step-status-icon { background: var(--sb-accent-light); color: var(--sb-accent-dark); }
.step-item.step-inprogress .step-status-icon { background: var(--sb-primary-light); color: var(--sb-primary); }
.step-item.step-blocked .step-status-icon { background: var(--sb-danger-light); color: var(--sb-danger); }
.step-item.step-locked .step-status-icon { background: var(--sb-neutral-light); color: var(--sb-text-muted); }
.step-item.step-notstarted .step-status-icon { background: var(--sb-neutral-light); color: var(--sb-text-muted); }
.step-item.step-na .step-status-icon { background: var(--sb-bg-tint); color: var(--sb-text-muted); }

.step-item.step-done { background: linear-gradient(0deg, var(--sb-accent-light) 0%, #fff 4%); }
.step-item.step-locked { opacity: .68; }
.step-item.step-blocked { border-color: rgba(239, 68, 89, .25); }

.step-item .step-name { font-weight: 700; font-size: .92rem; color: var(--sb-text); }
.step-item .step-desc { font-size: .78rem; color: var(--sb-text-muted); margin-top: .1rem; }
.step-item .step-meta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .5rem; font-size: .74rem; color: var(--sb-text-secondary); }
.step-item .step-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.step-item .step-meta i { font-size: .8rem; color: var(--sb-text-muted); }

/* ==========================================================================
   Empty / loading / error states
   ========================================================================== */

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--sb-text-muted); }
.empty-state .empty-icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--sb-bg-tint); color: var(--sb-primary);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.6rem;
}
.empty-state .empty-title { font-weight: 700; color: var(--sb-text); font-size: .95rem; margin-bottom: .25rem; }
.empty-state .empty-sub { font-size: .82rem; }

.error-state { text-align: center; padding: 3rem 1.5rem; }
.error-state .empty-icon { background: var(--sb-danger-light); color: var(--sb-danger); }

.skeleton {
    background: linear-gradient(90deg, var(--sb-bg-tint) 25%, var(--sb-border) 37%, var(--sb-bg-tint) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--sb-radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.spinner-brand {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2.5px solid var(--sb-primary-light); border-top-color: var(--sb-primary);
    animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Login / auth screens
   ========================================================================== */

.auth-shell {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--sb-bg-sidebar);
    background-image:
        radial-gradient(900px circle at 15% 10%, rgba(95, 95, 255, .5), transparent 55%),
        radial-gradient(700px circle at 90% 90%, rgba(16, 185, 154, .25), transparent 55%);
    padding: 2rem 1rem;
}
.auth-card {
    background: #fff; border-radius: var(--sb-radius-xl); box-shadow: var(--sb-shadow-lg);
    padding: 2.5rem; width: 100%; max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { height: 34px; }

.password-input-group { position: relative; }
.password-input-group .form-control { padding-right: 2.8rem; }
.password-toggle-btn {
    position: absolute; top: 50%; right: .4rem; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; background: transparent; border-radius: var(--sb-radius-sm);
    color: var(--sb-text-muted); display: flex; align-items: center; justify-content: center; font-size: 1rem;
    transition: background .12s ease, color .12s ease;
}
.password-toggle-btn:hover { background: var(--sb-bg-tint); color: var(--sb-text-secondary); }

/* ==========================================================================
   Misc utilities
   ========================================================================== */

.hover-lift { transition: transform .15s ease, box-shadow .15s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--sb-shadow-md); }

.divider-label {
    display: flex; align-items: center; gap: .75rem; color: var(--sb-text-muted);
    font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 1.5rem 0 1rem;
}
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--sb-border); }

@media (max-width: 991px) {
    .sbcrm-main { padding: 1.25rem 1rem 2rem; }
}

/* ==========================================================================
   Employee Operations Workspace — additive only, used exclusively by
   public/employee/dashboard.php. No rule above this point is modified.
   ========================================================================== */

.workspace-section-title {
    font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--sb-text-muted); display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem;
}
.workspace-section-title i { color: var(--sb-primary); font-size: .95rem; }
.workspace-section-title .count-chip {
    background: var(--sb-primary-light); color: var(--sb-primary-darker); border-radius: 999px;
    font-size: .68rem; font-weight: 700; padding: .1rem .5rem; text-transform: none; letter-spacing: 0;
}

/* Continue Previous Work banner */
.continue-banner {
    background: linear-gradient(120deg, var(--sb-primary-darker), var(--sb-primary));
    border-radius: var(--sb-radius-lg); color: #fff; padding: 1.1rem 1.4rem;
    display: flex; align-items: center; gap: 1rem; box-shadow: var(--sb-shadow-glow);
}
.continue-banner .cb-icon { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.continue-banner .cb-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.continue-banner .cb-title { font-weight: 700; font-size: 1rem; }
.continue-banner .cb-sub { font-size: .8rem; opacity: .85; }
.continue-banner .btn-light { background: #fff; color: var(--sb-primary-darker); border: none; font-weight: 700; }
.continue-banner .btn-light:hover { background: #f0f0ff; }

/* Hero work-queue card (#1 priority) */
.hero-work-card {
    border-radius: var(--sb-radius-lg); padding: 1.5rem; position: relative; overflow: hidden;
    background: var(--sb-bg-card); border: 1px solid var(--sb-border); box-shadow: var(--sb-shadow-sm);
}
.hero-work-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--sb-primary), var(--sb-accent));
}
.hero-work-card .hwc-eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sb-primary); }
.hero-work-card .hwc-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; margin: .25rem 0; }
.hero-work-card .hwc-sub { color: var(--sb-text-secondary); font-size: .88rem; }

/* Compact priority queue rows below the hero */
.queue-row {
    display: flex; align-items: center; gap: .85rem; padding: .75rem .9rem;
    border: 1px solid var(--sb-border); border-radius: var(--sb-radius-md); background: var(--sb-bg-card);
    margin-bottom: .55rem; transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.queue-row:hover { border-color: var(--sb-border-strong); box-shadow: var(--sb-shadow-xs); transform: translateX(2px); }
.queue-row .qr-rank {
    width: 26px; height: 26px; border-radius: 50%; background: var(--sb-bg-tint); color: var(--sb-text-muted);
    font-size: .74rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.queue-row .qr-title { font-weight: 600; font-size: .87rem; color: var(--sb-text); }
.queue-row .qr-sub { font-size: .76rem; color: var(--sb-text-muted); }

/* Needs My Attention — inbox-style sections with a colored left accent */
.attention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; }
.attention-card { border: 1px solid var(--sb-border); border-radius: var(--sb-radius-md); background: var(--sb-bg-card); overflow: hidden; box-shadow: var(--sb-shadow-xs); }
.attention-card .ac-head { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--sb-border); font-weight: 700; font-size: .82rem; }
.attention-card .ac-head i { font-size: .95rem; }
.attention-card.ac-danger .ac-head { color: var(--sb-danger); background: var(--sb-danger-light); }
.attention-card.ac-warning .ac-head { color: #92600F; background: var(--sb-warning-light); }
.attention-card.ac-info .ac-head { color: var(--sb-primary-darker); background: var(--sb-primary-light); }
.attention-card.ac-success .ac-head { color: var(--sb-accent-dark); background: var(--sb-accent-light); }
.attention-card .ac-body { max-height: 220px; overflow-y: auto; }
.attention-item { display: block; padding: .6rem .9rem; border-bottom: 1px solid var(--sb-border); text-decoration: none; color: inherit; font-size: .8rem; }
.attention-item:last-child { border-bottom: none; }
.attention-item:hover { background: var(--sb-bg-tint); }
.attention-item .ai-title { font-weight: 600; color: var(--sb-text); }
.attention-item .ai-meta { color: var(--sb-text-muted); font-size: .72rem; margin-top: .1rem; }
.attention-empty { padding: 1.25rem .9rem; text-align: center; color: var(--sb-text-muted); font-size: .78rem; }

/* Active Workflow widget */
.workflow-visual-card { border: 1px solid var(--sb-border); border-radius: var(--sb-radius-lg); background: var(--sb-bg-card); box-shadow: var(--sb-shadow-xs); overflow: hidden; }
.workflow-visual-head { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--sb-border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.workflow-visual-body { padding: 1.1rem 1.3rem; max-height: 480px; overflow-y: auto; }
.wv-step { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; position: relative; }
.wv-step .wv-line { position: absolute; left: 15px; top: -8px; width: 2px; height: 16px; background: var(--sb-border); }
.wv-step:first-child .wv-line { display: none; }
.wv-step .wv-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; z-index: 1; }
.wv-step.wv-done .wv-dot { background: var(--sb-accent); color: #fff; }
.wv-step.wv-current .wv-dot { background: var(--sb-primary); color: #fff; box-shadow: 0 0 0 5px var(--sb-primary-light); }
.wv-step.wv-locked .wv-dot { background: var(--sb-neutral-light); color: var(--sb-text-muted); }
.wv-step .wv-name { font-weight: 600; font-size: .85rem; }
.wv-step.wv-current .wv-name { color: var(--sb-primary-darker); font-weight: 700; }
.wv-step.wv-locked .wv-name { color: var(--sb-text-muted); }
.wv-step .wv-stage { font-size: .66rem; color: var(--sb-text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* Client workflow cards grid */
.client-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.client-work-card {
    border: 1px solid var(--sb-border); border-radius: var(--sb-radius-lg); background: var(--sb-bg-card);
    padding: 1.1rem; box-shadow: var(--sb-shadow-xs); transition: box-shadow .15s ease, transform .15s ease; display: flex; flex-direction: column; gap: .65rem;
}
.client-work-card:hover { box-shadow: var(--sb-shadow-md); transform: translateY(-2px); }
.client-work-card .cwc-flags { display: flex; flex-wrap: wrap; gap: .35rem; }
.cwc-flag { font-size: .66rem; font-weight: 700; padding: .18rem .5rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .25rem; }
.cwc-flag.cwc-evidence { background: var(--sb-warning-light); color: #92600F; }
.cwc-flag.cwc-approval { background: var(--sb-primary-light); color: var(--sb-primary-darker); }
.cwc-flag.cwc-blocked { background: var(--sb-danger-light); color: var(--sb-danger); }

/* Deadline groups */
.deadline-group + .deadline-group { margin-top: .9rem; }
.deadline-group-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sb-text-muted); margin-bottom: .4rem; }
.deadline-item { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; font-size: .8rem; border-bottom: 1px dashed var(--sb-border); }
.deadline-item:last-child { border-bottom: none; }

/* Metric pills row (replaces bulky KPI cards with a compact strip) */
.metric-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; }
.metric-pill { border: 1px solid var(--sb-border); border-radius: var(--sb-radius-md); background: var(--sb-bg-card); padding: .7rem .5rem; text-align: center; }
.metric-pill .mp-value { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.metric-pill .mp-label { font-size: .64rem; font-weight: 600; color: var(--sb-text-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: .2rem; }
@media (max-width: 1200px) { .metric-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .metric-strip { grid-template-columns: repeat(2, 1fr); } }

/* Sidebar compact widget */
.side-widget { border: 1px solid var(--sb-border); border-radius: var(--sb-radius-lg); background: var(--sb-bg-card); box-shadow: var(--sb-shadow-xs); margin-bottom: 1rem; overflow: hidden; }
.side-widget .sw-head { padding: .75rem .95rem; border-bottom: 1px solid var(--sb-border); font-weight: 700; font-size: .82rem; display: flex; align-items: center; justify-content: space-between; }
.side-widget .sw-body { max-height: 300px; overflow-y: auto; }
.side-widget .sw-item { padding: .6rem .95rem; border-bottom: 1px solid var(--sb-border); font-size: .78rem; display: block; text-decoration: none; color: inherit; transition: background .12s ease; }
.side-widget .sw-item:hover { background: var(--sb-bg-tint); }
.side-widget .sw-item:last-child { border-bottom: none; }

/* Global search */
.workspace-search { position: relative; }
.workspace-search input {
    border-radius: var(--sb-radius-pill); padding-left: 2.6rem; border: 1.5px solid var(--sb-border-strong);
}
.workspace-search .ws-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--sb-text-muted); }
.search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: var(--sb-radius-md);
    box-shadow: var(--sb-shadow-lg); border: 1px solid var(--sb-border); max-height: 360px; overflow-y: auto; z-index: 1050; display: none;
}
.search-results.show { display: block; }
.search-results .sr-group-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sb-text-muted); padding: .5rem .9rem .25rem; }
.search-results .sr-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; text-decoration: none; color: inherit; font-size: .84rem; }
.search-results .sr-item:hover, .search-results .sr-item.active { background: var(--sb-bg-tint); }
.search-results .sr-empty { padding: 1.25rem; text-align: center; color: var(--sb-text-muted); font-size: .82rem; }

/* Floating quick actions */
.quick-actions-fab { position: fixed; right: 1.75rem; bottom: 1.75rem; z-index: 1040; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.qa-menu { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .25rem; opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.qa-menu.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.qa-menu-item {
    display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-pill); padding: .5rem .9rem .5rem .6rem; box-shadow: var(--sb-shadow-md);
    text-decoration: none; color: var(--sb-text); font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.qa-menu-item:hover { background: var(--sb-primary-light); color: var(--sb-primary-darker); }
.qa-menu-item .qa-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--sb-primary-light); color: var(--sb-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-fab-toggle {
    width: 58px; height: 58px; border-radius: 50%; background: var(--sb-primary); color: #fff; border: none;
    box-shadow: var(--sb-shadow-glow-lg); font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
    transition: transform .2s ease, background .15s ease;
}
.qa-fab-toggle:hover { background: var(--sb-primary-dark); transform: scale(1.05); }
.qa-fab-toggle.open { transform: rotate(45deg); }

/* Micro-interactions */
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sb-danger); position: relative; }
.pulse-dot::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--sb-danger); opacity: .5;
    animation: pulse-ring 1.8s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes pulse-ring { 0% { transform: scale(.7); opacity: .6; } 70% { transform: scale(1.8); opacity: 0; } 100% { opacity: 0; } }

@media (max-width: 1199px) {
    .client-card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ==========================================================================
   Admin Operations Command Centre — additive only, used exclusively by
   public/admin/dashboard.php. No rule above this point is modified.
   ========================================================================== */

.metric-strip-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .metric-strip-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .metric-strip-5 { grid-template-columns: repeat(2, 1fr); } }

/* Workflow bottleneck bars */
.bottleneck-row { display: flex; align-items: center; gap: .85rem; padding: .4rem 0; }
.bottleneck-row .bn-name { width: 220px; flex-shrink: 0; font-size: .82rem; font-weight: 600; color: var(--sb-text); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.bottleneck-bar-track { flex-grow: 1; height: 10px; border-radius: 999px; background: var(--sb-bg-tint); overflow: hidden; }
.bottleneck-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sb-primary), var(--sb-accent)); transition: width .3s ease; }
.bottleneck-row .bn-count { width: 28px; flex-shrink: 0; text-align: right; font-size: .8rem; font-weight: 700; color: var(--sb-text-secondary); }

/* Pending Approvals centre rows */
.approval-row { display: flex; align-items: center; gap: 1rem; }

/* Evidence review grid */
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .9rem; }
.evidence-card { border: 1px solid var(--sb-border); border-radius: var(--sb-radius-md); overflow: hidden; background: var(--sb-bg-card); box-shadow: var(--sb-shadow-xs); transition: box-shadow .15s ease, transform .15s ease; }
.evidence-card:hover { box-shadow: var(--sb-shadow-md); transform: translateY(-2px); }
.evidence-thumb { display: block; width: 100%; height: 100px; background: var(--sb-bg-tint); color: var(--sb-primary); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; cursor: pointer; text-decoration: none; }
.evidence-thumb img { width: 100%; height: 100%; object-fit: cover; }
.evidence-meta { padding: .55rem .65rem; }

/* Employee performance grid */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.perf-card { position: relative; border: 1px solid var(--sb-border); border-radius: var(--sb-radius-lg); background: var(--sb-bg-card); padding: 1.1rem; box-shadow: var(--sb-shadow-xs); transition: box-shadow .15s ease, transform .15s ease; }
.perf-card:hover { box-shadow: var(--sb-shadow-md); transform: translateY(-2px); }
.perf-stat-row { display: flex; gap: .75rem; border-top: 1px solid var(--sb-border); padding-top: .65rem; margin-top: .15rem; }
.perf-stat { flex: 1; text-align: center; }
.perf-stat .ps-value { font-size: 1.15rem; font-weight: 800; line-height: 1.1; }
.perf-stat .ps-label { font-size: .64rem; font-weight: 600; color: var(--sb-text-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: .15rem; }

/* Notification group labels inside side-widget */
.notif-group-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sb-text-muted); padding: .6rem .95rem .3rem; }
