/* ============================================================
   LOGIN — split-screen (brand panel + clean form)
   ============================================================ */
    :root {
        --bg: #eef1f6;
        --surface: #ffffff;
        --border: #e4e7ec;
        --accent: #ef5d28;
        --accent-2: #ff8a4c;
        --text: #15181d;
        --text-muted: #667085;
        --text-faint: #98a2b3;
    }

    body {
        background: var(--bg);
        font-family: 'Inter', sans-serif;
        color: var(--text);
    }

    .font-display {
        font-family: 'Space Grotesk', sans-serif;
    }

    .font-mono {
        font-family: 'JetBrains Mono', monospace;
    }

    /* ---- Stage: soft near-white backdrop for the floating orbs ---- */
    .signin-stage {
        position: relative;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2.5rem 1rem;
        overflow: hidden;
        background: #ffffff;
    }

    /* The frame is the card's size; orbs are positioned against its edges so
       they hug the card the same way on every screen. */
    .signin-frame {
        position: relative;
        width: 100%;
        max-width: 400px;
    }

    /* ---- Floating 3D orbs hugging / showing through the glass ---- */
    .orbs {
        position: absolute;
        inset: 0;
        pointer-events: none;
        z-index: 0;
    }
    .orb {
        position: absolute;
        border-radius: 50%;
        background: radial-gradient(circle at 33% 27%, #ffffff 0%, #ffe3d1 24%, #ffb485 58%, #f3873f 100%);
        box-shadow:
            0 24px 48px -14px rgba(235, 101, 43, .32),
            inset -9px -11px 24px rgba(188, 74, 26, .30),
            inset 8px 10px 20px rgba(255, 255, 255, .6);
        will-change: transform;
    }
    /* negative offsets push each orb out past the card edge, so it overlaps.
       Each orb drifts on its own path + timing for lively, continuous motion. */
    .orb-1 { width: 160px; height: 160px; top: -66px;   left: -104px; animation: orbDriftA 13s ease-in-out infinite; }
    .orb-2 { width: 120px; height: 120px; top: -54px;   right: -82px; animation: orbDriftB 16s ease-in-out infinite; }
    .orb-3 { width: 190px; height: 190px; bottom: -84px; left: -84px; animation: orbDriftC 19s ease-in-out infinite; }
    .orb-4 { width: 92px;  height: 92px;  bottom: -46px; right: -66px; animation: orbDriftA 11s ease-in-out infinite reverse; }
    .orb-5 { width: 66px;  height: 66px;  top: 42%;      left: -118px; animation: orbDriftB 9s  ease-in-out infinite; }
    .orb-6 { width: 104px; height: 104px; top: 50%;      right: -116px; animation: orbDriftC 14s ease-in-out infinite reverse; }

    @keyframes orbDriftA {
        0%   { transform: translate(0, 0) scale(1); }
        25%  { transform: translate(18px, -26px) scale(1.04); }
        50%  { transform: translate(-12px, -42px) scale(1); }
        75%  { transform: translate(-24px, -16px) scale(.97); }
        100% { transform: translate(0, 0) scale(1); }
    }
    @keyframes orbDriftB {
        0%   { transform: translate(0, 0) scale(1); }
        33%  { transform: translate(-28px, 18px) scale(1.05); }
        66%  { transform: translate(16px, 32px) scale(.96); }
        100% { transform: translate(0, 0) scale(1); }
    }
    @keyframes orbDriftC {
        0%   { transform: translate(0, 0) scale(1); }
        30%  { transform: translate(26px, 20px) scale(1.03); }
        60%  { transform: translate(32px, -18px) scale(.98); }
        100% { transform: translate(0, 0) scale(1); }
    }
    /* Motion-sensitive viewers still get gentle, slow drift rather than a
       dead stop — the login's floating orbs are meant to keep moving. */
    @media (prefers-reduced-motion: reduce) {
        .orb-1, .orb-2, .orb-3, .orb-4, .orb-5, .orb-6 {
            animation: orbDriftGentle 26s ease-in-out infinite;
        }
        .orb-2 { animation-delay: -8s; }
        .orb-4 { animation-delay: -16s; }
        .orb-6 { animation-delay: -22s; }
    }
    @keyframes orbDriftGentle {
        0%, 100% { transform: translate(0, 0); }
        50%      { transform: translate(0, -12px); }
    }

    /* ---- The frosted glass card ---- */
    .signin-box {
        position: relative;
        z-index: 2;
        width: 100%;
        margin: 0 auto;
        padding: 56px 34px 34px;
        border-radius: 30px;
        background: rgba(255, 255, 255, 0.46);
        border: 1px solid rgba(255, 255, 255, 0.75);
        -webkit-backdrop-filter: blur(20px) saturate(155%);
        backdrop-filter: blur(20px) saturate(155%);
        box-shadow:
            0 40px 70px -26px rgba(16, 24, 40, .30),
            0 10px 26px -16px rgba(16, 24, 40, .18),
            inset 0 1px 0 rgba(255, 255, 255, .9);
    }
    .signin-box::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        padding: 1px;
        background: linear-gradient(150deg, rgba(255, 255, 255, .95), transparent 42%);
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        opacity: .7;
    }

    /* ---- Logo badge floating over the top edge of the card ---- */
    .signin-logo {
        position: absolute;
        top: -34px;
        left: 50%;
        transform: translateX(-50%);
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 12px 26px -10px rgba(16, 24, 40, .25), inset 0 1px 0 rgba(255, 255, 255, .9);
        z-index: 3;
    }

    /* ---- Pill fields (role select, email, password) ---- */
    .gfield {
        position: relative;
        display: flex;
        align-items: center;
        gap: 11px;
        height: 52px;
        padding: 0 18px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.8);
        box-shadow: inset 0 1px 2px rgba(255, 255, 255, .6), 0 2px 6px -4px rgba(16, 24, 40, .2);
        transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    }
    .gfield:focus-within {
        background: rgba(255, 255, 255, 0.82);
        border-color: rgba(239, 93, 40, .55);
        box-shadow: 0 0 0 3px rgba(239, 93, 40, .14);
    }
    .gfield-ic {
        display: inline-flex;
        color: var(--text-muted);
        flex: 0 0 auto;
    }
    .gfield input,
    .gfield .gselect {
        flex: 1;
        min-width: 0;
        border: none;
        outline: none;
        background: transparent;
        color: var(--text);
        font-size: 14px;
        font-family: inherit;
    }
    .gfield input::placeholder { color: var(--text-faint); }

    /* role dropdown: hide the native arrow and use our own chevron */
    .gfield-select .gselect {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        cursor: pointer;
        padding-right: 6px;
    }
    .gfield-select .gselect option { color: #15181d; }
    .gfield-chev {
        display: inline-flex;
        color: var(--text-muted);
        pointer-events: none;
        flex: 0 0 auto;
    }

    .gfield-eye {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: none;
        padding: 0;
        color: var(--text-faint);
        cursor: pointer;
        flex: 0 0 auto;
    }
    .gfield-eye:hover { color: var(--text-muted); }

    /* ---- Remember / forgot row ---- */
    .gcheck {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: var(--text-muted);
        cursor: pointer;
    }
    .gcheck input {
        width: 16px;
        height: 16px;
        accent-color: var(--accent);
        cursor: pointer;
    }
    .glink {
        border: none;
        background: none;
        padding: 0;
        font-size: 13px;
        font-style: italic;
        color: var(--accent);
        cursor: pointer;
    }
    .glink:hover { text-decoration: underline; }

    /* ---- Login button (pill) ---- */
    .btn-signin {
        position: relative;
        overflow: hidden;
        width: 100%;
        height: 50px;
        border: none;
        border-radius: 999px;
        background: linear-gradient(135deg, #ff7a43, var(--accent) 58%, #d94a1c);
        color: #fff;
        font-weight: 600;
        font-size: 15px;
        letter-spacing: .3px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        box-shadow: 0 14px 26px -12px rgba(239, 93, 40, .6);
        transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    }
    .btn-signin::after {
        content: "";
        position: absolute;
        top: 0;
        left: -120%;
        width: 60%;
        height: 100%;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
        transform: skewX(-20deg);
        transition: left .6s ease;
    }
    .btn-signin:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
        box-shadow: 0 18px 32px -12px rgba(239, 93, 40, .7);
    }
    .btn-signin:hover::after { left: 140%; }
    .btn-signin:active { transform: translateY(0) scale(.99); }

    /* ---- Responsive ---- */
    @media (max-width: 480px) {
        .signin-frame { max-width: 358px; }
        .signin-box { padding: 52px 24px 28px; border-radius: 26px; }
        .orb-1 { width: 120px; height: 120px; }
        .orb-3 { width: 140px; height: 140px; }
        .orb-6 { width: 80px; height: 80px; }
    }




:root{
  /* LIGHT THEME (default) — warm "CampusHub" palette */
  --db-bg:          #ffffff;   /* white base; the content panel itself is grey */
  --db-surface:     #ffffff;   /* cards / panels / sidebar */
  --db-surface-2:   #f2f0ec;   /* inputs and subtle fills */
  --db-border:      #ece9e3;   /* soft warm hairline */
  --db-text:        #1c1b19;
  --db-text-muted:  #8a857d;
  --db-accent:      #ef5d28;   /* primary orange */
  --db-accent-2:    #f5873f;   /* lighter orange (gradients) */
  --db-accent-soft: #fdeee6;   /* orange tint background */
  --db-dark:        #1a1713;   /* near-black (active pill, dark cards) */
  --db-radius:       16px;
  --db-shadow:       rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
  --db-shadow-hover: rgba(50, 50, 93, 0.3) 0px 8px 18px -4px, rgba(0, 0, 0, 0.25) 0px 4px 8px -4px;
}


/* Page + layout shell */
.db-bg{
  background-color: var(--db-bg) !important;
}
.db-bg h1, .db-bg h2, .db-bg h3, .db-bg h4, .db-bg h5, .db-bg h6,
.db-bg .text-dark{
  color: var(--db-text) !important;
}
.db-bg .text-secondary{
  color: var(--db-text-muted) !important;
}
.db-bg .bg-white{
  background-color: var(--db-surface) !important;
}
.db-bg .border{
  border-color: var(--db-border) !important;
}
.db-bg .shadow-sm{
  box-shadow: var(--db-shadow) !important;
}
.db-card-hover{
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.db-card-hover:hover{
  transform: translateY(-3px);
  box-shadow: var(--db-shadow-hover);
  border-color: rgba(239,93,40,.28);
}
.db-icon-chip{
  border-radius: 14px;
}

/* Panels / filters / inputs / table (Lead History page) */
.db-panel{
    background-color: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    box-shadow: var(--db-shadow);
}
.db-input-wrap{
    background-color: var(--db-surface-2);
    border: 1px solid var(--db-border);
}
.db-input{
    background-color: var(--db-surface-2) !important;
    color: var(--db-text) !important;
}
.db-input::placeholder{
    color: var(--db-text-muted);
}
select.db-input option{
    background-color: var(--db-surface-2);
    color: var(--db-text);
}
.db-table{
    --bs-table-bg: transparent;
    color: var(--db-text);
    border-collapse: separate;
    border-spacing: 0;
}
.db-table thead th{
    color: var(--db-text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--db-surface-2);
    border-bottom: none;
    padding: 0.8rem 1rem;
    white-space: nowrap;
}
.db-table thead th:first-child{ border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.db-table thead th:last-child{ border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.db-table tbody td{
    border-bottom: 1px solid var(--db-border);
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
}
.db-table tbody tr{
    transition: background-color .12s ease;
}
.db-table tbody tr:hover{
    background: color-mix(in srgb, var(--db-accent) 5%, transparent);
}
.db-table tbody tr:last-child td{
    border-bottom: none;
}
.db-action-btn{
    background-color: var(--db-surface-2);
    border: 1px solid var(--db-border);
    color: var(--db-text-muted);
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.db-action-btn:hover{
    border-color: var(--db-accent);
    color: var(--db-accent);
}

/* Sidebar / navigation */
.db-sidebar{
    background-color: var(--db-surface);
    border-right: 1px solid var(--db-border);
    color: var(--db-text);
}
.db-nav-link{
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--db-text-muted);
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: background-color .15s ease, color .15s ease;
}
.db-nav-link:not(.active):hover{
    background-color: var(--db-surface-2);
    color: var(--db-text);
}
.db-nav-link.active{
    background-color: var(--db-dark);
    color: #fff !important;
}
/* Sidebar navigation links */
.db-nav-link {
    color: var(--db-text) !important;
}

.db-nav-link:not(.active):hover {
    color: var(--db-accent) !important;
}

/* The current page stays legible under the pointer.

   The hover rules above paint links in --db-accent, which is also the
   active item's background — hovering the page you are on used to paint
   its label in exactly its own background colour, at a contrast of 1.00.
   Those rules now carry :not(.active), so an active item never competes
   for the property and cannot lose it to source order.

   This block states the active colours outright and repeats them for the
   pointer and keyboard states, so the item holds still whichever way it
   is reached. The icons follow: they are stroked with currentColor. */
.db-nav-link.active,
.db-nav-link.active:hover,
.db-nav-link.active:focus,
.db-nav-link.active:focus-visible {
    background-color: var(--db-dark);
    color: #fff !important;
}

/* A dialog wraps its own text.

   Modals are written inside the thing they act on — the status dialog
   lives in the table row, whose action cell is .text-nowrap. white-space
   inherits down the DOM tree and not the visual one, so the dialog
   inherited nowrap and its prose ran out of the card: 648px of text in a
   466px box. What is around it in the markup should not decide how it
   reads. Anything inside that wants a single line still says so with
   .text-nowrap, which is !important and still wins. */
.modal-content {
    white-space: normal;
}

/* Logout link — slightly distinct from regular nav items */
.db-nav-link.db-nav-logout:hover{
    background-color: rgba(220, 38, 38, 0.12);
    color: #f87171;
}

.fix-header {
    margin-bottom: 18px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    box-shadow: var(--db-shadow);
}
/* A slimmer top bar across every portal */
.fix-header > div {
    min-height: 0 !important;
    padding-top: .5rem !important;
    padding-bottom: .5rem !important;
    padding-left: 1.1rem !important;
    padding-right: 1.1rem !important;
}
.fix-header h1 { font-size: clamp(15px, 2vw, 19px) !important; margin-bottom: 0 !important; line-height: 1.2; }
.fix-header p, .fix-header .small { font-size: 11.5px !important; margin-top: 1px !important; }

/* ================team lead css==================== */

/* =========================================================
   TEAM LEADS & AGENTS - RESPONSIVE
   ========================================================= */

.team-page {
    min-width: 0;
    width: 100%;
}

/* Cards */
.team-stat-card {
    min-height: 135px;
}

/* Search/filter area */
.team-filters {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) minmax(160px, 1fr);
    gap: 12px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991.98px) {

    .team-filters {
        grid-template-columns: 1fr 1fr;
    }

    .team-filters-search {
        grid-column: 1 / -1;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    .team-page {
        padding: 16px 
    }

}

    .add-member-modal .form-label { color: var(--db-text); }

    .add-member-modal .db-input {
        border: 1px solid var(--db-border);
        transition: border-color .15s ease, box-shadow .15s ease;
    }
    .add-member-modal .db-input:focus {
        border-color: var(--db-accent);
        box-shadow: 0 0 0 3px rgba(239, 93, 40, .15);
    }
    .add-member-modal .btn-close { filter: var(--bs-btn-close-filter); }

    /* --- Team Lead field: hidden by default, shown only when
           the Role select has "agent" chosen. Requires a browser
           that supports :has() (Chrome, Edge, Safari, Firefox 121+). --- */
    .add-member-modal .team-lead-field {
        display: none;
    }
    .add-member-modal:has(#memberRole option[value="agent"]:checked) .team-lead-field {
        display: block;
    }

    /* --- Password field wrapper --- */
    .add-member-modal .password-field-wrap {
        position: relative;
        border: 1px solid var(--db-border);
        background-color: var(--db-input-bg, var(--db-card));
        transition: border-color .15s ease, box-shadow .15s ease;
    }
    .add-member-modal .password-field-wrap:focus-within {
        border-color: var(--db-accent);
        box-shadow: 0 0 0 3px rgba(239, 93, 40, .15);
    }
    .add-member-modal .password-field-wrap input.pw-masked-input {
        background: transparent !important;
        /* Mask the characters visually — WebKit/Blink only.
           Firefox will just show plain text with no masking support,
           so it stays safely hidden either way once toggled. */
        -webkit-text-security: disc;
    }

    /* Hide the real checkbox, keep it accessible */
    .add-member-modal .pw-toggle-checkbox {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
        pointer-events: none;
    }

    .add-member-modal .password-toggle-btn {
        margin: 0;
        padding: 0 12px;
        display: inline-flex;
        align-items: center;
        color: var(--db-text-muted);
        cursor: pointer;
        transition: color .15s ease;
    }
    .add-member-modal .password-toggle-btn:hover {
        color: var(--db-accent);
    }

    /* Default state: masked, "eye" (show) icon visible */
    .add-member-modal .pw-icon-hide { display: none; }
    .add-member-modal .pw-icon-show { display: block; }

    /* When checkbox is checked: reveal characters, swap icon */
    .add-member-modal .pw-toggle-checkbox:checked ~ .pw-masked-input {
        -webkit-text-security: none;
    }
    .add-member-modal .pw-toggle-checkbox:checked ~ .password-toggle-btn .pw-icon-show { display: none; }
    .add-member-modal .pw-toggle-checkbox:checked ~ .password-toggle-btn .pw-icon-hide { display: block; }

    

    .create-team-modal .form-label {
        color: var(--db-text) !important;
    }

    .create-team-modal .db-input {
        min-height: 46px;

        background-color: var(--db-bg) !important;
        color: var(--db-text) !important;

        border: 1px solid var(--db-border) !important;
    }

    .create-team-modal .db-input:focus {
        border-color: var(--db-accent) !important;

        box-shadow:
            0 0 0 3px rgba(147, 51, 234, .12) !important;
    }

    .create-team-modal .db-input option {
        background: #18181d;
        color: #fff;
    }


    /* CREATE TEAMS  */

    .agent-input-row {
        display: flex;
        gap: 10px;
    }

    .add-agent-modal-btn {
        min-width: 85px;

        background: rgba(147, 51, 234, .12);
        border: 1px solid rgba(147, 51, 234, .35);

        color: var(--db-accent);

        font-weight: 600;
    }

    .add-agent-modal-btn:hover {
        background: var(--db-accent);
        color: white;
    }


    /* Selected agent */

    .selected-agent-item {
        display: flex;
        align-items: center;
        gap: 12px;

        padding: 10px 12px;

        border: 1px solid var(--db-border);
        border-radius: 10px;

        background: rgba(255, 255, 255, .02);

        margin-bottom: 8px;
    }

    .selected-agent-avatar {
        width: 34px;
        height: 34px;

        border-radius: 50%;

        display: flex;
        align-items: center;
        justify-content: center;

        background: rgba(147, 51, 234, .12);
        color: var(--db-accent);

        font-size: 13px;
        font-weight: 600;

        flex-shrink: 0;
    }

    .selected-agent-name {
        color: var(--db-text);
        font-size: 14px;
        font-weight: 500;
    }

    .selected-agent-role {
        color: var(--db-text-muted);
        font-size: 12px;
    }

    .remove-agent-btn {
        width: 30px;
        height: 30px;

        border: 0;
        border-radius: 7px;

        background: transparent;
        color: var(--db-text-muted);

        display: flex;
        align-items: center;
        justify-content: center;

        margin-left: auto;
    }

    .remove-agent-btn:hover {
        background: rgba(239, 68, 68, .10);
        color: #ef4444;
    }


    /* Mobile */

    @media (max-width: 576px) {

        .agent-input-row {
            flex-direction: column;
        }

        .add-agent-modal-btn {
            width: 100%;
        }

    }

.team-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--db-border);
    color: var(--db-text);
}

/* Manager Avatar */
.manager-avatar {
    width: 44px;
    height: 44px;
    background: var(--db-accent);
    font-size: 16px;
}

/* Team Lead Avatar */
.lead-avatar {
    width: 36px;
    height: 36px;
    background: rgba(147, 51, 234, 0.15);
    color: var(--db-accent) !important;
    font-size: 14px;
}

/* Agent Row */
.agent-item {
    padding: 8px 0;
}

.agent-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(147, 51, 234, 0.12);
    color: var(--db-accent);
    font-size: 12px;
    font-weight: 600;
}

/* Agent Buttons */
.agent-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.agent-action-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--db-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--db-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.agent-action-btn:hover {
    background: rgba(147, 51, 234, 0.12);
    border-color: rgba(147, 51, 234, 0.35);
    color: var(--db-accent);
}

.agent-action-btn.agent-action-danger:hover {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.30);
    color: #ef4444;
}

/* Add Agent Button */
.add-agent-btn {
    height: 36px;
    border: 1px solid var(--db-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--db-text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-agent-btn:hover {
    background: rgba(147, 51, 234, 0.10);
    border-color: rgba(147, 51, 234, 0.35);
    color: var(--db-accent);
}

/* Three Dots Button */
.card-menu-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--db-border);
    border-radius: 8px;
    background: transparent;
    color: var(--db-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.card-menu-btn:hover {
    background: rgba(147, 51, 234, 0.10);
    color: var(--db-accent);
}

/* Dropdown */
.team-card .dropdown-menu {
    background: var(--db-card);
    border: 1px solid var(--db-border);
    border-radius: 10px;
}

.team-card .dropdown-item {
    color: var(--db-text);
}

.team-card .dropdown-item:hover {
    background: rgba(147, 51, 234, 0.10);
    color: var(--db-text);
}

/* Tree Connection */
.tree-line {
    width: 1px;
    height: 35px;
    background: var(--db-border);
}
/* =========================================
   TEAM CARD COLLAPSE
   ========================================= */

.team-expand-btn {
    width: 34px;
    height: 34px;
    padding: 0;

    border: 1px solid var(--db-border);
    border-radius: 8px;

    background: transparent;
    color: var(--db-text-muted);

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s ease;
}

.team-expand-btn:hover {
    background: rgba(147, 51, 234, .10);
    border-color: rgba(147, 51, 234, .35);
    color: var(--db-accent);
}

.team-expand-btn i {
    transition: transform 0.25s ease;
}

/* Arrow turns upward when team is open */
.team-expand-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Keep the collapse animation clean */
.team-card .collapse {
    transition: height 0.25s ease;
}

/* Mobile */
@media (max-width: 576px) {
    .agent-actions {
        gap: 4px;
    }

    .agent-action-btn {
        width: 30px;
        height: 30px;
    }
}



        .managers-page .btn-add-manager {
            transition: transform .15s ease, box-shadow .15s ease;
            box-shadow: 0 6px 16px -8px rgba(139, 92, 246, .55);
        }
        .managers-page .btn-add-manager:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 20px -8px rgba(139, 92, 246, .6);
            color: #fff;
        }

        .managers-page .mgr-stat-card {
            border: 1px solid var(--db-border);
            border-top: 3px solid transparent;
            transition: transform .18s ease, box-shadow .18s ease;
        }
        .managers-page .mgr-stat-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .18);
        }
        .managers-page .mgr-stat-card[data-accent="managers"] { border-top-color: var(--db-accent); }
        .managers-page .mgr-stat-card[data-accent="leads"] { border-top-color: #3b82f6; }
        .managers-page .mgr-stat-card[data-accent="active"] { border-top-color: #22c55e; }
        .managers-page .mgr-stat-card[data-accent="inactive"] { border-top-color: #ef4444; }

        .managers-page .stat-icon-chip {
            width: 40px; height: 40px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 10px;
        }
        .managers-page .stat-value {
            font-size: clamp(22px, 2.4vw, 28px);
            letter-spacing: -0.02em;
        }

        .managers-page .db-input-wrap,
        .managers-page select.db-input {
            border: 1px solid var(--db-border);
            height: 44px;
            transition: border-color .15s ease, box-shadow .15s ease;
        }
        .managers-page .db-input-wrap:focus-within,
        .managers-page select.db-input:focus {
            border-color: var(--db-accent);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
        }

        .managers-page .db-table thead th {
            font-size: 12.5px; font-weight: 600; text-transform: uppercase;
            letter-spacing: .04em; color: var(--db-text-muted);
            border-bottom: 1px solid var(--db-border); padding-bottom: 12px; white-space: nowrap;
        }
        .managers-page .db-table tbody tr {
            border-bottom: 1px solid var(--db-border);
            transition: background-color .15s ease;
        }
        .managers-page .db-table tbody tr:last-child { border-bottom: none; }
        .managers-page .db-table tbody tr:hover { background-color: rgba(139, 92, 246, .04); }
        .managers-page .db-table td { padding-top: 14px; padding-bottom: 14px; }

        .managers-page .member-avatar {
            width: 40px; height: 40px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-weight: 600; font-size: 13.5px;
        }

        .managers-page .role-badge {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
        }
        .managers-page .role-badge::before {
            content: ""; width: 6px; height: 6px; border-radius: 50%;
            background: currentColor; flex-shrink: 0;
        }

        .managers-page .db-action-btn {
            width: 32px; height: 32px; border-radius: 8px;
            border: 1px solid var(--db-border); background: transparent;
            color: var(--db-text-muted);
            transition: background-color .15s ease, color .15s ease, border-color .15s ease;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .managers-page .db-action-btn:hover {
            background: rgba(139, 92, 246, .1);
            border-color: var(--db-accent);
            color: var(--db-accent);
        }
        .managers-page .db-action-btn.db-action-danger:hover {
            background: rgba(239, 68, 68, .1);
            border-color: #ef4444;
            color: #ef4444;
        }

        .managers-page .pagination-btn {
            min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px;
            border: 1px solid var(--db-border); background: transparent;
            color: var(--db-text-muted); font-size: 13.5px;
            transition: background-color .15s ease, color .15s ease, border-color .15s ease;
        }
        .managers-page .pagination-btn:hover { border-color: var(--db-accent); color: var(--db-accent); }
        .managers-page .pagination-btn.is-active {
            background: var(--db-accent); border-color: var(--db-accent); color: #fff; font-weight: 600;
        }

        .mgr-modal .form-label { color: var(--db-text); }
        .mgr-modal .db-input {
            border: 1px solid var(--db-border);
            transition: border-color .15s ease, box-shadow .15s ease;
        }
        .mgr-modal .db-input:focus {
            border-color: var(--db-accent);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
        }
        .mgr-modal .btn-close { filter: var(--bs-btn-close-filter); }

        .delete-warn-icon {
            width: 36px; height: 36px; border-radius: 10px;
            background: rgba(239, 68, 68, .12); color: #ef4444;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
   


        /* ==============================VENDOR=========================== */

        .vendor-page .vendor-stat-card {
        border: 1px solid var(--db-border);
        border-top: 3px solid transparent;
        transition: transform .18s ease, box-shadow .18s ease;
    }

    .vendor-page .vendor-stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .18);
    }

    .vendor-page .vendor-stat-card[data-accent="leads"] {
        border-top-color: var(--db-accent);
    }

    .vendor-page .vendor-stat-card[data-accent="vendors"] {
        border-top-color: #3b82f6;
    }

    .vendor-page .vendor-stat-card[data-accent="top"] {
        border-top-color: #22c55e;
    }

    .vendor-page .vendor-stat-card[data-accent="unassigned"] {
        border-top-color: #ef4444;
    }

    .vendor-page .stat-icon-chip {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }

    .vendor-page .stat-value {
        font-size: clamp(22px, 2.4vw, 28px);
        letter-spacing: -0.02em;
    }

    .vendor-page .db-input-wrap,
    .vendor-page select.db-input {
        border: 1px solid var(--db-border);
        height: 44px;
        transition: border-color .15s ease, box-shadow .15s ease;
    }

    .vendor-page .db-input-wrap:focus-within,
    .vendor-page select.db-input:focus {
        border-color: var(--db-accent);
        box-shadow: 0 0 0 3px rgba(147, 51, 234, .12);
    }

    .vendor-page .db-table thead th {
        font-size: 12.5px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--db-text-muted);
        border-bottom: 1px solid var(--db-border);
        padding-bottom: 12px;
        white-space: nowrap;
    }

    .vendor-page .db-table tbody tr {
        border-bottom: 1px solid var(--db-border);
        transition: background-color .15s ease;
    }

    .vendor-page .db-table tbody tr:last-child {
        border-bottom: none;
    }

    .vendor-page .db-table tbody tr:hover {
        background-color: rgba(147, 51, 234, .04);
    }

    .vendor-page .db-table td {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .vendor-page .row-avatar {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 600;
        flex-shrink: 0;
    }

    .vendor-page .vendor-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        border-radius: 999px;
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
    }

    .vendor-page .pagination-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        border-radius: 999px;
        border: 1px solid var(--db-border);
        background: transparent;
        color: var(--db-text-muted);
        font-size: 13.5px;
        transition: background-color .15s ease, color .15s ease, border-color .15s ease;
    }

    .vendor-page .pagination-btn:hover {
        border-color: var(--db-accent);
        color: var(--db-accent);
    }

    .vendor-page .pagination-btn.is-active {
        background: var(--db-accent);
        border-color: var(--db-accent);
        color: #fff;
        font-weight: 600;
    }
        .vendor-badge {
            display: inline-block;
            padding: 0.3rem 0.65rem;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 500;
        }
        .stat-icon-chip {
            width: 38px;
            height: 38px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .stat-value {
            font-size: 1.5rem;
        }
        .add-member-modal {
            background: var(--db-card);
            color: var(--db-text);
        }
        .add-member-modal .db-input {
            border: 1px solid var(--db-border);
        }
    @media (min-width: 992px) {
        .vendor-page .col-lg-2-5 {
            flex: 0 0 auto;
            width: 20%;
        }
    }
     /* ===================== ORG TREE ===================== */
        .manager-avatar, .lead-avatar, .agent-avatar, .selected-agent-avatar {
            color: #fff; font-weight: 700; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .manager-avatar {
            width: 54px; height: 54px; font-size: 19px; border-radius: 50%;
            background: linear-gradient(135deg, #8b5cf6, #6d28d9);
            box-shadow: 0 6px 16px rgba(139, 92, 246, .35);
        }
        .lead-avatar {
            width: 40px; height: 40px; font-size: 15px; border-radius: 50%;
            background: linear-gradient(135deg, #6366f1, #4338ca);
            box-shadow: 0 4px 10px rgba(99, 102, 241, .30);
        }
        .agent-avatar {
            width: 34px; height: 34px; font-size: 13px; border-radius: 50%;
            background: linear-gradient(135deg, #22c55e, #15803d);
            box-shadow: 0 3px 8px rgba(34, 197, 94, .28);
        }

        /* connector under the admin node */
        .tree-connector {
            width: 2px; height: 26px; margin: 10px auto 0;
            background: linear-gradient(var(--db-accent), transparent);
            opacity: .5;
        }

        .team-card {
            border: 1px solid var(--db-border);
            background: var(--db-panel);
            transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
        }
        .team-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 14px 30px rgba(17, 24, 39, .10);
            border-color: var(--db-accent);
        }

        .agent-item {
            border: 1px solid var(--db-border);
            border-radius: 12px;
            background: rgba(139, 92, 246, .045);
            padding: 8px 10px;
            transition: border-color .15s ease, background .15s ease;
        }
        .agent-item:hover { border-color: var(--db-accent); background: rgba(139, 92, 246, .09); }

        /* round icon buttons: expand + remove */
        .team-expand-btn, .node-remove-btn {
            width: 30px; height: 30px; flex-shrink: 0; padding: 0;
            display: inline-flex; align-items: center; justify-content: center;
            border-radius: 8px; border: 1px solid var(--db-border);
            background: var(--db-panel); color: var(--db-text-muted);
            transition: all .15s ease;
        }
        .team-expand-btn:hover { border-color: var(--db-accent); color: var(--db-accent); }
        .team-expand-btn i { transition: transform .2s ease; }
        .team-expand-btn[aria-expanded="true"] i { transform: rotate(180deg); }
        .node-remove-btn { color: #ef4444; }
        .node-remove-btn:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
        .node-remove-form { display: inline-flex; margin: 0; }

        /* dashed "add" buttons */
        .add-agent-btn {
            background: transparent; border: 1.5px dashed var(--db-border);
            color: var(--db-text-muted); border-radius: 12px; padding: 9px 16px;
            font-size: 13px; font-weight: 600;
            display: inline-flex; align-items: center; justify-content: center;
            transition: all .15s ease;
        }
        .add-agent-btn:hover { border-color: var(--db-accent); color: var(--db-accent); background: rgba(139, 92, 246, .06); }

        /* create-team modal: agent picker + chips */
        .agent-input-row { display: flex; gap: 10px; align-items: stretch; }
        .add-agent-modal-btn {
            background: var(--db-accent); color: #fff; border: none;
            display: inline-flex; align-items: center; gap: 6px;
            padding: 0 16px; font-weight: 600; white-space: nowrap;
        }
        .add-agent-modal-btn:hover { filter: brightness(1.08); color: #fff; }
        .selected-agents { display: flex; flex-direction: column; gap: 8px; }
        .empty-agents { border: 1.5px dashed var(--db-border); border-radius: 12px; }
        .selected-agent-item {
            display: flex; align-items: center; gap: 12px;
            border: 1px solid var(--db-border); border-radius: 12px;
            background: rgba(139, 92, 246, .05); padding: 8px 12px;
        }
        .selected-agent-avatar {
            width: 34px; height: 34px; font-size: 13px;
            background: linear-gradient(135deg, #22c55e, #15803d);
        }
        .selected-agent-name { font-weight: 600; font-size: 14px; color: var(--db-text); }
        .selected-agent-role { font-size: 12px; color: var(--db-text-muted); }
        .remove-agent-btn {
            margin-left: auto; width: 30px; height: 30px; flex-shrink: 0;
            display: inline-flex; align-items: center; justify-content: center;
            border: none; border-radius: 8px; background: transparent; color: #ef4444;
            transition: all .15s ease;
        }
        .remove-agent-btn:hover { background: #ef4444; color: #fff; }

        /* delete-manager modal options */
        .delete-opt {
            border: 1px solid var(--db-border); border-radius: 12px;
            padding: 12px 14px; transition: border-color .15s ease;
        }
        .delete-opt:hover { border-color: var(--db-accent); }
        .delete-opt label { cursor: pointer; margin: 0; }
        .delete-opt input[type="radio"] { margin-top: 3px; accent-color: var(--db-accent); }
/* --- Scrollable modals whose form wraps the header/body/footer --------------
   Bootstrap makes .modal-content a flex column so .modal-body can shrink and
   scroll. When a <form> sits between them that chain is broken: the body grows
   to its full content height and .modal-content simply clips it, so nothing
   scrolls. Passing the flex column through the form restores it. */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
    min-height: 0;
    overflow-y: auto;
}

/* The avatar and name in the header open the profile page. Nothing marks that
   as clickable on its own, so give it a hover cue. */
.profile-link {
    padding: 4px 6px;
    border-radius: 10px;
    transition: background-color .15s ease;
}

.profile-link:hover,
.profile-link:focus-visible {
    background-color: var(--db-surface-2);
}

/* ============================================================
   HIGHLIGHT — the row a notification pointed at
   Added by the shared script in components/layout.blade.php when the
   URL carries ?highlight=<id>. Fades itself out so the page does not
   stay marked up after you have seen it.
   ============================================================ */
.db-highlight {
    animation: dbHighlightPulse 2.4s ease-out 2;
    /* A left edge that survives the fade, so the row stays findable. */
    box-shadow: inset 3px 0 0 0 var(--db-accent);
    transition: background-color .6s ease;
}

.db-highlight.db-highlight-done {
    animation: none;
    background-color: transparent;
}

@keyframes dbHighlightPulse {
    0%   { background-color: rgba(139, 92, 246, .28); }
    100% { background-color: rgba(139, 92, 246, .04); }
}

@media (prefers-reduced-motion: reduce) {
    .db-highlight { animation: none; background-color: rgba(139, 92, 246, .14); }
}

/* ============================================================
   FINANCE MANAGER PORTAL
   Marks are thin, data-ends are rounded, and every bar measures a
   single magnitude in the base currency, so one hue throughout.
   Everything animated here is decorative and switches off under
   prefers-reduced-motion.
   ============================================================ */

.fm-rise {
    animation: fmRise .5s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: var(--d, 0ms);
}

@keyframes fmRise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* --- headline tiles --------------------------------------------- */
.fm-tile {
    transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s;
}

.fm-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(24, 24, 27, .10);
}

/* The one figure the page is really about. */
.fm-tile-lead {
    box-shadow: inset 3px 0 0 0 var(--db-accent);
}

/* --- the column chart -------------------------------------------- */
.fm-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    min-height: 210px;
}

.fm-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.fm-col-track {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, var(--db-surface-2) 1px, transparent 1px) 0 0 / 100% 30px;
}

.fm-col-bar {
    display: block;
    width: 100%;
    height: var(--h, 0%);
    border-radius: 4px 4px 0 0;          /* rounded data-end, flat on the baseline */
    background: color-mix(in srgb, var(--db-accent) 34%, transparent);
    animation: fmGrow .8s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: var(--d, 500ms);
    transition: background-color .2s;
}

/* The month being reported on is the subject; the rest are context. */
.fm-col-bar.is-current {
    background: var(--db-accent);
}

.fm-col:hover .fm-col-bar {
    background: color-mix(in srgb, var(--db-accent) 62%, transparent);
}

.fm-col:hover .fm-col-bar.is-current {
    background: var(--db-accent);
}

.fm-col-value,
.fm-col-label {
    font-size: 11px;
    color: var(--db-text-muted);
    white-space: nowrap;
}

.fm-col-value { font-weight: 600; }

@keyframes fmGrow {
    from { height: 0; }
    to   { height: var(--h, 0%); }
}

/* --- horizontal magnitude bars ----------------------------------- */
.fm-track {
    height: 10px;
    border-radius: 999px;
    background: var(--db-surface-2);
    overflow: hidden;
}

.fm-fill {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 4px;
    background: var(--db-accent);
    animation: fmGrowW .9s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: var(--d, 600ms);
}

@keyframes fmGrowW {
    from { width: 0; }
    to   { width: var(--w, 0%); }
}

/* --- the calculation steps --------------------------------------- */
.fm-step {
    padding: 8px 0;
    border-bottom: 1px solid var(--db-border);
}

.fm-step:last-child { border-bottom: 0; }

.fm-step.is-total {
    background: var(--db-surface-2);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 6px 0;
    border-bottom: 0;
}

.fm-sign {
    display: inline-block;
    width: 12px;
    color: var(--db-text-muted);
    font-weight: 700;
}

/* --- nav items that are not built yet ---------------------------- */
.db-nav-link.fm-soon {
    opacity: .5;
    cursor: default;
}

.fm-soon-tag {
    margin-left: auto;
    font-size: 10px;
    font-style: normal;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

/* --- people who ask for less motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .fm-rise,
    .fm-col-bar,
    .fm-fill {
        animation: none;
    }

    .fm-col-bar { height: var(--h, 0%); }
    .fm-fill    { width: var(--w, 0%); }
    .fm-tile    { transition: none; }
}

/* ============================================================
   FINANCE MANAGER — further marks
   A stacked bar for a part-of-whole split, a meter for progress
   against a fixed total, a diverging bar for polarity, and a
   timeline for the audit trail. Same rules as above: thin marks,
   rounded data-ends, one hue unless the data is genuinely
   two-sided, and every animation switches off under
   prefers-reduced-motion.
   ============================================================ */

/* --- stacked distribution bar ------------------------------------ */
.fm-stack {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--db-surface-2);
    gap: 2px;                            /* the 2px surface gap between fills */
}

.fm-stack-seg {
    display: block;
    width: var(--w, 0%);
    height: 100%;
    animation: fmGrowW .9s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: var(--d, 400ms);
}

.fm-stack-seg:first-child { border-radius: 999px 0 0 999px; }
.fm-stack-seg:last-child  { border-radius: 0 999px 999px 0; }

/*
   Two segments can share a reserved status hue — Pending and Partially Paid
   are both warnings — and land side by side, where identical fills cannot be
   told apart. A 45-degree texture separates them without inventing a sixth
   hue, and keeps working for colour-blind readers and in print.
*/
.fm-stack-seg.is-textured,
.fm-dot.is-textured {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, .55) 0,
        rgba(255, 255, 255, .55) 2px,
        transparent 2px,
        transparent 5px
    );
}

/* --- the legend swatch -------------------------------------------- */
.fm-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* --- progress against a fixed total ------------------------------- */
.fm-meter {
    height: 14px;
    border-radius: 999px;
    background: var(--db-surface-2);
    overflow: hidden;
}

.fm-meter-fill {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 999px;
    background: var(--db-accent);
    animation: fmGrowW .9s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: var(--d, 400ms);
}

/* --- diverging bar: earnings right, deductions left --------------- */
.fm-diverge {
    display: flex;
    align-items: center;
    height: 12px;
}

/*
   Two equal halves with a fixed axis between them. The bars are sized against
   their own half, so the centre line stays centred whatever the values are —
   giving each bar the whole track and an auto margin instead would let the
   axis drift with the left-hand value.
*/
.fm-diverge-side {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
}

.fm-diverge-side.is-left  { justify-content: flex-end; }
.fm-diverge-side.is-right { justify-content: flex-start; }

.fm-diverge-neg,
.fm-diverge-pos {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    animation: fmGrowW .9s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: var(--d, 400ms);
}

.fm-diverge-neg {
    border-radius: 4px 0 0 4px;          /* rounded away from the axis */
    background: #6b7280;                 /* neutral ink, not a series hue */
}

.fm-diverge-pos {
    border-radius: 0 4px 4px 0;
    background: var(--db-accent);
}

/* The neutral midpoint a diverging scale needs. */
.fm-diverge-axis {
    flex: 0 0 2px;
    height: 18px;
    background: var(--db-border);
}

/* --- the contract picker ------------------------------------------
   A search box over a list, rather than a <select>: a native dropdown
   cannot be typed into, and once a portfolio runs past a dozen contracts
   scrolling one is the slowest part of recording a payment.
*/
.fm-combo {
    position: relative;
}

.fm-combo-list {
    position: absolute;
    z-index: 1060;          /* above the modal's own stacking context */
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 244px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--db-border);
    border-radius: 12px;
    background: var(--db-panel, #fff);
    box-shadow: 0 12px 28px rgba(24, 24, 27, .14);
}

.fm-combo-item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    line-height: 1.35;
}

.fm-combo-item:hover,
.fm-combo-item.is-active {
    background: rgba(139, 92, 246, .10);
}

.fm-combo-item .fm-combo-code {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--db-text);
}

.fm-combo-item .fm-combo-meta {
    display: block;
    font-size: 12px;
    color: var(--db-text-muted);
}

/* The term that matched, so it is obvious why a row is in the list. */
.fm-combo-item mark {
    padding: 0;
    background: rgba(250, 178, 25, .34);
    color: inherit;
}

.fm-combo-empty {
    padding: 10px;
    font-size: 13px;
    color: var(--db-text-muted);
}

/* --- per-row actions ---------------------------------------------- */
.fm-row-action {
    border: 1px solid var(--db-border);
    color: var(--db-text-muted);
    font-size: 12px;
    padding: 3px 10px;
}

.fm-row-action:hover {
    border-color: var(--db-accent);
    color: var(--db-accent);
}

/*
   Delete is recessive until it is reached for. It reads as an ordinary action
   at rest, and only declares itself destructive on hover — loud red on every
   row would make the whole table look like a warning.
*/
.fm-row-action.is-danger:hover {
    border-color: #d03b3b;
    color: #a32a2a;
    background: rgba(208, 59, 59, .06);
}

/* --- the audit trail ---------------------------------------------- */
.fm-timeline {
    position: relative;
    padding-left: 22px;
}

.fm-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--db-border);
}

.fm-timeline-item {
    position: relative;
    padding: 10px 0;
    border-bottom: 1px solid var(--db-border);
}

.fm-timeline-item:last-child { border-bottom: 0; }

.fm-timeline-dot {
    position: absolute;
    left: -22px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--db-surface);
    border: 2px solid var(--db-accent);
}

@media (prefers-reduced-motion: reduce) {
    .fm-stack-seg,
    .fm-meter-fill,
    .fm-diverge-neg,
    .fm-diverge-pos {
        animation: none;
    }

    .fm-stack-seg,
    .fm-meter-fill,
    .fm-diverge-neg,
    .fm-diverge-pos { width: var(--w, 0%); }
}

/* ============================================================
   Pagination (Laravel + Bootstrap 5)

   Laravel renders the pager and the "Showing x to y of z" line
   together. Bootstrap lays them out; these rules only colour
   them, using the same variables as every other surface.
   ============================================================ */

.db-bg .pagination {
    margin-bottom: 0;
    gap: 4px;
}

.db-bg .page-link {
    background-color: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: 8px;
    color: var(--db-text);
    font-size: 14px;
    min-width: 38px;
    padding: 7px 12px;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.db-bg .page-link:hover {
    background-color: var(--db-surface-2);
    border-color: var(--db-accent);
    color: var(--db-accent);
}

/* Keyboard focus has to stay visible, but Bootstrap's blue glow does not
   belong here. */
.db-bg .page-link:focus {
    background-color: var(--db-surface-2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .25);
    color: var(--db-accent);
    outline: none;
}

.db-bg .page-item.active .page-link {
    background-color: var(--db-accent);
    border-color: var(--db-accent);
    color: #fff;
}

.db-bg .page-item.disabled .page-link {
    background-color: var(--db-surface);
    border-color: var(--db-border);
    color: var(--db-text-muted);
    opacity: .55;
}

/* The "Showing 1 to 10 of 20 results" line beside the pager.
   Laravel's pager nav carries no role attribute, so it is found by the
   pagination list inside it. */
.db-bg nav:has(.pagination) p {
    color: var(--db-text-muted);
    font-size: 14px;
    margin-bottom: 0;
}

.db-bg nav:has(.pagination) p strong,
.db-bg nav:has(.pagination) p span {
    color: var(--db-text);
    font-weight: 600;
}

/* On a narrow screen Laravel shows only Previous/Next. Let them share the
   row evenly rather than hugging the left edge. */
@media (max-width: 575.98px) {
    .db-bg nav:has(.pagination) .pagination {
        justify-content: center;
        width: 100%;
    }
}

/* =========================================================
   CAMPUSHUB THEME REFINEMENTS (global, all portals)
   ========================================================= */

/* Form focus: a soft orange ring everywhere */
.db-bg .form-control:focus,
.db-bg .form-select:focus,
.db-input:focus{
    border-color: var(--db-accent) !important;
    box-shadow: 0 0 0 3px var(--db-accent-soft) !important;
    outline: none;
}

/* Buttons */
.db-btn-primary{
    background: var(--db-accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .6rem 1.25rem;
    font-weight: 600;
    transition: filter .15s ease, transform .15s ease;
}
.db-btn-primary:hover{ filter: brightness(.95); color:#fff; }
.db-btn-dark{
    background: var(--db-dark);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .6rem 1.25rem;
    font-weight: 600;
    transition: filter .15s ease, transform .15s ease;
}
.db-btn-dark:hover{ filter: brightness(1.25); color:#fff; }

/* Softer, rounder badges — proper pills with a visible fill + matching outline */
.db-bg .badge{
    border-radius: 999px;
    font-weight: 600;
    padding: .4em .8em;
    border: 1px solid currentColor;
}

/* Rounder tables inside panels already handled by .db-panel radius */

/* Pagination active state follows the accent */
.db-bg .page-item.active .page-link{
    background-color: var(--db-accent);
    border-color: var(--db-accent);
    color:#fff;
}
.db-bg .page-link{ color: var(--db-text); }
.db-bg .page-link:hover{ color: var(--db-accent); }

/* ---- Dashboard hero ---- */
.db-hero{
    position: relative;
    border-radius: var(--db-radius);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(120% 140% at 85% 10%, rgba(245,135,63,.55) 0%, rgba(239,93,40,.0) 55%),
        linear-gradient(120deg, #2a1c12 0%, #3a2112 38%, #b4431b 78%, #ef7a2e 100%);
    box-shadow: var(--db-shadow);
}
.db-hero-inner{ position: relative; z-index: 2; padding: 2rem 2.25rem; }
.db-hero h1{ color:#fff !important; font-weight: 700; line-height: 1.05; }
.db-hero .db-hero-eyebrow{
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .72rem;
    color: rgba(255,255,255,.72);
}
.db-hero-btn{
    display:inline-flex; align-items:center; gap:.5rem;
    background:#fff; color:#1a1713 !important;
    border-radius:999px; padding:.65rem 1.3rem; font-weight:600;
    text-decoration:none; transition: transform .15s ease, box-shadow .15s ease;
}
.db-hero-btn:hover{ transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.25); color:#1a1713; }
.db-hero-glass{
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: blur(6px);
    border-radius: 16px;
}
@media (max-width: 575.98px){
    .db-hero-inner{ padding: 1.5rem 1.4rem; }
}

/* Stat card: subtle top-to-bottom tint and a crisp icon chip */
.db-stat-spark{ opacity:.9; }

/* ===== Profile page (shared across portals) ===== */
.profile-hero{
    height: 120px;
    border-radius: var(--db-radius);
    background:
        radial-gradient(120% 160% at 85% 0%, rgba(245,135,63,.55) 0%, rgba(239,93,40,0) 55%),
        linear-gradient(120deg, #2a1c12 0%, #3a2112 35%, #b4431b 75%, #ef7a2e 100%);
    box-shadow: var(--db-shadow);
}
.profile-head{
    display: flex; align-items: flex-end; gap: 1rem;
    margin-top: -48px; padding-left: 1.25rem;
}
.profile-avatar-lg{
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--db-dark); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 2rem;
    border: 4px solid var(--db-surface);
    box-shadow: var(--db-shadow);
    position: relative; flex-shrink: 0;
}
.profile-status-dot{
    position: absolute; right: 7px; bottom: 7px;
    width: 15px; height: 15px; border-radius: 50%;
    background: #22c55e; border: 3px solid var(--db-surface);
}
.profile-identity{ padding-bottom: .35rem; min-width: 0; }
.profile-avatar-sm{
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--db-dark); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.profile-tab{
    display: flex; align-items: center; gap: .65rem; width: 100%;
    padding: .7rem .85rem; border: 0; background: transparent;
    border-radius: 12px; border-left: 3px solid transparent;
    color: var(--db-text-muted); font-weight: 500; font-size: .92rem;
    text-align: left; transition: background-color .15s ease, color .15s ease;
}
.profile-tab:hover{ background: var(--db-surface-2); color: var(--db-text); }
.profile-tab.active{
    background: var(--db-surface-2); color: var(--db-text);
    border-left-color: var(--db-accent);
}
.profile-tab svg{ flex-shrink: 0; }
@media (max-width: 575.98px){
    .profile-head{ margin-top: -38px; padding-left: .25rem; gap: .75rem; }
    .profile-avatar-lg{ width: 80px; height: 80px; font-size: 1.5rem; }
}

/* ---- Typography: a clean body face and a characterful display face ---- */
.db-bg, .db-sidebar{
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.db-bg h1, .db-bg h2, .db-bg h3, .db-bg h4, .db-bg h5, .db-bg h6,
.db-hero h1{
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -0.015em;
}
/* Big stat numbers read as a display element */
.db-panel h2{
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

/* ---- Cards: a touch more breathing room + crisp chip ---- */
.db-icon-chip{
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.02);
}
.db-panel .db-icon-chip svg{ stroke-width: 2.1; }

/* ---- Tables: keep the pill header clear of the rounded panel edge ---- */
.db-panel > .table-responsive,
.db-panel .table-responsive{ border-radius: 12px; }
.db-table td .fw-semibold, .db-table td .fw-medium{ color: var(--db-text); }

/* The avatar square in a table row (initials) — like the reference's dark tile */
.db-row-avatar{
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
    background: var(--db-dark); color: #fff;
    flex-shrink: 0;
}
/* Roomier rows so each one reads as its own block, like the reference */
.db-table tbody td{ padding-top: 1rem; padding-bottom: 1rem; }
/* The small secondary line under a row's main text */
.db-row-sub{ color: var(--db-text-muted); font-size: .8rem; }

/* ===== Separated "card" rows (reference style): each row a rounded,
         bordered band with a gap between them ===== */
.db-table{ border-collapse: separate; border-spacing: 0 10px; }
.db-table thead th{ padding-top: .1rem; padding-bottom: .55rem; }
.db-table tbody tr{ background: transparent; }
.db-table tbody td{
    background: var(--db-surface);
    border-top: 1px solid var(--db-border) !important;
    border-bottom: 1px solid var(--db-border) !important;
}
.db-table tbody td:first-child{
    border-left: 1px solid var(--db-border) !important;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
    padding-left: 1.1rem;
}
.db-table tbody td:last-child{
    border-right: 1px solid var(--db-border) !important;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}
.db-table tbody tr:hover td{
    background: color-mix(in srgb, var(--db-accent) 5%, var(--db-surface));
}
.db-table tbody tr:hover td:first-child{
    box-shadow: inset 4px 0 0 var(--db-accent);
}
/* The empty-state row shouldn't look like a card band */
.db-table tbody tr td[colspan]{
    border-radius: 14px !important;
    border: 1px dashed var(--db-border) !important;
}
/* When the table sits flush in a padding-less panel, give the card rows a
   little horizontal + bottom room so they don't touch the panel edges.
   (Pages that already wrap the table in a padded div are not double-padded,
   because this only targets a table-responsive that is a DIRECT panel child.) */
.db-panel > .table-responsive{
    padding-left: .9rem;
    padding-right: .9rem;
    padding-bottom: .5rem;
}

/* Modals follow the same soft, rounded language */
.modal-content{
    border-radius: var(--db-radius) !important;
    border: 1px solid var(--db-border) !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.18) !important;
}

/* Primary action buttons that use the accent inline get a pill + lift */
.db-bg .btn[style*="--db-accent"],
.db-bg .btn[style*="var(--db-accent)"]{
    border-radius: 999px;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.db-bg .btn[style*="--db-accent"]:hover,
.db-bg .btn[style*="var(--db-accent)"]:hover{
    filter: brightness(.96);
    transform: translateY(-1px);
}

/* ---- Table action column: keep every row's icons on ONE line ---- */
.db-table td.text-end,
.db-table th.text-end{ white-space: nowrap; }
.db-table td.text-end .db-action-btn{
    width: 30px; height: 30px;
    margin: 0 0 0 4px !important;
    vertical-align: middle;
}
.db-table td.text-end > .db-action-btn:first-child,
.db-table td.text-end > a.db-action-btn:first-child{ margin-left: 0 !important; }
/* The status-change control renders a button + a hidden modal; keep its button inline */
.db-table td.text-end > .d-inline,
.db-table td.text-end form.d-inline{ display: inline-flex !important; vertical-align: middle; margin-left: 4px; }

/* Tighter cells so a wide table is less likely to need a scrollbar */
.db-table thead th,
.db-table tbody td{ padding-left: .7rem; padding-right: .7rem; }

/* ---- One clean, consistent stat-card look (used across list pages) ---- */
.db-stat{
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    box-shadow: var(--db-shadow);
    padding: 1.05rem 1.15rem;
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.db-stat:hover{ transform: translateY(-3px); box-shadow: var(--db-shadow-hover); border-color: rgba(239,93,40,.28); }
.db-stat.db-stat-active{ border-color: var(--db-accent); box-shadow: 0 0 0 3px var(--db-accent-soft), var(--db-shadow); }
.db-stat-chip{
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.db-stat-label{ color: var(--db-text-muted); font-size: .82rem; font-weight: 500; }
.db-stat-num{
    font-family: 'Space Grotesk','Inter',sans-serif;
    font-weight: 700; font-size: 1.9rem; line-height: 1;
    color: var(--db-text); letter-spacing: -.02em;
}

/* ---- The sidebar is a white panel floating on the grey canvas: no hard
        divider, just a soft right-edge shadow so the two merge cleanly ---- */
.db-sidebar{
    background-color: #ffffff !important;
    border-right: none !important;
    box-shadow: none !important;
    z-index: 5;
}

/* The content area is the grey "canvas": a panel whose TOP-LEFT corner curves
   away from the white sidebar, so the curve belongs to the canvas (not the
   sidebar). The white base shows through the curve and blends with the sidebar. */
.db-sidebar ~ main{
    background: #E8E8E8;
    border-top-left-radius: 64px;
    min-height: 100vh;
    padding: 1rem !important;
}
@media (min-width: 768px){
    .db-sidebar ~ main{ padding: 1.5rem 1.75rem !important; }
}

/* ---- Sidebar: sticky full-height with a slim scrollbar when items overflow ---- */
@media (min-width: 992px){
    .db-sidebar{
        position: sticky;
        top: 0;
        height: 100vh !important;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
}
/* A quiet overlay-style scrollbar: invisible until the sidebar is hovered */
.db-sidebar{ scrollbar-width: thin; scrollbar-color: transparent transparent; }
.db-sidebar:hover{ scrollbar-color: #dcdad5 transparent; }
.db-sidebar::-webkit-scrollbar{ width: 6px; }
.db-sidebar::-webkit-scrollbar-track{ background: transparent; }
.db-sidebar::-webkit-scrollbar-thumb{ background: transparent; border-radius: 999px; }
.db-sidebar:hover::-webkit-scrollbar-thumb{ background: #dcdad5; }
.db-sidebar::-webkit-scrollbar-thumb:hover{ background: #c7c5bf; }

/* A slim, unobtrusive scrollbar for the content area too */
.db-bg{ scrollbar-width: thin; scrollbar-color: #e2e0db transparent; }
.db-bg::-webkit-scrollbar{ width: 10px; height: 10px; }
.db-bg::-webkit-scrollbar-thumb{ background: #e2e0db; border-radius: 8px; }
.db-bg::-webkit-scrollbar-thumb:hover{ background: #cfcdc7; }

/* On a white canvas, give cards a touch more edge so they never disappear */
.db-panel, .db-stat{ border-color: #ececec; }

/* ===== Plain table headers (reference style: text only, no fill) ===== */
.db-table thead th{
    background: transparent !important;
    border-bottom: 1px solid var(--db-border) !important;
    border-radius: 0 !important;
    letter-spacing: .06em;
    color: var(--db-text-muted);
}

/* Row left-accent on hover, like the reference */
.db-table tbody tr{ position: relative; }
.db-table tbody tr:hover > td:first-child{ box-shadow: inset 3px 0 0 var(--db-accent); }

/* ===== Filter bar — pill controls (reference style) ===== */
.db-filterbar{ display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.db-filterbar .db-filter-select,
.db-filterbar .db-filter-text{
    height: 42px;
    background: var(--db-surface-2);
    border: 1px solid var(--db-border);
    border-radius: 999px;
    color: var(--db-text);
    font-size: .875rem; font-weight: 500;
    padding: 0 1rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.db-filterbar .db-filter-select{
    appearance:none; -webkit-appearance:none; -moz-appearance:none;
    padding-right: 2.3rem; cursor:pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a857d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat:no-repeat; background-position: right .9rem center;
}
.db-filterbar .db-filter-search{ position: relative; flex: 1 1 260px; min-width: 200px; }
.db-filterbar .db-filter-search svg{
    position:absolute; left:1rem; top:50%; transform:translateY(-50%);
    color: var(--db-text-muted); pointer-events:none;
}
.db-filterbar .db-filter-search input{
    width:100%; height:42px;
    background: var(--db-surface-2);
    border:1px solid var(--db-border);
    border-radius:999px;
    color: var(--db-text); font-size:.9rem;
    padding: 0 1rem 0 2.6rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.db-filterbar .db-filter-datewrap{
    display:inline-flex; align-items:center; gap:.45rem;
    height:42px; background:var(--db-surface-2); border:1px solid var(--db-border);
    border-radius:999px; padding: 0 1rem; font-size:.78rem; color:var(--db-text-muted);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.db-filterbar .db-filter-datewrap input{
    border:0; background:transparent; color:var(--db-text); font-size:.85rem; padding:0;
}
.db-filterbar .db-filter-select:focus,
.db-filterbar .db-filter-text:focus,
.db-filterbar .db-filter-search input:focus,
.db-filterbar .db-filter-datewrap:focus-within{
    border-color: var(--db-accent);
    box-shadow: 0 0 0 3px var(--db-accent-soft);
    outline: none;
}
.db-filterbar .db-filter-clear{
    height:42px; display:inline-flex; align-items:center;
    border:1px solid var(--db-border); border-radius:999px;
    padding:0 1rem; font-size:.85rem; color:var(--db-text); text-decoration:none;
    background: var(--db-surface); transition: border-color .15s ease, color .15s ease;
}
.db-filterbar .db-filter-clear:hover{ border-color: var(--db-accent); color: var(--db-accent); }
