/* ============================================================
   GLOBAL ADMIN THEME  — prefix: adm-
   Shared base across all DataTables admin pages.
   Include on any page using this design system.
   Requires: Inter font, Select2 CSS, bootstrap-daterangepicker CSS.
   ============================================================ */


/* ════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════ */
:root {
    /* ── Text scale ── */
    --adm-text:        #4a5a72;       /* body / default text */
    --adm-text-strong: #2c3a50;       /* headings / emphasis */
    --adm-muted:       #8693a6;       /* secondary / meta text */
    --adm-text-faint:  #99a0a8;       /* placeholder / disabled */

    /* ── Surfaces ── */
    --adm-surface:        #ffffff;    /* card / panel background */
    --adm-surface-subtle: #f9fafc;    /* page tint / input bg */
    --adm-surface-inset:  #f3f5f8;    /* inner areas / disabled fields */

    /* ── Borders ── */
    --adm-border:       #e2e7ee;      /* default divider / card border */
    --adm-border-soft:  #eef1f5;      /* table row divider / light sep */
    --adm-border-input: #dde3ed;      /* form input default border */
    --adm-border-strong: #c8d4e6;     /* hover / focus border */

    /* ── Elevation ── */
    --adm-shadow-sm:         0 1px 2px rgba(28,42,66,.05), 0 1px 8px rgba(28,42,66,.03);
    --adm-shadow-card:       0 1px 3px rgba(15,28,55,.07), 0 2px 12px rgba(15,28,55,.04);
    --adm-shadow-card-hover: 0 6px 20px rgba(15,28,55,.10);

    /* ── Brand accent — single source of truth. Change these to re-theme the whole admin UI. ── */
    --adm-accent:        #2F6FE0;
    --adm-accent-dark:   #2560c4;          /* hover / pressed */
    --adm-accent-bg:     #eaf1fc;          /* tint background */
    --adm-accent-ring:   rgba(47,111,224,.16);
    --adm-accent-border: rgba(47,111,224,.25);
    --adm-blue-link:     #3877cf;

    /* ── Brand secondary ── */
    --adm-green:         #1ba97a;          /* YesMadam green — sidebar, stepper active */
    --adm-green-dark:    #159a71;          /* hover / pressed */
    --adm-green-bg:      #e7f5ef;          /* tint background */

    /* ── Milestone / celebrate type ── */
    --adm-milestone:        #13795a;       /* icon & text colour */
    --adm-milestone-bg:     #e7f5ef;       /* surface tint (same as --adm-green-bg) */
    --adm-milestone-strong: #0d5c44;       /* dark label / active state */

    /* ── Semantic status (order/booking states) ── */
    --adm-success:      #16a34a;  --adm-success-bg:  #dcfce7;
    --adm-warning:      #d97706;  --adm-warning-bg:  #fef3c7;
    --adm-error:        #dc2626;  --adm-error-bg:    #fee2e2;
    --adm-info:         #3b82f6;  --adm-info-bg:     #dbeafe;
    --adm-teal:         #0d9488;  --adm-teal-bg:     #ccfbf1;
    --adm-purple:       #7c3aed;  --adm-purple-bg:   #ede9fe;
    --adm-indigo:       #4f46e5;  --adm-indigo-bg:   #e0e7ff;
    --adm-rose:         #e11d48;  --adm-rose-bg:     #ffe4e6;
}


/* ════════════════════════════════════════
   BASE WRAPPER
════════════════════════════════════════ */
.adm-wrap {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}


/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.adm-btn-link {
    background: transparent; border: none; padding: 0;
    font-family: inherit; font-size: 12.5px; font-weight: 600;
    color: var(--adm-blue-link); cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
}
.adm-btn-ghost {
    background: #fff; border: 1px solid var(--adm-border); border-radius: 8px;
    padding: 5px 12px; font-family: inherit; font-size: 12.5px; font-weight: 600;
    color: var(--adm-text); cursor: pointer;
}
.adm-btn-ghost:hover { background: #f7f9fb; }
.adm-btn-green {
    background: var(--adm-accent); border: 1px solid var(--adm-accent); border-radius: 8px;
    padding: 0 18px; height: 38px; font-family: inherit; font-size: 13.5px; font-weight: 600;
    color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.adm-btn-green:hover { background: var(--adm-accent-dark); }


/* ════════════════════════════════════════
   FORM FIELDS
════════════════════════════════════════ */
.adm-field { display: flex; flex-direction: column; gap: 5px; }
.adm-field-label {
    font-size: 11.5px; font-weight: 600; color: var(--adm-muted);
    text-transform: uppercase; letter-spacing: .04em;
}

/* Text input + native select */
.adm-input, .adm-select {
    width: 100%; box-sizing: border-box; height: 38px; padding: 0 11px;
    border: 1px solid var(--adm-border); border-radius: 8px;
    background: #fff; font-family: inherit; font-size: 13.5px;
    color: var(--adm-text); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.adm-input:focus, .adm-select:focus {
    border-color: var(--adm-accent);
    box-shadow: 0 0 0 3px var(--adm-accent-ring);
}

/* Input with trailing icon (datepicker) */
.adm-input-icon-wrap { position: relative; }
.adm-input-icon-right {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--adm-muted); pointer-events: none; display: flex; align-items: center;
}
.adm-datepicker { padding-right: 34px; cursor: pointer; }

/* Native select with custom arrow */
.adm-select-wrap { position: relative; }
.adm-select { appearance: none; padding-right: 30px; cursor: pointer; }
.adm-select-arrow {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--adm-muted); pointer-events: none;
}

/* Filter actions row */
.adm-filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-top: 2px; }


/* ════════════════════════════════════════
   TOGGLE SWITCH
════════════════════════════════════════ */
.adm-toggle-wrap {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--adm-text); cursor: pointer;
    padding-top: 18px;
}
.adm-toggle {
    position: relative; width: 38px; height: 22px; border-radius: 999px;
    background: #cdd5df; border: none; cursor: pointer; padding: 0;
    transition: background .15s; flex-shrink: 0;
}
.adm-toggle.on { background: var(--adm-accent); }
.adm-toggle-knob {
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s;
}
.adm-toggle.on .adm-toggle-knob { left: 18px; }


/* ════════════════════════════════════════
   STATUS PILLS
════════════════════════════════════════ */
.adm-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 9px 2px 7px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.adm-pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.adm-pill-new         { color: #1d4ed8; background: #e8eefc; } .adm-pill-new .adm-pill-dot         { background: var(--adm-accent); }
.adm-pill-ongoing     { color: #9a5b00; background: #fcefda; } .adm-pill-ongoing .adm-pill-dot     { background: #e0941f; }
.adm-pill-resolved    { color: #13795a; background: #dcf3ea; } .adm-pill-resolved .adm-pill-dot    { background: #1ba97a; }
.adm-pill-resolved-nr { color: #5b6573; background: #eceff3; } .adm-pill-resolved-nr .adm-pill-dot { background: #8a96a6; }
.adm-pill-rejected    { color: #991b1b; background: #fee2e2; } .adm-pill-rejected .adm-pill-dot    { background: #dc2626; }
.adm-pill-default     { color: #4b5563; background: #f3f4f6; } .adm-pill-default .adm-pill-dot     { background: #9ca3af; }

.adm-status-cell  { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.adm-status-icons { display: flex; align-items: center; gap: 6px; }
.adm-flag         { display: inline-flex; align-items: center; color: #c0392b; }
.adm-reopen-request-icon { display: inline-flex; align-items: center; color: #c0392b; }
.adm-late-badge { font-size: 10px; font-weight: 700; letter-spacing: .4px; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 4px; padding: 1px 5px; }


/* ════════════════════════════════════════
   SELECT2 OVERRIDES
════════════════════════════════════════ */
.adm-s2 + .select2-container { width: 100% !important; }

/* Single */
.select2-container--default .select2-selection--single {
    height: 38px !important; border: 1px solid var(--adm-border) !important;
    border-radius: 8px !important; background: #fff !important;
    font-family: "Inter", sans-serif !important;
    transition: border-color .15s, box-shadow .15s;
}
.select2-container--default.select2-container--open  .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--adm-accent) !important;
    box-shadow: 0 0 0 3px var(--adm-accent-ring) !important; outline: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important; font-size: 13.5px !important;
    color: var(--adm-text) !important; padding-left: 11px !important; padding-right: 28px !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--adm-muted) !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow       { height: 38px !important; right: 6px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow b     { border-color: var(--adm-muted) transparent transparent transparent !important; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent var(--adm-muted) transparent !important; }
.select2-container--default .select2-selection--single .select2-selection__clear { color: var(--adm-muted); font-size: 16px; margin-right: 4px; line-height: 38px; }

/* Multiple */
.select2-container--default .select2-selection--multiple {
    min-height: 38px !important; border: 1px solid var(--adm-border) !important;
    border-radius: 8px !important; background: #fff !important;
    font-family: "Inter", sans-serif !important; padding: 3px 6px !important;
    cursor: pointer !important; transition: border-color .15s, box-shadow .15s;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open  .select2-selection--multiple {
    border-color: var(--adm-accent) !important;
    box-shadow: 0 0 0 3px var(--adm-accent-ring) !important; outline: none !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important; display: flex !important; flex-wrap: wrap !important;
    gap: 3px !important; align-items: center !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--adm-accent-bg) !important; border: 1px solid var(--adm-accent-border) !important;
    border-radius: 6px !important; color: var(--adm-accent) !important;
    font-size: 11.5px !important; font-weight: 600 !important;
    padding: 1px 6px 1px 5px !important; margin: 0 !important;
    line-height: 1.6 !important; font-family: "Inter", sans-serif !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--adm-accent) !important; margin-right: 3px !important;
    font-size: 13px !important; line-height: 1 !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: var(--adm-accent-dark) !important; background: transparent !important; }
.select2-container--default .select2-selection--multiple .select2-search--inline {
    display: flex !important; align-items: center !important; flex: 1 !important; min-width: 80px !important;
}
.select2-container--default .select2-selection--multiple .select2-search__field {
    font-family: "Inter", sans-serif !important; font-size: 13.5px !important;
    color: var(--adm-text) !important; margin: 0 !important; padding: 0 4px !important;
    min-width: 80px !important; width: 100% !important; height: 30px !important;
    line-height: 30px !important; border: none !important; outline: none !important;
    background: transparent !important;
}
.select2-container--default .select2-selection--multiple .select2-search__field::placeholder { color: var(--adm-muted) !important; opacity: 1 !important; }
.select2-container--default .select2-selection--multiple .select2-selection__clear { margin-right: 6px !important; color: var(--adm-muted) !important; font-size: 16px !important; }

/* Shared dropdown */
.select2-dropdown {
    border: 1px solid var(--adm-border) !important; border-radius: 8px !important;
    box-shadow: 0 6px 20px rgba(28,42,66,.10) !important;
    font-family: "Inter", sans-serif !important; overflow: hidden;
}
.select2-container--default .select2-search--dropdown { padding: 8px 8px 6px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--adm-border) !important; border-radius: 6px !important;
    padding: 6px 10px !important; font-family: "Inter", sans-serif !important;
    font-size: 13px !important; color: var(--adm-text) !important;
    outline: none !important; box-sizing: border-box;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--adm-accent) !important; box-shadow: 0 0 0 2px var(--adm-accent-ring) !important;
}
.select2-results__option { padding: 8px 12px !important; font-size: 13px !important; color: var(--adm-text) !important; font-family: "Inter", sans-serif !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--adm-accent-bg) !important; color: var(--adm-accent) !important; }
.select2-container--default .select2-results__option[aria-selected=true]         { background: var(--adm-accent-bg) !important; color: var(--adm-text-strong) !important; }
.select2-results__option--load-more, .select2-results__message { font-size: 12px !important; color: var(--adm-muted) !important; }


/* ════════════════════════════════════════
   DATERANGEPICKER OVERRIDES
════════════════════════════════════════ */
.daterangepicker {
    font-family: "Inter", sans-serif !important; border: 1px solid var(--adm-border) !important;
    border-radius: 10px !important; box-shadow: 0 6px 20px rgba(28,42,66,.12) !important;
}
.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td { font-family: "Inter", sans-serif !important; font-size: 12.5px !important; }
.daterangepicker td.active, .daterangepicker td.active:hover { background: var(--adm-accent) !important; border-color: var(--adm-accent) !important; }
.daterangepicker td.in-range { background: var(--adm-accent-bg) !important; color: var(--adm-accent) !important; }
.daterangepicker td:hover    { background: var(--adm-accent-bg) !important; color: var(--adm-accent) !important; }
.daterangepicker .drp-buttons .btn-primary  { background: var(--adm-accent) !important; border-color: var(--adm-accent) !important; font-family: "Inter", sans-serif !important; border-radius: 7px !important; }
.daterangepicker .drp-buttons .btn-default  { font-family: "Inter", sans-serif !important; border-radius: 7px !important; }
.daterangepicker select.monthselect,
.daterangepicker select.yearselect { border-radius: 6px !important; border-color: var(--adm-border) !important; font-family: "Inter", sans-serif !important; font-size: 12.5px !important; }


/* ════════════════════════════════════════
   DATATABLES FOOTER / PROCESSING
════════════════════════════════════════ */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 10px 18px; font-size: 12px;
    color: var(--adm-muted); font-family: "Inter", sans-serif;
}
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 6px !important; font-size: 12px !important; font-family: "Inter", sans-serif !important; }
div.dataTables_processing { background: transparent !important; border: none !important; box-shadow: none !important; }


/* ════════════════════════════════════════
   SHARED APP SHELL — base
════════════════════════════════════════ */
body.adm-shell {
    font-family: "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #edf1f8;
    color: var(--adm-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.adm-shell .container.body .right_col {
    background: #edf1f8;
    min-height: calc(100vh - 56px);
    padding: 92px 24px 18px;
}

body.adm-shell .container.body .main_container {
    background: transparent;
}

body.adm-shell.nav-md .container.body .col-md-3.left_col,
body.adm-shell .nav_title {
    width: var(--adm-shell-sidebar-width);
}

body.adm-shell.nav-md .container.body .right_col {
    margin-left: var(--adm-shell-sidebar-width);
}

body.adm-shell.nav-sm .container.body .col-md-3.left_col {
    width: 82px;
}

body.adm-shell.nav-sm .container.body .right_col,
body.adm-shell.nav-sm .main_container .top_nav {
    margin-left: 82px;
}

body.adm-shell .container.body .right_col {
    padding-top: 92px !important;
}

body.adm-shell.nav-sm .container.body .right_col {
    padding-top: 92px;
}

@media (max-width: 991px) {
    body.adm-shell .container.body .right_col {
        padding: 18px 14px 14px !important;
    }
}

@media (max-width: 991px) {
    body.adm-shell .container.body .right_col {
        padding-top: 86px !important;
    }
}

/* Standalone dashboard redesign alignment — shell tokens */
body.adm-shell {
    --adm-shell-sidebar-width: 264px;
    --adm-shell-bg: #edf2f9;
    --adm-shell-sidebar-top: #141f38;
    --adm-shell-sidebar-bottom: #0c1422;
    --adm-shell-sidebar-muted: rgba(213, 222, 235, 0.6);
    --adm-shell-sidebar-text: #ffffff;
    --adm-shell-accent-blue: var(--adm-accent);
    --adm-shell-accent-pink: var(--adm-accent);
}

body.adm-shell.nav-md .container.body .col-md-3.left_col,
body.adm-shell .nav_title {
    width: var(--adm-shell-sidebar-width) !important;
}

body.adm-shell .container.body .main_container {
    background: var(--adm-shell-bg) !important;
}

body.adm-shell .container.body .right_col {
    min-height: calc(100vh - 60px);
    padding: 82px 24px 24px !important;
    background: var(--adm-shell-bg) !important;
}

/* Pages with orderheader-stats panel: right_col min-height must not include the panel's height */
body.adm-shell.adm-has-stats .container.body .right_col {
    min-height: calc(100vh - 450px) !important;
}

@media (max-width: 991px) {
    body.adm-shell .container.body .right_col,
    body.adm-shell .adm-dashboard-page {
        padding: 78px 16px 22px !important;
    }
}


/* ════════════════════════════════════════
   SCROLLBARS
════════════════════════════════════════ */
html,
body,
body.adm-shell,
body.adm-shell .left_col.scroll-view,
body.adm-shell .container.body .right_col,
body.adm-shell #sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: var(--adm-accent) var(--adm-accent-bg);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
body.adm-shell::-webkit-scrollbar,
body.adm-shell .left_col.scroll-view::-webkit-scrollbar,
body.adm-shell .container.body .right_col::-webkit-scrollbar,
body.adm-shell #sidebar-menu::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
body.adm-shell::-webkit-scrollbar-track,
body.adm-shell .left_col.scroll-view::-webkit-scrollbar-track,
body.adm-shell .container.body .right_col::-webkit-scrollbar-track,
body.adm-shell #sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
body.adm-shell::-webkit-scrollbar-thumb,
body.adm-shell .left_col.scroll-view::-webkit-scrollbar-thumb,
body.adm-shell .container.body .right_col::-webkit-scrollbar-thumb,
body.adm-shell #sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--adm-accent-bg);
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
body.adm-shell::-webkit-scrollbar-thumb:hover,
body.adm-shell .left_col.scroll-view::-webkit-scrollbar-thumb:hover,
body.adm-shell .container.body .right_col::-webkit-scrollbar-thumb:hover,
body.adm-shell #sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--adm-accent);
}


/* ════════════════════════════════════════
   TOAST NOTIFICATIONS — global
   Usage: showToast('message', 'success'|'warning'|'error')
════════════════════════════════════════ */
#adm-toast-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.adm-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    padding: 13px 14px 13px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(15,28,55,.13), 0 2px 6px rgba(15,28,55,.06);
    pointer-events: all;
    animation: adm-toast-in .22s cubic-bezier(.22,1,.36,1) forwards;
    font-family: 'Inter', 'Open Sans', sans-serif;
    position: relative;
    overflow: hidden;
}

.adm-toast.adm-toast-removing {
    animation: adm-toast-out .18s ease forwards;
}

@keyframes adm-toast-in {
    from { opacity: 0; transform: translateX(24px) scale(.97); }
    to   { opacity: 1; transform: translateX(0)   scale(1); }
}

@keyframes adm-toast-out {
    from { opacity: 1; transform: translateX(0)   scale(1); max-height: 100px; margin-bottom: 0; }
    to   { opacity: 0; transform: translateX(24px) scale(.97); max-height: 0; margin-bottom: -10px; }
}

.adm-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.adm-toast-msg {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.adm-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #b0bfcf;
    font-size: 13px;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    transition: color .15s;
    line-height: 1;
}

.adm-toast-close:hover { color: #4a5568; }

/* Progress bar */
.adm-toast-bar {
    position: absolute;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    border-radius: 14px 14px 0 0;
    animation: adm-toast-bar-shrink 4.5s linear forwards;
}
@keyframes adm-toast-bar-shrink {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Success */
.adm-toast.adm-toast-success { border-color: rgba(27,169,122,.28); background: #f2fdf8; }
.adm-toast.adm-toast-success .adm-toast-icon { background: #d8f3e8; color: #1ba97a; }
.adm-toast.adm-toast-success .adm-toast-msg  { color: #0a5c3a; }
.adm-toast.adm-toast-success .adm-toast-bar  { background: #1ba97a; opacity: .55; }

/* Warning */
.adm-toast.adm-toast-warning { border-color: rgba(245,158,11,.28); background: #fffcf0; }
.adm-toast.adm-toast-warning .adm-toast-icon { background: #fef3c7; color: #d97706; }
.adm-toast.adm-toast-warning .adm-toast-msg  { color: #78350f; }
.adm-toast.adm-toast-warning .adm-toast-bar  { background: #d97706; opacity: .55; }

/* Error */
.adm-toast.adm-toast-error { border-color: rgba(220,38,38,.2); background: #fff5f5; }
.adm-toast.adm-toast-error .adm-toast-icon { background: #fee2e2; color: #dc2626; }
.adm-toast.adm-toast-error .adm-toast-msg  { color: #7f1d1d; }
.adm-toast.adm-toast-error .adm-toast-bar  { background: #dc2626; opacity: .55; }


/* ════════════════════════════════════════
   CARD
════════════════════════════════════════ */
.adm-card {
    background: #fff; border-radius: 12px; border: 1px solid var(--adm-border);
    box-shadow: var(--adm-shadow-sm); overflow: hidden; position: relative;
}
.adm-card + .adm-card { margin-top: 16px; }
.adm-card.adm-loading { min-height: 260px; }   /* keep panel from collapsing while first page loads */


/* ════════════════════════════════════════
   LOADER OVERLAY
════════════════════════════════════════ */
.adm-loader {
    position: absolute; inset: 0; background: rgba(255,255,255,.82); z-index: 10;
    display: flex; align-items: center; justify-content: center; border-radius: 12px; pointer-events: none;
}
.adm-spinner {
    width: 30px; height: 30px; border: 3px solid var(--adm-accent-bg);
    border-top-color: var(--adm-accent); border-radius: 50%; animation: adm-spin .65s linear infinite;
}
@keyframes adm-spin { to { transform: rotate(360deg); } }

/* NProgress — accent colour override */
#nprogress .bar { background: var(--adm-accent) !important; }
#nprogress .peg { box-shadow: 0 0 10px var(--adm-accent), 0 0 5px var(--adm-accent) !important; }

#adm-page-loader {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(10, 16, 30, 0.52);
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
#adm-page-loader.is-active { display: flex; }
#adm-page-loader .adm-spinner { width: 46px; height: 46px; border-width: 4px; }


/* ════════════════════════════════════════
   ICON BUTTON (refresh, etc.)
════════════════════════════════════════ */
.adm-icon-btn {
    width: 34px; height: 34px; border: 1px solid var(--adm-border); border-radius: 8px; background: #fff;
    color: var(--adm-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: color .12s, border-color .12s, background .12s;
}
.adm-icon-btn:hover { color: var(--adm-accent); border-color: var(--adm-accent); background: var(--adm-accent-bg); }
.adm-icon-btn.spinning svg { animation: adm-spin .7s linear infinite; }


/* ════════════════════════════════════════
   TABLE (themed base + sort indicators)
════════════════════════════════════════ */
.adm-table { margin: 0 !important; width: 100% !important; border-collapse: collapse !important; table-layout: fixed; }
.adm-table thead th {
    font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--adm-muted);
    padding: 11px 18px; border: none !important; border-bottom: 1px solid var(--adm-border-soft) !important;
    background: #fafbfc; text-align: left; background-image: none !important;
}
.adm-table tbody td { padding: 14px 18px; border: none !important; border-bottom: 1px solid var(--adm-border-soft) !important; vertical-align: middle; font-size: 13px; }
.adm-table tbody tr:hover { background: #fbfdfc; }
/* sort: accent triangle + tint only on the actively-sorted column.
   Shared by every themed table (.adm-table and .spt-table) — keep page CSS free of sort styling. */
.adm-table thead th.sorting, .adm-table thead th.sorting_asc, .adm-table thead th.sorting_desc,
.spt-table thead th.sorting, .spt-table thead th.sorting_asc, .spt-table thead th.sorting_desc { cursor: pointer; }
.adm-table thead th.sorting_asc, .adm-table thead th.sorting_desc,
.spt-table thead th.sorting_asc, .spt-table thead th.sorting_desc { background: var(--adm-accent-bg) !important; color: var(--adm-accent) !important; }
/* hide DataTables' default glyphs on every header */
.adm-table thead th.sorting::before, .adm-table thead th.sorting::after,
.adm-table thead th.sorting_asc::before, .adm-table thead th.sorting_asc::after,
.adm-table thead th.sorting_desc::before, .adm-table thead th.sorting_desc::after,
.spt-table thead th::before, .spt-table thead th::after { display: none !important; }
/* visible accent triangle on the sorted column */
.adm-table thead th.sorting_asc::after, .adm-table thead th.sorting_desc::after,
.spt-table thead th.sorting_asc::after, .spt-table thead th.sorting_desc::after {
    display: inline-block !important; margin-left: 7px; font-size: 9px; line-height: 1;
    vertical-align: middle; color: var(--adm-accent) !important;
}
.adm-table thead th.sorting_asc::after,  .spt-table thead th.sorting_asc::after  { content: '\25B2' !important; }
.adm-table thead th.sorting_desc::after, .spt-table thead th.sorting_desc::after { content: '\25BC' !important; }


/* ════════════════════════════════════════
   DATATABLES PAGINATION THEME (scoped to themed pages)
════════════════════════════════════════ */
.adm-wrap .dataTables_info { font-size: 12.5px !important; color: var(--adm-muted) !important; padding: 0 !important; margin: 0 !important; float: none !important; }
.adm-wrap .dataTables_paginate { padding: 0 !important; margin: 0 !important; float: none !important; }
.adm-wrap .dataTables_paginate .pagination { margin: 0 !important; display: flex !important; gap: 3px !important; }
.adm-wrap .dataTables_paginate .paginate_button > a,
.adm-wrap .dataTables_paginate .paginate_button > span {
    border: 1px solid var(--adm-border) !important; border-radius: 7px !important;
    color: var(--adm-text) !important; font-size: 12.5px !important; padding: 4px 10px !important;
    background: #fff !important; line-height: 1.5 !important; display: block; min-width: 30px; text-align: center;
    transition: background .12s, border-color .12s, color .12s;
}
.adm-wrap .dataTables_paginate .paginate_button.active > a,
.adm-wrap .dataTables_paginate .paginate_button.active > a:hover {
    background: var(--adm-accent) !important; border-color: var(--adm-accent) !important; color: #fff !important; box-shadow: none !important;
}
.adm-wrap .dataTables_paginate .paginate_button:not(.disabled):not(.active):hover > a {
    background: var(--adm-accent-bg) !important; border-color: var(--adm-accent) !important; color: var(--adm-accent) !important;
}
.adm-wrap .dataTables_paginate .paginate_button.disabled > a,
.adm-wrap .dataTables_paginate .paginate_button.disabled > a:hover {
    color: #c8d0db !important; background: #f7f9fb !important; border-color: var(--adm-border) !important; cursor: default;
}
.adm-wrap .dataTables_paginate .paginate_button,
.adm-wrap .dataTables_paginate .paginate_button:hover { background: none !important; border: none !important; padding: 0 !important; }

/* ── Paginated multiselect dropdown (adm-msd) ── */
.adm-msd { position: relative; user-select: none; }
.adm-msd-display {
    border: 1px solid var(--adm-border); border-radius: 8px;
    padding: 6px 10px; cursor: pointer; background: #fff;
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    min-height: 36px; font-size: 13px; transition: border-color .14s;
}
.adm-msd-display:hover { border-color: var(--adm-accent); }
.adm-msd-placeholder { color: var(--adm-muted); font-size: 13px; flex: 1; }
.adm-msd-arrow { margin-left: auto; font-size: 10px; color: var(--adm-muted); flex-shrink: 0; padding-left: 4px; }
.adm-msd-tag {
    background: var(--adm-accent); color: #fff;
    border-radius: 10px; padding: 2px 8px; font-size: 11.5px;
    display: inline-flex; align-items: center; gap: 4px; max-width: 140px;
}
.adm-msd-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-msd-tag-x { cursor: pointer; font-weight: 700; line-height: 1; flex-shrink: 0; }
.adm-msd-panel {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--adm-border); border-radius: 8px;
    z-index: 9999; box-shadow: 0 6px 18px rgba(20,30,50,.12); padding: 6px 0;
}
.adm-msd-search {
    width: calc(100% - 16px); margin: 6px 8px; padding: 6px 10px;
    border: 1px solid var(--adm-border); border-radius: 6px;
    font-size: 13px; outline: none; box-sizing: border-box;
    transition: border-color .14s;
}
.adm-msd-search:focus { border-color: var(--adm-accent); }
.adm-msd-options { max-height: 175px; overflow-y: auto; }
.adm-msd-option {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px; cursor: pointer; margin: 0;
    font-weight: normal; font-size: 13px;
}
.adm-msd-option:hover { background: var(--adm-accent-bg); }
.adm-msd-option input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: var(--adm-accent); }
.adm-msd-msg { padding: 9px 12px; font-size: 12.5px; color: var(--adm-muted); text-align: center; }
.adm-msd-sentinel { height: 1px; }

/* ── SP View & Manage: scroll tabs horizontally instead of wrapping ── */
#myTab.nav-tabs.bar_tabs {
    display: block;
    overflow-x: auto;
    overflow-y: visible;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#myTab.nav-tabs.bar_tabs::-webkit-scrollbar { display: none; }
#myTab.nav-tabs.bar_tabs > li {
    display: inline-block;
    float: none;
}


/* ════════════════════════════════════════
   adm-confirm — Confirmation Modal
════════════════════════════════════════ */
.adm-confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(10,14,26,.55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.adm-confirm-overlay.is-open {
    opacity: 1; pointer-events: auto;
}

.adm-confirm {
    background: var(--adm-surface);
    border-radius: 12px;
    width: 100%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.09);
    border: 1px solid var(--adm-border);
    overflow: hidden;
    transform: translateY(12px) scale(.97);
    transition: transform .22s cubic-bezier(.34,1.4,.64,1), opacity .2s ease;
    opacity: 0;
}
.adm-confirm-overlay.is-open .adm-confirm {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* intent stripe */
.adm-confirm-stripe { height: 4px; background: var(--adm-accent); }
.adm-confirm[data-intent="warning"] .adm-confirm-stripe { background: var(--adm-warning); }
.adm-confirm[data-intent="danger"]  .adm-confirm-stripe { background: var(--adm-danger); }

/* header */
.adm-confirm-header {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 20px 20px 16px;
}
.adm-confirm-icon-wrap {
    width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--adm-accent-bg); color: var(--adm-accent);
    font-size: 17px;
}
.adm-confirm[data-intent="warning"] .adm-confirm-icon-wrap { background: var(--adm-warning-bg); color: var(--adm-warning); }
.adm-confirm[data-intent="danger"]  .adm-confirm-icon-wrap { background: var(--adm-danger-bg);  color: var(--adm-danger);  }
.adm-confirm-title-group { flex: 1; min-width: 0; }
.adm-confirm-title    { font-size: 15px; font-weight: 700; color: var(--adm-text-strong); line-height: 1.3; margin-bottom: 3px; }
.adm-confirm-subtitle { font-size: 12px; color: var(--adm-muted); font-weight: 500; }

/* optional preview card */
.adm-confirm-preview {
    margin: 0 20px 14px;
    background: var(--adm-surface-subtle);
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex; align-items: center; gap: 12px;
}
.adm-confirm-preview-thumb {
    width: 36px; height: 36px; border-radius: 7px;
    background: var(--adm-accent-bg);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
}
.adm-confirm-preview-name { font-size: 13px; font-weight: 600; color: var(--adm-text-strong); }
.adm-confirm-preview-meta { font-size: 11px; color: var(--adm-muted); margin-top: 1px; }

/* info message — flex column, gaps between all visible children */
.adm-confirm-body {
    padding: 0 20px 18px;
    display: flex; flex-direction: column; gap: 8px;
}
.adm-confirm-badge {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    background: var(--adm-surface-inset); border: 1px solid var(--adm-border);
    border-radius: 100px; padding: 4px 10px;
    font-size: 12px; font-weight: 600; color: var(--adm-text);
}
.adm-confirm[data-intent="warning"] .adm-confirm-badge { background: var(--adm-warning-bg); border-color: rgba(217,119,6,.3); color: #92400e; }
.adm-confirm[data-intent="danger"]  .adm-confirm-badge { background: var(--adm-danger-bg);  border-color: rgba(220,38,38,.3); color: #991b1b; }
.adm-confirm-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--adm-accent); flex-shrink: 0; }
.adm-confirm[data-intent="warning"] .adm-confirm-badge-dot { background: var(--adm-warning); }
.adm-confirm[data-intent="danger"]  .adm-confirm-badge-dot { background: var(--adm-danger);  }
.adm-confirm-msg-header { font-size: 13.5px; font-weight: 700; color: var(--adm-text-strong); line-height: 1.4; }
.adm-confirm-msg        { font-size: 13px;   color: var(--adm-text);        line-height: 1.6; }
.adm-confirm-msg-footer {
    font-size: 11.5px; color: var(--adm-muted); line-height: 1.5;
    padding-top: 8px; border-top: 1px solid var(--adm-border-soft);
}

/* footer */
.adm-confirm-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--adm-border);
    background: var(--adm-surface-subtle);
}
.adm-confirm-cancel {
    padding: 9px 18px; border-radius: 7px;
    background: transparent; color: var(--adm-text);
    border: 1.5px solid var(--adm-border);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .14s, border-color .14s;
}
.adm-confirm-cancel:hover { background: var(--adm-surface-inset); border-color: var(--adm-border-strong); }
.adm-confirm-cancel:focus-visible { outline: 2px solid var(--adm-accent); outline-offset: 2px; }
.adm-confirm-ok {
    padding: 9px 20px; border-radius: 7px;
    background: var(--adm-accent); color: #fff;
    border: 1.5px solid var(--adm-accent);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .14s, border-color .14s;
}
.adm-confirm-ok:hover { background: var(--adm-accent-dark); border-color: var(--adm-accent-dark); }
.adm-confirm[data-intent="warning"] .adm-confirm-ok { background: var(--adm-warning); border-color: var(--adm-warning); }
.adm-confirm[data-intent="warning"] .adm-confirm-ok:hover { background: #b45309; border-color: #b45309; }
.adm-confirm[data-intent="danger"]  .adm-confirm-ok { background: var(--adm-danger);  border-color: var(--adm-danger);  }
.adm-confirm[data-intent="danger"]  .adm-confirm-ok:hover { background: #b91c1c; border-color: #b91c1c; }
.adm-confirm-ok:focus-visible { outline: 2px solid var(--adm-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .adm-confirm-overlay, .adm-confirm { transition: none; }
}
