/* ==========================================================================
   Connectify backend skin — admin console + partner portal (v3, redesign)
   --------------------------------------------------------------------------
   The ONE custom stylesheet for the backend. Loaded last in
   admin/partials/head.blade.php, right before the theme-token block that
   config/theme.php + App\Services\Theme\ThemeResolver emit as `:root{…}`.

   Design source: the Connectify frontend (public/new-assets/css/*.scss) —
   see docs/backend-design-brief.md. Indigo + white, Manrope, 8px controls,
   16px cards, white 280px collapsible sidebar, white 76px topbar.

   Rules
   - Every colour/metric comes from a token (var(--…)). The :root block below
     only holds FALLBACKS; tenant values win because the token block loads
     after this file.
   - Shell markup uses bk-* classes (sidebar, topbar, user, search) and owns
     its layout; Metronic stays only for page components (portlets, forms,
     tables, modals), which sections 6–12 retheme.
   - Role variation hangs off <body data-portal="admin|partner|creator">.
   - No inline <style> in views. Page-specific bits live in §15.

   Sections
     1. Tokens (fallbacks)   6. Buttons            11. Modals & dropdowns
     2. Base                 7. Forms              12. Feedback
     3. Shell: sidebar       8. Tables/DataTables  13. Footer
     4. Shell: topbar        9. Badges & alerts    14. Utilities
     5. Page & cards        10. Tabs               15. Page modules + auth
   ========================================================================== */


/* 1. Tokens — fallbacks only; config/theme.php is the source of truth
   -------------------------------------------------------------------------- */
:root {
    --brand:             #4F46E5;
    --brand-hover:       #4338CA;
    --brand-rgb:         79, 70, 229;
    --brand-contrast:    #FFFFFF;
    --font-sans:         'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --radius:            16px;
    --radius-sm:         8px;
    --surface:           #FFFFFF;
    --surface-alt:       #FAFAFB;
    --border:            #E4E4E7;
    --text:              #18181B;
    --text-muted:        #71717A;
    --success:           #2EB67D;
    --warning:           #ECB22E;
    --danger:            #E01E5A;
    --info:              #4F46E5;

    --bk-topbar-bg:      #FFFFFF;
    --bk-topbar-text:    #18181B;
    --bk-topbar-height:  76px;
    --bk-sidebar-bg:     #FFFFFF;
    --bk-sidebar-border: #E4E4E7;
    --bk-sidebar-text:   #18181B;
    --bk-sidebar-muted:  #71717A;
    --bk-sidebar-width:  280px;
    --bk-content-bg:     #FFFFFF;

    /* derived (not in config) */
    --brand-tint:        rgba(var(--brand-rgb), .10);
    /* fallbacks; ThemeResolver emits the real values per tenant (see config/theme.php) */
    --brand-contrast:    #ffffff;
    --placeholder:       #A1A1AA;
    --shadow-1:          0 0 8px -2px rgba(0, 0, 0, .15);
    --shadow-2:          0 0 30px -7px rgba(0, 0, 0, .15);
    --sidebar-rail:      72px;
}
body.sb-collapsed { --bk-sidebar-width: var(--sidebar-rail); }


/* 2. Base
   -------------------------------------------------------------------------- */
html, body {
    font-family: var(--font-sans) !important;
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bk-content-bg) !important;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
}
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; } h5 { font-size: 13px; }
a { color: var(--brand); }
a:hover, a:focus { color: var(--brand-hover); text-decoration: none; }
b, strong { font-weight: 700; color: var(--text); }
p { margin: 0 0 1em; }
code, pre { font-size: 12.5px; border-radius: var(--radius-sm); }
pre { background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); }
hr { border-color: var(--border); }
::selection { background: rgba(var(--brand-rgb), .2); }
.text-muted { color: var(--text-muted) !important; }
.text-dark { color: var(--text) !important; }
.text-primary { color: var(--brand) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Neutralise Metronic layout chrome we no longer use */
.page-header.navbar, .page-quick-sidebar-toggler, .page-sidebar-wrapper, .theme-panel { display: none !important; }
.page-header-fixed .page-container { margin-top: 0 !important; }
.page-container { margin: 0 !important; padding: 0 !important; }
.page-wrapper { background: var(--bk-content-bg); }


/* 3. Shell: sidebar
   -------------------------------------------------------------------------- */
.bk-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--bk-sidebar-width);
    background: var(--bk-sidebar-bg);
    border-right: 1px solid var(--bk-sidebar-border);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: width .2s ease, transform .25s ease;
}
.bk-brand { display: flex; align-items: center; gap: 8px; padding: 4px 0 8px; }
.bk-brand-link { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; text-decoration: none; }
.bk-brand-mark {
    width: 48px; height: 48px; flex: 0 0 48px;
    border-radius: 50%; overflow: hidden;
    border: 1px solid var(--border); background: #fff;
    display: flex; align-items: center; justify-content: center;
}
.bk-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-brand-text { display: flex; flex-direction: column; min-width: 0; }
.bk-brand-name {
    color: var(--text); font-weight: 800; font-size: 15px; letter-spacing: .5px; text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.bk-brand-sub { font-size: 11px; font-weight: 600; color: var(--text-muted); line-height: 1.3; }
.bk-sidebar .bk-sb-close { display: none !important; }

.bk-create { position: relative; }
.bk-create .bk-create-btn {
    width: 100%; height: 48px !important; font-size: 15px !important;
    display: flex !important; align-items: center; justify-content: center; gap: 10px;
    padding: 0 16px !important;
}
.bk-create .bk-create-btn .bk-caret { margin-left: auto; font-size: 13px; opacity: .85; }
.bk-create .bk-create-btn:after { display: none; }
.bk-create-menu { left: 0 !important; right: 0 !important; min-width: 0; margin-top: 6px !important; padding: 5px !important; }
.bk-create-menu > li > a {
    display: flex !important; align-items: center; gap: 10px;
    padding: 9px 12px !important; border-radius: 6px; color: var(--text) !important; font-weight: 600; white-space: normal;
}
.bk-create-menu > li > a small { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); line-height: 1.35; }
.bk-create-menu > li > a:hover { background: var(--brand-tint) !important; color: var(--brand) !important; }
.bk-create-menu > li > a:hover .bk-nav-ic, .bk-create-menu > li > a:hover small { color: var(--brand); }

.bk-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.bk-nav-section {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--bk-sidebar-muted); padding: 14px 15px 4px; white-space: nowrap;
}
.bk-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 15px; border-radius: var(--radius-sm);
    color: var(--bk-sidebar-text) !important; font-weight: 500; text-decoration: none !important;
    transition: background-color .2s, color .2s; line-height: 1.35;
}
.bk-nav-ic { width: 22px; height: 22px; flex: 0 0 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: var(--text-muted); }
.bk-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-nav-link:hover { background: var(--brand-tint); color: var(--text) !important; }
.bk-nav-link.active { background: var(--brand-tint); color: var(--brand) !important; font-weight: 600; }
.bk-nav-link.active .bk-nav-ic { color: var(--brand); }

.bk-user {
    border-top: 1px solid var(--bk-sidebar-border);
    margin: 0 -15px; padding: 14px 15px 4px;
    display: flex; align-items: center; gap: 10px;
}
.bk-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; object-fit: cover; background: var(--brand-tint); }
.bk-user-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bk-user-who strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-user-who span { font-size: 12px; color: var(--text-muted); }

.bk-icon-btn {
    width: 40px; height: 40px; flex: 0 0 40px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--text-muted); font-size: 17px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    position: relative; transition: background-color .2s, color .2s; text-decoration: none !important;
}
.bk-icon-btn:hover, .bk-icon-btn:focus { background: var(--brand-tint); color: var(--brand); }

/* Collapsed rail (desktop) */
body.sb-collapsed .bk-sidebar { padding: 15px 12px; }
body.sb-collapsed .bk-brand { justify-content: center; padding: 4px 0 8px; }
body.sb-collapsed .bk-brand-text, body.sb-collapsed .bk-nav-section, body.sb-collapsed .bk-nav-label,
body.sb-collapsed .bk-user-who, body.sb-collapsed .bk-user .bk-icon-btn, body.sb-collapsed .bk-create-btn .bk-caret,
body.sb-collapsed .bk-create-menu small { display: none; }
body.sb-collapsed .bk-nav-link { justify-content: center; padding: 10px 0; }
body.sb-collapsed .bk-nav-section + .bk-nav-link { margin-top: 10px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding-top: 14px; }
body.sb-collapsed .bk-create .bk-create-btn { padding: 0 !important; }
body.sb-collapsed .bk-create-menu { left: 0 !important; right: auto !important; min-width: 200px; }
body.sb-collapsed .bk-user { justify-content: center; }


/* 4. Shell: topbar
   -------------------------------------------------------------------------- */
.bk-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--bk-topbar-height);
    margin-left: var(--bk-sidebar-width);
    background: var(--bk-topbar-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    padding: 0 18px;
    transition: margin-left .2s ease;
}
.bk-only-mobile { display: none !important; }
.bk-search { flex: 1 1 auto; max-width: 520px; position: relative; }
.bk-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }
.bk-search .form-control { padding-left: 40px !important; margin: 0; }
.bk-search.bk-search-off { visibility: hidden; }
.bk-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bk-user-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px;
    border-radius: 30px; border: 1px solid transparent; background: transparent;
    font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
}
.bk-user-btn:hover { background: var(--brand-tint); }
.bk-user-btn .bk-avatar { width: 32px; height: 32px; flex-basis: 32px; }
.bk-user-btn .bk-caret { color: var(--text-muted); font-size: 13px; }
.bk-user-menu .dropdown-menu { margin-top: 6px; min-width: 190px; }
.bk-user-menu .dropdown-menu > li > a > i { width: 18px; text-align: center; margin-right: 6px; color: var(--text-muted); }

/* Content wrapper follows the sidebar width */
.page-content-wrapper .page-content,
.page-content-wrapper .page-content.page-content-white {
    margin-left: var(--bk-sidebar-width) !important;
    padding: 18px !important;
    min-height: calc(100vh - var(--bk-topbar-height) - 48px);
    background: var(--bk-content-bg) !important;
    transition: margin-left .2s ease;
}
.page-footer { margin-left: var(--bk-sidebar-width); transition: margin-left .2s ease; }

/* Off-canvas sidebar on tablets/phones */
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(24, 24, 27, .45); z-index: 1035; }
@media (max-width: 991px) {
    body, body.sb-collapsed { --bk-sidebar-width: 280px; }
    .bk-sidebar { transform: translateX(-100%); box-shadow: none; }
    body.sb-open .bk-sidebar { transform: none; box-shadow: var(--shadow-2); }
    body.sb-open .sb-backdrop { display: block; }
    body.sb-collapsed .bk-brand-text, body.sb-collapsed .bk-nav-section, body.sb-collapsed .bk-nav-label,
    body.sb-collapsed .bk-user-who, body.sb-collapsed .bk-user .bk-icon-btn, body.sb-collapsed .bk-create-btn .bk-caret { display: initial; }
    body.sb-collapsed .bk-nav-link { justify-content: flex-start; padding: 9px 15px; }
    body.sb-collapsed .bk-nav-section + .bk-nav-link { margin-top: 0; border-top: 0; padding-top: 9px; }
    .bk-sidebar .bk-sb-close { display: inline-flex !important; }
    .bk-topbar { margin-left: 0; padding: 0 16px; }
    .bk-only-desktop { display: none !important; }
    .bk-only-mobile { display: inline-flex !important; }
    .bk-user-name { display: none; }
    .page-content-wrapper .page-content, .page-content-wrapper .page-content.page-content-white { margin-left: 0 !important; padding: 16px !important; }
    .page-footer { margin-left: 0; }
}


/* 5. Page & cards
   -------------------------------------------------------------------------- */
/* Page title block: <section class="content-header"><h1>…</h1><small>…</small> [actions]</section> */
.content-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
    margin: 0 0 18px; padding: 0;
}
.content-header > h1 { flex: 1 1 320px; margin: 0; font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--text); }
.content-header > h1 > small, .content-header > small {
    display: block; flex-basis: 100%; margin-top: 2px; padding: 0;
    font-size: 14px; font-weight: 500; color: var(--text-muted);
}
.content-header > h1 > small { display: inline; margin-left: 8px; flex-basis: auto; }
.content-header > .btn, .content-header > form, .content-header > .btn-group, .content-header > div:last-child { margin-left: auto; }
.content-header-flex > h1 { flex: 1 1 auto; }
.content-header .breadcrumb { flex-basis: 100%; margin: 0; }

/* Cards (Metronic portlets) */
.portlet, .portlet.light, .portlet.light.bordered, .portlet.box {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    padding: 18px !important;
    margin-bottom: 18px;
    box-shadow: none;
}
.portlet.light > .portlet-title, .portlet > .portlet-title {
    min-height: 0; margin-bottom: 14px; padding: 0 0 12px;
    border-bottom: 1px solid var(--border) !important;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    background: transparent !important;
}
.portlet.light > .portlet-title > .caption, .portlet > .portlet-title > .caption {
    flex: 1 1 auto; padding: 0; float: none; display: flex; align-items: center; gap: 8px; color: var(--text);
}
.portlet.light > .portlet-title > .caption > i { color: var(--brand) !important; font-size: 16px; margin: 0; }
.portlet.light > .portlet-title > .caption > .caption-subject,
.portlet.light > .portlet-title > .caption > .caption-subject label,
.portlet > .portlet-title > .caption > .caption-subject {
    font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--text) !important; margin: 0; text-transform: none;
}
.portlet.light > .portlet-title > .caption > .caption-helper { font-size: 13px; color: var(--text-muted); }
.portlet.light > .portlet-title > .actions, .portlet.light > .portlet-title > .tools,
.portlet > .portlet-title > .actions, .portlet > .portlet-title > .tools {
    float: none; margin-left: auto; padding: 0; display: flex; gap: 8px;
}
.portlet.light > .portlet-body, .portlet > .portlet-body { padding: 0; background: transparent; }
.portlet .portlet-body .table-scrollable { margin: 0; }

/* Stat tiles */
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.stat-value { margin-top: 6px; font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-value-sm { font-size: 20px; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 30px; }
.stat-delta.up { background: rgba(46, 182, 125, .12); color: #1F9463; }
.stat-delta.down { background: rgba(224, 30, 90, .10); color: var(--danger); }

/* Filter card + row */
.search-filter, .filter-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 18px 2px; margin-bottom: 18px;
}
.filter-actions { padding-top: 26px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .form-group { flex: 1 1 180px; margin: 0 0 16px; }


/* 6. Buttons — frontend _forms.scss
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 20px;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--brand); background: var(--brand-tint); color: var(--brand);
    font-family: var(--font-sans); font-size: 14px; font-weight: 600; line-height: 1;
    text-transform: none; white-space: nowrap; cursor: pointer;
    box-shadow: none !important; outline: 0 !important;
    transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.btn:hover, .btn:focus, .btn:active, .btn.active { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.btn > i, .btn > .fa { font-size: 15px; line-height: 1; }
.btn.btn-sm, .btn-group-sm > .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.btn-xs, .btn-group-xs > .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.btn-lg, .btn-group-lg > .btn { height: 48px; padding: 0 24px; font-size: 15px; }
.btn.btn-block { display: flex; width: 100%; }

.btn-primary, .btn-success, .btn.fill, .btn.green:not(.btn-outline), .btn.blue:not(.btn-outline) {
    background: var(--brand) !important; border-color: var(--brand) !important; color: var(--brand-contrast) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle,
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn.fill:hover,
.btn.green:not(.btn-outline):hover, .btn.green:not(.btn-outline):focus, .btn.blue:not(.btn-outline):hover {
    background: var(--brand-hover) !important; border-color: var(--brand-hover) !important; color: var(--brand-contrast) !important;
}
.btn-default, .btn.default, .btn.grey, .btn-secondary {
    background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important;
}
.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle,
.btn.default:hover, .btn-secondary:hover {
    background: var(--surface-alt) !important; border-color: #D4D4D8 !important; color: var(--text) !important;
}
.btn-danger, .btn.red:not(.btn-outline), .btn.danger {
    background: rgba(224, 30, 90, .10) !important; border-color: transparent !important; color: var(--danger) !important;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn.red:not(.btn-outline):hover, .btn.danger:hover {
    background: rgba(224, 30, 90, .25) !important; color: var(--danger) !important;
}
.btn-warning, .btn.yellow:not(.btn-outline), .btn.warning {
    background: rgba(236, 178, 46, .12) !important; border-color: transparent !important; color: #A8730A !important;
}
.btn-warning:hover, .btn.warning:hover { background: rgba(236, 178, 46, .3) !important; color: #7C5A0B !important; }
.btn-info, .btn.success { background: rgba(46, 182, 125, .10) !important; border-color: transparent !important; color: #1F9463 !important; }
.btn-info:hover, .btn.success:hover { background: rgba(46, 182, 125, .25) !important; color: #1F9463 !important; }
.btn-link, .btn.btn-link, .btn.link {
    background: transparent !important; border-color: transparent !important; color: var(--brand) !important;
    height: auto; padding: 0 4px; text-decoration: underline;
}
.btn-link:hover, .btn.link:hover { color: var(--brand-hover) !important; text-decoration: none; }
.btn.disabled, .btn[disabled], fieldset[disabled] .btn { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn-group > .btn + .dropdown-toggle { padding-left: 10px; padding-right: 10px; }
.btn.btn-xs.gray.dropdown-toggle, .btn.btn-xs.grey.dropdown-toggle {
    background: transparent !important; border-color: transparent !important; color: var(--text-muted) !important;
}
.btn.btn-xs.gray.dropdown-toggle:hover { color: var(--brand) !important; background: var(--brand-tint) !important; }
.btn.btn-outline.green, .btn.btn-outline.blue { background: transparent !important; border-color: var(--brand) !important; color: var(--brand) !important; }
.btn.btn-outline.green:hover { background: var(--brand) !important; color: var(--brand-contrast) !important; }

/* Round icon-only action button (row actions in DataTables) */
.btn.icon {
    width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent !important; border-radius: 50% !important;
    background: transparent !important; color: var(--text-muted) !important; font-size: 16px;
}
.btn.icon i { display: inline-block; font-size: 16px; }
.btn.icon:hover, .btn.icon:focus { background: var(--brand-tint) !important; color: var(--brand) !important; }
.btn.icon.danger { color: var(--danger) !important; background: rgba(224, 30, 90, .08) !important; }
.btn.icon.danger:hover { background: rgba(224, 30, 90, .2) !important; color: var(--danger) !important; }
.btn.icon.btn-sm, .btn.icon.sm { width: 32px; height: 32px; font-size: 14px; }
.btn.icon.btn-xs { width: 28px; height: 28px; font-size: 13px; }


/* 7. Forms — frontend _forms.scss
   -------------------------------------------------------------------------- */
label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-control, .form-select, .form-control-solid, select.form-control, input.form-control {
    height: 40px !important; padding: 0 16px !important;
    font-family: var(--font-sans); font-size: 14px; color: var(--text);
    background: var(--surface-alt) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    transition: border-color .2s, background-color .2s;
}
.form-control:focus, .form-control-solid:focus {
    border-color: var(--brand) !important; background: var(--surface) !important; outline: 0;
}
.form-control::placeholder { color: var(--placeholder); }
.form-control[disabled], .form-control[readonly] { background: #F4F4F5 !important; color: var(--text-muted); }
textarea.form-control { height: auto !important; min-height: 110px; padding: 12px 16px !important; line-height: 20px; resize: vertical; }
select.form-control { padding-right: 40px !important; }
.input-sm.form-control, .form-control.input-sm { height: 32px !important; padding: 0 12px !important; font-size: 13px; }
.input-group .form-control:first-child { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group .form-control:last-child { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group-addon, .input-group-btn > .btn { height: 40px; border-radius: var(--radius-sm); background: var(--surface-alt); border-color: var(--border); color: var(--text-muted); }
.input-group-btn > .btn { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.has-error .form-control { border-color: var(--danger) !important; }
.help-block { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }
.help-block-error, .has-error .help-block, .Polaris-InlineError, label.error { color: var(--danger); font-size: 12px; margin-top: 4px; font-weight: 500; }
.required { color: var(--danger); font-size: 12px; padding-left: 2px; }
.checkbox label, .radio label, .checkbox-inline, .radio-inline { font-weight: 500; color: var(--text-muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.form-horizontal .control-label { font-weight: 600; }
.form-actions { padding: 16px 0 0; border-top: 1px solid var(--border); margin-top: 8px; background: transparent; }
.form-actions .btn { margin-right: 8px; }

/* select2 (bootstrap theme, loaded via the `select2` bundle) */
.select2-container--bootstrap .select2-selection {
    border-color: var(--border); border-radius: var(--radius-sm); box-shadow: none;
    background: var(--surface-alt); font-family: var(--font-sans); font-size: 14px; color: var(--text);
}
.select2-container--bootstrap .select2-selection--single { height: 40px; padding: 9px 30px 9px 16px; }
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow { top: 8px; right: 10px; }
.select2-container--bootstrap .select2-selection--multiple { min-height: 40px; padding: 4px 10px; }
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
    background: var(--brand-tint); border-color: transparent; color: var(--brand); border-radius: 6px; font-weight: 600;
}
.select2-container--bootstrap.select2-container--focus .select2-selection,
.select2-container--bootstrap.select2-container--open .select2-selection { border-color: var(--brand); background: var(--surface); box-shadow: none; }
.select2-container--bootstrap .select2-dropdown { border-color: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }
.select2-container--bootstrap .select2-results__option--highlighted[aria-selected] { background: var(--brand); color: var(--brand-contrast); }

/* bootstrap-tagsinput (docs editor) */
.bootstrap-tagsinput { width: 100%; min-height: 40px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); box-shadow: none; }
.bootstrap-tagsinput .tag { background: var(--brand); color: var(--brand-contrast); border-radius: 6px; padding: 3px 8px; font-weight: 600; font-size: 12px; }
.bootstrap-tagsinput input { height: 26px; }

/* bootstrap-switch (single page) + pure-CSS switch used in DataTables rows */
.bootstrap-switch { border-radius: 30px; border-color: var(--border); box-shadow: none; }
.bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-label { line-height: 22px !important; }
.bootstrap-switch-handle-on { background: var(--brand) !important; color: var(--brand-contrast); }
.cc-switch { position: relative; display: inline-block; width: 33px; height: 20px; vertical-align: middle; margin: 0; }
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-switch .cc-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; cursor: pointer; background: var(--brand-tint); border-radius: 30px; transition: background-color .2s; }
.cc-switch .cc-slider:before { content: ''; position: absolute; height: 14px; width: 14px; left: 3px; top: 3px; background: var(--brand); border-radius: 50%; transition: transform .2s, background-color .2s; }
.cc-switch input:checked + .cc-slider { background: var(--brand); }
.cc-switch input:checked + .cc-slider:before { background: #fff; transform: translateX(13px); }
.cc-switch input:disabled + .cc-slider { opacity: .5; cursor: not-allowed; }


/* 8. Tables & DataTables — listing pattern (brief §7)
   -------------------------------------------------------------------------- */
.table { margin-bottom: 0; font-size: 14px; color: var(--text); }
.table > thead > tr > th {
    padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-muted); background: var(--surface-alt);
    border-top: 0 !important; border-bottom: 1px solid var(--border) !important; vertical-align: middle; white-space: nowrap;
}
.table > tbody > tr > td, .table > tfoot > tr > td { padding: 12px 14px; vertical-align: middle; border-top: 1px solid var(--border) !important; color: var(--text); }
.table > tbody > tr:first-child > td { border-top: 0 !important; }
.table-bordered { border: 0 !important; }
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border-left: 0 !important; border-right: 0 !important; }
.table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
.table-hover > tbody > tr:hover > td { background: rgba(var(--brand-rgb), .04) !important; }
.table td .text-muted, .table td small { font-size: 12px; }
.table td a:not(.btn) { color: var(--brand); font-weight: 600; }
.table .btn-group .dropdown-menu { min-width: 160px; }
tr.selected > td { background: rgba(var(--brand-rgb), .06) !important; }

/* The rounded, bordered container every listing table sits in */
.table-scrollable, .table-wrap {
    border: 1px solid var(--border) !important; border-radius: 12px !important;
    margin: 0 !important; overflow: hidden; background: var(--surface);
}
.table-scrollable > .table, .table-wrap > .table { margin: 0 !important; }
.table-scrollable .dataTables_wrapper, .table-wrap .dataTables_wrapper { overflow: visible; }
.table-responsive { border: 0; }

table.dataTable { border-collapse: collapse !important; margin: 0 !important; width: 100% !important; }
table.dataTable.no-footer { border-bottom: 0; }
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc { padding-right: 26px; }
table.dataTable thead .sorting:after, table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after { opacity: .3; bottom: 11px; }
table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after { opacity: 1; color: var(--brand); }
table.dataTable tbody tr { background: transparent !important; }
table.dataTable.order-column tbody tr > .sorting_1, table.dataTable.display tbody tr > .sorting_1 { background: transparent !important; }
table.dataTable > tbody > tr.child ul.dtr-details > li { border-bottom-color: var(--border); padding: 6px 0; }
table.dataTable > tbody > tr.child span.dtr-title { font-weight: 600; color: var(--text-muted); min-width: 120px; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before { background: var(--brand); border: 0; box-shadow: none; }

/* Toolbar (search left, length right) and footer row (info left, pages right) */
.dataTables_wrapper .row { margin: 0 !important; }
.dataTables_wrapper .row > [class*="col-"] { padding: 0 !important; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate {
    font-size: 13px; color: var(--text-muted); padding: 12px !important; margin: 0 !important;
}
.dataTables_wrapper .dataTables_filter { float: left; }
.dataTables_wrapper .dataTables_length { float: right; }
.dataTables_wrapper .dataTables_filter label, .dataTables_wrapper .dataTables_length label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.dataTables_wrapper .dataTables_filter input {
    display: inline-block; width: 320px !important; max-width: 100%; height: 40px !important; margin: 0; padding: 0 16px 0 40px !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; background: var(--surface-alt) !important; box-shadow: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 512 512'><path fill='%2371717A' d='M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z'/></svg>") !important;
    background-repeat: no-repeat !important; background-position: 14px center !important; background-size: 15px !important;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--brand) !important; background-color: var(--surface) !important; outline: 0; }
.dataTables_wrapper div.dataTables_length select {
    display: inline-block; width: auto !important; height: 36px !important; padding: 0 30px 0 12px !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; background: var(--surface-alt) !important;
}
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { background: var(--surface-alt); border-top: 1px solid var(--border); }
.dataTables_wrapper .dataTables_paginate { float: right; }
.dataTables_wrapper .dataTables_info { float: left; padding-top: 18px !important; }
.dataTables_wrapper .dataTables_processing {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2); color: var(--text); font-weight: 600; padding: 12px; z-index: 5;
}
.dataTables_wrapper .dt-buttons .btn { margin-right: 6px; }
.dataTables_wrapper:after { content: ""; display: table; clear: both; }
.pagination { margin: 0; display: inline-flex; gap: 6px; }
/* DataTables core styles the <li class="paginate_button"> itself (padding, grey/black gradients on hover/current) — the pill is the <a>, so strip the li. */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:active,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; color: inherit !important; min-width: 0;
}
.pagination > li > a, .pagination > li > span {
    float: none; min-width: 32px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--brand) !important;
    background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; margin: 0;
}
.pagination > li > a:hover, .pagination > li > a:focus { background: var(--brand-tint) !important; }
.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover { color: var(--brand-contrast) !important; background: var(--brand) !important; border-color: var(--brand) !important; }
.pagination > .disabled > a, .pagination > .disabled > span { color: var(--placeholder) !important; background: var(--surface) !important; }
.app-list { display: inline-flex; }
.app-list span, .app-list img {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; margin-right: -8px; color: var(--text); object-fit: contain;
}
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-alt), #EDEDF0, var(--surface-alt)); background-size: 200% 100%; animation: bk-sk 1.2s infinite; }
@keyframes bk-sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }


/* 9. Badges, labels & alerts — frontend .badge
   -------------------------------------------------------------------------- */
.badge, .label {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 30px !important;
    font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.4;
    border: 1px solid var(--brand); background: var(--brand-tint); color: var(--brand);
    text-shadow: none; white-space: nowrap;
}
.badge-default, .label-default, .badge.muted { border-color: var(--border) !important; background: var(--surface-alt) !important; color: var(--text-muted) !important; }
.badge-success, .label-success, .badge.success { border-color: var(--success) !important; background: rgba(46, 182, 125, .10) !important; color: #1F9463 !important; }
.badge-warning, .label-warning, .badge.warning { border-color: var(--warning) !important; background: rgba(236, 178, 46, .12) !important; color: #A8730A !important; }
.badge-danger, .label-danger, .badge.danger { border-color: var(--danger) !important; background: rgba(224, 30, 90, .10) !important; color: var(--danger) !important; }
.badge-primary, .label-primary, .badge-info, .label-info { border-color: var(--brand) !important; background: var(--brand-tint) !important; color: var(--brand) !important; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.alert { padding: 12px 16px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; border-radius: var(--radius-sm); }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert .close { opacity: .5; text-shadow: none; font-size: 20px; line-height: 1; }
.alert-success { background: rgba(46, 182, 125, .10); border-color: rgba(46, 182, 125, .5); color: #166B48; }
.alert-info { background: var(--brand-tint); border-color: rgba(var(--brand-rgb), .35); color: var(--brand); }
.alert-warning { background: rgba(236, 178, 46, .10); border-color: rgba(236, 178, 46, .5); color: #7C5A0B; }
.alert-danger, .alert-error { background: rgba(224, 30, 90, .08); border-color: rgba(224, 30, 90, .4); color: #B4144A; }
.alert-compact { padding: 8px 12px; }
.note { border-radius: var(--radius-sm); border-left-width: 3px; }


/* 10. Tabs
   -------------------------------------------------------------------------- */
.nav-tabs { border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.nav-tabs > li { margin-bottom: -1px; }
.nav-tabs > li > a {
    margin-right: 4px; padding: 10px 14px; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0;
    background: transparent !important; color: var(--text-muted) !important; font-size: 13px; font-weight: 600;
}
.nav-tabs > li > a:hover { color: var(--text) !important; }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover { color: var(--brand) !important; border-bottom-color: var(--brand) !important; background: transparent !important; }
.tabbable-custom > .tab-content, .tabbable-line > .tab-content, .tab-content { border: 0; padding: 0; }
.tabbable-custom > .nav-tabs > li.active { border: 0 !important; }
.nav-pills > li > a { border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text); }
.nav-pills > li.active > a, .nav-pills > li.active > a:hover { background: var(--brand) !important; color: var(--brand-contrast); }


/* 11. Modals & dropdowns
   -------------------------------------------------------------------------- */
.modal-dialog { margin: 24px auto; }
.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-2); }
.modal-header { position: relative; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
/* The theme's .close hides its × (text-indent) behind a PNG sprite that was removed with the old
   icon set, leaving a 9px invisible hit area. Back to the text glyph, for modals and alerts alike. */
.close, .modal .modal-header .close {
    width: auto; height: auto; margin-right: 0; text-indent: 0; background-image: none !important;
    color: var(--text); font-weight: 400;
}
.modal-header .close { margin: 2px 0 0; padding: 0 4px; opacity: .5; font-size: 22px; line-height: 1; text-shadow: none; }
.modal-header .close:hover { opacity: .9; }
.modal-header-close { position: absolute; top: 14px; right: 16px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-backdrop.in { opacity: .45; }
/* bk.confirm(): above any modal it is opened from; the message keeps its line breaks. */
.bk-confirm { z-index: 10060; }
.bk-confirm .bk-confirm-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.bk-confirm .modal-header { border-bottom: 0; padding-bottom: 4px; }
.bk-confirm .modal-footer { border-top: 0; }
.modal .modal-content .portlet { box-shadow: none !important; }
.modal .modal-content .portlet .select2-container--bootstrap { width: 100% !important; }

.dropdown-menu {
    padding: 5px !important; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-2);
}
.dropdown-menu > li > a { padding: 7px 12px; border-radius: 6px; color: var(--text); font-weight: 500; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background: var(--brand-tint); color: var(--brand); }
.dropdown-menu > li > a > i { width: 16px; margin-right: 6px; color: var(--text-muted); }
.dropdown-menu .divider { margin: 5px 0; background: var(--border); }
.dropdown-menu-default > li > a { color: var(--text) !important; }

.breadcrumb { background: transparent !important; padding: 0 !important; margin: 0 0 12px; font-size: 13px; }
.breadcrumb > li, .breadcrumb > li > a { color: var(--text-muted); }
.breadcrumb > li.active { color: var(--text); }
.breadcrumb > li + li:before { content: "/"; padding: 0 8px; color: #D4D4D8; }
.breadcrumb > li i { margin: 0; color: #D4D4D8; vertical-align: middle; }


/* 12. Feedback — toastr, sweetalert, loading overlay
   -------------------------------------------------------------------------- */
#toast-container > .toast {
    position: relative; padding: 14px 34px 14px 50px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2); opacity: .97; font-family: var(--font-sans); font-weight: 600;
}
#toast-container > .toast-success { background-color: var(--success); }
#toast-container > .toast-error { background-color: var(--danger); }
#toast-container > .toast-info { background-color: var(--brand); color: var(--brand-contrast); }
#toast-container > .toast-warning { background-color: var(--warning); }
#toast-container .toast-close-button {
    position: absolute; top: 6px; right: 10px; font-size: 20px; line-height: 1; font-weight: 700; color: #fff; opacity: .9; text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
#toast-container .toast-close-button:hover { opacity: 1; }

.swal-modal { border-radius: var(--radius); font-family: var(--font-sans); }
.swal-title { font-size: 18px; font-weight: 700; color: var(--text); }
.swal-text { font-size: 14px; color: var(--text-muted); text-align: center; }
.swal-button { padding: 10px 18px; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); box-shadow: none !important; }
.swal-button--confirm { background: var(--brand); color: var(--brand-contrast); }
.swal-button--confirm:not([disabled]):hover { background: var(--brand-hover); }
.swal-button--danger { background: var(--danger); }
.swal-button--cancel { background: var(--surface-alt); color: var(--text); }
.swal-icon--warning { border-color: var(--warning); }
.swal-icon--warning__body, .swal-icon--warning__dot { background: var(--warning); }

/* helper_functions.js show_loading_img(): body.unavalable + .overlay */
.overlay { display: none; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #000; opacity: .5; pointer-events: none; }
.unavalable { pointer-events: none; cursor: default; }
#loading-img { background: url(../img/ajax-loader.gif) center center no-repeat; height: 100%; z-index: 20; }


/* 13. Footer
   -------------------------------------------------------------------------- */
/* Footer — static, in normal flow (Metronic pins .page-footer to the bottom and it covered content) */
.page-footer.bk-footer {
    position: static !important; z-index: auto; width: auto; height: auto;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
    padding: 14px 18px; font-size: 12px; color: var(--text-muted);
    background: var(--surface-alt) !important; border-top: 1px solid var(--border);
}
.page-footer.bk-footer:before, .page-footer.bk-footer:after { display: none; }
.bk-footer-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bk-footer-brand img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.bk-footer-brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.bk-footer-brand-text strong { color: var(--text); font-size: 13px; }
.bk-footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.bk-footer-links a { color: var(--text-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.bk-footer-links a:hover { color: var(--brand); text-decoration: none; }
.bk-footer-links a i { font-size: 13px; }
.bk-footer-env { font-size: 10px; letter-spacing: .04em; }


/* 14. Utilities (Bootstrap 3 has none of these)
   -------------------------------------------------------------------------- */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.inline { display: inline !important; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; }
.m-0 { margin: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 8px !important; } .mt-3 { margin-top: 12px !important; } .mt-4 { margin-top: 20px !important; }
.mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 12px !important; }
.ml-2 { margin-left: 8px !important; } .mr-2 { margin-right: 8px !important; }
.p-3 { padding: 16px !important; } .p-4 { padding: 24px !important; }
.break-all { word-break: break-all; }
.text-capitalize { text-transform: capitalize; }
.num { font-variant-numeric: tabular-nums; }
.link-inline { color: var(--brand); text-decoration: underline; cursor: pointer; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state i { font-size: 30px; color: var(--placeholder); display: block; margin-bottom: 4px; }
.empty-state h4 { margin: 0; }


/* 15. Page modules + auth pages
   -------------------------------------------------------------------------- */
/* Logs (bulk sync): connector icon inside a table cell */
.channel_icon img { width: 20px; }

/* Webhook-logs run modal / expandable runs: per-node cards */
/* Run logs modal — one card per workflow step on a vertical timeline */
.bk-modal-sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.bk-modal-body-alt { background: var(--surface-alt); }
.bk-modal-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; color: var(--text-muted); font-weight: 600; }
.bk-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(var(--brand-rgb), .25); border-top-color: var(--brand); animation: bk-spin .7s linear infinite; }
.bk-run-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; font-size: 13px; color: var(--text-muted); }
.bk-run-stat strong { color: var(--text); font-size: 15px; }
.bk-run-started { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.bk-run-steps { list-style: none; margin: 0; padding: 0 0 0 36px; position: relative; }
.bk-run-steps:before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; border-left: 2px dashed var(--border); }
.bk-run-step { position: relative; margin-bottom: 12px; }
.bk-run-step:last-child { margin-bottom: 0; }
.bk-run-step-no {
    position: absolute; left: -36px; top: 10px; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
    background: var(--surface); border: 2px solid var(--border); color: var(--text-muted);
}
.bk-run-step.is-ok .bk-run-step-no { border-color: var(--success); color: var(--success); }
.bk-run-step.is-failed .bk-run-step-no { border-color: var(--danger); color: var(--danger); background: rgba(224, 30, 90, .06); }
.bk-run-step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.bk-run-step.is-failed .bk-run-step-card { border-color: rgba(224, 30, 90, .35); }
.bk-run-step-head { display: flex; align-items: center; gap: 10px; }
.bk-run-step-icon { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: var(--brand-tint); padding: 4px; flex: 0 0 auto; }
.bk-run-step-icon-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--brand); font-size: 15px; }
.bk-run-step-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.3; }
.bk-run-step-title strong { font-size: 14px; color: var(--text); }
.bk-run-step-time { font-size: 12px; color: var(--text-muted); }
.bk-run-step-msg { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-alt); font-size: 13px; color: var(--text); word-break: break-word; }
.bk-run-step-msg i { color: var(--success); margin-top: 2px; flex: 0 0 auto; }
.bk-run-step.is-failed .bk-run-step-msg { background: rgba(224, 30, 90, .07); color: var(--danger); }
.bk-run-step.is-failed .bk-run-step-msg i { color: var(--danger); }
.bk-run-json { margin-top: 10px; }
.bk-run-json-tabs { display: flex; align-items: center; gap: 4px; }
.bk-run-json-tab { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px 6px 0 0; font-size: 12px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; }
.bk-run-json-tab:hover { color: var(--text); }
.bk-run-json-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.bk-run-json-copy { margin-left: auto; }
.log-json { background: #1E1B2E; color: #E4E4E7; border: 0; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; max-height: 320px; overflow: auto; font-size: 12px; line-height: 1.55; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.log-json[hidden] { display: none !important; }
.log-json .j-key { color: #A5B4FC; }
.log-json .j-str { color: #86EFAC; }
.log-json .j-num { color: #FDBA74; }
.log-json .j-bool { color: #67E8F9; }
.log-json .j-null { color: #F0ABFC; font-style: italic; }

/* Exception detail modal */
.bk-exc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); }
.bk-exc-head .bk-exc-id { font-weight: 600; }
.bk-exc-head .bk-exc-when { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.bk-exc-class { margin: 0 0 6px; font-size: 13px; }
.bk-exc-class code { background: transparent; padding: 0; color: var(--text); font-weight: 700; font-size: 13px; word-break: break-all; }
.bk-exc-msg { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(224, 30, 90, .07); border-left: 3px solid var(--danger); color: var(--text); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.bk-exc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px 24px; margin-bottom: 18px; }
.bk-exc-section { min-width: 0; }
.bk-exc-section h5, .bk-exc-code h5 { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.bk-kv-list { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.bk-kv-list dt, .bk-kv-list dd { margin: 0; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); min-width: 0; }
.bk-kv-list dt { font-weight: 600; color: var(--text-muted); background: var(--surface-alt); }
.bk-kv-list dd { color: var(--text); word-break: break-word; }
.bk-kv-list dt:nth-last-of-type(1), .bk-kv-list dd:last-of-type { border-bottom: 0; }
.bk-kv-list code { font-size: 12px; word-break: break-all; }
.bk-exc-code { margin-bottom: 18px; }
.bk-exc-code:last-child { margin-bottom: 0; }
.bk-exc-code-head { display: flex; align-items: center; gap: 10px; }
.bk-exc-code-head h5 { margin: 0; }
.bk-exc-code-head small { color: var(--text-muted); font-size: 12px; }
.bk-exc-code-head .btn { margin-left: auto; }
.bk-exc-code .log-json { margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.bk-exc-code .log-json.bk-scroll-lg { max-height: 420px; }

/* Notes inside modals / forms */
.bk-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-tint); color: var(--text); font-size: 13px; line-height: 1.5; margin: 0; }
.bk-note > i { color: var(--brand); margin-top: 2px; flex: 0 0 auto; }
.bk-note ol, .bk-note ul { margin: 0; padding-left: 18px; }
.bk-note li + li { margin-top: 6px; }

/* Choice cards (radio / checkbox as a card) */
.bk-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.bk-choice { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; margin: 0; font-weight: 500; color: var(--text); transition: border-color .15s, background-color .15s; }
.bk-choice:hover { border-color: rgba(var(--brand-rgb), .5); }
.bk-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bk-choice-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-alt); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
.bk-choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-choice-text strong { font-size: 13px; }
.bk-choice-text span { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.bk-choice.is-checked, .bk-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.bk-choice.is-checked .bk-choice-ic, .bk-choice:has(input:checked) .bk-choice-ic { background: var(--brand); color: var(--brand-contrast); }
.bk-choice input:focus-visible ~ .bk-choice-ic { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .3); }
.bk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 30px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; margin: 0; }
.bk-chip input { position: absolute; opacity: 0; pointer-events: none; }
.bk-chip:hover { border-color: rgba(var(--brand-rgb), .5); color: var(--text); }
.bk-chip.is-checked, .bk-chip:has(input:checked) { border-color: var(--brand); background: var(--brand); color: var(--brand-contrast); }
.bk-chip i { font-size: 12px; }

/* Table cell: connector icons + title (favourite workflows) */
.bk-cell-icons { display: inline-flex; align-items: center; gap: 12px; }
.bk-cell-icons .app-list { padding-right: 8px; }
.bk-cell-icon { width: 24px; height: 24px; flex: 0 0 24px; object-fit: contain; border-radius: 6px; }
label.bk-block { display: block; }

/* Sign-out is a POST: the form's button is styled like the menu link / icon button it replaces */
.bk-logout-form { margin: 0; display: contents; }
.dropdown-menu > li > .bk-logout-form > button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 16px; color: var(--text); font-size: 13px; font-weight: 500; }
.dropdown-menu > li > .bk-logout-form > button:hover { background: var(--surface-alt); color: var(--brand); }
.bk-auth-back .bk-logout-form > button { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; }

.bk-note-page { margin-bottom: 16px; }
.bk-auth-actions { display: flex; justify-content: center; gap: 8px; border-top: 0; padding-top: 0; margin-top: 6px; }

/* Dashboards: period switch, bar rows, attention list, population strip */
.bk-period { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.bk-period-btn { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-right: 1px solid var(--border); }
.bk-period-btn:last-child { border-right: 0; }
.bk-period-btn:hover { color: var(--text); text-decoration: none; background: var(--surface-alt); }
.bk-period-btn.active { background: var(--brand); color: var(--brand-contrast); }
.bk-bars { display: flex; flex-direction: column; gap: 8px; }
.bk-bar-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.bk-bar-label { color: var(--text-muted); font-weight: 600; }
.bk-bar-track { height: 10px; border-radius: 6px; background: var(--surface-alt); overflow: hidden; }
.bk-bar-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), #8B5CF6); width: 0; transition: width .4s ease; }
.bk-bar-value { color: var(--text); font-weight: 600; min-width: 56px; text-align: right; }
.bk-attention { list-style: none; margin: 0; padding: 0; }
.bk-attention li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.bk-attention li:last-child { border-bottom: 0; }
.bk-attention .who { flex: 1 1 auto; min-width: 0; }
.bk-attention .who strong { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-attention .who span { color: var(--text-muted); font-size: 12px; }
.bk-populations { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.bk-population { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.bk-population .lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bk-population .val { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 2px; }
.bk-population .sub { font-size: 12px; color: var(--text-muted); }
.bk-kpi-row .portlet { height: calc(100% - 20px); }

/* Field rows that only apply to some audience / option */
.bk-conditional[hidden] { display: none !important; }

/* Send email page */
.bk-step-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-contrast); font-size: 12px; font-weight: 700; margin-right: 8px; vertical-align: -5px; }
.bk-audience-count { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 12px; border-radius: 30px; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 600; }
.bk-audience-count strong { font-size: 14px; }
.bk-audience-count.is-empty { background: rgba(236, 178, 46, .15); color: #92400E; }
.bk-audience-count .bk-spinner { width: 14px; height: 14px; }
.bk-filters { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.bk-audience-summary { font-size: 12px; color: var(--text-muted); min-height: 18px; }
.bk-audience-summary:empty { display: none; }
.bk-toggle-row { margin: 4px 0 12px; }
.bk-toggle-row label { font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 8px; padding-left: 0; }
.bk-toggle-row input { margin: 0; position: static; width: 16px; height: 16px; }
.bk-note-sender { margin-top: 6px; }
.bk-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-form-actions .btn { margin-right: 0; }
textarea.form-control.bk-textarea-lg { min-height: 240px; }

/* Notifications module */
.bk-tabs > li > a .badge { margin-left: 6px; }
.bk-tabs > li > a i { margin-right: 4px; }
.bk-truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-repeater { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.bk-repeater-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.bk-repeater-fields { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; min-width: 0; }
.bk-repeater-fields .form-group { margin-bottom: 12px; }
.bk-repeater-fields label { font-size: 12px; }
.bk-repeater-row .bk-repeater-remove { margin-top: 24px; flex: 0 0 auto; }
.bk-repeater-add { margin-bottom: 4px; }
.modal .select2-container { width: 100% !important; }
.modal .select2-container--bootstrap .select2-selection { background: var(--surface); }
.bk-repeater .select2-container--bootstrap .select2-selection { background: var(--surface); }

/* Form pages — <x-bk.form-card title>: stacked label + control, 16px groups, actions row at the end.
   (Replaces the old .my-style/.wraper/.lable-style horizontal layout.) */
.bk-form-card .portlet-body { padding-top: 6px; }
.bk-form-card .portlet-title .caption-subject { font-size: 15px; }
.bk-form-card .portlet-title .caption small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.bk-form-card .row > [class*="col-"] > .form-group:last-child { margin-bottom: 16px; }
.bk-form-card .bk-form-actions { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 4px; }
.bk-form-narrow { max-width: 760px; }
label .bk-req { color: var(--danger); margin-left: 2px; }
/* Repeatable single-input list (image URLs): rows of input + remove, one add button below */
.bk-url-list { display: flex; flex-direction: column; gap: 8px; }
.bk-url-list-row { display: flex; align-items: center; gap: 8px; }
.bk-url-list-row .form-control { flex: 1 1 auto; }
.bk-url-list-add { margin-top: 8px; }
/* CKEditor 4 chrome on the token system */
.cke_chrome { border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; box-shadow: none !important; overflow: hidden; }
.cke_top { background: var(--surface-alt) !important; border-bottom: 1px solid var(--border) !important; box-shadow: none !important; }
.cke_bottom { background: var(--surface-alt) !important; border-top: 1px solid var(--border) !important; box-shadow: none !important; }
.cke_toolgroup, .cke_combo_button { background: var(--surface) !important; border-color: var(--border) !important; box-shadow: none !important; border-radius: 6px !important; }
.bootstrap-tagsinput { display: block; }

/* Favourite workflow editor: CodeMirror JSON editor */
.json-editor-container { height: 400px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: auto; background: #1e1e1e; font-size: 14px; }
.json-editor-container .CodeMirror { height: 100% !important; }

/* Store detail / log detail: legacy form footer + heading strip */
.box-footer { border: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 5px; margin: 20px 10px; background: var(--surface); }
.content-area { background: var(--surface); padding: 10px; width: 100%; }

/* Configured data events table on small screens */
@media screen and (max-width: 680px) {
    .registered-webhook-table tbody tr td:first-child { padding: 6px 0 0 30px !important; text-align: left !important; }
    #sample_1 th, #sample_1 td { text-align: center; }
    #sample_1 tr.child td ul li { display: block !important; }
    .table-scroll .dataTables_paginate { display: flex; justify-content: center; }
}


/* Portal-specific accents: the marker on <body> is the hook; currently no
   visual difference between admin and partner beyond the brand token. */
body[data-portal="creator"] .bk-brand-sub:after { content: " · creator"; }

/* Stat tiles with an icon bubble (frontend card language): the tile is any
   .portlet whose body carries .stat-label; the optional .stat-icon sits top-right. */
.portlet.light.bordered:has(.stat-label) { position: relative; transition: border-color .2s; }
.portlet.light.bordered:has(.stat-label):hover { border-color: var(--brand) !important; }
.portlet.light.bordered:has(.stat-label) .portlet-body { padding-right: 56px; }
.stat-icon {
    position: absolute; top: 16px; right: 16px;
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-tint); color: var(--brand); font-size: 18px;
}
.stat-icon.success { background: rgba(46, 182, 125, .12); color: #1F9463; }
.stat-icon.warning { background: rgba(236, 178, 46, .14); color: #A8730A; }
.stat-icon.danger { background: rgba(224, 30, 90, .10); color: var(--danger); }
.stat-icon.muted { background: var(--surface-alt); color: var(--text-muted); }

/* Filter cards: eyebrow title, inline fields with even gaps, no stray margins */
.portlet.light.bordered:has(> .portlet-body > form.form-inline) > .portlet-title { border-bottom: 0 !important; margin-bottom: 8px; padding-bottom: 0; }
.portlet.light.bordered:has(> .portlet-body > form.form-inline) > .portlet-title > .caption { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-inline .form-group { margin: 0; display: inline-flex; align-items: center; }
/* A field with a visible label reads like every other filter card: label above, control below. */
.form-inline .form-group:has(> label:not(.sr-only)) { flex-direction: column; align-items: flex-start; gap: 6px; }
.form-inline .form-group > label:not(.sr-only) { margin: 0; }
.btn.is-busy { pointer-events: none; opacity: .7; }
/* Branding page: live sample of the colour being picked + the readability hint under it. */
.bk-colour-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.bk-colour-sample-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.bk-colour-sample-link { font-size: 13px; font-weight: 600; }
.bk-colour-hint { margin-top: 10px; }
/* The hidden attribute must win over component display rules (.bk-note is flex). */
[hidden] { display: none !important; }
.bk-colour-hint .bk-swatch { vertical-align: middle; }
.bk-colour-hint .btn { margin-left: 6px; }
/* A read-only value shown in an input-group next to its Copy button (not a form control). */
.bk-copy-text { display: block; overflow-x: auto; white-space: nowrap; line-height: 26px; background: var(--surface-alt); user-select: all; }
.form-inline .form-control, .form-inline select.form-control { width: auto; min-width: 160px; }
.form-inline > .text-muted { font-size: 13px; }
.bk-search.bk-search-off .form-control { opacity: .55; }

/* Listing pattern wrappers created by the DataTables `dom` default in backend.js */
.bk-dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.bk-dt-toolbar .dataTables_filter, .bk-dt-toolbar .dataTables_length { float: none !important; padding: 0 !important; }
.bk-dt-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface-alt); border-top: 1px solid var(--border); font-size: 12px; }
.bk-dt-footer .dataTables_info, .bk-dt-footer .dataTables_paginate { float: none !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
.bk-dt-body { position: relative; }
.bk-dt-body .dataTables_processing { top: 50%; left: 50%; transform: translate(-50%, -50%); width: auto; margin: 0; }
table.dataTable td.dataTables_empty { padding: 40px 20px !important; text-align: center; color: var(--text-muted); font-weight: 600; }
.bk-actions { display: inline-flex; gap: 2px; white-space: nowrap; }
.bk-page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.bk-page-actions form { display: inline; }
.bk-table-card > .portlet-title > .caption > .badge { margin-left: 8px; }
.bk-table-card .portlet-title { margin-bottom: 12px; }
.empty-state-body { color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state-body p { margin: 0; }
/* Server-rendered (non-DataTable) listings share the same footer look */
.bk-list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface-alt); border-top: 1px solid var(--border); font-size: 12px; }
.bk-list-footer .pagination { margin: 0; }
.bk-w-280 { min-width: 280px; } .bk-w-200 { min-width: 200px; } .bk-w-160 { min-width: 160px; }

/* Key/value tables on detail pages, form helpers */
.table.bk-kv > tbody > tr > th { width: 200px; font-weight: 600; color: var(--text-muted); background: transparent; text-transform: none; letter-spacing: 0; font-size: 13px; }
.table.bk-kv > tbody > tr.bk-kv-total > th { color: var(--text); font-size: 14px; border-top: 2px solid var(--border) !important; }
.bk-steps { margin: 0; padding-left: 20px; color: var(--text-muted); line-height: 1.9; }
.bk-steps li::marker { color: var(--brand); font-weight: 700; }
.bk-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.bk-color-field { display: flex; gap: 8px; align-items: center; }
.bk-color-field input[type="color"] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: 0 0 48px; }
.bk-color-field .form-control { flex: 1 1 auto; }
.bk-logo-field { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.bk-logo-preview { width: 120px; height: 120px; flex: 0 0 120px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bk-logo-preview.empty { border-style: dashed; color: var(--placeholder); font-size: 28px; }
.bk-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bk-logo-inputs { flex: 1 1 320px; }
.bk-avatar-field { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.bk-avatar-lg { width: 96px; height: 96px; flex: 0 0 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.bk-avatar-field > div { flex: 1 1 auto; }
.bk-w-32 { width: 32px; } .bk-w-36 { width: 36px; } .bk-w-60 { width: 60px; } .bk-w-120 { width: 120px; } .bk-w-180 { width: 180px; } .bk-w-220 { width: 220px; } .bk-w-60p { width: 60%; }

/* Bulk selection bar + checkbox column */
.bk-bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 12px; background: var(--brand-tint); border-bottom: 1px solid rgba(var(--brand-rgb), .25); color: var(--brand); font-weight: 600; }
.bk-bulkbar.show { display: flex; }
.bk-bulkbar .spacer { flex: 1 1 auto; }
th.sel, td.sel { width: 40px; padding-right: 0 !important; }
th.sel input, td.sel input { width: 16px; height: 16px; margin: 0; display: block; accent-color: var(--brand); }
/* One-off replacements for former inline styles */
.bk-swatch { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; border-radius: 3px; border: 1px solid var(--border); margin-right: 4px; }
.bk-list { list-style: none; padding: 0; margin: 0; }
.bk-list > li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.bk-list > li:last-child { border-bottom: 0; }
.stat-sub { font-size: 11px; margin-top: 2px; color: var(--text-muted); }
.bk-summary-table { margin-top: 16px !important; max-width: 420px; margin-left: auto; }
.bk-scroll { max-height: 220px; overflow: auto; }
.bk-scroll-sm { max-height: 180px; }
.bk-scroll-lg { max-height: 400px; font-size: 12px; }
.bk-prewrap { white-space: pre-wrap; word-break: break-word; }
.break-word { word-break: break-word; }
.app-list li { display: inline-block; margin-right: -8px; }
.app-list li img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: #fff; object-fit: contain; padding: 3px; display: block; }

/* Auth pages (admin.layouts.auth + <x-bk.auth-card>) — frontend login look */
body.bk-auth { background: #F8F8FF !important; }
.bk-auth-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 16px; }
.bk-auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 32px 28px; box-shadow: var(--shadow-1); }
.bk-auth-card-wide { max-width: 520px; }
.bk-auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.bk-auth-brand .bk-brand-mark { width: 48px; height: 48px; flex: 0 0 48px; }
.bk-auth-brand-name { font-size: 15px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text); }
.bk-auth-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.bk-auth-sub { color: var(--text-muted); margin: 0 0 20px; }
.bk-auth-sub .badge { vertical-align: 1px; }
.bk-auth-form .form-group { margin-bottom: 16px; }
.bk-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; font-size: 13px; }
.bk-auth-row .check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.bk-auth-row .check input { margin: 0; width: 16px; height: 16px; }
.bk-auth-form .btn-block { height: 44px; font-size: 15px; }
.bk-auth-back { text-align: center; margin: 16px 0 0; font-size: 13px; color: var(--text-muted); }
.bk-auth-foot { font-size: 12px; color: var(--text-muted); margin: 0; }
.bk-plain-list { padding-left: 18px; }
@media (max-width: 480px) { .bk-auth-card { padding: 28px 20px 22px; } }

/* Loading states — one indicator: the brand gradient bar across the top of the table body
   plus a dimmed table. The DataTables "processing" pill is hidden (it overlapped the bar). */
.bk-dt-body.is-loading table.dataTable { opacity: .45; transition: opacity .15s; }
.bk-dt-body .dataTables_processing { display: none !important; }
.dataTables_wrapper .dataTables_processing {
    align-items: center; gap: 10px;
    padding: 10px 16px !important; width: auto !important; height: auto !important;
    background: var(--surface) !important; border: 1px solid rgba(var(--brand-rgb), .3) !important; color: var(--brand) !important;
    border-radius: 30px !important; box-shadow: var(--shadow-2) !important; font-weight: 600; font-size: 13px; z-index: 5;
}
.dataTables_wrapper .dataTables_processing:before {
    content: ""; display: inline-block; vertical-align: -3px; margin-right: 10px; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(var(--brand-rgb), .25); border-top-color: var(--brand);
    animation: bk-spin .7s linear infinite;
}
.bk-dt-body.is-loading:after {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--brand), #8B5CF6, #06B6D4, var(--brand)); background-size: 200% 100%;
    animation: bk-slide 1.2s linear infinite; z-index: 6;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }
@keyframes bk-slide { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.overlay { background: rgba(255, 255, 255, .6) !important; opacity: 1 !important; z-index: 2000; pointer-events: all !important; }
#loading-img { background: none !important; display: flex; align-items: center; justify-content: center; }
#loading-img:before { content: ""; width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(var(--brand-rgb), .2); border-top-color: var(--brand); animation: bk-spin .8s linear infinite; }

/* Dashboard cards */
.bk-kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.bk-money-list { list-style: none; margin: 0; padding: 0; }
.bk-money-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bk-money-list li:last-child { border-bottom: 0; }
.bk-money-list .stat-icon { position: static; width: 36px; height: 36px; font-size: 15px; flex: 0 0 36px; }
.bk-money-list .lbl { flex: 1 1 auto; font-weight: 600; color: var(--text); }
.bk-money-list .lbl small { display: block; font-weight: 500; color: var(--text-muted); font-size: 12px; }
.bk-money-list .amt { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px -18px -18px; padding: 12px 18px; background: var(--surface-alt); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); font-size: 13px; color: var(--text-muted); }

.bk-count { white-space: nowrap; line-height: 1.4; }
.bk-count > div { margin-top: 4px; }
