/* ============================================================
   CEPA Mobility — Visual Refinement Layer
   Loaded AFTER admin.css to refine UI without changing fonts,
   markup or functionality. Safe overrides only.
   ============================================================ */

:root {
    --cepa-font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --cepa-bg:          #f5f7fb;
    --cepa-surface:     #ffffff;
    --cepa-surface-2:   #f8fafc;
    --cepa-border:      #e4eaf2;
    --cepa-border-soft: #edf1f7;
    --cepa-text:        #0f1f3d;
    --cepa-text-soft:   #4f6787;
    --cepa-text-muted:  #8499b6;

    --cepa-primary:        #0d9488;
    --cepa-primary-strong: #0b7d76;
    --cepa-primary-soft:   #e6f6f4;
    --cepa-accent:         #2563eb;

    --cepa-danger:  #d9534f;
    --cepa-warn:    #e0a300;
    --cepa-success: #10b981;

    --cepa-radius-sm: 0.5rem;
    --cepa-radius:    0.75rem;
    --cepa-radius-lg: 1rem;

    --cepa-shadow-sm: 0 1px 2px rgba(15, 31, 61, 0.05);
    --cepa-shadow:    0 6px 18px rgba(15, 31, 61, 0.07);
    --cepa-shadow-lg: 0 18px 40px rgba(15, 31, 61, 0.12);
}

/* ---------- Typography (family preservation) ---------- */
html,
body,
body *,
input,
select,
textarea,
button,
optgroup,
option,
.select2-container,
.select2-container *,
.ql-editor,
.ql-container,
.CodeMirror,
.flatpickr-calendar,
.flatpickr-calendar *,
.trix-content {
    font-family: var(--cepa-font-stack) !important;
}

i,
[class^="icon-"],
[class*=" icon-"],
.material-icons,
.fa, .far, .fas, .fab, .fal, .fad,
.fw-icon, .fontawesome,
svg {
    font-family: revert !important;
}

body.admin-shell {
    background: var(--cepa-bg);
    color: var(--cepa-text);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.admin-shell h1,
body.admin-shell h2,
body.admin-shell h3,
body.admin-shell h4,
body.admin-shell h5,
body.admin-shell h6 {
    color: var(--cepa-text);
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.25;
}

body.admin-shell p,
body.admin-shell span,
body.admin-shell a,
body.admin-shell label,
body.admin-shell li {
    font-weight: 400;
}

body.admin-shell strong,
body.admin-shell b {
    font-weight: 600;
}

body.admin-shell small {
    font-size: 0.78rem;
    color: var(--cepa-text-muted);
}

/* ---------- Buttons ---------- */
body .btn {
    border-radius: var(--cepa-radius);
    font-weight: 500;
    letter-spacing: 0.005em;
    transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}

body .btn.btn-primary {
    font-weight: 600;
}

body .btn.btn-primary {
    background: #2563eb;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
    font-weight: 600;
    letter-spacing: 0.01em;
}

body .btn.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

body .btn.btn-primary:active {
    transform: translateY(0);
}

body .btn.btn-md {
    padding: 0.55rem 1.1rem;
    min-height: 2.4rem;
    font-size: 0.85rem;
}

/* Secondary header button style for Create Lead in kanban header */
body .content .table > .table-header .table-action .btn.btn-primary {
    padding: 0.55rem 1.2rem;
    min-height: 2.4rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

body .btn.btn-secondary,
body .btn.btn-default {
    background: #fff;
    border: 1px solid var(--cepa-border);
    color: var(--cepa-text);
    box-shadow: var(--cepa-shadow-sm);
}

body .btn.btn-secondary:hover,
body .btn.btn-default:hover {
    background: var(--cepa-surface-2);
    border-color: #d3dce8;
}

/* ---------- Inputs / Controls ---------- */
body .control,
body input.control,
body select.control,
body textarea.control {
    border-radius: var(--cepa-radius);
    border: 1px solid var(--cepa-border);
    background: #fff;
    min-height: 2.6rem;
    padding: 0.55rem 0.9rem;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

body .control:focus,
body input.control:focus,
body select.control:focus,
body textarea.control:focus {
    border-color: var(--cepa-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
    outline: 0;
}

/* ---------- Page Header (table-header) ---------- */
body .content .table > .table-header {
    padding: 0.25rem 0.25rem 0.7rem;
    border-bottom: 1px solid var(--cepa-border-soft);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

body .content .table > .table-header h1 {
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--cepa-text);
    line-height: 1.25;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

body .content .table > .table-header .table-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

body .content .table > .table-header h1 .breadcrumb,
body .content .table > .table-header .breadcrumb {
    font-size: 0.72rem;
    color: var(--cepa-text-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

body .breadcrumb a,
body .breadcrumb li,
body .breadcrumb span {
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

body .content .table > .table-header .table-action .btn {
    box-shadow: 0 12px 22px rgba(13, 148, 136, 0.22);
}

/* ---------- Filters Bar ---------- */
body .datagrid-filters {
    background: #fff;
    border: 1px solid var(--cepa-border-soft);
    border-radius: var(--cepa-radius-lg);
    padding: 0.55rem 0.65rem;
    box-shadow: 0 1px 3px rgba(15, 31, 61, 0.04);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
    min-height: 3.1rem;
}

body .datagrid-filters .search-filter {
    flex: 1;
    max-width: 440px;
    position: relative;
}

body .datagrid-filters .search-filter .control {
    padding-left: 2.4rem;
    background: #f1f5f9;
    border-color: #e2e8f0;
    min-height: 2.4rem;
    height: 2.4rem;
    border-radius: var(--cepa-radius);
    font-size: 0.85rem;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
    box-sizing: border-box;
}

body .datagrid-filters .search-filter .control:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body .datagrid-filters .search-filter .control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

body .datagrid-filters .search-filter .input-search-icon {
    left: 0.85rem;
    opacity: 0.55;
}

body .datagrid-filters .filter-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.4rem;
}

body .datagrid-filters .filter-right > * {
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
}

body .table .datagrid-filters .filter-btn .grid-dropdown-header,
body .table .datagrid-filters .filter-right .filter-btn .grid-dropdown-header,
body .datagrid-filters .filter-btn .grid-dropdown-header {
    background: #fff;
    border: 1px solid var(--cepa-border);
    border-radius: var(--cepa-radius);
    padding: 0 0.95rem;
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--cepa-text-soft);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    min-height: 2.4rem;
    height: 2.4rem;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

body .datagrid-filters .filter-btn .grid-dropdown-header:hover {
    background: var(--cepa-surface-2);
    color: var(--cepa-text);
    border-color: #d3dce8;
    box-shadow: 0 2px 5px rgba(15, 31, 61, 0.06);
}

/* Pipeline selector + view switcher */
body .switch-pipeline-container {
    min-width: 190px;
    display: inline-flex !important;
    align-items: center;
    height: 2.4rem;
    margin: 0 !important;
}

body .switch-pipeline-container .form-group {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 2.4rem;
    width: 100%;
}

body .datagrid-filters .filter-right .switch-pipeline-container .control,
body .datagrid-filters .switch-pipeline-container .control,
body .switch-pipeline-container .control,
body .switch-pipeline-container select.control {
    font-weight: 500;
    font-size: 0.82rem;
    min-height: 2.4rem;
    height: 2.4rem;
    padding: 0 2.1rem 0 0.85rem;
    width: 100%;
    min-width: 180px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none'><path d='M5 7.5L10 12.5L15 7.5' stroke='%234f6787' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem;
    border-color: var(--cepa-border);
    border-radius: var(--cepa-radius);
    transition: border-color .2s ease, box-shadow .2s ease;
    box-sizing: border-box;
    background-color: #fff;
}

body .switch-pipeline-container .control:hover {
    border-color: #d3dce8;
    box-shadow: 0 2px 5px rgba(15, 31, 61, 0.06);
}

body .switch-view-container {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--cepa-radius);
    padding: 0.22rem;
    display: inline-flex;
    gap: 0.15rem;
    align-items: center;
    height: 2.4rem;
    box-sizing: border-box;
}

body .switch-view-container .icon-container {
    border-radius: calc(var(--cepa-radius) - 0.2rem);
    min-width: 2rem;
    height: calc(2.4rem - 0.5rem);
    padding: 0 0.55rem;
}

body .switch-view-container .icon-container {
    padding: 0.3rem 0.55rem;
    border-radius: 0.55rem;
    transition: background .15s ease, box-shadow .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 100%;
    color: var(--cepa-text-muted);
    text-decoration: none;
}

body .switch-view-container .icon-container i.icon {
    opacity: 0.75;
    transition: opacity .15s ease;
}

body .switch-view-container .icon-container:hover i.icon {
    opacity: 1;
}

body .switch-view-container .icon-container.active {
    background: linear-gradient(120deg, var(--cepa-primary) 0%, #23b8ad 100%);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

body .switch-view-container .icon-container.active i.icon {
    opacity: 1;
}

/* ---------- Kanban ---------- */
body .kanban-board {
    background: transparent !important;
}

body .drag-container {
    gap: 1rem;
}

body .drag-container .drag-column {
    background: #ffffff;
    border: 1px solid var(--cepa-border-soft);
    border-radius: var(--cepa-radius-lg);
    box-shadow: var(--cepa-shadow-sm);
    padding: 1rem 0.7rem 0.75rem;
    min-width: 300px;
    position: relative;
    overflow: hidden;
}

/* Colored top stripe per stage (cycles by nth-child) */
body .drag-container .drag-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #94a3b8;
    border-radius: var(--cepa-radius-lg) var(--cepa-radius-lg) 0 0;
}

body .drag-container .drag-column:nth-child(1)::before { background: #10b981; }
body .drag-container .drag-column:nth-child(2)::before { background: #3b82f6; }
body .drag-container .drag-column:nth-child(3)::before { background: #f59e0b; }
body .drag-container .drag-column:nth-child(4)::before { background: #8b5cf6; }
body .drag-container .drag-column:nth-child(5)::before { background: #059669; }
body .drag-container .drag-column:nth-child(6)::before { background: #ef4444; }
body .drag-container .drag-column:nth-child(n+7)::before { background: #64748b; }

/* Column header value matches stripe color */
body .drag-container .drag-column:nth-child(1) h2 .float-right { color: #10b981; }
body .drag-container .drag-column:nth-child(2) h2 .float-right { color: #3b82f6; }
body .drag-container .drag-column:nth-child(3) h2 .float-right { color: #f59e0b; }
body .drag-container .drag-column:nth-child(4) h2 .float-right { color: #8b5cf6; }
body .drag-container .drag-column:nth-child(5) h2 .float-right { color: #059669; }
body .drag-container .drag-column:nth-child(6) h2 .float-right { color: #ef4444; }

body .drag-container .drag-column > header,
body .drag-container .drag-column h2 {
    background: transparent !important;
    color: var(--cepa-text-soft) !important;
    padding: 0.2rem 0.5rem 0.85rem !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cepa-border-soft);
    margin-bottom: 0.65rem;
}

body .drag-container .drag-column h2 .float-right {
    background: transparent;
    color: var(--cepa-primary-strong);
    border: none;
    padding: 0;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    text-align: right;
    display: inline-block;
}

body .drag-container .drag-column h2 + a {
    display: block;
    margin: 0 0.25rem 0.65rem;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px dashed #c9d3e3;
    border-radius: var(--cepa-radius);
    text-align: center;
    color: var(--cepa-text-soft) !important;
    font-weight: 500;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}

body .drag-container .drag-column h2 + a:hover {
    border-color: var(--cepa-primary);
    color: var(--cepa-primary) !important;
    background: var(--cepa-primary-soft);
    box-shadow: var(--cepa-shadow-sm);
    text-decoration: none;
}

/* Cards */
body .drag-container .drag-item,
body .drag-container .drag-item .lead-block {
    background: #fff !important;
    border: 1px solid var(--cepa-border) !important;
    border-radius: var(--cepa-radius) !important;
    box-shadow: var(--cepa-shadow-sm) !important;
    padding: 0.9rem 0.95rem !important;
    margin-bottom: 0.6rem;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}

body .drag-container .drag-item:hover,
body .drag-container .drag-item .lead-block:hover {
    transform: translateY(-1px);
    box-shadow: var(--cepa-shadow) !important;
    border-color: #cfd9e8 !important;
}

body .drag-item .lead-title,
body .drag-item .lead-block .lead-title {
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--cepa-text);
    line-height: 1.35;
    letter-spacing: -0.005em;
    margin-bottom: 0.55rem;
    padding-right: 2.75rem;
}

body .drag-item .icons {
    position: absolute;
    top: 0.7rem;
    right: 0.75rem;
    display: inline-flex;
    gap: 0.3rem;
    opacity: 0.55;
    transition: opacity .2s ease;
}

body .drag-item:hover .icons {
    opacity: 1;
}

body .drag-item .lead-person,
body .drag-item .lead-block .lead-person {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--cepa-text-soft);
    font-weight: 400;
    margin-bottom: 0.35rem;
}

body .drag-item .lead-person a {
    color: var(--cepa-text-soft);
    font-weight: 500;
    text-decoration: none;
}

body .drag-item .lead-person a:hover {
    color: var(--cepa-primary);
}

body .drag-item .lead-cost,
body .drag-item .lead-block .lead-cost {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding: 0.28rem 0.6rem;
    background: var(--cepa-primary-soft);
    color: var(--cepa-primary-strong);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0;
}

body .drag-item .lead-block.rotten {
    border-left: 3px solid var(--cepa-danger) !important;
}

/* Lead temperature badge */
body .drag-item .lead-temperature {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.55rem;
    margin-left: 0.4rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body .drag-item .lead-temperature::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

body .drag-item .lead-temperature.temp-cold {
    background: #dbeafe;
    color: #1d4ed8;
}

body .drag-item .lead-temperature.temp-warm {
    background: #fef3c7;
    color: #b45309;
}

body .drag-item .lead-temperature.temp-hot {
    background: #fee2e2;
    color: #b91c1c;
}

/* Create Lead dashed button refinement */
body .drag-container .drag-column h2 + a:hover {
    transform: translateY(-1px);
}

/* Empty state in kanban columns */
body .drag-container .empty-icon-container,
body .empty-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0.5rem;
    color: var(--cepa-text-muted);
}

body .empty-icon-container .icon-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
}

body .empty-icon-container span {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cepa-text-muted);
}

/* ---------- Data table (list view) ---------- */
body .datagrid-container,
body .datagrid,
body .datagrid-table,
body table.datagrid-list {
    border-radius: var(--cepa-radius-lg);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--cepa-border);
    box-shadow: var(--cepa-shadow-sm);
}

body .datagrid-table thead,
body .datagrid thead {
    background: var(--cepa-surface-2);
}

body .datagrid-table thead th,
body .datagrid thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 500;
    color: var(--cepa-text-muted);
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--cepa-border);
}

body .datagrid-table tbody td,
body .datagrid tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--cepa-border-soft);
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--cepa-text);
}

body .datagrid-table tbody tr:hover,
body .datagrid tbody tr:hover {
    background: var(--cepa-surface-2);
}

/* ---------- Sidebar (primary nav) ---------- */
/* ===================================================================
   SIDEBAR — .navbar-left (Krayin nav) — refinement layer
   =================================================================== */

body .navbar-left,
body .navbar-left.open {
    background: #0b1628;
    display: flex;
    flex-direction: column;
    width: 190px !important;
    padding: 0.55rem 0.4rem 0.35rem;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
    border-right: none;
    transition: width .2s ease, padding .2s ease;
}

body .navbar-left .menubar {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    list-style: none;
}

body .navbar-left .menubar > li.menu-item {
    position: relative;
    margin: 0;
    padding: 0;
    border-radius: 0.55rem;
    transition: background-color .2s ease, transform .2s ease;
}

body .navbar-left .menubar > li.menu-item > a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.55rem;
    border-radius: 0.5rem;
    color: #a0acc3;
    font-size: 0.8rem;
    font-weight: 450;
    letter-spacing: 0.005em;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    min-height: 2rem;
}

body .navbar-left .menubar > li.menu-item > a .menu-label {
    font-weight: 450;
    letter-spacing: 0.005em;
}

body .navbar-left .menubar > li.menu-item > a i.icon,
body .navbar-left .menubar > li.menu-item > a i.sprite {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    opacity: 0.72;
    transition: opacity .2s ease, filter .2s ease;
}

body .navbar-left .menubar > li.menu-item > a .lucide-nav-icon,
body .navbar-left .menubar > li.menu-item > a svg.lucide {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #a0acc3;
    stroke-width: 1.6;
    transition: color .2s ease;
}

/* Chevron indicating submenu availability */
body .navbar-left .menubar > li.menu-item > a .menu-chevron,
body .navbar-left .menubar > li.menu-item > a svg.lucide[data-lucide="chevron-down"] {
    margin-left: auto;
    width: 14px;
    height: 14px;
    color: #7a8aa4;
    stroke-width: 2;
    transition: transform .2s ease, color .2s ease;
    flex-shrink: 0;
}

body .navbar-left .menubar > li.menu-item.active > a .menu-chevron,
body .navbar-left .menubar > li.menu-item.current-menu-item > a .menu-chevron,
body .navbar-left .menubar > li.menu-item.active > a svg.lucide[data-lucide="chevron-down"],
body .navbar-left .menubar > li.menu-item.current-menu-item > a svg.lucide[data-lucide="chevron-down"] {
    transform: rotate(180deg);
    color: #ffffff;
}

body .navbar-left:not(.open) .menubar > li.menu-item > a .menu-chevron,
body .navbar-left:not(.open) .menubar > li.menu-item > a svg.lucide[data-lucide="chevron-down"] {
    display: none;
}

body .navbar-left .menubar > li.menu-item:hover > a .lucide-nav-icon,
body .navbar-left .menubar > li.menu-item:hover > a svg.lucide {
    color: #e6ecf6;
}

body .navbar-left .menubar > li.menu-item.active > a .lucide-nav-icon,
body .navbar-left .menubar > li.menu-item.current-menu-item > a .lucide-nav-icon,
body .navbar-left .menubar > li.menu-item.active > a svg.lucide,
body .navbar-left .menubar > li.menu-item.current-menu-item > a svg.lucide {
    color: #ffffff;
    stroke-width: 1.9;
}

/* Hover: subtle shift + softer bg */
body .navbar-left .menubar > li.menu-item:hover {
    background: rgba(255, 255, 255, 0.035);
    transform: translateX(2px);
}

body .navbar-left .menubar > li.menu-item:hover > a {
    color: #e6ecf6;
}

body .navbar-left .menubar > li.menu-item:hover > a i.icon,
body .navbar-left .menubar > li.menu-item:hover > a i.sprite {
    opacity: 0.95;
}

/* Active: refined, no glow */
body .navbar-left .menubar > li.menu-item.active,
body .navbar-left .menubar > li.menu-item.current-menu-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
    transform: none;
}

body .navbar-left .menubar > li.menu-item.active > a,
body .navbar-left .menubar > li.menu-item.current-menu-item > a {
    color: #ffffff;
    font-weight: 550;
}

body .navbar-left .menubar > li.menu-item.active > a i.icon,
body .navbar-left .menubar > li.menu-item.current-menu-item > a i.icon,
body .navbar-left .menubar > li.menu-item.active > a i.sprite,
body .navbar-left .menubar > li.menu-item.current-menu-item > a i.sprite {
    opacity: 1;
    filter: brightness(0) invert(1);
}

/* Sub menu (Settings / Configuration children) */
body .navbar-left .sub-menubar {
    list-style: none;
    padding: 0.15rem 0 0.2rem 0.6rem;
    margin: 0.25rem 0 0.4rem 1.2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

body .navbar-left .sub-menubar li.sub-menu-item {
    margin: 0;
}

body .navbar-left .sub-menubar li.sub-menu-item > a {
    display: block;
    padding: 0.4rem 0.7rem;
    border-radius: 0.55rem;
    color: #8694ad;
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}

body .navbar-left .sub-menubar li.sub-menu-item:hover > a {
    color: #e6ecf6;
    background: rgba(255, 255, 255, 0.04);
}

body .navbar-left .sub-menubar li.sub-menu-item.active > a,
body .navbar-left .sub-menubar li.sub-menu-item.current-menu-item > a {
    color: #23b8ad;
    background: rgba(35, 184, 173, 0.12);
    font-weight: 500;
}

/* Bottom: collapse toggle */
body .navbar-left .menubar-bottom {
    margin-top: auto;
    padding: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.7rem;
    transition: background-color .18s ease;
}

body .navbar-left .menubar-bottom:hover {
    background: rgba(255, 255, 255, 0.05);
}

body .navbar-left .menubar-bottom .icon {
    width: 22px;
    height: 22px;
    opacity: 0.75;
    transition: opacity .18s ease;
}

body .navbar-left .menubar-bottom:hover .icon {
    opacity: 1;
}

/* Collapsed: sidebar without .open */
body .navbar-left:not(.open) {
    width: 56px !important;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

/* Align content-container with the new sidebar widths */
body .content-container {
    padding-left: 56px !important;
}

body .navbar-left.open + .content-container {
    padding-left: 190px !important;
}

body .navbar-left:not(.open) .menubar > li.menu-item > a {
    justify-content: center;
    padding: 0.65rem 0.5rem;
    gap: 0;
}

body .navbar-left:not(.open) .menubar > li.menu-item > a .menu-label,
body .navbar-left:not(.open) .sub-menubar {
    display: none;
}

/* Scrollbar inside sidebar (dark) */
body .navbar-left .menubar::-webkit-scrollbar {
    width: 6px;
}

body .navbar-left .menubar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

body .navbar-left .menubar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ---------- Legacy/compat selectors ---------- */
body .nav-left .nav-menu li a,
body aside .nav-menu li a,
body .sidebar-container .nav-menu li a {
    border-radius: var(--cepa-radius);
    margin: 2px 8px;
    padding: 0.6rem 0.85rem;
    transition: background .15s ease, color .15s ease;
    font-weight: 450;
    font-size: 0.88rem;
    letter-spacing: 0.005em;
}

body .nav-left .nav-menu li a:hover {
    background: rgba(255, 255, 255, 0.06);
}

body .nav-left .nav-menu li.active > a,
body .nav-left .nav-menu li a.active {
    background: linear-gradient(120deg, var(--cepa-primary) 0%, #23b8ad 100%);
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(13, 148, 136, 0.24);
    font-weight: 550;
}

body .nav-left .nav-menu li.active > a i,
body .nav-left .nav-menu li a.active i {
    filter: brightness(0) invert(1);
}

/* ---------- Top nav ---------- */
body .nav-top {
    background: #fff;
    border-bottom: 1px solid var(--cepa-border-soft);
    box-shadow: var(--cepa-shadow-sm);
}

/* ---------- Top navbar right actions (Quick create + Profile) ---------- */
body .navbar-top .navbar-top-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-right: 0.5rem;
}

/* Quick create button (+) */
body .navbar-top .quick-create {
    display: inline-flex;
    align-items: center;
}

body .navbar-top .quick-create .button.dropdown-toggle {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(37, 99, 235, 0.3);
    transition: transform .18s ease, box-shadow .2s ease, filter .2s ease;
}

body .navbar-top .quick-create .button.dropdown-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    filter: brightness(1.04);
}

body .navbar-top .quick-create .button.dropdown-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.22);
}

body .navbar-top .quick-create .button.dropdown-toggle i.icon {
    width: 18px;
    height: 18px;
    opacity: 1;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    line-height: 0;
}

/* Profile card */
body .navbar-top .profile-info {
    position: relative;
}

body .navbar-top .profile-info .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.45rem 0.3rem 0.35rem;
    background: #fff;
    border: 1px solid var(--cepa-border-soft);
    border-radius: 999px;
    cursor: pointer;
    min-height: 2.6rem;
    box-shadow: 0 1px 2px rgba(15, 31, 61, 0.04);
    transition: background-color .18s ease, border-color .18s ease, box-shadow .2s ease;
}

body .navbar-top .profile-info .dropdown-toggle:hover {
    background: var(--cepa-surface-2);
    border-color: #d3dce8;
    box-shadow: 0 2px 6px rgba(15, 31, 61, 0.07);
}

body .navbar-top .profile-info .dropdown-toggle .avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fde68a;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(15, 31, 61, 0.06);
}

body .navbar-top .profile-info .dropdown-toggle .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body .navbar-top .profile-info .dropdown-toggle .avatar .icon {
    width: 100%;
    height: 100%;
}

body .navbar-top .profile-info .dropdown-toggle .info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    gap: 0.1rem;
    padding-right: 0.15rem;
}

body .navbar-top .profile-info .dropdown-toggle .info .howdy {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cepa-text-muted);
    line-height: 1;
}

body .navbar-top .profile-info .dropdown-toggle .info .user {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cepa-text);
    letter-spacing: -0.005em;
    line-height: 1.15;
}

body .navbar-top .profile-info .dropdown-toggle .icon.ellipsis-icon {
    width: 18px;
    height: 18px;
    opacity: 0.55;
    transition: opacity .18s ease;
    margin-left: 0.15rem;
}

body .navbar-top .profile-info .dropdown-toggle:hover .icon.ellipsis-icon {
    opacity: 0.9;
}

/* ---------- Breadcrumbs ---------- */
body .breadcrumb a {
    color: var(--cepa-text-muted);
    transition: color .15s ease;
}

body .breadcrumb a:hover {
    color: var(--cepa-primary);
}

body .breadcrumb .active,
body .breadcrumb li.active span {
    color: var(--cepa-text);
    font-weight: 500;
}

/* ---------- Chips / badges that may appear ---------- */
body .badge,
body .tag {
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    padding: 0.18rem 0.7rem;
    text-transform: uppercase;
}

/* ---------- Scrollbars (subtle, scoped to admin shell) ---------- */
/* Firefox fallback */
body.admin-shell,
body.admin-shell * {
    scrollbar-width: thin;
    scrollbar-color: #c2cee0 transparent;
}

/* WebKit: base rule for any scrollable area within the admin shell */
body.admin-shell ::-webkit-scrollbar {
    width: 8px;
    height: 10px;
}

body.admin-shell ::-webkit-scrollbar-track,
body.admin-shell ::-webkit-scrollbar-corner {
    background: transparent;
}

body.admin-shell ::-webkit-scrollbar-thumb {
    background: #d6deeb;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color .2s ease;
}

body.admin-shell ::-webkit-scrollbar-thumb:hover {
    background: #9aa9c2;
    background-clip: padding-box;
    border: 2px solid transparent;
}

body.admin-shell ::-webkit-scrollbar-thumb:active {
    background: #7b8aa5;
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* Kanban horizontal scrollbar — a bit larger/easier to grab */
body .drag-container::-webkit-scrollbar {
    height: 12px;
}

body .drag-container::-webkit-scrollbar-track {
    background: linear-gradient(180deg, transparent 0%, rgba(148, 163, 184, 0.08) 50%, transparent 100%);
    border-radius: 999px;
    margin: 0 0.5rem;
}

body .drag-container::-webkit-scrollbar-thumb {
    background: #cdd6e6;
    border: 3px solid transparent;
    background-clip: padding-box;
}

body .drag-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
    border: 3px solid transparent;
}

/* Inner column scrollbars — discreet, more visible on hover */
body .drag-inner-list {
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

body .drag-inner-list::-webkit-scrollbar {
    width: 6px;
}

body .drag-inner-list::-webkit-scrollbar-thumb {
    background: transparent;
    transition: background-color .2s ease;
}

body .drag-column:hover .drag-inner-list::-webkit-scrollbar-thumb,
body .drag-inner-list:hover::-webkit-scrollbar-thumb {
    background: #d0d9ea;
}

body .drag-inner-list:hover::-webkit-scrollbar-thumb:hover {
    background: #9aa9c2;
}

/* Datagrid / tables */
body .datagrid::-webkit-scrollbar,
body .datagrid-container::-webkit-scrollbar {
    width: 8px;
    height: 10px;
}

/* ---------- Layout overflow fix (scoped to Kanban page only) ---------- */
/* Only apply flex/overflow constraints on pages that actually render a kanban-board.
   The :has() selector targets the ancestor chain only when a kanban exists,
   so normal pages (create lead, settings, etc.) keep native page scroll. */

/* Ensure full-height chain from html root */
html:has(.drag-container),
html:has(.drag-container) body.admin-shell {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

body.admin-shell:has(.drag-container) {
    overflow: hidden;
    height: 100vh;
}

body.admin-shell:has(.drag-container) .content-container {
    overflow: hidden;
    height: calc(100vh - 60px);
    padding-right: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

body .content.full-page:has(.drag-container),
body.admin-shell:has(.drag-container) .content-container .content.full-page {
    height: 100%;
    max-height: 100%;
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    padding: 1.25rem 1.25rem 0.75rem !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

body .content.full-page:has(.drag-container) > .table,
body.admin-shell:has(.drag-container) .content.full-page > .table {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

body .content.full-page:has(.drag-container) > .table > .table-body.viewport-height,
body.admin-shell:has(.drag-container) .content.full-page > .table > .table-body.viewport-height {
    flex: 1;
    min-height: 0;
    height: auto !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}

body .kanban-board {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
}

body .drag-container {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.65rem;
    display: block;
    margin: 0;
}

body .drag-container > ul.drag-list,
body .drag-container .drag-list {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(280px, 1fr);
    grid-gap: 1rem;
    width: 100% !important;
    min-width: 100%;
    max-width: none !important;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch;
    justify-content: stretch;
}

body .drag-container .drag-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    width: auto;
    min-width: 0;
    flex-shrink: 1;
    margin: 0;
    overflow: hidden;
}

body .drag-container .drag-inner-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 768px) {
    body .datagrid-filters {
        flex-wrap: wrap;
    }
    body .datagrid-filters .filter-right {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    body .content .table > .table-header h1 {
        font-size: 1.35rem;
    }
}
