/*
 * MegaPay admin: modern theme layer.
 * Loaded after AdminLTE and app.css, so it only restyles; page markup stays as it is.
 * Tokens first, then page chrome, forms, buttons, tables.
 */
:root {
    --mp-primary: #0a2472;
    --mp-primary-dark: #061a52;
    --mp-primary-soft: rgba(10, 36, 114, .14);
    --mp-navy: #0a2472;
    --mp-ink: #1d2939;
    --mp-muted: #667085;
    --mp-line: #e4e8f0;
    --mp-line-soft: #eef1f6;
    --mp-bg: #f4f6fb;
    --mp-surface: #ffffff;
    --mp-danger: #e5484d;
    --mp-success: #2fa36b;
    --mp-warning: #d9b45a;
    --mp-gold: #d9b45a;
    --mp-gold-light: #f0dc8a;
    --mp-gold-dark: #b8923a;
    --mp-navy-deep: #061a52;
    --mp-navy-mid: #123a9c;
    --mp-radius: 12px;
    --mp-radius-sm: 9px;
    --mp-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .05);
}

body,
.content-wrapper {
    font-family: 'Inter', 'Source Sans Pro', -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--mp-ink);
    -webkit-font-smoothing: antialiased;
}
.content-wrapper {
    background: var(--mp-bg);
}

/* ---------- Cards ---------- */
.card {
    border: 0;
    border-radius: var(--mp-radius);
    background: var(--mp-surface);
    box-shadow: var(--mp-shadow);
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 24px;
    background: transparent;
    border-bottom: 1px solid var(--mp-line-soft);
    border-radius: var(--mp-radius) var(--mp-radius) 0 0;
}
.card-header::after {
    display: none;
}
.card-header .card-title {
    float: none;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.2px;
    color: var(--mp-navy);
}
.card-header .card-tools {
    float: none;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header .card-tools .btn {
    margin: 0;
}
.card-body {
    padding: 24px;
}
.card-footer {
    padding: 16px 24px;
    background: #fafbfd;
    border-top: 1px solid var(--mp-line-soft);
    border-radius: 0 0 var(--mp-radius) var(--mp-radius);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}
.card-footer .btn {
    margin: 0;
}

/* a card whose first header only holds the Back button: no divider, tighter */
.card-header[style*="border-bottom:none"] {
    padding-bottom: 0;
    justify-content: flex-start;
}
.card-header[style*="border-bottom:none"] + .card-header {
    border-bottom: 0;
    padding-top: 12px;
    padding-bottom: 4px;
}
.card-header[style*="border-bottom:none"] + .card-header .card-title {
    font-size: 22px;
}

/* ---------- Forms ---------- */
/* One grid for every form. Any container that holds col-md-* form groups (the form itself, a fieldset,
   a wrapper div) becomes a wrapping flex row, so columns keep their col-md-* width and rows line up
   without the inline-block gaps. */
.card-body form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-left: -12px;
    margin-right: -12px;
}
.card-body form > * {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
}
.card-body form :where(fieldset, div):has(> .form-group[class*="col-"]) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    padding-left: 0;
    padding-right: 0;
}
.card-body form :where(fieldset, div):has(> .form-group[class*="col-"]) > * {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
}
.card-body form .form-group[class*="col-"] {
    flex: 0 0 auto;
    display: block;
    margin-bottom: 20px;
    padding-left: 12px;
    padding-right: 12px;
}
.card-body form .form-group.col-md-1 { flex-basis: 8.3333%; max-width: 8.3333%; }
.card-body form .form-group.col-md-2 { flex-basis: 16.6667%; max-width: 16.6667%; }
.card-body form .form-group.col-md-3 { flex-basis: 25%; max-width: 25%; }
.card-body form .form-group.col-md-4 { flex-basis: 33.3333%; max-width: 33.3333%; }
.card-body form .form-group.col-md-5 { flex-basis: 41.6667%; max-width: 41.6667%; }
.card-body form .form-group.col-md-6 { flex-basis: 50%; max-width: 50%; }
.card-body form .form-group.col-md-7 { flex-basis: 58.3333%; max-width: 58.3333%; }
.card-body form .form-group.col-md-8 { flex-basis: 66.6667%; max-width: 66.6667%; }
.card-body form .form-group.col-md-9 { flex-basis: 75%; max-width: 75%; }
.card-body form .form-group.col-md-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
.card-body form .form-group.col-md-11 { flex-basis: 91.6667%; max-width: 91.6667%; }
.card-body form .form-group.col-md-12 { flex-basis: 100%; max-width: 100%; }
/* "%" / "Months" unit labels sit beside the input they belong to */
.card-body form .form-group.col-md-0 {
    flex: 0 0 auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    align-self: flex-end;
    margin-bottom: 30px;
}
.card-body form > br { display: none; }
.card-body form .form-group:not([class*="col-"]) {
    margin-bottom: 20px;
}
.iblock,
.d-inline-block {
    vertical-align: top;
}
fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 8px;
    min-width: 0;
}
legend {
    width: 100%;
    margin: 0 0 18px;
    padding: 4px 12px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-navy);
    border-bottom: 1px solid var(--mp-line-soft);
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475467;
}
.checkbox label,
label.mr-3,
label.form-check-label,
.form-check label {
    display: inline-block;
    font-weight: 500;
    color: var(--mp-ink);
    margin-bottom: 4px;
}
input[type=checkbox],
input[type=radio] {
    accent-color: var(--mp-primary);
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
}

.form-control,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--mp-ink);
    background-color: #fff;
    border: 1px solid #d5dbe7;
    border-radius: var(--mp-radius-sm);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.form-control {
    height: auto;
    min-height: 110px;
    line-height: 1.5;
}
.form-control::placeholder {
    color: #98a2b3;
}
.form-control:hover {
    border-color: #b9c2d3;
}
.form-control:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    color: var(--mp-ink);
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 4px var(--mp-primary-soft);
    outline: 0;
}
.form-control[readonly],
.form-control:disabled {
    background-color: #f3f5f9;
    color: #667085;
    cursor: not-allowed;
}
select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
input[type=file].form-control {
    height: auto;
    padding: 9px 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 22px;
    padding-left: 0;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    right: 8px;
}
.invalid-feedback,
.text-danger {
    font-size: 12.5px;
}
.is-invalid {
    border-color: var(--mp-danger) !important;
}
small.text-muted,
small.text-warning {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
}
.card-body hr {
    border-top: 1px solid var(--mp-line-soft);
    margin: 8px 0 24px;
}
.card-body form h4,
.card-body form h5,
.card-body form h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-navy);
    margin: 8px 0 16px;
}
.card-body form .dataTables_wrapper,
.card-body form > table,
.card-body form > .table-responsive {
    margin-bottom: 20px;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--mp-radius-sm);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .1px;
    padding: 9px 18px;
    border-width: 1px;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:focus {
    box-shadow: 0 0 0 4px var(--mp-primary-soft);
}
.btn:active {
    transform: translateY(1px);
}
.btn-new-prim,
.btn-primary {
    background-color: var(--mp-primary);
    border-color: var(--mp-primary);
    color: #fff;
}
.btn-new-prim:hover,
.btn-primary:hover {
    background-color: var(--mp-primary-dark);
    border-color: var(--mp-primary-dark);
    color: #fff;
}
.btn-success { background-color: var(--mp-success); border-color: var(--mp-success); }
.btn-danger { background-color: var(--mp-danger); border-color: var(--mp-danger); }
.btn-warning { background-color: var(--mp-gold); border-color: var(--mp-gold); color: #061a52; }
.btn-outline-secondary {
    color: #475467;
    background: #fff;
    border-color: #d5dbe7;
}
.btn-outline-secondary:hover {
    color: var(--mp-ink);
    background: #f3f5f9;
    border-color: #b9c2d3;
}
.btn-back {
    padding: 7px 14px;
    border-radius: 999px;
}
.card-footer .btn {
    min-width: 130px;
    padding: 11px 22px;
}
.btn-create,
.card-tools .btn {
    padding: 9px 16px;
}

/* inline "Add" buttons that sit next to a label */
label .btn,
.form-group > .btn,
td > .btn-add,
.btn-add {
    padding: 5px 14px;
    margin-left: 8px;
}

/* row actions: equal icon buttons in one tidy line */
.table td .btn,
.act-cell .btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    line-height: 34px;
    margin: 0 4px 0 0;
    border-radius: 8px;
    text-align: center;
}
.table td .btn:last-child {
    margin-right: 0;
}
.act-cell,
td.act_col {
    white-space: nowrap;
}

/* ---------- Tables ---------- */
.table {
    color: var(--mp-ink);
    font-size: 14px;
}
.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: var(--mp-line-soft);
}
.table thead th {
    background: #f8fafc;
    color: var(--mp-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--mp-line);
    border-top: 0;
    vertical-align: middle;
    padding: 12px 14px;
}
.table td {
    vertical-align: middle;
    padding: 12px 14px;
}
.table-striped tbody tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-child(odd) {
    background-color: #fbfcfe;
}
.table-striped tbody tr:nth-of-type(even) {
    background-color: #fff;
}
.table-hover tbody tr:hover,
.table tbody tr:hover {
    background-color: #f4f9fd;
}
.table-bordered {
    border: 1px solid var(--mp-line-soft);
    border-radius: var(--mp-radius-sm);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}
/* nested tables (rates, banks) read lighter */
.table .table {
    margin-bottom: 0;
}

/* ---------- Misc ---------- */
.alert {
    border: 0;
    border-radius: var(--mp-radius-sm);
    box-shadow: var(--mp-shadow);
}
.badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 600;
}
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid var(--mp-line);
    color: #475467;
}
.pagination .active .page-link {
    background: var(--mp-primary);
    border-color: var(--mp-primary);
}
.pop-content {
    border-radius: 16px !important;
}
.pop-footer .btn {
    border-radius: var(--mp-radius-sm);
}

/* a label followed by an inline button (e.g. "Bank [Add]") stays on one line */
label:has(+ .btn) {
    display: inline-block;
    margin-bottom: 8px;
}

/* radio / checkbox options read as one inline choice */
label:has(> input[type=radio]),
label:has(> input[type=checkbox]) {
    display: inline-block;
    font-weight: 500;
    color: var(--mp-ink);
    margin-right: 18px;
    margin-bottom: 6px;
}

/* unit text ("Months", "%") beside an input lines up with the input, not the label */
.card-body form .form-group:has(> label:empty) > label:empty {
    height: 19px;
}
.card-body form .form-group:has(> label:empty) > div {
    line-height: 44px;
    margin-left: 0 !important;
}

/* filters that live inside a page title (e.g. the Relationship Manager picker) keep their natural width */
.card-header .card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header .card-title .form-group {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.card-header .card-title select.form-control {
    min-width: 260px;
    height: 40px;
}

/* headers that hold col-md-* groups (record picker + shortcut buttons): same grid, left aligned */
.card-header:has(> .form-group[class*="col-"]) {
    justify-content: flex-start;
    gap: 0;
}
.card-header > .form-group[class*="col-"] {
    flex: 0 0 auto;
    margin: 0;
    padding-left: 0;
    padding-right: 12px;
}
.card-header > .form-group.col-md-1 { flex-basis: 8.3333%; max-width: 8.3333%; }
.card-header > .form-group.col-md-2 { flex-basis: 16.6667%; max-width: 16.6667%; }
.card-header > .form-group.col-md-3 { flex-basis: 25%; max-width: 25%; }
.card-header > .form-group.col-md-5 { flex-basis: 41.6667%; max-width: 41.6667%; }
.card-header > .form-group .btn {
    white-space: nowrap;
}

/* Forms designed on a 10 (or 11) column width: stretch the columns so rows end flush at the right edge */
.card-body form.grid-10 .form-group.col-md-1 { flex-basis: 10%; max-width: 10%; }
.card-body form.grid-10 .form-group.col-md-2 { flex-basis: 20%; max-width: 20%; }
.card-body form.grid-10 .form-group.col-md-3 { flex-basis: 30%; max-width: 30%; }
.card-body form.grid-10 .form-group.col-md-4 { flex-basis: 40%; max-width: 40%; }
.card-body form.grid-10 .form-group.col-md-5 { flex-basis: 50%; max-width: 50%; }
.card-body form.grid-10 .form-group.col-md-6 { flex-basis: 60%; max-width: 60%; }
.card-body form.grid-10 .form-group.col-md-7 { flex-basis: 70%; max-width: 70%; }
.card-body form.grid-10 .form-group.col-md-8 { flex-basis: 80%; max-width: 80%; }
.card-body form.grid-10 .form-group.col-md-9 { flex-basis: 90%; max-width: 90%; }
.card-body form.grid-10 .form-group.col-md-10,
.card-body form.grid-10 .form-group.col-md-11 { flex-basis: 100%; max-width: 100%; }

.card-body form.grid-11 .form-group.col-md-1 { flex-basis: 9.0909%; max-width: 9.0909%; }
.card-body form.grid-11 .form-group.col-md-2 { flex-basis: 18.1818%; max-width: 18.1818%; }
.card-body form.grid-11 .form-group.col-md-3 { flex-basis: 27.2727%; max-width: 27.2727%; }
.card-body form.grid-11 .form-group.col-md-4 { flex-basis: 36.3636%; max-width: 36.3636%; }
.card-body form.grid-11 .form-group.col-md-5 { flex-basis: 45.4545%; max-width: 45.4545%; }
.card-body form.grid-11 .form-group.col-md-6 { flex-basis: 54.5454%; max-width: 54.5454%; }
.card-body form.grid-11 .form-group.col-md-7 { flex-basis: 63.6363%; max-width: 63.6363%; }
.card-body form.grid-11 .form-group.col-md-8 { flex-basis: 72.7272%; max-width: 72.7272%; }
.card-body form.grid-11 .form-group.col-md-9 { flex-basis: 81.8181%; max-width: 81.8181%; }
.card-body form.grid-11 .form-group.col-md-10 { flex-basis: 90.9090%; max-width: 90.9090%; }
.card-body form.grid-11 .form-group.col-md-11 { flex-basis: 100%; max-width: 100%; }

/* show/hide password eye sits inside the field, so both password inputs start at the same height */
.card-body form .form-group:has(> #toggleBtn) {
    position: relative;
}
.card-body form .form-group > #toggleBtn {
    position: absolute;
    right: 26px;
    top: 41px;
    z-index: 2;
}
.card-body form .form-group > br,
.card-body form .form-group .form-group + br {
    display: none;
}
.card-body form .form-group .form-group {
    margin-bottom: 12px;
}

/* ---------- Image upload card (admin.components.image_upload) ---------- */
.card-body form .upload-field {
    margin-bottom: 24px;
}
.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px;
    background: #fafbfe;
    border: 2px dashed #cdd5e3;
    border-radius: 14px;
    transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover {
    border-color: var(--mp-primary);
    background: #f4fbfe;
}
.dropzone .dz-preview {
    flex: 0 0 auto;
    width: 240px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #e9edf4;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
.dropzone.shape-square .dz-preview {
    width: 130px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}
.dropzone .dz-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dropzone .dz-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mp-ink);
}
.dropzone .dz-title .fa {
    color: var(--mp-primary);
    margin-right: 6px;
    font-size: 18px;
}
.dropzone .dz-link {
    color: var(--mp-primary-dark);
    text-decoration: underline;
}
.dropzone .dz-hint {
    margin-top: 4px;
    font-size: 13px;
    color: var(--mp-muted);
}
.dropzone .dz-file {
    margin-top: 10px;
    font-size: 13px;
    color: var(--mp-muted);
}
.dropzone .dz-file.has-file {
    color: var(--mp-success);
    font-weight: 600;
}
.dropzone input[type=file] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    border: 0;
}
.dropzone input[type=file]:disabled {
    cursor: not-allowed;
    pointer-events: none;
}
.dropzone:has(input:disabled) {
    opacity: .65;
    background: #f3f5f9;
}
.dropzone:has(input:disabled):hover {
    border-color: #cdd5e3;
}
@media (max-width: 768px) {
    .dropzone { flex-direction: column; align-items: flex-start; }
    .dropzone .dz-preview { width: 100%; }
}

/* ---------- Form sections as soft panels ---------- */
.card-body form fieldset {
    background: #fff;
    border: 1px solid var(--mp-line-soft);
    border-radius: var(--mp-radius);
    margin: 0 12px 24px;
    padding: 6px 0 6px;
    max-width: calc(100% - 24px);
}
.card-body form fieldset legend {
    padding: 14px 24px;
    margin: 0 0 18px;
    background: #fafbfd;
    border-bottom: 1px solid var(--mp-line-soft);
    border-radius: var(--mp-radius) var(--mp-radius) 0 0;
}
.card-body form fieldset > .form-group[class*="col-"],
.card-body form fieldset > * {
    padding-left: 24px;
    padding-right: 24px;
}
.card-body form > hr {
    display: none;
}

/* very narrow columns (e.g. VIP yes/no): keep the select readable */
.card-body form .form-group.col-md-1 select.form-control {
    padding-left: 10px;
    padding-right: 26px;
    background-position: right 8px center;
}

/* "Bank [Add]" section: title on the left, Add button on the right, aligned with the table below */
.card-body form .form-group:has(> .btn-add) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.card-body form .form-group:has(> .btn-add) > label {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--mp-navy);
}
.card-body form .form-group:has(> .btn-add) > .btn-add {
    margin: 0 0 0 auto;
    padding: 7px 16px;
}
.btn-add::before {
    content: "+";
    margin-right: 6px;
    font-weight: 700;
}
.card-body form .form-group:has(> .btn-add) > table {
    flex: 0 0 100%;
    margin-top: 12px;
}

/* Selects: Bootstrap forces select.form-control to 38px, which clipped the text ("Monthlv") and made
   selects shorter than inputs. Same height as every other field, text centred, nothing cut off. */
select.form-control:not([size]):not([multiple]),
select.form-control {
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 42px;
}
.card-body form .form-group.col-md-1 select.form-control {
    padding-left: 10px;
    padding-right: 26px;
}
.card-header .card-title select.form-control:not([size]):not([multiple]) {
    height: 40px;
    line-height: 38px;
}
select.form-control option {
    line-height: 1.6;
    padding: 6px 10px;
}
/* select2 pickers: same fix */
.select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
}

/* =====================================================================
   Brand theme: navy + gold, taken from the MegaPay logo
   navy #0a2472 (deep #061a52), gold #d9b45a (light #f0dc8a, dark #b8923a)
   ===================================================================== */
a {
    color: var(--mp-navy-mid);
}
a:hover {
    color: var(--mp-navy-deep);
}
.btn-new-prim,
.btn-primary {
    background: var(--mp-primary);
    border-color: var(--mp-primary);
}
.btn-new-prim:hover,
.btn-primary:hover,
.btn-new-prim:focus {
    background: var(--mp-navy-deep);
    border-color: var(--mp-navy-deep);
}
.btn-warning { background-color: var(--mp-gold); border-color: var(--mp-gold); color: #061a52; }
.btn-warning:hover {
    background: var(--mp-gold-dark);
    border-color: var(--mp-gold-dark);
    color: #fff;
}
.pagination .active .page-link {
    background: var(--mp-primary);
    border-color: var(--mp-primary);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--mp-primary);
}
.badge-warning {
    background: var(--mp-gold);
    color: var(--mp-navy-deep);
}
.table td .btn-new-prim:hover {
    background: var(--mp-navy-deep);
}

/* ---------- Sidebar ---------- */
.main-sidebar {
    background: linear-gradient(180deg, #061a52 0%, #0a2472 55%, #0e3299 100%) !important;
    box-shadow: 4px 0 24px rgba(6, 26, 82, .18) !important;
}
.main-sidebar .brand-link.megapay-brand {
    background: #fff !important;
    height: 66px;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #b8923a, #f0dc8a 50%, #b8923a) 1;
}
.main-sidebar .sidebar {
    padding: 14px 12px 24px;
}
.nav-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin: 2px 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, .74) !important;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .1px;
    transition: background-color .15s ease, color .15s ease;
}
.nav-sidebar .nav-link p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin: 0;
    padding: 0 !important;
    white-space: nowrap;
}
.nav-sidebar .nav-link > i.fa:first-child,
.nav-sidebar .nav-link > i.fa-lg {
    flex: 0 0 22px;
    width: 22px;
    margin: 0 12px 0 0;
    padding: 0 !important;
    text-align: center;
    color: rgba(255, 255, 255, .6);
    transition: color .15s ease;
}
.nav-sidebar .nav-link .right {
    position: static;
    margin-left: auto;
    font-size: 14px;
    opacity: .7;
    transition: transform .2s ease;
}
.nav-sidebar .menu-open > .nav-link .right {
    transform: rotate(-90deg);
}
.nav-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
}
.nav-sidebar .nav-link:hover > i.fa:first-child {
    color: var(--mp-gold-light);
}
/* open group */
.nav-sidebar > .nav-item.menu-open > .nav-link {
    background: rgba(255, 255, 255, .07) !important;
    color: #fff !important;
}
/* current page: gold edge + warm tint */
.nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(90deg, rgba(240, 220, 138, .24), rgba(255, 255, 255, .06)) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--mp-gold);
}
.nav-sidebar .nav-link.active > i.fa:first-child {
    color: var(--mp-gold-light);
}
/* sub menu */
.nav-sidebar .nav-treeview {
    margin: 2px 0 8px 22px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .16);
}
.nav-sidebar .nav-treeview > .nav-item > .nav-link,
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link {
    padding: 8px 12px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .64) !important;
    background: transparent;
}
.nav-sidebar .nav-treeview > .nav-item > .nav-link:hover {
    background: rgba(255, 255, 255, .07) !important;
    color: #fff !important;
}
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active:hover {
    background: rgba(217, 180, 90, .18) !important;
    color: var(--mp-gold-light) !important;
    font-weight: 600;
}
.nav-sidebar .nav-treeview .nav-link p {
    padding-left: 0 !important;
}
/* collapsed (icon only) sidebar keeps working */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-link p {
    display: none;
}
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-link > i.fa:first-child {
    margin-right: 0;
}

/* ---------- Top bar ---------- */
.main-header {
    background: #fff;
    border-bottom: 1px solid var(--mp-line-soft);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}
.main-header .nav-link,
.main-header .nav-link i {
    color: var(--mp-navy);
}
.main-header .nav-link:hover {
    color: var(--mp-gold-dark) !important;
}

/* ---------- Login page ---------- */
.login-page .btn-new-prim,
.login-box .btn-new-prim {
    background: var(--mp-primary);
    border-color: var(--mp-primary);
    color: #fff;
}

/* Sidebar icons: one box, one size, centred, so no icon looks bigger or smaller than another */
.nav-sidebar .nav-link > i.fa:first-child,
.nav-sidebar .nav-link > i.fa-lg {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0 12px 0 0;
    font-size: 16px !important;
    line-height: 24px !important;
    text-align: center;
}
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-link > i.fa:first-child {
    margin: 0;
    font-size: 17px !important;
}

/* ---------- Filter bar (date range / pickers + action button in a page header) ---------- */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 0 0 0 auto;
}
.filter-bar .filter-field {
    display: flex;
    flex-direction: column;
}
.filter-bar .filter-field label {
    margin-bottom: 4px;
}
.filter-bar .form-control {
    width: 170px;
}
.filter-bar .btn {
    height: 44px;
    padding: 0 22px;
    white-space: nowrap;
}

/* ---------- Searchable dropdowns (select2) ---------- */
.select2-container {
    width: 100% !important;
    max-width: 100%;
}
.card-header .card-title .select2-container {
    min-width: 260px;
    width: auto !important;
}
.select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    flex: 1;
    padding-left: 0;
    padding-right: 26px;
    color: var(--mp-ink);
    line-height: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #98a2b3;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 10px;
    height: 100%;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--mp-muted) transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--mp-muted) transparent;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
    background: #f3f5f9;
    cursor: not-allowed;
}
.select2-dropdown {
    border: 1px solid #d5dbe7;
    border-radius: var(--mp-radius-sm);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
    overflow: hidden;
    z-index: 2000;
}
.select2-container--default .select2-search--dropdown {
    padding: 10px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d5dbe7;
    border-radius: 8px;
    outline: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 4px var(--mp-primary-soft);
}
.select2-results__option {
    padding: 9px 14px;
    font-size: 14px;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background: var(--mp-gold-soft, #f0ebe1);
    color: var(--mp-ink);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--mp-primary);
    color: #fff;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 4px var(--mp-primary-soft);
    outline: 0;
}

/* ---------- Member detail: picker + shortcuts bar, chart empty state, edit bar ---------- */
.member-bar {
    justify-content: space-between !important;
    gap: 16px !important;
}
.member-bar .member-picker {
    flex: 0 1 380px;
    min-width: 260px;
}
.member-bar .member-picker .form-group,
.member-bar .member-picker select {
    margin: 0;
}
.member-bar .member-links {
    display: flex;
    align-items: center;
    gap: 10px;
}
.member-bar .member-links .btn {
    height: 44px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
#nodonut {
    padding: 36px 0 24px;
    color: var(--mp-muted);
    font-size: 15px;
}
#nodonut::before {
    content: "\f080";
    display: block;
    margin-bottom: 10px;
    font-family: FontAwesome;
    font-size: 30px;
    color: var(--mp-gold-light, #e6d8b8);
}
.edit-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
}
.edit-bar > span {
    display: inline-flex;
    gap: 10px;
}
.edit-bar .btn {
    height: 40px;
    padding: 0 18px;
    line-height: 38px;
}
.edit-bar .btn i {
    margin-right: 8px;
}


/* ---------- Dividend progress (member detail), same look as the app ---------- */
.dp-empty {
    text-align: center;
    padding: 30px 0 20px;
    color: var(--mp-muted);
}
.dp-empty .fa {
    display: block;
    margin-bottom: 10px;
    font-size: 30px;
    color: var(--mp-gold-light);
}
.dp-summary {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.dp-summary > div {
    flex: 1 1 180px;
    padding: 14px 18px;
    background: var(--mp-bg);
    border: 1px solid var(--mp-line-soft);
    border-radius: 12px;
}
.dp-summary span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--mp-muted);
}
.dp-summary b {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    color: var(--mp-navy);
}
.dp-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.dp-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--mp-line);
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.dp-tab b {
    font-size: 14px;
    color: var(--mp-ink);
}
.dp-tab span {
    font-size: 12px;
    color: var(--mp-muted);
}
.dp-tab:hover {
    border-color: var(--mp-gold);
}
.dp-tab.active {
    background: var(--mp-gold-soft);
    border-color: var(--mp-gold);
    box-shadow: inset 0 -3px 0 var(--mp-gold);
}
.dp-card {
    border: 1px solid var(--mp-line-soft);
    border-radius: 14px;
    padding: 22px 26px 26px;
    background: #fff;
}
.dp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--mp-line-soft);
}
.dp-head h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--mp-navy);
}
.dp-head p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--mp-muted);
}
.dp-next {
    text-align: right;
}
.dp-next span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--mp-muted);
}
.dp-next b {
    color: var(--mp-gold-dark);
}
.dp-body {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}
.dp-ring {
    flex: 0 0 280px;
    text-align: center;
}
.dp-svg {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
}
.dp-svg svg {
    width: 100%;
    height: 100%;
}
.dp-svg path {
    fill: none;
    stroke: #efe3bf;
    stroke-width: 11;
}
.dp-svg path.paid {
    stroke: var(--mp-navy);
}
.dp-svg path.next {
    stroke: var(--mp-gold);
}
.dp-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.dp-center strong {
    display: block;
    font-size: 48px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--mp-navy);
}
.dp-center small {
    font-size: 22px;
    letter-spacing: 0;
}
.dp-center span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: var(--mp-muted);
}
.dp-key {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--mp-muted);
}
.dp-key .k {
    display: inline-block;
    width: 14px;
    height: 7px;
    margin-right: 6px;
    border-radius: 3px;
    vertical-align: middle;
    background: #efe3bf;
}
.dp-key .k.p {
    background: var(--mp-navy);
}
.dp-info {
    flex: 1 1 380px;
    min-width: 300px;
}
.dp-title {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mp-muted);
}
.dp-steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}
.dp-steps::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: #efe3bf;
}
.dp-step {
    position: relative;
    flex: 1;
    text-align: center;
}
.dp-step i {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #efe3bf;
    background: #fff;
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
    color: var(--mp-gold-dark);
}
.dp-step span {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--mp-muted);
}
.dp-step b {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    color: var(--mp-ink);
}
.dp-step.paid i {
    background: var(--mp-navy);
    border-color: var(--mp-navy);
    color: #fff;
}
.dp-step.current i {
    background: var(--mp-gold-light);
    border-color: var(--mp-gold);
    color: var(--mp-navy);
    box-shadow: 0 0 0 5px rgba(217, 180, 90, .22);
}
.dp-step.current span,
.dp-step.current b {
    color: var(--mp-gold-dark);
}
.dp-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.dp-stat {
    flex: 1 1 200px;
    padding: 16px 18px;
    background: var(--mp-bg);
    border: 1px solid var(--mp-line-soft);
    border-radius: 14px;
}
.dp-stat span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--mp-muted);
}
.dp-stat span i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--mp-navy);
}
.dp-stat.todo span i {
    background: var(--mp-gold);
}
.dp-stat b {
    display: block;
    margin: 8px 0 2px;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--mp-navy);
}
.dp-stat.todo b {
    color: var(--mp-gold-dark);
}
.dp-stat em {
    font-size: 12.5px;
    font-style: normal;
    color: var(--mp-muted);
}

/* ---------- Member import ---------- */
.imp-step {
    display: flex;
    gap: 22px;
    padding: 22px 0;
    border-bottom: 1px solid var(--mp-line-soft);
}
.imp-step:last-child {
    border-bottom: 0;
}
.imp-num {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mp-gold-soft);
    border: 2px solid var(--mp-gold);
    color: var(--mp-navy);
    font-weight: 800;
    text-align: center;
    line-height: 36px;
}
.imp-body {
    flex: 1;
    min-width: 0;
}
.imp-body h4 {
    margin: 4px 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--mp-navy);
}
.imp-body p {
    margin: 0 0 14px;
    color: var(--mp-muted);
}
.imp-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.imp-form {
    margin-top: 6px;
}
.imp-note {
    margin: 14px 0 0 !important;
    padding: 12px 16px;
    background: var(--mp-gold-soft);
    border-radius: 10px;
    color: var(--mp-ink) !important;
    font-size: 13.5px;
}
.imp-summary {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.imp-summary > div {
    flex: 1 1 180px;
    padding: 14px 18px;
    background: var(--mp-bg);
    border: 1px solid var(--mp-line-soft);
    border-radius: 12px;
}
.imp-summary span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--mp-muted);
}
.imp-summary b {
    display: block;
    margin-top: 4px;
    font-size: 26px;
    color: var(--mp-navy);
}
.imp-summary .ok b {
    color: var(--mp-success);
}
.imp-summary .bad b {
    color: var(--mp-danger);
}
.imp-table td {
    vertical-align: top;
    font-size: 13.5px;
}
.imp-table tr.row-bad td {
    background: #fff6f5;
}
.imp-errors {
    margin: 0;
    padding-left: 18px;
    color: var(--mp-danger);
    font-size: 13px;
}
.imp-ok {
    color: var(--mp-success);
    font-weight: 600;
}
.imp-h {
    margin: 24px 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-navy);
}
.imp-confirm .card-footer {
    gap: 14px;
}
.imp-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 0 0 !important;
    font-weight: 500 !important;
}
.imp-body code {
    color: var(--mp-navy);
    background: var(--mp-gold-soft);
    padding: 2px 6px;
    border-radius: 6px;
}

/* ---------- Alerts (flash messages) ---------- */
.mp-alert {
    --c: var(--mp-success);
    --bg: #f0faf5;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 20px;
    padding: 14px 16px 14px 18px;
    background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
    border-left: 4px solid var(--c);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: opacity .35s ease, transform .35s ease;
}
.mp-alert-danger {
    --c: var(--mp-danger);
    --bg: #fff5f4;
}
.mp-alert-warning {
    --c: var(--mp-gold-dark);
    --bg: #fbf7ec;
}
.mp-alert-out {
    opacity: 0;
    transform: translateY(-6px);
}
.mp-alert-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
    font-size: 18px;
    line-height: 34px;
    text-align: center;
}
.mp-alert-body {
    flex: 1;
    min-width: 0;
    color: var(--mp-ink);
}
.mp-alert-body strong {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--c);
}
.mp-alert-body p {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.5;
}
.mp-alert-body ul {
    margin: 4px 0 0;
    padding-left: 18px;
    font-size: 14px;
}
.mp-alert-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mp-muted);
    cursor: pointer;
}
.mp-alert-close:hover {
    background: rgba(16, 24, 40, .06);
    color: var(--mp-ink);
}

/* ---------- Product detail page ---------- */
.pv-head .pv-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pv-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef1f6;
    color: var(--mp-muted);
}
.pv-success { background: #e8f6ef; color: var(--mp-success); }
.pv-danger { background: #fdeceb; color: var(--mp-danger); }
.pv-warning { background: var(--mp-gold-soft); color: var(--mp-gold-dark); }
.pv-main { background: var(--mp-gold); color: #fff; }
.pv-top {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 28px;
}
.pv-image {
    flex: 0 0 420px;
    max-width: 100%;
}
.pv-image img,
.pv-noimg {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
.pv-noimg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #eef0f4;
    color: var(--mp-muted);
    box-shadow: none;
    border: 2px dashed #d5dbe7;
}
.pv-noimg .fa {
    font-size: 34px;
}
.pv-facts {
    flex: 1 1 360px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}
.pv-facts div {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mp-line-soft);
}
.pv-facts dt {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--mp-muted);
}
.pv-facts dd {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--mp-ink);
}
.pv-h {
    margin: 26px 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-navy);
}
.pv-desc {
    padding: 16px 18px;
    background: var(--mp-bg);
    border: 1px solid var(--mp-line-soft);
    border-radius: 12px;
    white-space: pre-line;
    line-height: 1.6;
}
.pv-rates td strong {
    color: var(--mp-navy);
}
.pv-reject {
    margin-bottom: 22px;
    padding: 16px 18px;
    background: #fff5f4;
    border: 1px solid #f6d3d0;
    border-radius: 12px;
}
.pv-reject .pv-reject-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

/* Sidebar scrollbar: always the same slim gutter, so opening a menu (which makes the list scroll)
   no longer squeezes the items narrower than when it is closed. */
.main-sidebar,
.main-sidebar .sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.main-sidebar .sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}
@supports not (scrollbar-color: auto) {
    .main-sidebar .sidebar::-webkit-scrollbar { width: 6px; }
    .main-sidebar .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 6px; }
    .main-sidebar .sidebar::-webkit-scrollbar-button { display: none; }
    .main-sidebar .sidebar::-webkit-scrollbar-track { background: transparent; }
}

/* password eye inside each password field + live username check */
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 42px; }
.pw-wrap .pw-eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #0a2472; cursor: pointer; z-index: 2; }
.un-status { display: block; margin-top: 4px; font-size: 12px; }
.un-status.un-ok { color: #1e8e4e; }
.un-status.un-bad { color: #d93025; font-weight: 600; }

/* member list toolbar: every control the same 44px height, centred on one line */
.card-header .card-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.card-header .card-tools .btn { margin: 0 !important; height: 44px; display: inline-flex; align-items: center; }
.card-header .card-tools .member-filter { height: 44px; margin: 0; width: 200px; }
.card-header .card-tools #member-status { width: 170px; }
.card-header .card-title { display: flex; align-items: center; gap: 14px; margin: 0; }
.card-header .card-title .form-group { margin: 0 !important; }
.card-header .card-title .select2-container { margin: 0; }
.card-header .card-title .select2-container .select2-selection--single { height: 44px; display: flex; align-items: center; }
.card-header .card-title .select2-container .select2-selection__arrow { height: 42px; }
.card-header .card-title .form-group.col-md-3 { flex: 0 0 auto; width: 300px; max-width: none; padding: 0; }
.card-header .card-tools .btn { gap: 8px; }
.card-header .card-tools .btn > i.fa { margin: 0 !important; }

/* confirm pop-ups (.pop-content): centred in the window, scrolls inside when tall, never cut off */
.modal-dialog:has(> .pop-content) {
    position: fixed !important;
    inset: 0 !important;
    margin: auto !important;
    padding: 0 !important;
    width: 700px !important;
    max-width: calc(100vw - 32px) !important;
    height: max-content !important;
    max-height: calc(100vh - 32px) !important;
    display: flex;
}
.modal-dialog > .pop-content {
    width: 100% !important;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}
.pop-body label { display: block; margin: 14px 0 6px; font-weight: 600; }
.pop-body .form-control.man-name { display: flex; align-items: center; }
/* Bootstrap's .modal.fade pushes the dialog up by 25% of its height; these pop-ups are shown without the fade, so cancel it */
.modal .modal-dialog:has(> .pop-content) { transform: none !important; transition: none !important; }
/* header tools sit in the same flex row as the title (AdminLTE absolute-positions them, which left them 8px high) */
.card-header .card-tools { position: static !important; margin-left: auto; float: none; }
.card-header { flex-wrap: nowrap; gap: 12px; }
.card-header .card-title { flex: 0 1 auto; min-width: 0; }
.card-header .card-title .form-group.col-md-3 { width: 240px; }
.card-header .card-tools { flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; gap: 8px; }
.card-header .card-tools .member-filter { flex: 1 1 160px; min-width: 110px; width: auto; max-width: 240px; }
.card-header .card-tools #member-status { flex: 0 1 150px; min-width: 120px; }
.card-header .card-tools .btn { flex: 0 0 auto; white-space: nowrap; }
.card-header .card-title { flex-wrap: nowrap; white-space: nowrap; }
.card-header .card-title .form-group.col-md-3 { flex: 0 0 240px; width: 240px; max-width: 240px; }
.card-header .card-title .select2-container { width: 100% !important; }
.card-header .card-title .form-group.col-md-3 { min-width: 0; }
.card-header .card-title .select2-container .select2-selection__rendered { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-header .card-title .form-group.col-md-3 { flex: 0 0 240px !important; width: 240px !important; max-width: 240px !important; }
.card-header .card-title .select2-container { min-width: 0 !important; }
.card-header .card-title { flex-shrink: 0; }

/* ---------- Role screens: permission cards ---------- */
.role-type .rp-options { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 8px; }
.rp-opt { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.rp-opt input { position: absolute; opacity: 0; pointer-events: none; }
.rp-switch { position: relative; flex: 0 0 40px; height: 22px; border-radius: 22px; background: #cfd6e4; transition: background .2s; }
.rp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.rp-opt input:checked + .rp-switch { background: var(--mp-primary); }
.rp-opt input:checked + .rp-switch::after { transform: translateX(18px); }
.rp-opt input:disabled + .rp-switch { opacity: .4; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 22px; }
.perm-card { background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: var(--mp-radius); overflow: hidden; }
.perm-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 18px; background: #f8f9fc; border-bottom: 1px solid var(--mp-line-soft); }
.perm-card h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--mp-primary); }
.perm-card header p { margin: 2px 0 0; font-size: 12.5px; color: var(--mp-muted); }
.perm-tag { margin-left: 6px; padding: 2px 8px; border-radius: 20px; background: var(--mp-primary-soft); color: var(--mp-primary); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; vertical-align: middle; }
.perm-all { font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--mp-gold-dark); }
.perm-list { padding: 8px 12px 12px; }
.perm-item { display: flex; align-items: center; gap: 12px; margin: 0; padding: 9px 8px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.perm-item:hover { background: #f4f6fb; }
.perm-item input { position: absolute; opacity: 0; pointer-events: none; }
.perm-box { flex: 0 0 20px; height: 20px; border: 2px solid #b9c2d3; border-radius: 6px; background: #fff; position: relative; transition: all .15s; }
.perm-item input:checked + .perm-box { background: var(--mp-primary); border-color: var(--mp-primary); }
.perm-item input:checked + .perm-box::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.perm-item input:focus-visible + .perm-box { box-shadow: 0 0 0 3px var(--mp-primary-soft); }
.perm-empty { margin: 8px; color: var(--mp-muted); font-size: 13px; }
/* beat the generic "label wrapping a checkbox is inline" rule */
.perm-card label.perm-item { display: flex !important; margin: 0 !important; width: 100%; color: var(--mp-ink); font-size: 14px; }
.role-type label.rp-opt { display: flex !important; margin: 0 !important; font-size: 14px; color: var(--mp-ink); }
.perm-box, .rp-switch { display: block; }
.perm-card label.perm-item .perm-label { font-weight: 500; }

/* product list */
.pl-product { display: flex; align-items: center; gap: 14px; min-width: 230px; }
.pl-thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--mp-line); flex: 0 0 84px; }
.pl-thumb-empty { display: flex; align-items: center; justify-content: center; background: #f4f6fb; color: #98a2b3; font-size: 20px; }
.pl-name { font-weight: 700; color: var(--mp-primary); display: block; }
.pl-sub { font-size: 12px; color: var(--mp-muted); margin-bottom: 2px; }
.pl-rates { line-height: 1.7; white-space: nowrap; cursor: help; }
.pl-rates .pl-k { display: inline-block; min-width: 62px; font-size: 12px; color: var(--mp-muted); }
.pl-rates .fa { font-size: 11px; color: var(--mp-muted); margin: 0 3px; }

/* dashboard cards: one big total, and a per-product breakdown only when there is more than one product */
.card.text-white .dash-total { font-size: 34px; font-weight: 700; line-height: 1.2; margin-top: 10px; letter-spacing: -.5px; }
.card.text-white .dash-break { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.22); }
.card.text-white .dash-break-h { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; opacity: .7; margin-bottom: 4px; }
.card.text-white .dash-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 2px 0; }
.card.text-white .dash-row b { font-weight: 600; }

/* dashboard charts */
.dash-chart { background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 18px 20px 14px; height: 100%; box-shadow: var(--mp-shadow); }
.dash-chart h6 { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--mp-primary); }
.dash-chart h6 small { font-weight: 500; color: var(--mp-muted); margin-left: 6px; font-size: 12px; }
.dash-chart-box { position: relative; height: 240px; }

/* dashboard KPI tiles: light, compact, grouped */
.kpi-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--mp-muted); margin: 6px 0 10px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { display: flex; align-items: center; gap: 14px; background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 16px 18px; box-shadow: var(--mp-shadow); }
.kpi-icon { flex: 0 0 46px; height: 46px; border-radius: 12px; background: var(--mp-primary-soft); color: var(--mp-primary); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 13px; color: var(--mp-muted); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--mp-primary); line-height: 1.2; letter-spacing: -.4px; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--mp-muted); letter-spacing: 0; }
.kpi-break { margin-top: 6px; font-size: 12.5px; color: var(--mp-muted); }
.kpi-break div { display: flex; justify-content: space-between; gap: 12px; }
.kpi-attn .kpi-icon { background: rgba(217, 180, 90, .2); color: var(--mp-gold-dark); }
.kpi-on { border-color: var(--mp-gold); box-shadow: 0 0 0 2px rgba(217, 180, 90, .25); }
.kpi-on .kpi-value { color: var(--mp-gold-dark); }

/* header bell: notifications dropdown (replaces the banners at the top of every page) */
.bell { position: relative; list-style: none; display: flex; align-items: center; margin-right: 6px; }
.bell-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; color: var(--mp-primary); font-size: 22px; transition: background .15s; }
.bell-btn:hover { background: var(--mp-primary-soft); color: var(--mp-primary); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--mp-danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.bell-panel { display: none; position: absolute; right: -10px; top: 52px; width: 440px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--mp-line); border-radius: var(--mp-radius); box-shadow: 0 12px 40px rgba(16, 24, 40, .18); z-index: 1100; overflow: hidden; }
.bell-panel.open { display: block; }
.bell-head { padding: 14px 18px; font-weight: 700; color: var(--mp-primary); border-bottom: 1px solid var(--mp-line-soft); }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--mp-line-soft); border-left: 4px solid transparent; }
.bell-item > .fa { margin-top: 3px; font-size: 16px; width: 18px; text-align: center; }
.bell-item .bell-msg { flex: 1; font-size: 13.5px; line-height: 1.45; color: var(--mp-ink); }
.bell-item .bell-msg:hover { color: var(--mp-primary); }
.bell-x { border: 0; background: transparent; color: #98a2b3; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.bell-x:hover { background: #f4f6fb; color: var(--mp-danger); }
.bell-red { border-left-color: var(--mp-danger); } .bell-red > .fa { color: var(--mp-danger); }
.bell-orange { border-left-color: #f0883e; } .bell-orange > .fa { color: #f0883e; }
.bell-yellow { border-left-color: var(--mp-gold); } .bell-yellow > .fa { color: var(--mp-gold-dark); }
.bell-blue { border-left-color: #3b9be8; } .bell-blue > .fa { color: #3b9be8; }
.bell-empty { padding: 28px 18px; text-align: center; color: var(--mp-muted); font-size: 14px; }
.bell-foot { display: block; padding: 12px 18px; text-align: center; font-weight: 600; font-size: 13.5px; border-top: 1px solid var(--mp-line-soft); background: #f8f9fc; color: var(--mp-primary); }
.bell-foot b { margin-left: 6px; color: var(--mp-danger); font-weight: 600; }
/* bell: small round counter that sits on the corner and leaves the bell visible */
.bell-btn { font-size: 24px; }
.bell-count { box-sizing: border-box !important; top: 1px !important; right: 1px !important; min-width: 18px !important; width: auto; height: 18px !important; padding: 0 5px !important; border: 2px solid #fff !important; border-radius: 9px !important; font-size: 10px !important; line-height: 14px !important; }
.bell-count { top: -3px !important; right: -6px !important; }

/* redemption list: Approve / Reject (or Mark as paid) sit side by side at the same size */
.redem-actions { white-space: nowrap; }
.redem-actions > span { display: inline-flex; gap: 8px; }
.redem-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 104px; height: 40px; margin: 0 !important; }
.redem-actions > .btn { margin-right: 8px !important; }
.table td.redem-actions .btn { min-width: 104px; width: 104px; height: 38px; line-height: 1; padding: 0 10px; }
.table td.redem-actions > .btn { width: auto; min-width: 140px; }

/* icon-only action buttons with a hover label */
.table td.redem-actions .btn, .table td.redem-actions > .btn { width: 38px; min-width: 38px; height: 38px; padding: 0; position: relative; font-size: 15px; }
.table td.redem-actions .btn[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: #1d2939; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; padding: 5px 9px; border-radius: 6px; z-index: 20; pointer-events: none;
}
.table td.redem-actions .btn[data-tip]:hover::before {
    content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: #1d2939; z-index: 20; pointer-events: none;
}

/* list footer: count + rows per page on the left, pager on the right */
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 30px 26px; }
.list-foot-left { display: flex; align-items: center; gap: 22px; color: var(--mp-muted); font-size: 14px; }
.list-foot .per-page { display: flex; align-items: center; gap: 10px; margin: 0 !important; font-weight: 500; color: var(--mp-muted); }
.list-foot .per-page select { width: 76px; height: 38px !important; padding: 0 10px; }
.mp-pager { margin: 0; gap: 6px; display: flex; flex-wrap: wrap; }
.mp-pager .page-item { margin: 0; }
.mp-pager .page-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 14px; border: 1px solid var(--mp-line); border-radius: 10px !important; color: var(--mp-ink); font-weight: 600; font-size: 14px; background: #fff; transition: all .15s; }
.mp-pager .page-link .fa { font-size: 18px; line-height: 1; }
.mp-pager a.page-link:hover { background: var(--mp-primary-soft); border-color: var(--mp-primary); color: var(--mp-primary); }
.mp-pager .page-item.active .page-link { background: var(--mp-primary); border-color: var(--mp-primary); color: #fff; }
.mp-pager .page-item.disabled .page-link { background: #f4f6fb; color: #b0b8c8; border-color: var(--mp-line-soft); }

/* generic icon-button row (admin list and others): one line, 38px squares, hover label */
.table td.act-icons { white-space: nowrap; }
.table td.act-icons .btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-width: 38px; height: 38px; padding: 0; margin: 0 8px 0 0 !important; position: relative; font-size: 15px; }
.table td.act-icons .btn:last-child { margin-right: 0 !important; }
.table td.act-icons .btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #1d2939; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; padding: 5px 9px; border-radius: 6px; z-index: 20; pointer-events: none; }
.table td.act-icons .btn[data-tip]:hover::before { content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1d2939; z-index: 20; pointer-events: none; }

.inv-member { font-weight: 700; color: var(--mp-primary); }
.inv-sub { font-size: 12px; color: var(--mp-muted); }

/* header row: title, manager filter and tools share one centre line, and the manager filter shows its full text */
.card-header .card-title { align-items: center; line-height: 1.2; }
.card-header .card-title > .form-group { display: flex !important; align-items: center; height: 44px; }
.card-header .card-title .select2-container .select2-selection--single .select2-selection__rendered { line-height: 44px !important; height: 44px; padding-top: 0 !important; padding-bottom: 0 !important; }
.card-header .card-title .form-group.col-md-3 { flex: 0 0 300px !important; width: 300px !important; max-width: 300px !important; }

/* list pages: title + actions on top, filters in their own bar underneath */
.list-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 24px 4px; }
.list-filters .fb-search { flex: 0 1 300px; min-width: 200px; height: 44px; margin: 0; }
.list-filters .fb-select { flex: 0 0 260px; }
.list-filters .fb-select.fb-narrow { flex-basis: 190px; }
.list-filters .fb-select .select2-container { width: 100% !important; min-width: 0 !important; }
.list-filters .fb-select .form-control { margin: 0; }
.list-filters .select2-container .select2-selection--single { height: 44px; }
.list-filters .select2-container .select2-selection__rendered { line-height: 42px !important; }
.list-filters.lf-labeled { align-items: flex-end; }
.list-filters .filter-field { display: flex; flex-direction: column; }
.list-filters .filter-field label { margin-bottom: 4px; }
.list-filters .filter-field .form-control { width: 170px; }
.list-filters > .btn { height: 44px; padding: 0 22px; white-space: nowrap; }

/* one "Member" cell: name (+VIP tag), then username / I/C, email and phone */
.mc-name { font-weight: 700; color: var(--mp-primary); line-height: 1.3; }
.mc-vip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px; background: rgba(217,180,90,.25); color: var(--mp-gold-dark); font-size: 11px; font-weight: 700; vertical-align: middle; }
.mc-vip .fa { font-size: 10px; }
.mc-sub { font-size: 12.5px; color: var(--mp-muted); line-height: 1.55; word-break: break-word; }
.mc-sub .fa { width: 14px; text-align: center; margin-right: 4px; opacity: .8; }

/* status pill: short and the same size on every row */
.st { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.st-ok { background: rgba(47,163,107,.14); color: #1e8e4e; }
.st-warn { background: rgba(240,136,62,.16); color: #c4620d; }
.st-bad { background: rgba(229,72,77,.13); color: #d93025; cursor: help; }
.st-off { background: #eef1f6; color: #667085; }
/* masked I/C: asterisks drawn on the digits' centre line */
.mk { position: relative; top: .16em; letter-spacing: 1px; }

/* dropdown text sits on the box's centre line (Inter's line box rides about 3px high inside select2) */
.select2-container--default .select2-selection--single .select2-selection__rendered { position: relative; top: 2px; }
.st-info { background: rgba(59,111,212,.14); color: #2a58c4; }
.st-bad { cursor: default; }
.st-date { font-size: 12px; color: var(--mp-muted); margin-top: 3px; }

/* sub-lines: icon on the left, text beside it (wraps under itself, never under the icon) */
.mc-sub { display: flex; align-items: flex-start; gap: 7px; }
.mc-sub .fa { flex: 0 0 14px; width: 14px; margin: 3px 0 0; text-align: center; }
.mc-sub > span { min-width: 0; }
.mc-sub > b { margin-left: auto; padding-left: 14px; color: var(--mp-ink); font-weight: 600; white-space: nowrap; }
.mc-sub .mk { white-space: nowrap; }
.mc-sub.mc-main > b { font-size: 15px; font-weight: 700; color: var(--mp-primary); }
.mc-sub.mc-main > span { color: var(--mp-ink); font-weight: 600; }

/* status columns: heading and badges centred */
.table th.col-center, .table td.col-center { text-align: center; }

/* shared confirmation dialog */
.mpc { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: none; align-items: center; justify-content: center; z-index: 3000; padding: 16px; }
.mpc.open { display: flex; }
.mpc-card { width: 420px; max-width: 100%; background: #fff; border-radius: 16px; padding: 28px 28px 22px; text-align: center; box-shadow: 0 20px 60px rgba(16, 24, 40, .3); animation: mpc-in .15s ease-out; }
@keyframes mpc-in { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.mpc-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--mp-primary-soft); color: var(--mp-primary); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.mpc-icon.risky { background: rgba(229, 72, 77, .14); color: var(--mp-danger); }
.mpc-card h4 { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--mp-ink); }
.mpc-card p { margin: 0 0 22px; color: var(--mp-muted); font-size: 15px; line-height: 1.5; white-space: pre-line; }
.mpc-actions { display: flex; gap: 10px; justify-content: center; }
.mpc-actions .btn { min-width: 120px; height: 44px; }
