/*
 * MyTrackGPT theme
 * ---------------
 * A full reskin of the inherited admin template, applied as an override layer
 * so none of the original stylesheets are edited. Loaded after app.min.css and
 * custom.css, which is what lets these rules win.
 *
 * The inherited look was: mint/teal chrome (var(--mtg-primary, #5b5bd6)), a WHITE sidebar, hard
 * 4px corners, bordered inputs and navy/gold accents spread over ~300 hex
 * literals in two files. Rather than chase those, everything here is driven by
 * the custom properties in :root — and the shape of the UI is changed too, not
 * just its colour, so it does not read as the same product:
 *
 *   - sidebar inverted to dark, topbar to white (the old app was the reverse)
 *   - inputs are filled and borderless until focus, instead of outlined boxes
 *   - corners go from 4px to 12-16px, shadows from hard to soft
 *   - tighter, heavier typography with uppercase micro-labels
 *
 * Deliberately NOT touched: semantic status colours (success / danger /
 * warning). In an ERP a red balance or a green "delivered" stamp carries
 * meaning, and must stay red and green in any theme.
 */

:root {
    /* Brand */
    --mtg-primary:        #5b5bd6;
    --mtg-primary-hover:  #4a4ac4;
    --mtg-primary-soft:   #eeeefb;
    --mtg-accent:         #f5a524;

    /* Chrome — inverted from the original: dark rail, light bar */
    --mtg-sidebar-bg:     #14162b;
    --mtg-sidebar-fg:     #a9adc9;
    --mtg-sidebar-fg-active: #ffffff;
    --mtg-sidebar-hover:  rgba(255, 255, 255, 0.06);

    --mtg-topbar-bg:      #ffffff;
    --mtg-topbar-fg:      #2c2f44;
    --mtg-topbar-border:  #ebecf3;

    /* Surfaces */
    --mtg-body-bg:        #f4f5fa;
    --mtg-card-bg:        #ffffff;
    --mtg-border:         #e8e9f2;
    --mtg-text:           #1c1e33;
    --mtg-text-muted:     #7a7f9a;

    /* Inputs — filled, not outlined */
    --mtg-field-bg:       #f2f3f9;
    --mtg-field-bg-focus: #ffffff;
    --mtg-field-border:   transparent;

    /* Shape */
    --mtg-radius:         12px;
    --mtg-radius-lg:      16px;
    --mtg-radius-pill:    999px;
    --mtg-shadow:         0 1px 2px rgba(20, 22, 43, 0.04), 0 8px 24px rgba(20, 22, 43, 0.05);
}

/* ============================================================ typography */

body,
.form-control,
.form-select,
.btn,
table {
    font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: -0.006em;
}

body {
    background-color: var(--mtg-body-bg);
    color: var(--mtg-text);
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6,
.page-title,
.card-title {
    color: var(--mtg-text);
    font-weight: 650;
    letter-spacing: -0.02em;
}

/* ============================================================== surfaces */

.card,
.page-content .card {
    background-color: var(--mtg-card-bg);
    border: 0;
    border-radius: var(--mtg-radius-lg);
    box-shadow: var(--mtg-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mtg-border);
    padding: 1rem 1.25rem;
}

/* ================================================================ topbar */

#page-topbar {
    background-color: var(--mtg-topbar-bg);
    border-bottom: 1px solid var(--mtg-topbar-border);
    box-shadow: none;
}

#page-topbar .header-item,
#page-topbar .header-item i,
#page-topbar .navbar-header a,
#page-topbar .navbar-header span {
    color: var(--mtg-topbar-fg);
}

#page-topbar .header-item {
    border-radius: var(--mtg-radius);
}

#page-topbar .header-item:hover {
    background-color: var(--mtg-primary-soft);
    color: var(--mtg-primary);
}

/* Topbar polish: tighter, calmer right-side cluster (logical prop: RTL-safe) */
#page-topbar .navbar-header {
    padding-inline-end: 12px;
}

#page-topbar .header-item {
    transition: background-color 0.15s ease;
}

/* Initials chip — replaces the stock avatar photo */
.header-profile-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mtg-primary);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

#page-header-user-dropdown {
    background: transparent !important;
    border: 0 !important;
}

#page-header-user-dropdown:hover .header-profile-initials {
    box-shadow: 0 0 0 3px var(--mtg-primary-soft);
}

/* The brand block now belongs to the dark rail, not the bar. */
.navbar-brand-box {
    background: var(--mtg-sidebar-bg);
    border-right: 0;
    box-shadow: none;
}

.navbar-brand-box .logo-txt,
.navbar-brand-box .logo span {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* =============================================================== sidebar */

.vertical-menu {
    background: var(--mtg-sidebar-bg);
    border-right: 0;
}

#sidebar-menu ul li a {
    color: var(--mtg-sidebar-fg);
    border-radius: var(--mtg-radius);
    margin: 2px 10px;
    padding: 9px 14px;
    font-weight: 500;
}

#sidebar-menu ul li a i,
#sidebar-menu ul li a svg {
    color: var(--mtg-sidebar-fg);
    opacity: 0.75;
}

#sidebar-menu ul li a:hover,
#sidebar-menu ul li a:hover i,
#sidebar-menu ul li a:hover svg,
#sidebar-menu ul li ul.sub-menu li a:hover {
    color: var(--mtg-sidebar-fg-active);
    background-color: var(--mtg-sidebar-hover);
}

.mm-active > a,
.mm-active > a i,
.mm-active > a svg,
.mm-active .active,
.mm-active .active i,
.mm-active .active svg,
#sidebar-menu ul li a.active {
    color: var(--mtg-sidebar-fg-active) !important;
    opacity: 1;
}

.mm-active > a,
#sidebar-menu ul li a.active {
    background-color: var(--mtg-primary) !important;
    font-weight: 600;
}

#sidebar-menu ul li ul.sub-menu li a {
    color: var(--mtg-sidebar-fg);
    font-size: 13px;
}

.menu-title {
    /* 0.35 alpha failed contrast against the dark rail; 0.62 keeps the label
       secondary without making it unreadable. */
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    padding: 18px 24px 8px;
}

/* The sidebar search sits on the dark rail now. */
.form-control-sidebar {
    background: rgba(255, 255, 255, 0.06);
    border: 0;
    color: #ffffff;
    border-radius: var(--mtg-radius);
}

.form-control-sidebar::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ================================================================ fields */

.form-control,
.form-select,
.input-form,
textarea.form-control {
    background-color: var(--mtg-field-bg);
    border: 1.5px solid var(--mtg-field-border);
    border-radius: var(--mtg-radius);
    color: var(--mtg-text);
    padding: 10px 14px;
    min-height: 42px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder,
.input-form::placeholder {
    color: #a4a8c0;
}

.form-control:focus,
.form-select:focus,
.input-form:focus,
textarea.form-control:focus {
    background-color: var(--mtg-field-bg-focus);
    border-color: var(--mtg-primary);
    box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.12);
    outline: none;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #eceef6;
    color: var(--mtg-text-muted);
}

.form-label,
label {
    color: var(--mtg-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

.form-check-input {
    border-radius: 6px;
    border-color: #cdd0e2;
    width: 1.1em;
    height: 1.1em;
}

.form-check-input:checked {
    background-color: var(--mtg-primary);
    border-color: var(--mtg-primary);
}

.input-group-text {
    background-color: var(--mtg-field-bg);
    border: 0;
    border-radius: var(--mtg-radius);
    color: var(--mtg-text-muted);
}

/* Select2 has to follow the same treatment or the forms look half-reskinned. */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: var(--mtg-field-bg);
    border: 1.5px solid var(--mtg-field-border);
    border-radius: var(--mtg-radius);
    min-height: 42px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    background-color: var(--mtg-field-bg-focus);
    border-color: var(--mtg-primary);
    box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.12);
}

.select2-dropdown {
    border: 0;
    border-radius: var(--mtg-radius);
    box-shadow: var(--mtg-shadow);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--mtg-primary);
}

/* =============================================================== buttons */

.btn {
    border-radius: var(--mtg-radius);
    font-weight: 600;
    padding: 9px 18px;
    letter-spacing: -0.005em;
}

.btn-primary {
    background-color: var(--mtg-primary);
    border-color: var(--mtg-primary);
    box-shadow: 0 1px 2px rgba(91, 91, 214, 0.3);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--mtg-primary-hover) !important;
    border-color: var(--mtg-primary-hover) !important;
}

.btn-outline-primary {
    color: var(--mtg-primary);
    border-color: #d6d7ef;
}

.btn-outline-primary:hover {
    background-color: var(--mtg-primary);
    border-color: var(--mtg-primary);
}

.btn-light,
.btn-secondary {
    background-color: var(--mtg-field-bg);
    border-color: transparent;
    color: var(--mtg-text);
}

.btn-xs {
    border-radius: var(--mtg-radius-pill);
    padding: 3px 10px;
    font-size: 11px;
}

/* ================================================================= links */

a {
    color: var(--mtg-primary);
    text-decoration: none;
}

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

/* ================================================================ tables */

.table {
    --bs-table-hover-bg: var(--mtg-primary-soft);
}

.table > thead th {
    background-color: transparent;
    color: var(--mtg-text-muted);
    border-bottom: 1px solid var(--mtg-border);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    padding: 12px 14px;
}

.table > tbody > tr > td {
    border-bottom: 1px solid #f1f2f8;
    padding: 12px 14px;
    vertical-align: middle;
}

.table > tbody > tr:hover > td {
    background-color: var(--mtg-primary-soft);
}

/* ================================================================ badges */

.badge {
    border-radius: var(--mtg-radius-pill);
    font-weight: 600;
    padding: 4px 10px;
    letter-spacing: 0.01em;
}

.badge.bg-primary,
.bg-primary {
    background-color: var(--mtg-primary) !important;
}

.text-primary {
    color: var(--mtg-primary) !important;
}

/* ========================================================== misc chrome */

.modal-content,
.dropdown-menu {
    border: 0;
    border-radius: var(--mtg-radius-lg);
    box-shadow: var(--mtg-shadow);
}

.dropdown-item {
    border-radius: 8px;
    margin: 2px 6px;
    width: auto;
}

.dropdown-item:hover {
    background-color: var(--mtg-primary-soft);
    color: var(--mtg-primary);
}

.page-item.active .page-link {
    background-color: var(--mtg-primary);
    border-color: var(--mtg-primary);
    border-radius: 8px;
}

.page-link {
    color: var(--mtg-text-muted);
    border: 0;
}

.nav-tabs {
    border-bottom: 1px solid var(--mtg-border);
}

.nav-tabs .nav-link {
    border: 0;
    color: var(--mtg-text-muted);
    font-weight: 600;
}

.nav-tabs .nav-link.active {
    color: var(--mtg-primary);
    background: transparent;
    border-bottom: 2px solid var(--mtg-primary);
}

/* ================================================================= login */

/*
 * Split composition: brand panel on one side, form on the other. The template
 * shipped a single centred card on a plain page, so this alone changes what
 * the sign-in screen reads as.
 */
.mtg-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--mtg-card-bg);
}

.mtg-login__brand {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 15% 10%, rgba(255, 255, 255, 0.10), transparent 60%),
        radial-gradient(900px 500px at 85% 90%, rgba(245, 165, 36, 0.16), transparent 60%),
        linear-gradient(150deg, #14162b 0%, #262a55 55%, #3a2f6b 100%);
    color: #ffffff;
    padding: 64px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mtg-login__brand::after {
    /* Faint grid, so the panel is not a flat gradient. */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
}

.mtg-login__mark {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mtg-login__pitch {
    position: relative;
    z-index: 1;
    max-width: 30ch;
}

.mtg-login__pitch h1 {
    color: #ffffff;
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.mtg-login__pitch p {
    color: rgba(255, 255, 255, 0.66);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.mtg-login__meta {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12.5px;
}

.mtg-login__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.mtg-login__form-inner {
    width: 100%;
    max-width: 380px;
}

.mtg-login__title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}

.mtg-login__sub {
    color: var(--mtg-text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.mtg-login__form .form-control,
.mtg-login__form .form-select {
    min-height: 48px;
}

.mtg-login__form .btn-primary {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
}

.mtg-login__divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--mtg-text-muted);
    font-size: 12px;
    margin: 22px 0;
}

.mtg-login__divider::before,
.mtg-login__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--mtg-border);
}

@media (max-width: 900px) {
    .mtg-login {
        grid-template-columns: 1fr;
    }
    .mtg-login__brand {
        display: none;
    }
}

/* ==========================================================================
 * Structure layer
 * --------------------------------------------------------------------------
 * The colour work above is not enough on its own: the listing, form and view
 * screens still read as the stock admin template because of their SHAPE —
 * heavy card headers, dense bordered tables, and rows of small solid-colour
 * action buttons in blue/orange/green.
 *
 * This section changes that shape. It works on the generic blades
 * (Config/index, Config/add_edit_view, Config/masterButtons) which nearly
 * every module renders through, so restyling them here reaches the whole app
 * without touching 1,300 views.
 * ========================================================================== */

/* ------------------------------------------------------ page + card frame */

.page-content {
    padding-top: 84px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mtg-border);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header .card-title {
    font-size: 15px;
    font-weight: 650;
    margin: 0;
    letter-spacing: -0.015em;
}

/* Anything after the title in a header drifts to the trailing edge, which
   turns the header into a toolbar instead of a stacked block. */
.card-header .card-title ~ * {
    margin-inline-start: auto;
}

.card-body {
    padding: 22px;
}

/* --------------------------------------------------------------- listings */

/* Filter bars sit on a tinted strip so they read as controls, not content. */
.card-header + .card-body > .row:first-child,
.card-body > .row.filter-row:first-child {
    background: var(--mtg-field-bg);
    border-radius: var(--mtg-radius);
    padding: 14px 16px;
    margin: 0 0 18px;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table > thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--mtg-card-bg);
    white-space: nowrap;
}

.table > tbody > tr {
    transition: background-color 0.12s ease;
}

.table > tbody > tr > td:first-child,
.table > thead th:first-child {
    padding-inline-start: 22px;
}

.table > tbody > tr > td:last-child,
.table > thead th:last-child {
    padding-inline-end: 22px;
}

/* Kill the template's outer table borders — the card already frames it. */
.table-bordered,
.table-bordered > :not(caption) > * ,
.table-bordered > :not(caption) > * > * {
    border-width: 0;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* DataTables chrome */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--mtg-field-bg);
    border: 0;
    border-radius: var(--mtg-radius);
    padding: 7px 12px;
    min-height: 38px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    color: var(--mtg-text-muted);
    font-size: 12.5px;
}

/* ------------------------------------------------------- row action icons */

/*
 * The template renders per-row actions as solid btn-xs in primary / warning /
 * success / light. A row of four saturated chips is the single most
 * recognisable thing about the old listing screens, so they become neutral
 * ghost icons that only take colour on hover.
 */
td .btn.btn-xs,
td .btn-xs {
    background: transparent !important;
    border: 1px solid var(--mtg-border) !important;
    color: var(--mtg-text-muted) !important;
    box-shadow: none !important;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-inline-end: 4px;
    font-size: 12px;
}

td .btn.btn-xs:hover,
td .btn-xs:hover {
    background: var(--mtg-primary-soft) !important;
    border-color: transparent !important;
    color: var(--mtg-primary) !important;
}

/* Destructive stays destructive on hover — meaning beats consistency. */
td .btn.btn-xs.btn-danger:hover,
td .btn-xs.btn-danger:hover {
    background: #fdeaea !important;
    color: #d92d20 !important;
}

/* Status toggles in listings keep their colour: they show state, not action. */
td .btn-xs.btn-success,
td .btn-xs.btn-danger.is-status {
    border-radius: var(--mtg-radius-pill);
    padding: 0 12px !important;
    width: auto;
}

/* ------------------------------------------------------------------ forms */

/* Section headers inside forms become quiet labels rather than banners. */
.card-body .card > .card-header,
fieldset legend {
    border-bottom: 0;
    padding: 0 0 10px;
    color: var(--mtg-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.form-group,
.mb-3 {
    margin-bottom: 18px;
}

/* Required marker: a dot, not a red asterisk shouting in the label. */
.asterisk,
label .text-danger {
    color: var(--mtg-primary) !important;
    font-weight: 700;
}

/* Form footers: primary action solid, everything else quiet. */
.card-body > .row:last-child .btn-light,
.form-actions .btn-light {
    background: transparent;
    border: 1px solid var(--mtg-border);
    color: var(--mtg-text-muted);
}

/* ------------------------------------------------------------- view pages */

/*
 * Read-only screens reuse the form markup with disabled inputs, which made
 * them look like a greyed-out form. Strip the field chrome so they read as a
 * record instead.
 */
.view-mode .form-control[readonly],
.view-mode .form-control:disabled,
.view-mode .input-form[readonly] {
    background: transparent;
    border-color: transparent;
    padding-inline: 0;
    color: var(--mtg-text);
    font-weight: 600;
    min-height: 32px;
}

.view-mode .form-label,
.view-mode label {
    color: var(--mtg-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------------------------------------------------------------- sidebar */

.vertical-menu {
    padding-top: 6px;
}

#sidebar-menu ul li a {
    position: relative;
    font-size: 13.5px;
}

/* Active item gets a pill plus a leading marker, so the tree is readable at a
   glance without relying on colour alone. */
.mm-active > a::before,
#sidebar-menu ul li a.active::before {
    content: "";
    position: absolute;
    inset-inline-start: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    border-radius: 3px;
    background: #ffffff;
    opacity: 0.9;
}

#sidebar-menu ul li ul.sub-menu {
    padding-block: 2px;
}

#sidebar-menu ul li ul.sub-menu li a {
    padding-block: 7px;
    opacity: 0.9;
}

/* Thin, dark scrollbar — the default light one cut through the rail. */
.vertical-menu ::-webkit-scrollbar,
.vertical-menu::-webkit-scrollbar {
    width: 6px;
}

.vertical-menu ::-webkit-scrollbar-thumb,
.vertical-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}

/* -------------------------------------------------------------- dashboard */

.section-header,
.dash-section-header {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--mtg-text);
}

.section-header-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--mtg-primary-soft);
    color: var(--mtg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 10px;
}

.quick-actions-bar {
    background: var(--mtg-card-bg);
    border-radius: var(--mtg-radius-lg);
    box-shadow: var(--mtg-shadow);
    padding: 12px 16px;
    gap: 8px;
}

.quick-action-pill {
    background: var(--mtg-field-bg);
    border: 0;
    border-radius: var(--mtg-radius-pill);
    padding: 7px 14px;
    color: var(--mtg-text);
    font-weight: 600;
    font-size: 13px;
}

.quick-action-pill:hover {
    background: var(--mtg-primary);
    color: #ffffff;
}

.quick-action-shortcut {
    opacity: 0.55;
    font-size: 11px;
}

.quick-action-label {
    color: var(--mtg-text-muted);
    text-transform: uppercase;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
}

/* ==========================================================================
 * Identity layer v2 — dashboard, sidebar tree, list toolbars, form actions
 * --------------------------------------------------------------------------
 * The v1 structure layer restyled the shared chrome, but three template
 * signatures survived because page-level stylesheets (dashboard.css, the
 * per-module *.css) load inside the content section and out-cascade the head:
 * the blue gradient greeting banner, the tinted full-width section strips and
 * the solid-button toolbars. master.blade.php now re-links theme.css at the
 * end of <body>, so the rules below genuinely win.
 * ========================================================================== */

/* ------------------------------------------------- dashboard: greeting */

/* Blue gradient hero -> flat white header card, dark type. */
.dashboard-greeting {
    background: var(--mtg-card-bg) !important;
    color: var(--mtg-text) !important;
    border: 0;
    border-radius: var(--mtg-radius-lg);
    box-shadow: var(--mtg-shadow);
    padding: 20px 24px;
}

.dashboard-greeting .greeting-hello {
    color: var(--mtg-text) !important;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dashboard-greeting .greeting-date,
.dashboard-greeting .greeting-branch {
    color: var(--mtg-text-muted) !important;
    font-size: 12.5px;
}

.dashboard-greeting .greeting-branch {
    display: inline-block;
    background: var(--mtg-primary-soft);
    color: var(--mtg-primary) !important;
    border-radius: var(--mtg-radius-pill);
    padding: 2px 10px;
    font-weight: 600;
    margin-top: 6px;
}

/* The stats cluster on the banner follows the light surface. */
.dashboard-greeting .branch-info-panel,
.dashboard-greeting .branch-info-block {
    background: transparent !important;
    border: 0 !important;
}

.dashboard-greeting .branch-info-header,
.dashboard-greeting .branch-info-count,
.dashboard-greeting .branch-info-label,
.dashboard-greeting .branch-info-panel i {
    color: var(--mtg-text) !important;
}

.dashboard-greeting .branch-info-count {
    font-weight: 750;
}

.dashboard-greeting .branch-info-label {
    color: var(--mtg-text-muted) !important;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.dashboard-greeting .branch-info-name-tag {
    background: var(--mtg-field-bg) !important;
    color: var(--mtg-text) !important;
    border: 0 !important;
    border-radius: var(--mtg-radius-pill);
}

.dashboard-greeting .branch-info-vcf-btn {
    background: var(--mtg-primary-soft) !important;
    color: var(--mtg-primary) !important;
    border: 0 !important;
    border-radius: var(--mtg-radius-pill);
    font-weight: 600;
}

/* ------------------------------------------------- dashboard: sections */

/* Tinted full-width strips -> plain white rows; colour lives only in the
   icon chip, so the sections stop reading as the template's rainbow. */
.dashboard-section-header {
    background: var(--mtg-card-bg) !important;
    border: 0 !important;
    border-radius: var(--mtg-radius-lg) !important;
    box-shadow: var(--mtg-shadow);
    color: var(--mtg-text) !important;
    padding: 14px 18px !important;
}

.dashboard-section-header:hover {
    background: var(--mtg-card-bg) !important;
    transform: none !important;
}

.dashboard-section-header .section-toggle-icon {
    color: var(--mtg-text-muted) !important;
}

.section-collapsible {
    background: transparent !important;
    border: 0 !important;
}

/* ------------------------------------------------------- sidebar tree */

/* Children hang off a guide line instead of floating in the rail. */
#sidebar-menu ul li ul.sub-menu {
    margin-inline-start: 26px;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.12);
    padding-inline-start: 6px;
}

#sidebar-menu ul li ul.sub-menu li a {
    margin: 1px 6px;
    padding: 6px 10px;
    border-radius: 8px;
}

/* Sub-items get a node dot; the active one fills in. */
#sidebar-menu ul li ul.sub-menu li a::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
    margin-inline-end: 9px;
    vertical-align: middle;
}

#sidebar-menu ul li ul.sub-menu li a.active::before,
#sidebar-menu ul li ul.sub-menu li a:hover::before {
    opacity: 1;
}

/* Sub-items never get the solid pill — that is for top-level only. */
#sidebar-menu ul li ul.sub-menu li a.active {
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 600;
}

#sidebar-menu ul li ul.sub-menu li a.active::before {
    background: var(--mtg-accent);
}

/* Sidebar search reads as a pill with breathing room. */
#sidebar-menu .form-inline,
.vertical-menu .form-inline {
    padding: 12px 14px 6px;
}

/* -------------------------------------------- listings: header toolbar */

/* The template nests a card inside the list card's header; strip the inner
   card so the header reads as one toolbar, not a box in a box. */
.card-header > .card,
.card-header .card {
    background: transparent;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    margin: 0;
}

.card-header > .card > .card-header,
.card-header .card .card-header {
    border-bottom: 0;
    padding: 0;
}

/* Top action buttons: soft chips, not a row of solid rectangles. */
.card-header .btn.btn-primary {
    background: var(--mtg-primary-soft);
    border-color: transparent;
    color: var(--mtg-primary);
    box-shadow: none;
    font-size: 13px;
    padding: 7px 14px;
}

.card-header .btn.btn-primary:hover {
    background: var(--mtg-primary) !important;
    color: #ffffff;
}

/* ------------------------------------------------- forms: action bar */

/* Save/Cancel dock to the bottom of the viewport while the long generic
   forms scroll — the strongest "different product" cue on add/edit. */
.form-button {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--mtg-card-bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--mtg-border);
    margin: 18px -22px -22px;
    padding: 12px 22px;
    border-radius: 0 0 var(--mtg-radius-lg) var(--mtg-radius-lg);
}

.form-button ul {
    margin: 0;
    padding: 0;
    gap: 8px;
}

.form-button li {
    list-style: none;
}

/* Cancel: quiet outline, not the template's red block. */
.form-button .btn-red {
    background: transparent;
    border: 1px solid var(--mtg-border);
    color: var(--mtg-text-muted);
    border-radius: var(--mtg-radius);
}

.form-button .btn-red:hover {
    border-color: #f0b4b4;
    color: #d92d20;
    background: #fdf1f1;
}

/* --------------------------------------------------- page-title strip */

.page-title-box {
    padding: 14px 0 10px;
}

.page-title-box h4,
.page-title-box .page-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-title-box .breadcrumb {
    background: transparent;
    font-size: 12px;
}

/* ------------------------------------------------------- scrollbars */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cfd2e3;
    border-radius: 5px;
    border: 2px solid var(--mtg-body-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: #b4b8d0;
}
