/*
 * Swift Galleries modern design layer.
 *
 * Loaded after the Material Pro theme and every plugin stylesheet, and scoped to
 * html.sg-modern so the whole layer can be switched off by removing that class.
 * It restyles the existing Bootstrap 4 / Material markup rather than replacing it,
 * so jQuery plugins, modals, dropdowns and forms keep their behavior.
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

html.sg-modern {
    /* Brand palette: the app's established colors (Material theme as customised for Swift
       Galleries) plus the marketing site's pink call-to-action. Keep these values exact. */
    --sg-brand-pink: #fc4b6c;          /* swiftgalleries.com primary CTA; the app's "danger" buttons */
    --sg-brand-pink-600: #e63c5d;
    --sg-brand-pink-50: #ffeef1;
    --sg-navy: #043c59;                /* app topbar (ui.color.css) */
    --sg-navy-600: #0a4d70;
    --sg-navy-800: #022a3f;
    --sg-primary: #059669;             /* primary action emerald (btn-info / btn-primary); 3.8:1 with white */
    --sg-primary-600: #047857;         /* button hover, active accent text */
    --sg-primary-700: #065f46;         /* strong accent text */
    --sg-primary-50: #ecfdf5;
    --sg-link: #1565c0;                /* text links stay blue (>= 5:1 on every surface) */
    --sg-link-700: #0d4a96;
    --sg-info-50: #e8f3fd;             /* informational alerts and badges stay blue */
    --sg-info-600: #1565c0;
    --sg-teal: #4cae9c;                /* onboarding band */
    --sg-teal-600: #3e9585;
    --sg-teal-50: #e6f4f1;
    --sg-cyan: #26c6da;                /* the app's "success" buttons (Start Meeting, Make Title) */
    --sg-cyan-600: #1fb0c3;
    --sg-amber: #ffb22b;               /* the app's "warning" buttons (order numbers) */
    --sg-amber-600: #f0a215;
    --sg-purple: #7460ee;              /* the app's "primary" buttons */
    --sg-purple-600: #634fe0;
    --sg-success: #17784f;             /* status text and alerts (not button fills) */
    --sg-success-50: #e7f5ee;
    --sg-warning: #8a5300;
    --sg-warning-50: #fff5e0;
    --sg-danger: #b8284c;
    --sg-danger-50: #ffeef1;
    --sg-bg: #f3f5f8;
    --sg-surface: #ffffff;
    --sg-surface-2: #f8fafc;
    --sg-border: #e2e7ee;
    --sg-border-strong: #cdd5df;
    --sg-text: #1b2533;
    --sg-text-2: #475467;
    --sg-muted: #5d6878;
    --sg-radius-sm: 6px;
    --sg-radius: 10px;
    --sg-radius-lg: 14px;
    --sg-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --sg-shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
    --sg-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
    --sg-focus-ring: #1565c0;
    --sg-focus: 0 0 0 3px rgba(5, 150, 105, 0.22);
    --sg-topbar-h: 64px;
    --sg-sidebar-w: 248px;
    --sg-sidebar-mini-w: 68px;
    --sg-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sg-font-display: "Poppins", var(--sg-font);
    -webkit-text-size-adjust: 100%;
    background: var(--sg-bg);
}

/* ------------------------------------------------------------------ base */

html.sg-modern body {
    font-family: var(--sg-font);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.55;
    color: var(--sg-text);
    background: var(--sg-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

html.sg-modern h1, html.sg-modern h2, html.sg-modern h3,
html.sg-modern h4, html.sg-modern h5, html.sg-modern h6 {
    font-family: var(--sg-font-display);
    color: var(--sg-text);
    font-weight: 600;
    letter-spacing: -0.01em;
}

html.sg-modern h4 { font-size: 1.15rem; }
html.sg-modern h5 { font-size: 1rem; }
html.sg-modern h6 { font-size: 0.9rem; }

html.sg-modern a:not(.btn) { color: var(--sg-link); }
html.sg-modern a:not(.btn):hover, html.sg-modern a:not(.btn):focus { color: var(--sg-link-700); }

html.sg-modern .text-muted, html.sg-modern small.text-muted { color: var(--sg-muted) !important; }
html.sg-modern .text-themecolor { color: var(--sg-text) !important; }
html.sg-modern .text-info { color: var(--sg-link) !important; }
html.sg-modern .text-success { color: var(--sg-success) !important; }
html.sg-modern .text-warning { color: var(--sg-warning) !important; }
html.sg-modern .text-danger { color: var(--sg-danger) !important; }

html.sg-modern :focus-visible {
    outline: 2px solid var(--sg-focus-ring) !important;
    outline-offset: 2px;
}

html.sg-modern .topbar :focus-visible { outline-color: #ffffff !important; }      /* 11.7:1 on navy */
html.sg-modern .onboard-row :focus-visible { outline-color: var(--sg-navy) !important; } /* 4.4:1 on teal */

html.sg-modern hr { border-top-color: var(--sg-border); }

html.sg-modern .preloader { background: var(--sg-bg); }
html.sg-modern .preloader .circular .path { stroke: var(--sg-primary); }

/* --------------------------------------------------------------- topbar */

html.sg-modern .topbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1050;
    background: var(--sg-navy) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(2, 20, 32, 0.18);
    min-height: var(--sg-topbar-h);
}

html.sg-modern .topbar .top-navbar {
    min-height: var(--sg-topbar-h);
    padding: 0 12px 0 0;
}

html.sg-modern .topbar .top-navbar .navbar-header {
    background: transparent !important;
    line-height: var(--sg-topbar-h);
    width: var(--sg-sidebar-w);
    display: flex;
    align-items: center;
    padding-left: 18px;
    text-align: left;
}

html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--sg-topbar-h);
}

html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand b { line-height: 1; display: inline-flex; }
html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand b img { width: 34px !important; }
html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand span img { width: 150px !important; }

html.sg-modern .topbar .navbar-light .navbar-nav .nav-item > a.nav-link,
html.sg-modern .topbar .sg-nav-toggle {
    color: rgba(255, 255, 255, 0.92) !important;
    line-height: var(--sg-topbar-h);
    padding: 0 12px;
    font-weight: 500;
    font-size: 14px;
}

html.sg-modern .topbar .navbar-light .navbar-nav .nav-item > a.nav-link:hover,
html.sg-modern .topbar .navbar-light .navbar-nav .nav-item > a.nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

html.sg-modern .topbar .navbar-nav .nav-item > a.nav-link i { font-size: 20px; vertical-align: -3px; }

html.sg-modern .topbar.possessing { background: #6b2a2a !important; }

html.sg-modern .sg-nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 24px;
    width: 48px;
    height: var(--sg-topbar-h);
    align-items: center;
    justify-content: center;
}

html.sg-modern .topbar .dropdown-menu {
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
    box-shadow: var(--sg-shadow-lg);
    padding: 6px;
    margin-top: 6px;
    min-width: 240px;
}

html.sg-modern .topbar .dropdown-user li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--sg-radius-sm);
    color: var(--sg-text-2);
    font-size: 14px;
}

html.sg-modern .topbar .dropdown-user li a:hover { background: var(--sg-surface-2); color: var(--sg-text); }
html.sg-modern .topbar .dropdown-user li a i { font-size: 18px; color: var(--sg-muted); width: 20px; text-align: center; }
html.sg-modern .topbar .dropdown-user li.divider,
html.sg-modern .topbar .dropdown-user li[role=separator] { height: 1px; margin: 6px 4px; background: var(--sg-border); }
html.sg-modern .topbar .dropdown-user .dw-user-box { padding: 8px 12px 4px; }
html.sg-modern .topbar .dropdown-user .dw-user-box .u-text p { margin: 0; font-size: 13px; }

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

html.sg-modern .left-sidebar {
    z-index: 1040; /* ui-extend.css set 9999999, which painted the sidebar over the topbar's logo */
    width: var(--sg-sidebar-w);
    padding-top: var(--sg-topbar-h);
    background: var(--sg-surface);
    box-shadow: none;
    border-right: 1px solid var(--sg-border);
}

html.sg-modern .scroll-sidebar { padding-bottom: 72px; }
html.sg-modern .sidebar-nav { padding: 12px 10px; background: transparent; }

html.sg-modern .sidebar-nav #sidebarnav > li > a,
html.sg-modern .sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: var(--sg-radius-sm);
    color: var(--sg-text-2);
    font-size: 14px;
    font-weight: 500;
    border-left: 0 !important;
}

html.sg-modern .sidebar-nav #sidebarnav > li > a i {
    top: 0;
    font-size: 20px;
    width: 22px;
    color: var(--sg-muted);
    flex: 0 0 22px;
    text-align: center;
}

html.sg-modern .sidebar-nav #sidebarnav > li > a:hover,
html.sg-modern .sidebar-nav ul li a:hover {
    background: var(--sg-surface-2);
    color: var(--sg-text);
}

/* The sidebar keeps the original blue accents; the green primary is for page actions. */
html.sg-modern .left-sidebar {
    --sg-primary: #1e88e5;
    --sg-primary-600: #1976d2;
    --sg-primary-700: #1565c0;
    --sg-primary-50: #e8f3fd;
}

html.sg-modern .sidebar-nav #sidebarnav > li > a:hover i { color: var(--sg-primary); }

html.sg-modern .sidebar-nav #sidebarnav > li.active > a,
html.sg-modern .sidebar-nav #sidebarnav > li > a.active,
html.sg-modern .sidebar-nav #sidebarnav > li[data-is-active=active] > a {
    background: var(--sg-primary-50);
    color: var(--sg-primary-600);
}

html.sg-modern .sidebar-nav #sidebarnav > li.active > a i,
html.sg-modern .sidebar-nav #sidebarnav > li > a.active i,
html.sg-modern .sidebar-nav #sidebarnav > li[data-is-active=active] > a i { color: var(--sg-primary); }

html.sg-modern .sidebar-nav #sidebarnav > li > ul {
    padding: 2px 0 6px 34px;
    background: transparent;
}

html.sg-modern .sidebar-nav #sidebarnav > li > ul > li > a {
    padding: 7px 12px;
    font-size: 13.5px;
    font-weight: 400;
}

html.sg-modern .sidebar-nav #sidebarnav > li > ul > li > a.active,
html.sg-modern .sidebar-nav #sidebarnav > li > ul > li.active > a { color: var(--sg-primary-600); font-weight: 600; }

html.sg-modern .sidebar-nav .has-arrow::after {
    border-color: var(--sg-muted) !important;
    right: 14px !important;
    width: 6px !important;
    height: 6px !important;
}

html.sg-modern .sidebar-nav #sidebarnav > li.nav-devider,
html.sg-modern .sidebar-nav .nav-devider {
    height: 1px;
    margin: 10px 8px;
    background: var(--sg-border);
}

html.sg-modern .sidebar-footer {
    width: var(--sg-sidebar-w);
    background: var(--sg-surface);
    border-top: 1px solid var(--sg-border);
    display: flex;
}

html.sg-modern .sidebar-footer a {
    float: none;
    flex: 1;
    padding: 14px 0;
    color: var(--sg-muted);
    font-size: 19px;
}

html.sg-modern .sidebar-footer a:hover { color: var(--sg-primary); background: var(--sg-surface-2); }

/* ------------------------------------------------------------ page shell */

html.sg-modern .page-wrapper {
    background: var(--sg-bg);
    margin-left: var(--sg-sidebar-w);
    padding-top: var(--sg-topbar-h);
    padding-bottom: 56px;
}

html.sg-modern .container-fluid { padding: 0 28px 28px; }

html.sg-modern .page-titles {
    background: transparent;
    box-shadow: none;
    margin: 0 0 18px;
    padding: 24px 0 4px;
}

html.sg-modern .page-titles h1,
html.sg-modern .page-titles h3 {
    margin: 0 0 4px;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--sg-text) !important;
}

html.sg-modern .page-titles .breadcrumb { font-size: 13px; margin: 0; }
html.sg-modern .page-titles .breadcrumb a { color: var(--sg-muted); }
html.sg-modern .page-titles .breadcrumb a:hover { color: var(--sg-primary); }
html.sg-modern .page-titles .breadcrumb .breadcrumb-item.active { color: var(--sg-text-2); }
html.sg-modern .page-titles .breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--sg-border-strong); }

html.sg-modern .page-titles .chart-text h4 { font-size: 1.2rem; }

html.sg-modern .footer {
    background: transparent;
    border-top: 1px solid var(--sg-border);
    left: var(--sg-sidebar-w);
    padding: 14px 20px;
    font-size: 13px;
}

html.sg-modern .footer .b-r { border-right: 0 !important; }
html.sg-modern .footer a { color: var(--sg-muted) !important; }
html.sg-modern .footer a:hover { color: var(--sg-primary) !important; }

/* Onboarding / system notification band ("What's Next?").
   The theme pins it with position:fixed and a JS-sized spacer (#notification-padding);
   keep it in normal flow instead so it can never overlap or leave a gap under the topbar. */
html.sg-modern .system-notifications {
    position: relative !important;
    width: auto !important;
    margin-left: -28px !important;
    margin-right: -28px !important;
    z-index: 5;
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

html.sg-modern #notification-padding { display: none !important; }

html.sg-modern .notification-row {
    padding: 10px 28px;
    font-size: 14px;
    background: var(--sg-warning-50);
    color: #6b4307;
    margin: 0 !important;
}

html.sg-modern .onboard-row { background: var(--sg-teal); color: var(--sg-text); }
html.sg-modern .onboard-row .row { align-items: center; margin: 0; }
html.sg-modern .onboard-row .row > [class*="col-"] { padding: 0 !important; }

html.sg-modern .onboarding-bar-left-side,
html.sg-modern .onboarding-bar-right-side {
    height: auto !important;   /* theme fixed 28px + overflow:hidden, which clipped the button */
    overflow: visible !important;
    min-height: 32px;
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px !important;
}

html.sg-modern .onboarding-bar-right-side { justify-content: flex-end; }
html.sg-modern .onboarding-col { margin-left: 0 !important; }
html.sg-modern .onboard-row a:not(.btn) { color: var(--sg-text); }

html.sg-modern .onboard-row .onboarding-btn,
html.sg-modern .onboard-row .gold-onboarding-btn,
html.sg-modern .onboarding-btn,
html.sg-modern .gold-onboarding-btn {
    top: 0;
    margin: 0 !important;
    padding: 6px 12px !important;
    min-height: 32px;
    line-height: 20px;
    font-size: 13.5px;
    border-radius: var(--sg-radius-sm);
}

html.sg-modern .onboarding-btn { background: #fff; color: var(--sg-text) !important; }
html.sg-modern .onboarding-btn:hover { background: #eef7f5 !important; }
html.sg-modern .onboarding-link,
html.sg-modern .onboarding-link:hover { color: var(--sg-text) !important; border-bottom: 1px dashed rgba(27, 37, 51, 0.6); text-decoration: none; }

/* Image cards (client images, client list): actions lived in a hover-only overlay.
   Keep the hover reveal for mouse users, show it on keyboard focus, and make it a
   permanent action bar on touch screens, where hover doesn't exist. */
html.sg-modern .el-element-overlay .el-card-item .el-overlay-1 { border-radius: var(--sg-radius) var(--sg-radius) 0 0; }
html.sg-modern .el-element-overlay .el-card-item .el-overlay-1:hover img { transform: scale(1.04) translateZ(0); }
html.sg-modern .el-element-overlay .el-card-item .el-overlay { background-color: rgba(11, 26, 38, 0.55); }
html.sg-modern .el-element-overlay .el-card-item .el-overlay-1:focus-within .el-overlay { opacity: 1; }
html.sg-modern .el-element-overlay .el-card-item .el-overlay-1 .el-info > li a {
    border-radius: var(--sg-radius-sm);
    padding: 9px 14px;
    text-transform: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
}

html.sg-modern .el-element-overlay .el-card-item .el-overlay-1 .el-info > li a:hover { background: var(--sg-brand-pink); border-color: var(--sg-brand-pink); }
html.sg-modern .el-card-content { padding: 0 12px; }
html.sg-modern .el-card-content .box-title { font-size: 14px; font-weight: 600; }

@media (hover: none) {
    html.sg-modern .el-element-overlay .el-card-item .el-overlay {
        opacity: 1;
        top: auto;
        bottom: 0;
        height: auto;
        background-color: rgba(11, 26, 38, 0.6);
    }

    html.sg-modern .el-element-overlay .el-card-item .el-overlay-1 .el-info {
        position: static;
        transform: none;
        display: flex;
        justify-content: center;
        padding: 8px;
    }

    html.sg-modern .el-element-overlay .el-card-item .el-overlay-1:hover img { transform: none; }
}

html.sg-modern .system-notifications > * { border-radius: 0; }
html.sg-modern .system-notifications .btn { border-radius: var(--sg-radius-sm); }

/* Centered "security" shell (UserBundle base_security: onboarding wizard, phone room upload). */
html.sg-modern #wrapper .login-register { padding: 24px 16px 40px; background: transparent; }
html.sg-modern #wrapper .login-box {
    width: min(480px, 100%) !important;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

html.sg-modern #wrapper > .row.justify-content-center { margin: 0; padding-left: 16px; padding-right: 16px; }
html.sg-modern #wrapper > .row.justify-content-center > img { width: min(280px, 72vw) !important; height: auto !important; }

/* ---------------------------------------------------------------- cards */

html.sg-modern .card {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-lg);
    box-shadow: var(--sg-shadow);
    margin-bottom: 22px;
}

html.sg-modern .card-no-border .card { border: 1px solid var(--sg-border); box-shadow: var(--sg-shadow); }
html.sg-modern .card > .card-block,
html.sg-modern .card > .card-body { padding: 22px 24px; }
html.sg-modern .card-block > .card-block { padding: 0; }

/* Cards nested inside a card (client tabs, settings panels) read as sections, not floating tiles. */
html.sg-modern .card .card { box-shadow: none; border-radius: var(--sg-radius); }
html.sg-modern .card .card > .card-block { padding: 18px 20px; }

html.sg-modern .card-header {
    background: var(--sg-surface-2);
    border-bottom: 1px solid var(--sg-border);
    border-radius: var(--sg-radius-lg) var(--sg-radius-lg) 0 0 !important;
    padding: 14px 24px;
    font-weight: 600;
}

html.sg-modern .card-footer {
    background: var(--sg-surface-2);
    border-top: 1px solid var(--sg-border);
    border-radius: 0 0 var(--sg-radius-lg) var(--sg-radius-lg) !important;
}

html.sg-modern .card-title {
    font-family: var(--sg-font-display);
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--sg-text);
    margin-bottom: 4px;
}

html.sg-modern .card-subtitle { color: var(--sg-muted); font-size: 13.5px; margin-bottom: 16px; }
html.sg-modern .card-outline-info, html.sg-modern .card-outline-primary { border-color: var(--sg-border); }
html.sg-modern .card-outline-info > .card-header,
html.sg-modern .card-outline-primary > .card-header { background: var(--sg-navy); border-color: var(--sg-navy); color: #fff; }
html.sg-modern .card-outline-info > .card-header *,
html.sg-modern .card-outline-primary > .card-header * { color: #fff; }

/* -------------------------------------------------------------- buttons */

html.sg-modern .btn {
    font-family: var(--sg-font);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    padding: 9px 16px;
    border-radius: var(--sg-radius-sm);
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

html.sg-modern .btn:focus, html.sg-modern .btn.focus { box-shadow: none; }
html.sg-modern .btn:focus-visible { outline: 2px solid var(--sg-focus-ring) !important; outline-offset: 2px; }
html.sg-modern .btn-sm { padding: 6px 11px; font-size: 13px; }
html.sg-modern .btn-lg { padding: 12px 22px; font-size: 16px; }
html.sg-modern .btn-rounded { border-radius: 999px; }
html.sg-modern .waves-effect .waves-ripple { display: none; }

/* Primary actions (btn-info, btn-primary) are green; brand CTAs (btn-danger) stay pink. */
html.sg-modern .btn-info, html.sg-modern .btn-primary, html.sg-modern .btn-themecolor {
    background: var(--sg-primary);
    border: 1px solid var(--sg-primary);
    color: #fff;
}

html.sg-modern .btn-info:hover, html.sg-modern .btn-primary:hover, html.sg-modern .btn-themecolor:hover,
html.sg-modern .btn-info:active, html.sg-modern .btn-info.active,
html.sg-modern .btn-primary:active, html.sg-modern .btn-primary.active {
    background: var(--sg-primary-600) !important;
    border-color: var(--sg-primary-600) !important;
    color: #fff !important;
}


html.sg-modern .btn-success { background: var(--sg-cyan); border: 1px solid var(--sg-cyan); color: var(--sg-text) !important; }
html.sg-modern .btn-success:hover, html.sg-modern .btn-success:active { background: var(--sg-cyan-600) !important; border-color: var(--sg-cyan-600) !important; color: var(--sg-text) !important; }

html.sg-modern .btn-warning { background: var(--sg-amber); border: 1px solid var(--sg-amber); color: var(--sg-text) !important; }
html.sg-modern .btn-warning:hover, html.sg-modern .btn-warning:active { background: var(--sg-amber-600) !important; border-color: var(--sg-amber-600) !important; color: var(--sg-text) !important; }

html.sg-modern .btn-danger { background: var(--sg-brand-pink); border: 1px solid var(--sg-brand-pink); color: #fff; }
html.sg-modern .btn-danger:hover, html.sg-modern .btn-danger:active { background: var(--sg-brand-pink-600) !important; border-color: var(--sg-brand-pink-600) !important; color: #fff !important; }

html.sg-modern .btn-secondary, html.sg-modern .btn-default, html.sg-modern .btn-light {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border-strong);
    color: var(--sg-text);
}

html.sg-modern .btn-secondary:hover, html.sg-modern .btn-default:hover, html.sg-modern .btn-light:hover {
    background: var(--sg-surface-2);
    border-color: var(--sg-border-strong);
    color: var(--sg-text);
}

html.sg-modern .btn-inverse, html.sg-modern .btn-dark { background: var(--sg-navy); border: 1px solid var(--sg-navy); color: #fff; }
html.sg-modern .btn-inverse:hover, html.sg-modern .btn-dark:hover { background: var(--sg-navy-800); color: #fff; }

html.sg-modern .btn-outline-info, html.sg-modern .btn-outline-primary { color: var(--sg-primary); border-color: var(--sg-primary); background: transparent; }
html.sg-modern .btn-outline-info:hover, html.sg-modern .btn-outline-primary:hover { background: var(--sg-primary); color: #fff; }
html.sg-modern .btn-outline-danger { color: var(--sg-brand-pink); border-color: var(--sg-brand-pink); }
html.sg-modern .btn-outline-danger:hover { background: var(--sg-brand-pink); color: #fff; }
html.sg-modern .btn-outline-success { color: var(--sg-cyan-600); border-color: var(--sg-cyan); }
html.sg-modern .btn-outline-success:hover { background: var(--sg-cyan); color: #fff; }

html.sg-modern .btn.disabled, html.sg-modern .btn:disabled { opacity: 0.55; cursor: not-allowed; }
html.sg-modern .btn i { vertical-align: -1px; }

html.sg-modern .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; }

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

html.sg-modern label,
html.sg-modern .control-label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--sg-text-2);
    margin-bottom: 6px;
}

html.sg-modern .form-control,
html.sg-modern .custom-select,
html.sg-modern select.form-control,
html.sg-modern .select2-container--default .select2-selection--single,
html.sg-modern .select2-container--default .select2-selection--multiple {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14.5px;
    color: var(--sg-text);
    background-color: var(--sg-surface);
    border: 1px solid var(--sg-border-strong);
    border-radius: var(--sg-radius-sm);
    box-shadow: var(--sg-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html.sg-modern textarea.form-control { min-height: 84px; }

html.sg-modern .form-control:focus,
html.sg-modern .custom-select:focus,
html.sg-modern .select2-container--focus .select2-selection,
html.sg-modern .select2-container--open .select2-selection {
    border-color: var(--sg-primary) !important;
    box-shadow: var(--sg-focus) !important;
    outline: 0;
}

html.sg-modern .form-control::placeholder { color: #808a99; }
html.sg-modern .form-control:disabled, html.sg-modern .form-control[readonly] { background-color: var(--sg-surface-2); color: var(--sg-text-2); }

html.sg-modern .form-control-feedback, html.sg-modern .help-block, html.sg-modern .form-text { font-size: 12.5px; color: var(--sg-muted); }
html.sg-modern .has-danger .form-control, html.sg-modern .form-control.parsley-error { border-color: var(--sg-danger) !important; }
html.sg-modern .parsley-errors-list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--sg-danger); }

/* Material underline inputs become boxed inputs */
html.sg-modern .form-material .form-control,
html.sg-modern .form-material .form-control.focus,
html.sg-modern .form-material .form-control:focus {
    background-image: none !important;
    padding: 8px 12px;
    border: 1px solid var(--sg-border-strong);
    border-radius: var(--sg-radius-sm);
}

html.sg-modern .form-material .form-control:focus { border-color: var(--sg-primary); box-shadow: var(--sg-focus); }
html.sg-modern .form-group { margin-bottom: 18px; }

html.sg-modern .input-group-addon {
    background: var(--sg-surface-2);
    border: 1px solid var(--sg-border-strong);
    color: var(--sg-text-2);
    font-size: 14px;
}

html.sg-modern .input-group > .input-group-addon:first-child { border-radius: var(--sg-radius-sm) 0 0 var(--sg-radius-sm); }
html.sg-modern .input-group > .input-group-addon:last-child { border-radius: 0 var(--sg-radius-sm) var(--sg-radius-sm) 0; }
html.sg-modern .input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
html.sg-modern .input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }

html.sg-modern .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 22px; padding-left: 0; color: var(--sg-text); }
html.sg-modern .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; right: 6px; }
html.sg-modern .select2-dropdown { border-color: var(--sg-border-strong); border-radius: var(--sg-radius-sm); box-shadow: var(--sg-shadow-lg); }
html.sg-modern .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--sg-primary); }

/* iCheck checkboxes and radios. Templates pick red/orange sprite skins; redraw every skin
   with CSS so they match the palette, keep their state classes, and stay crisp. */
html.sg-modern [class*="icheckbox_"],
html.sg-modern [class*="iradio_"] {
    width: 20px !important;
    height: 20px !important;
    background-image: none !important;
    background-color: var(--sg-surface) !important;
    border: 1.5px solid var(--sg-border-strong);
    border-radius: 5px;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

html.sg-modern [class*="iradio_"] { border-radius: 50%; }
html.sg-modern [class*="icheckbox_"].hover,
html.sg-modern [class*="iradio_"].hover { border-color: var(--sg-brand-pink); }
html.sg-modern [class*="icheckbox_"].focus,
html.sg-modern [class*="iradio_"].focus { box-shadow: var(--sg-focus); }
html.sg-modern [class*="icheckbox_"].checked,
html.sg-modern [class*="iradio_"].checked { background-color: var(--sg-brand-pink) !important; border-color: var(--sg-brand-pink); }

html.sg-modern [class*="icheckbox_"].checked::after {
    content: "";
    position: absolute;
    left: 5.5px;
    top: 1.5px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

html.sg-modern [class*="iradio_"].checked::after {
    content: "";
    position: absolute;
    inset: 4.5px;
    border-radius: 50%;
    background: #fff;
}

html.sg-modern [class*="icheckbox_"].disabled,
html.sg-modern [class*="iradio_"].disabled { opacity: 0.5; cursor: not-allowed; }

/* Bootstrap switch */
/* Toggle switches (bootstrap-switch): a pill track with a round knob. ui-modern.js sets the
   plugin's labelWidth to 30px so the middle segment is a knob slot rather than a blank block. */
html.sg-modern .bootstrap-switch {
    height: 32px;
    border: 1px solid var(--sg-border-strong);
    border-radius: 999px;
    background: var(--sg-surface-2);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    vertical-align: middle;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
html.sg-modern .bootstrap-switch .bootstrap-switch-container { height: 100%; }
html.sg-modern .bootstrap-switch .bootstrap-switch-handle-on,
html.sg-modern .bootstrap-switch .bootstrap-switch-handle-off {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: 0.01em;
    text-transform: none;
    background: transparent !important;
}
html.sg-modern .bootstrap-switch .bootstrap-switch-handle-on { color: #fff !important; }
html.sg-modern .bootstrap-switch .bootstrap-switch-handle-off { color: var(--sg-text-2) !important; }
html.sg-modern .bootstrap-switch .bootstrap-switch-label {
    position: relative;
    height: 30px;
    padding: 0;
    background: transparent !important;
    color: transparent;
}
html.sg-modern .bootstrap-switch .bootstrap-switch-label::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.06);
}
html.sg-modern .bootstrap-switch.bootstrap-switch-on { background: var(--sg-primary); border-color: var(--sg-primary); }
html.sg-modern .bootstrap-switch.bootstrap-switch-off:has(.bootstrap-switch-handle-off.bootstrap-switch-danger) {
    background: var(--sg-danger-50, #fdecef);
    border-color: #f1b8c5;
}
html.sg-modern .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-handle-off.bootstrap-switch-danger { color: var(--sg-danger) !important; }
html.sg-modern .bootstrap-switch.bootstrap-switch-focused { box-shadow: var(--sg-focus); border-color: var(--sg-primary); }
html.sg-modern .bootstrap-switch.bootstrap-switch-disabled,
html.sg-modern .bootstrap-switch.bootstrap-switch-readonly { opacity: 0.55; }

/* --------------------------------------------------------------- tables */

html.sg-modern .table {
    color: var(--sg-text);
    font-size: 14px;
    margin-bottom: 0;
}

html.sg-modern .table thead th,
html.sg-modern .table th {
    font-family: var(--sg-font);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sg-muted);
    background: var(--sg-surface-2);
    border-top: 0;
    border-bottom: 1px solid var(--sg-border) !important;
    padding: 11px 14px;
    white-space: nowrap;
}

html.sg-modern .table td {
    padding: 12px 14px;
    border-top: 1px solid var(--sg-border);
    vertical-align: middle;
}

html.sg-modern .table-hover tbody tr:hover,
html.sg-modern table.dataTable tbody tr:hover { background: var(--sg-surface-2); }
html.sg-modern .table-striped tbody tr:nth-of-type(odd) { background: #fafbfd; }
html.sg-modern .table-bordered, html.sg-modern .table-bordered td, html.sg-modern .table-bordered th { border-color: var(--sg-border); }

html.sg-modern table.dataTable { border-collapse: collapse !important; }
html.sg-modern table.dataTable thead .sorting::after,
html.sg-modern table.dataTable thead .sorting_asc::after,
html.sg-modern table.dataTable thead .sorting_desc::after { opacity: 0.6; }

html.sg-modern .dataTables_wrapper .dataTables_filter input,
html.sg-modern .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--sg-border-strong);
    border-radius: var(--sg-radius-sm);
    padding: 6px 10px;
    min-height: 36px;
    margin-left: 6px;
    background: var(--sg-surface);
}

html.sg-modern .dataTables_wrapper .dataTables_filter input:focus { border-color: var(--sg-primary); box-shadow: var(--sg-focus); outline: 0; }
html.sg-modern .dataTables_wrapper .dataTables_info { color: var(--sg-muted); font-size: 13px; padding-top: 14px; }

html.sg-modern .dataTables_wrapper .dataTables_paginate { padding-top: 10px; }
html.sg-modern .dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid transparent !important;
    border-radius: var(--sg-radius-sm) !important;
    padding: 5px 11px !important;
    color: var(--sg-text-2) !important;
    background: transparent !important;
    font-size: 13px;
}

html.sg-modern .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--sg-surface-2) !important; border-color: var(--sg-border) !important; color: var(--sg-text) !important; }
html.sg-modern .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--sg-primary) !important; border-color: var(--sg-primary) !important; color: #fff !important; }
html.sg-modern .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: 0.45; }

html.sg-modern .dt-buttons .dt-button,
html.sg-modern .dt-buttons .btn {
    background: var(--sg-surface) !important;
    border: 1px solid var(--sg-border-strong) !important;
    color: var(--sg-text) !important;
    border-radius: var(--sg-radius-sm) !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 600;
    margin-right: 6px;
}

html.sg-modern .dt-buttons .dt-button:hover { background: var(--sg-surface-2) !important; }

html.sg-modern .bootstrap-table .fixed-table-container { border-color: var(--sg-border); border-radius: var(--sg-radius); }
html.sg-modern .pagination .page-link { border-color: var(--sg-border); color: var(--sg-text-2); }
html.sg-modern .pagination .page-item.active .page-link,
html.sg-modern .pagination > .active > a { background: var(--sg-primary); border-color: var(--sg-primary); color: #fff; }

/* Wrapper added by the tables macro, ui-modern.js, or directly, so wide tables scroll inside
   their card instead of the page. The theme forced overflow:scroll on the older containers,
   which drew permanent scrollbars and also scrolled the paging controls out of view. */
html.sg-modern .sg-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
}

html.sg-modern .sg-table-scroll > .table { border: 0; }
html.sg-modern .sg-table-scroll > .table tr:last-child td { border-bottom: 0; }
html.sg-modern .table-container { overflow: visible !important; }
html.sg-modern .table-responsive { overflow-x: auto !important; overflow-y: hidden !important; }
html.sg-modern .sg-datatable { min-width: 0 !important; }
html.sg-modern .dataTables_wrapper:not(:has(.sg-table-scroll)) { overflow-x: auto; }
html.sg-modern .dataTables_wrapper .dataTables_filter { display: none; }
html.sg-modern .table-searching { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
html.sg-modern .table-searching h5,
html.sg-modern .table-searching label { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--sg-text-2); font-family: var(--sg-font); }
html.sg-modern .table-searching input[type=search] {
    border: 1px solid var(--sg-border-strong);
    border-radius: var(--sg-radius-sm);
    padding: 7px 12px;
    min-height: 38px;
    width: min(280px, 100%);
    background: var(--sg-surface);
    font-size: 14px;
}

html.sg-modern .table-searching input[type=search]:focus { border-color: var(--sg-primary); box-shadow: var(--sg-focus); outline: 0; }

/* Vertical sub-tabs (Client > Opportunities). The theme laid them out as table cells;
   use flex so they can sit beside the content on desktop and stack on phones. */
html.sg-modern .sg-vtabs { display: flex !important; gap: 24px; align-items: flex-start; position: relative; min-height: 180px; }
html.sg-modern .sg-vtabs > #opportunity-loader { position: absolute; top: 0; right: 0; bottom: 0; left: 174px; width: auto !important; pointer-events: none; }
html.sg-modern .sg-vtabs > .tabs-vertical {
    display: flex !important;
    flex-direction: column;
    flex: 0 0 150px;
    width: auto !important;
    border-right: 1px solid var(--sg-border);
    border-bottom: 0;
    padding-right: 12px;
    gap: 2px;
}

html.sg-modern .sg-vtabs > .tabs-vertical .nav-link {
    border: 0 !important;
    border-radius: var(--sg-radius-sm);
    padding: 9px 12px;
}

html.sg-modern .sg-vtabs > .tabs-vertical .nav-link.active { background: var(--sg-primary-50); color: var(--sg-primary-600); }
html.sg-modern .sg-vtabs > #opportunity-content { flex: 1 1 auto; min-width: 0; }
html.sg-modern .sg-vtabs .tab-content { display: block !important; width: 100%; padding: 0 !important; }
/* album.js sizes these panes to "card width - 130px" (for the old table-cell tabs) and toggles
   overflow:scroll, which clipped rows and, on iOS, modals. The flex layout sizes them instead. */
html.sg-modern .sg-vtabs #ips-list,
html.sg-modern .sg-vtabs #online-list { width: auto !important; overflow: visible !important; }

@media (max-width: 767.98px) {
    html.sg-modern .sg-vtabs { flex-direction: column; gap: 12px; }
    html.sg-modern .sg-vtabs > .tabs-vertical {
        flex-direction: row;
        flex-basis: auto;
        width: 100% !important;
        border-right: 0;
        border-bottom: 1px solid var(--sg-border);
        padding: 0 0 8px;
    }

    html.sg-modern .sg-vtabs > #opportunity-content { width: 100%; }
}

/* Client > Opportunities: meeting rows (markup built by AlbumBundle CalendarExtension).
   They used fixed 950/900/450px widths, so the Edit/Start actions were cut off. */
html.sg-modern #ips-table-container,
html.sg-modern #online-table-container { min-width: 0 !important; margin: 0; overflow: visible; }
html.sg-modern .width-800, html.sg-modern .width-900 { max-width: 100%; }
html.sg-modern .ips-table,
html.sg-modern .ips-table > tbody { display: block; width: 100% !important; }
html.sg-modern .ips-table > tbody > tr {
    display: grid;
    grid-template-columns: 36px minmax(120px, 1fr) minmax(0, 2.2fr) minmax(170px, auto);
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--sg-surface) !important;
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
}

html.sg-modern .ips-table > tbody > tr > td { display: block; padding: 0 !important; min-width: 0 !important; border: 0; }
html.sg-modern .ips-table .addeventatc { width: 100% !important; max-width: 420px; margin: 0 auto; box-shadow: var(--sg-shadow-sm) !important; border: 1px solid var(--sg-border) !important; border-radius: var(--sg-radius) !important; }
html.sg-modern .ips-table .inner-ips-table td { padding: 3px 0 !important; border: 0; }
html.sg-modern .ips-table .inner-ips-table .btn { width: 100%; min-width: 0 !important; }
html.sg-modern .ips-table .delete-ips { display: inline-flex; padding: 6px; border-radius: var(--sg-radius-sm); }
html.sg-modern .ips-table .delete-ips:hover { background: var(--sg-danger-50); }

@media (max-width: 991.98px) {
    html.sg-modern .ips-table > tbody > tr { grid-template-columns: 32px minmax(0, 1fr); }
    html.sg-modern .ips-table > tbody > tr > td:nth-child(3),
    html.sg-modern .ips-table > tbody > tr > td:nth-child(4) { grid-column: 1 / -1; }
    html.sg-modern .ips-table .addeventatc { max-width: none; }
    html.sg-modern .ips-table .inner-ips-table,
    html.sg-modern .ips-table .inner-ips-table tbody { display: block; }
    html.sg-modern .ips-table .inner-ips-table tbody { display: flex; flex-wrap: wrap; gap: 8px; }
    html.sg-modern .ips-table .inner-ips-table tr { display: block; flex: 1 1 140px; }
    html.sg-modern .ips-table .inner-ips-table td { display: block; }
}

/* ------------------------------------------------------ nav tabs / pills */

html.sg-modern .nav-tabs { border-bottom: 1px solid var(--sg-border); gap: 4px; }
html.sg-modern .nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--sg-text-2);
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 0;
}

html.sg-modern .nav-tabs .nav-link:hover { color: var(--sg-text); border-bottom-color: var(--sg-border-strong); }
html.sg-modern .nav-tabs .nav-link.active,
html.sg-modern .nav-tabs .nav-item.show .nav-link { color: var(--sg-primary-600); background: transparent; border-bottom-color: var(--sg-primary); }
html.sg-modern .customtab li a.nav-link.active { border-bottom-color: var(--sg-primary); color: var(--sg-primary-600); }
html.sg-modern .nav-pills .nav-link { border-radius: var(--sg-radius-sm); color: var(--sg-text-2); }
html.sg-modern .nav-pills .nav-link.active { background: var(--sg-primary); color: #fff; }

/* --------------------------------------------------- alerts, badges, etc */

html.sg-modern .alert {
    border-radius: var(--sg-radius);
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 14px;
}

html.sg-modern .alert-info { background: var(--sg-info-50); border-color: #c6dfee; color: #0c4a6e; }
html.sg-modern .alert-success { background: var(--sg-success-50); border-color: #bfe3d1; color: #13553a; }
html.sg-modern .alert-warning { background: var(--sg-warning-50); border-color: #f3d9a6; color: #6b4307; }
html.sg-modern .alert-danger { background: var(--sg-danger-50); border-color: #f2c4c2; color: #7a2323; }

html.sg-modern .badge, html.sg-modern .label {
    font-weight: 600;
    font-size: 11.5px;
    padding: 4px 8px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

html.sg-modern .badge-info, html.sg-modern .label-info { background: var(--sg-info-50); color: var(--sg-info-600); }
html.sg-modern .badge-success, html.sg-modern .label-success { background: var(--sg-success-50); color: var(--sg-success); }
html.sg-modern .badge-warning, html.sg-modern .label-warning { background: var(--sg-warning-50); color: var(--sg-warning); }
html.sg-modern .badge-danger, html.sg-modern .label-danger { background: var(--sg-danger-50); color: var(--sg-danger); }

html.sg-modern .progress { border-radius: 999px; background: #e9edf2; height: 8px; }
html.sg-modern .progress-bar { background: var(--sg-primary); }

/* ------------------------------------------------- modals and popovers */

html.sg-modern .modal-content {
    border: 0;
    border-radius: var(--sg-radius-lg);
    box-shadow: var(--sg-shadow-lg);
    overflow: hidden;
}

html.sg-modern .modal-header { border-bottom: 1px solid var(--sg-border); padding: 16px 22px; }
html.sg-modern .modal-header .modal-title { font-family: var(--sg-font-display); font-weight: 600; font-size: 1.1rem; }
html.sg-modern .modal-body { padding: 20px 22px; }
html.sg-modern .modal-footer { border-top: 1px solid var(--sg-border); padding: 14px 22px; background: var(--sg-surface-2); }
html.sg-modern .modal-backdrop.show, html.sg-modern .modal-backdrop.in { opacity: 0.45; background: #0b1a26; }

html.sg-modern .dropdown-menu { border: 1px solid var(--sg-border); border-radius: var(--sg-radius); box-shadow: var(--sg-shadow-lg); }
html.sg-modern .dropdown-item { border-radius: var(--sg-radius-sm); padding: 7px 12px; color: var(--sg-text-2); }
html.sg-modern .dropdown-item:hover { background: var(--sg-surface-2); color: var(--sg-text); }
html.sg-modern .popover { border-color: var(--sg-border); border-radius: var(--sg-radius); box-shadow: var(--sg-shadow-lg); font-family: var(--sg-font); }
html.sg-modern .tooltip-inner { background: var(--sg-text); border-radius: var(--sg-radius-sm); font-size: 12.5px; padding: 6px 10px; }

/* Bootstrap 4 alpha draws each pointer with a border on the inner pseudo-element. */
html.sg-modern .tooltip.tooltip-top .tooltip-inner::before,
html.sg-modern .tooltip.bs-tether-element-attached-bottom .tooltip-inner::before { border-top-color: var(--sg-text); }
html.sg-modern .tooltip.tooltip-right .tooltip-inner::before,
html.sg-modern .tooltip.bs-tether-element-attached-left .tooltip-inner::before { border-right-color: var(--sg-text); }
html.sg-modern .tooltip.tooltip-bottom .tooltip-inner::before,
html.sg-modern .tooltip.bs-tether-element-attached-top .tooltip-inner::before { border-bottom-color: var(--sg-text); }
html.sg-modern .tooltip.tooltip-left .tooltip-inner::before,
html.sg-modern .tooltip.bs-tether-element-attached-right .tooltip-inner::before { border-left-color: var(--sg-text); }

/* SweetAlert2 dialogs */
html.sg-modern .swal2-popup, html.sg-modern .swal2-modal {
    border-radius: var(--sg-radius-lg) !important;
    font-family: var(--sg-font) !important;
    padding: 24px !important;
}

html.sg-modern .swal2-title { font-family: var(--sg-font-display) !important; font-weight: 600 !important; color: var(--sg-text) !important; font-size: 1.35rem !important; }
html.sg-modern .swal2-content, html.sg-modern .swal2-html-container { color: var(--sg-text-2) !important; font-size: 15px !important; }
html.sg-modern .swal2-styled { border-radius: var(--sg-radius-sm) !important; font-weight: 600 !important; padding: 10px 20px !important; font-size: 14.5px !important; }
html.sg-modern .swal2-styled.swal2-confirm { background-color: var(--sg-primary) !important; }
html.sg-modern .swal2-styled.swal2-cancel { background-color: #eef1f5 !important; color: var(--sg-text) !important; }

/* Hopscotch guided tours */
html.sg-modern .hopscotch-bubble { border-radius: var(--sg-radius) !important; border-color: var(--sg-border) !important; box-shadow: var(--sg-shadow-lg); font-family: var(--sg-font); }
html.sg-modern .hopscotch-bubble .hopscotch-nav-button { border-radius: var(--sg-radius-sm); }

/* Datetime picker */
html.sg-modern .bootstrap-datetimepicker-widget { border-radius: var(--sg-radius); box-shadow: var(--sg-shadow-lg); }

/* Session-ended prompt (ui-modern.js); above every theme layer, including modals. */
html.sg-modern .sg-session-prompt {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(11, 26, 38, 0.5);
}

html.sg-modern .sg-session-prompt__card {
    width: min(440px, 100%);
    background: var(--sg-surface);
    border-radius: var(--sg-radius-lg);
    box-shadow: var(--sg-shadow-lg);
    padding: 24px;
}

html.sg-modern .sg-session-prompt__card h2 { font-size: 1.25rem; margin: 0 0 8px; }
html.sg-modern .sg-session-prompt__card p { color: var(--sg-text-2); margin: 0 0 16px; }
html.sg-modern .sg-session-prompt__actions { display: flex; gap: 10px; flex-wrap: wrap; }
html.sg-modern .sg-session-prompt__actions .btn { flex: 1 1 150px; }
html.sg-modern .sg-session-prompt__hint { font-size: 13px; color: var(--sg-muted) !important; margin: 14px 0 0 !important; }

/* -------------------------------------------- responsive: tablet & phone */

html.sg-modern .sg-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 26, 38, 0.45);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Large desktop, collapsed ("mini") icon rail chosen with the toggle. The theme's flyouts
   (a full-width coloured bar plus an unstyled list) become a compact menu card beside the
   rail, titled with the section name, opened by hover, keyboard focus or tap. */
@media (min-width: 1200px) {
    html.sg-modern .mini-sidebar .left-sidebar,
    html.sg-modern .mini-sidebar .sidebar-footer { width: var(--sg-sidebar-mini-w); }
    html.sg-modern .mini-sidebar .page-wrapper { margin-left: var(--sg-sidebar-mini-w); }
    html.sg-modern .mini-sidebar .footer { left: var(--sg-sidebar-mini-w); margin-left: 0; }
    html.sg-modern .mini-sidebar .top-navbar .navbar-header { width: var(--sg-sidebar-mini-w); padding-left: 0; justify-content: center; }
    html.sg-modern .mini-sidebar .sidebar-footer { display: none; }

    html.sg-modern .mini-sidebar .left-sidebar,
    html.sg-modern .mini-sidebar .scroll-sidebar,
    html.sg-modern .mini-sidebar .slimScrollDiv { overflow: visible !important; }
    html.sg-modern .mini-sidebar .sidebar-nav { padding: 12px 8px; }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li { position: relative; }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > a,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > a {
        width: auto !important;
        justify-content: center;
        padding: 10px 0 !important;
        background: transparent;
        color: var(--sg-text-2);
    }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > a,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:focus-within > a {
        background: var(--sg-primary-50) !important;
        color: var(--sg-primary-600) !important;
    }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > a i,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:focus-within > a i { color: var(--sg-primary); }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > a.has-arrow::after { display: none !important; }

    /* Hover bridge across the gap between the rail and the menu card. */
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover::after {
        content: "";
        position: absolute;
        top: 0;
        left: 100%;
        width: 14px;
        height: 100%;
    }

    /* Items without a submenu: the label appears as a tooltip. */
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > a .hide-menu {
        display: block !important;
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap;
        padding: 0 !important;
        border: 0 !important;
    }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:not(:has(> ul)):hover > a .hide-menu,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:not(:has(> ul)):focus-within > a .hide-menu {
        display: block !important;
        position: absolute !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        clip: auto !important;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        padding: 7px 12px !important;
        background: var(--sg-text);
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        border-radius: var(--sg-radius-sm);
        white-space: nowrap;
        box-shadow: var(--sg-shadow);
        z-index: 1060;
        pointer-events: none;
    }

    /* Items with a submenu: a menu card titled with the section name. */
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul.collapse,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul.in {
        display: none !important;
        position: absolute !important;
        left: calc(100% + 10px) !important;
        top: -6px !important;
        width: auto !important;
        min-width: 210px;
        height: auto !important;
        padding: 6px !important;
        background: var(--sg-surface) !important;
        border: 1px solid var(--sg-border);
        border-radius: var(--sg-radius);
        box-shadow: var(--sg-shadow-lg);
        z-index: 1060;
    }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > ul,
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:focus-within > ul { display: block !important; }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul::before {
        content: attr(data-title);
        display: block;
        padding: 8px 10px 6px;
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--sg-muted);
    }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul > li > a {
        display: block;
        padding: 8px 10px !important;
        margin: 1px 0;
        font-size: 14px;
        font-weight: 500;
        color: var(--sg-text);
        border-radius: var(--sg-radius-sm);
        white-space: nowrap;
    }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul > li > a:hover { background: var(--sg-surface-2); color: var(--sg-primary-600); }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul > li > a.active { background: var(--sg-primary-50); color: var(--sg-primary-600); }
}

/* Below 1200px the sidebar becomes an off-canvas drawer opened from the topbar. */
@media (max-width: 1199.98px) {
    html.sg-modern .sg-nav-toggle { display: inline-flex; }
    html.sg-modern .topbar .nav-toggler,
    html.sg-modern .topbar .sidebartoggler { display: none !important; }

    html.sg-modern .topbar .top-navbar .navbar-header,
    html.sg-modern .mini-sidebar .topbar .top-navbar .navbar-header { width: auto; padding-left: 4px; }
    html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand span { display: inline-flex !important; }

    html.sg-modern .left-sidebar,
    html.sg-modern .mini-sidebar .left-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0 !important;
        width: min(300px, 86vw) !important;
        padding-top: var(--sg-topbar-h);
        transform: translateX(-102%);
        transition: transform 0.22s ease;
        z-index: 1045;
        box-shadow: none;
        overflow-y: auto;
    }

    html.sg-modern .sidebar-footer,
    html.sg-modern .mini-sidebar .sidebar-footer {
        display: flex !important;
        width: min(300px, 86vw) !important;
        left: 0 !important;
        transform: translateX(-102%);
        transition: transform 0.22s ease;
        z-index: 1046;
    }

    html.sg-modern.sg-nav-open .left-sidebar,
    html.sg-modern.sg-nav-open .sidebar-footer { transform: none; }
    html.sg-modern.sg-nav-open .left-sidebar { box-shadow: var(--sg-shadow-lg); }
    html.sg-modern.sg-nav-open .sg-nav-backdrop { opacity: 1; visibility: visible; }
    html.sg-modern.sg-nav-open body { overflow: hidden; }

    /* The theme's mini-sidebar hover flyouts are replaced by an accordion. */
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > a { width: auto !important; padding: 10px 12px !important; justify-content: flex-start; }
    html.sg-modern .mini-sidebar .sidebar-nav .hide-menu { display: inline !important; }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > a.has-arrow::after { display: block !important; }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul {
        position: static !important;
        width: auto !important;
        background: transparent !important;
        padding-left: 34px !important;
        box-shadow: none !important;
    }

    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > ul:not(.in),
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > ul.collapse:not(.in) { display: none !important; }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > ul.in { display: block !important; height: auto !important; }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > a { width: auto !important; }
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li:hover > a .hide-menu { display: inline !important; }

    html.sg-modern .page-wrapper,
    html.sg-modern .mini-sidebar .page-wrapper { margin-left: 0 !important; }
    html.sg-modern .footer,
    html.sg-modern .mini-sidebar .footer { left: 0 !important; }
}

/* Phones and small tablets */
@media (max-width: 767.98px) {
    html.sg-modern body { font-size: 15px; }
    html.sg-modern { --sg-topbar-h: 56px; }

    html.sg-modern .topbar .top-navbar { padding-right: 4px; }
    html.sg-modern .topbar .navbar-collapse { display: flex !important; flex: 1; align-items: center; justify-content: flex-end; }
    html.sg-modern .topbar .navbar-collapse > .navbar-nav.mr-auto { display: none; }
    html.sg-modern .topbar .navbar-nav { flex-direction: row; }
    html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand span img { width: 118px !important; }
    html.sg-modern .topbar .top-navbar .navbar-header .navbar-brand b img { width: 28px !important; }
    html.sg-modern .topbar .navbar-light .navbar-nav .nav-item > a.nav-link { padding: 0 10px; }
    html.sg-modern .topbar .dropdown-menu { position: fixed !important; top: var(--sg-topbar-h) !important; right: 8px !important; left: 8px !important; min-width: 0; }

    html.sg-modern .page-wrapper { padding-top: var(--sg-topbar-h); padding-bottom: 72px; }
    html.sg-modern .container-fluid { padding: 0 14px 20px; }
    html.sg-modern .system-notifications { margin-left: -14px !important; margin-right: -14px !important; }
    html.sg-modern .notification-row { padding-left: 14px; padding-right: 14px; }
    html.sg-modern .page-titles { padding: 16px 0 2px; margin-bottom: 12px; }
    html.sg-modern .page-titles h1,
html.sg-modern .page-titles h3 { font-size: 1.3rem; }
    html.sg-modern .page-titles { margin-left: 0 !important; margin-right: 0 !important; }
    /* ui-extend.css forced a 40px indent here to clear the old floating menu button. */
    html.sg-modern .page-titles > div,
    html.sg-modern .page-titles > [class*="col-"] { padding-left: 0 !important; padding-right: 0 !important; }
    html.sg-modern .table td, html.sg-modern .table th { padding: 10px 12px; }
    html.sg-modern .topbar .navbar-light .navbar-nav .nav-item > a.nav-link { max-width: none; }

    html.sg-modern .row { margin-left: -8px; margin-right: -8px; }
    html.sg-modern .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

    html.sg-modern .card { border-radius: var(--sg-radius); margin-bottom: 14px; }
    html.sg-modern .card > .card-block,
    html.sg-modern .card > .card-body { padding: 16px; }
    html.sg-modern .card-header { padding: 12px 16px; }

    /* 16px controls stop iOS from zooming the page on focus; 44px meets touch-target guidance. */
    html.sg-modern .form-control,
    html.sg-modern select.form-control,
    html.sg-modern .custom-select,
    html.sg-modern .dataTables_wrapper .dataTables_filter input,
    html.sg-modern .table-searching input[type=search] { font-size: 16px; min-height: 44px; }
    html.sg-modern .onboard-row .onboarding-btn { min-height: 44px; }
    html.sg-modern .dataTables_wrapper .dataTables_paginate .paginate_button { min-height: 44px; min-width: 44px; display: inline-flex !important; align-items: center; justify-content: center; }
    html.sg-modern .footer a { display: inline-block; padding: 10px 4px; }
    html.sg-modern .btn { min-height: 44px; padding: 10px 16px; }
    html.sg-modern .btn-sm { min-height: 36px; }

    html.sg-modern .dataTables_wrapper .dataTables_length,
    html.sg-modern .dataTables_wrapper .dataTables_filter { float: none; text-align: left; margin-bottom: 10px; }
    html.sg-modern .dataTables_wrapper .dataTables_filter label { display: flex; align-items: center; width: 100%; }
    html.sg-modern .dataTables_wrapper .dataTables_filter input { flex: 1; width: auto; margin-left: 8px; }
    html.sg-modern .dataTables_wrapper .dataTables_info,
    html.sg-modern .dataTables_wrapper .dataTables_paginate { float: none; text-align: center; }

    html.sg-modern .footer { position: static; text-align: center; }
    html.sg-modern .footer .row > div { flex: 0 0 auto; max-width: none; width: auto; padding: 0 8px; }
    html.sg-modern .footer .row { justify-content: center; }

    html.sg-modern .modal-dialog { margin: 12px; }
    html.sg-modern .swal2-popup { width: calc(100% - 24px) !important; }

    /* ui-extend.css min-width utilities (350–950px) force horizontal overflow on phones. */
    html.sg-modern .min-width-350, html.sg-modern .min-width-400, html.sg-modern .min-width-450,
    html.sg-modern .min-width-500, html.sg-modern .min-width-800, html.sg-modern .min-width-950 { min-width: 0 !important; }

    /* Fixed-width helpers from the theme that overflow phones */
    html.sg-modern [style*="width: 1000px"], html.sg-modern [style*="min-width: 1000px"] { max-width: 100%; }
    html.sg-modern img { max-width: 100%; height: auto; }
}

/* Card tables (ui-modern.js adds .sg-cards when a table's columns don't fit).
   One card per row: title, optional thumbnail, labelled details and an action bar. */
html.sg-modern table.sg-cards,
html.sg-modern table.sg-cards > tbody,
html.sg-modern table.sg-cards > tfoot { display: block; width: 100% !important; min-width: 0 !important; border: 0; }
html.sg-modern table.sg-cards > thead { display: none; }
html.sg-modern table.sg-cards > tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 12px;
}

html.sg-modern table.sg-cards > tbody > tr,
html.sg-modern table.sg-cards > tfoot > tr {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 14px 16px;
    background: var(--sg-table-row-background, var(--sg-surface)) !important;
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
    box-shadow: var(--sg-shadow-sm);
}

html.sg-modern table.sg-cards > tfoot > tr { margin-top: 12px; background: var(--sg-surface-2) !important; box-shadow: none; }
html.sg-modern table.sg-cards > tbody > tr:hover { background: var(--sg-surface) !important; border-color: var(--sg-border-strong); }

html.sg-modern table.sg-cards td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    width: auto !important;
    min-width: 0;
    padding: 4px 0 !important;
    border: 0 !important;
    white-space: normal !important;
    text-align: right;
    font-size: 14px;
    overflow-wrap: anywhere;
}

html.sg-modern table.sg-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 48%;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--sg-muted);
}

html.sg-modern table.sg-cards td[data-label=""]::before { display: none; }
html.sg-modern table.sg-cards td.sg-cell-empty { display: none; }

html.sg-modern table.sg-cards td.sg-cell-title {
    order: -2;
    display: block;
    text-align: left;
    font-family: var(--sg-font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--sg-text);
    padding: 0 0 8px !important;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--sg-border) !important;
}

html.sg-modern table.sg-cards td.sg-cell-title::before { display: none; }
html.sg-modern table.sg-cards td.sg-cell-title a { color: var(--sg-text); }
html.sg-modern table.sg-cards td.sg-cell-title a:hover { color: var(--sg-primary); }

html.sg-modern table.sg-cards td.sg-cell-media { order: -3; display: block; padding: 0 0 10px !important; text-align: left; }
html.sg-modern table.sg-cards td.sg-cell-media::before { display: none; }
html.sg-modern table.sg-cards td.sg-cell-media img { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--sg-radius-sm); }

html.sg-modern table.sg-cards td.sg-cell-actions {
    order: 10;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px !important;
    border-top: 1px solid var(--sg-border) !important;
}

html.sg-modern table.sg-cards td.sg-cell-actions::before { display: none; }
html.sg-modern table.sg-cards td.sg-cell-actions + td.sg-cell-actions { margin-top: 0; padding-top: 4px !important; border-top: 0 !important; }
html.sg-modern table.sg-cards td.sg-cell-actions .btn,
html.sg-modern table.sg-cards td.sg-cell-actions a:has(> .btn) { flex: 1 1 auto; text-align: center; }
html.sg-modern table.sg-cards td.sg-cell-actions a:has(> .btn) > .btn { width: 100%; }

html.sg-modern table.sg-cards td > input,
html.sg-modern table.sg-cards td > select,
html.sg-modern table.sg-cards td > .form-control { max-width: 60%; }
html.sg-modern table.sg-cards td.dataTables_empty { display: block; text-align: center; color: var(--sg-muted); }
html.sg-modern table.sg-cards td.dataTables_empty::before { display: none; }

/* In card mode the scroll frame and stripes go away; the cards are the frame. */
html.sg-modern .sg-table-scroll:has(> table.sg-cards) { overflow: visible; border: 0; border-radius: 0; }
html.sg-modern table.sg-cards.table-striped > tbody > tr:nth-of-type(odd) { background: var(--sg-surface) !important; }

@media (prefers-reduced-motion: reduce) {
    html.sg-modern *, html.sg-modern *::before, html.sg-modern *::after { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    html.sg-modern .topbar, html.sg-modern .left-sidebar, html.sg-modern .sidebar-footer, html.sg-modern .footer, html.sg-modern .sg-nav-backdrop { display: none !important; }
    html.sg-modern .page-wrapper { margin: 0 !important; padding: 0 !important; background: #fff; }
    html.sg-modern .card { box-shadow: none; border-color: #ccc; }
}

/* Make Title / similar buttons carried inline "color:#fff !important"; keep text readable on cyan. */
html.sg-modern .btn-success[style*="color: #fff"] { color: var(--sg-text) !important; }

html.sg-modern .dropdown:not(.show):not(.open) > .dropdown-menu.scale-up { visibility: hidden; }

html.sg-modern [class*="table-width-"] { min-width: 0 !important; max-width: 100%; }

/* Material "floating" labels sat inside the boxed inputs (low contrast, overlapping text).
   Show them as normal labels above the field; the underline bar is no longer used. */
html.sg-modern .floating-labels .form-group:has(> .form-control, > select, > textarea, > .select2-container) { display: flex; flex-direction: column; position: relative; }
html.sg-modern .floating-labels .form-group:has(> .form-control, > select, > textarea, > .select2-container) > label,
html.sg-modern .floating-labels .form-group:has(> .form-control, > select, > textarea, > .select2-container) > .control-label {
    order: -1;
    position: static !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    font-size: 13.5px !important;
    color: var(--sg-text-2) !important;
    margin-bottom: 6px;
    pointer-events: auto;
}

html.sg-modern .floating-labels .bar,
html.sg-modern .floating-labels .bar::before,
html.sg-modern .floating-labels .bar::after { display: none !important; }
html.sg-modern .floating-labels .form-control { padding: 8px 12px !important; }

html.sg-modern .sg-skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2147483646;
    padding: 10px 16px;
    background: var(--sg-surface);
    color: var(--sg-text) !important;
    border-radius: var(--sg-radius-sm);
    box-shadow: var(--sg-shadow-lg);
    font-weight: 600;
}

html.sg-modern .sg-skip-link:focus { top: 12px; }
html.sg-modern .sg-sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 767.98px) {
    html.sg-modern .sg-label-sm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 575.98px) {
    html.sg-modern .sg-label-xs-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Select2 "bootstrap" skin (pmd-select2) drew an underline-only field; box it like other inputs. */
html.sg-modern .select2-container--bootstrap .select2-selection {
    border: 1px solid var(--sg-border-strong) !important;
    border-radius: var(--sg-radius-sm) !important;
    background-color: var(--sg-surface) !important;
    box-shadow: var(--sg-shadow-sm) !important;
    min-height: 40px;
}

html.sg-modern .select2-container--bootstrap .select2-selection--single { padding: 8px 32px 8px 12px !important; height: auto !important; }
html.sg-modern .select2-container--bootstrap .select2-selection--single .select2-selection__rendered { color: var(--sg-text); line-height: 22px; padding: 0 !important; }
html.sg-modern .select2-container--bootstrap .select2-selection--single .select2-selection__arrow { right: 10px; top: 50%; transform: translateY(-50%); }
html.sg-modern .select2-container--bootstrap.select2-container--focus .select2-selection,
html.sg-modern .select2-container--bootstrap.select2-container--open .select2-selection { border-color: var(--sg-primary) !important; box-shadow: var(--sg-focus) !important; }
html.sg-modern .select2-container--bootstrap .select2-selection--multiple { padding: 4px 8px !important; }
html.sg-modern .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
    background: var(--sg-primary-50);
    color: var(--sg-primary-700);
    border: 0;
    border-radius: 999px;
    padding: 2px 10px;
}

@media (max-width: 767.98px) {
    html.sg-modern .select2-container--bootstrap .select2-selection { min-height: 44px; font-size: 16px; }
}


/* ---- QA round fixes ---------------------------------------------------- */

/* Theme's mini-sidebar made .scroll-sidebar position:absolute, shrink-wrapping the nav in the
   drawer (~160px inside a 300px panel) and widening the rail past its border. */
@media (max-width: 1199.98px) {
    html.sg-modern .mini-sidebar .scroll-sidebar,
    html.sg-modern .scroll-sidebar { position: static !important; width: auto !important; }
}

@media (min-width: 1200px) {
    html.sg-modern .mini-sidebar .scroll-sidebar { position: static !important; width: auto !important; }
    /* .waves-effect clipped the rail tooltips. */
    html.sg-modern .mini-sidebar .sidebar-nav #sidebarnav > li > a { overflow: visible !important; }
}

/* Account menu on phones: the theme's fixed 270px list plus width:100% overflowed the screen. */
@media (max-width: 767.98px) {
    html.sg-modern .topbar .dropdown-menu { width: auto !important; }
    html.sg-modern .topbar .dropdown-user { width: auto !important; }
}

/* Meeting (IPS) modals: full-height sheet on phones, Cancel/Save always reachable. */
html.sg-modern .ips-modal .modal-body > .modal-footer,
html.sg-modern .ips-modal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: var(--sg-surface);
    border-top: 1px solid var(--sg-border);
}

html.sg-modern .modal-header .close { font-size: 26px; line-height: 1; opacity: 0.6; padding: 4px 8px; min-width: 44px; min-height: 44px; }
html.sg-modern .modal-header .close:hover { opacity: 1; }

@media (max-width: 767.98px) {
    html.sg-modern .ips-modal.modal-dialog,
    html.sg-modern .modal-dialog.ips-modal { margin: 0; max-width: none; min-height: 100%; }
    html.sg-modern .ips-modal .modal-content { min-height: 100vh; border-radius: 0; }
    html.sg-modern .ips-modal .modal-body { max-height: calc(100vh - 64px) !important; overflow-y: auto !important; overflow-x: hidden !important; }
    html.sg-modern .modal textarea,
    html.sg-modern .modal input.form-control,
    html.sg-modern .modal select { font-size: 16px !important; }
}

/* Touch screens of any size (iPads included): 44px targets. */
@media (pointer: coarse) {
    html.sg-modern .btn { min-height: 44px; }
    html.sg-modern .btn-sm { min-height: 38px; }
    html.sg-modern .form-control,
    html.sg-modern select.form-control,
    html.sg-modern .table-searching input[type=search],
    html.sg-modern .select2-container .select2-selection { min-height: 44px; }
    html.sg-modern .dataTables_wrapper .dataTables_paginate .paginate_button { min-height: 44px; min-width: 44px; display: inline-flex !important; align-items: center; justify-content: center; }
    html.sg-modern .onboard-row .onboarding-btn { min-height: 44px; }
    html.sg-modern .nav-tabs .nav-link,
    html.sg-modern .sg-vtabs > .tabs-vertical .nav-link { min-height: 44px; display: flex; align-items: center; }
    html.sg-modern [class*="icheckbox_"],
    html.sg-modern [class*="iradio_"] { width: 24px !important; height: 24px !important; }
    html.sg-modern [class*="icheckbox_"].checked::after { left: 7.5px; top: 3px; width: 6px; height: 11px; }
}

/* Onboarding button: centre its label vertically at any height. */
html.sg-modern .onboard-row .onboarding-btn { display: inline-flex !important; align-items: center; justify-content: center; }

/* Client image cards: show a properly framed thumbnail (was offset/cropped by JS centering). */
html.sg-modern .swift-album-image-card .image-container {
    aspect-ratio: 4 / 3;
    height: auto !important;
    background: var(--sg-surface-2);
}

html.sg-modern .swift-album-image-card .image-container img.swift-album-image {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none;
    object-fit: cover;
}

html.sg-modern .swift-album-image-card .current-primary.disabled { color: var(--sg-text-2) !important; opacity: 1; }

/* Meeting rows: calendar widget text and action alignment. */
html.sg-modern .ips-table .addeventatc p.atc_node,
html.sg-modern .ips-table .addeventatc .desc { width: auto !important; max-width: 100%; }
html.sg-modern .ips-table .addeventatc,
html.sg-modern .addeventatc { font-family: var(--sg-font) !important; }
html.sg-modern .ips-table .inner-ips-table .btn { margin: 0 !important; }

/* Old-theme leftovers. */
html.sg-modern h6.card-subtitle, html.sg-modern .card-subtitle { font-weight: 400; }
html.sg-modern .hopscotch-bubble,
html.sg-modern .hopscotch-bubble .hopscotch-title,
html.sg-modern .hopscotch-bubble .hopscotch-content { font-family: var(--sg-font) !important; color: var(--sg-text) !important; }
html.sg-modern .hopscotch-bubble .hopscotch-title { font-weight: 600 !important; font-size: 15px !important; }
html.sg-modern .hopscotch-bubble .hopscotch-content { font-size: 14px !important; line-height: 1.5 !important; }
html.sg-modern .hopscotch-bubble .hopscotch-nav-button { min-height: 36px; padding: 6px 14px !important; font-family: var(--sg-font) !important; font-weight: 600 !important; }

/* Phones: onboarding band keeps "Show Me How" / "Skip Setup" (the theme hid them below 768). */
@media (max-width: 767.98px) {
    html.sg-modern .onboard-row > .hidden-sm-down { display: block !important; }
    html.sg-modern .onboard-row > .hidden-md-up { display: none !important; }
    html.sg-modern .onboard-row .row { flex-direction: column; align-items: stretch; gap: 8px; }
    html.sg-modern .onboard-row .row > [class*="col-"] { max-width: 100%; flex: 0 0 auto; }
    html.sg-modern .onboarding-bar-left-side,
    html.sg-modern .onboarding-bar-right-side { justify-content: center; text-align: center; }
    html.sg-modern .onboarding-bar-left-side .hide-when-small,
    html.sg-modern .onboarding-bar-right-side .hide-when-small { display: inline !important; }
    html.sg-modern .onboarding-col:nth-child(3) { display: none; } /* the "|" separator */

    /* Nested cards inside tabs: less stacked padding so content keeps its width. */
    html.sg-modern .card .card > .card-block { padding: 12px; }
    html.sg-modern .tab-content > .tab-pane { padding-left: 0 !important; padding-right: 0 !important; }
}

/* Card tables: a spanning footer cell (e.g. "TOTAL:") is a heading for the totals card. */
html.sg-modern table.sg-cards td.sg-cell-spanning { order: -1; display: block; text-align: left; font-weight: 600; padding-bottom: 6px !important; }
html.sg-modern table.sg-cards td.sg-cell-spanning::before { display: none; }

/* DataTables marked `nowrap` (the dataTable macro) keep one line per cell in table mode and
   scroll inside .sg-table-scroll; the DataTables stylesheet that defined this isn't loaded. */
html.sg-modern table.dataTable.nowrap:not(.sg-cards) > thead > tr > th,
html.sg-modern table.dataTable.nowrap:not(.sg-cards) > tbody > tr > td {
    white-space: nowrap;
}

/* Edge fade on tables that scroll sideways (classes set by ui-modern.js). */
html.sg-modern .sg-table-scroll.sg-more-end {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), rgba(0, 0, 0, .18));
    mask-image: linear-gradient(to right, #000 calc(100% - 56px), rgba(0, 0, 0, .18));
}
html.sg-modern .sg-table-scroll.sg-more-start {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 56px), rgba(0, 0, 0, .18));
    mask-image: linear-gradient(to left, #000 calc(100% - 56px), rgba(0, 0, 0, .18));
}
html.sg-modern .sg-table-scroll.sg-more-start.sg-more-end {
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, .18), #000 56px, #000 calc(100% - 56px), rgba(0, 0, 0, .18));
    mask-image: linear-gradient(to right, rgba(0, 0, 0, .18), #000 56px, #000 calc(100% - 56px), rgba(0, 0, 0, .18));
}
@media print {
    html.sg-modern .sg-table-scroll { -webkit-mask-image: none !important; mask-image: none !important; }
}

/* Tour bubble close: the theme's 8px sprite had its focus outline removed (ui.hopscotch.css).
   A drawn × at a usable size, with the normal focus ring. */
html.sg-modern .hopscotch-bubble .hopscotch-bubble-close.hopscotch-close {
    width: 36px;
    height: 36px;
    padding: 0;
    top: 2px;
    right: 2px;
    background: none !important;
    border-radius: var(--sg-radius-sm);
    text-indent: 0;
    font-size: 0;
    color: var(--sg-muted);
}
html.sg-modern .hopscotch-bubble .hopscotch-bubble-close.hopscotch-close::before {
    content: "\00d7";
    display: block;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
}
html.sg-modern .hopscotch-bubble .hopscotch-bubble-close.hopscotch-close:hover { color: var(--sg-text); background: var(--sg-surface-2) !important; }
html.sg-modern .hopscotch-bubble .hopscotch-bubble-close.hopscotch-close:focus-visible {
    outline: 2px solid var(--sg-focus-ring) !important;
    outline-offset: 0;
}
html.sg-modern .hopscotch-bubble .hopscotch-title { padding-right: 30px; }

/* Dropdowns: a centered chevron instead of the browser's fallback triangle, which Chrome draws
   low in the field once a select has custom borders. Multi-selects and list boxes keep theirs. */
html.sg-modern select.form-control:not([multiple]):not([size]),
html.sg-modern .custom-select,
html.sg-modern .dataTables_wrapper .dataTables_length select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%235d6878' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px 16px !important;
    cursor: pointer;
    text-overflow: ellipsis;
}
html.sg-modern select.form-control:not([multiple]):not([size]):disabled,
html.sg-modern .custom-select:disabled { cursor: not-allowed; opacity: 0.7; }
html.sg-modern select.form-control::-ms-expand,
html.sg-modern .custom-select::-ms-expand { display: none; }

/* Select2 dropdowns: ui.select2.css draws a rotated "►" pinned near the bottom edge. Use the same
   centered chevron as native selects, flipped while the list is open. */
html.sg-modern .select2-container .select2-selection--single { position: relative; padding-right: 38px !important; }
html.sg-modern .select2-container .select2-selection--single .select2-selection__rendered::after {
    content: "" !important;
    position: absolute;
    top: 50% !important;
    right: 12px !important;
    bottom: auto !important;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    transform: none !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%235d6878' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
    transition: transform 0.15s ease;
}
html.sg-modern .select2-container--open .select2-selection--single .select2-selection__rendered::after { transform: rotate(180deg) !important; }
html.sg-modern .select2-container .select2-selection--multiple .select2-selection__rendered::after { content: none !important; }
@media (prefers-reduced-motion: reduce) {
    html.sg-modern .select2-container .select2-selection--single .select2-selection__rendered::after { transition: none; }
}

/* ----------------------------------------------------------- table polish */
/* Softer, rounded shell; the scroll wrapper clips its rows to the radius. */
html.sg-modern .sg-table-scroll {
    border-radius: var(--sg-radius-lg);
    background: var(--sg-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
html.sg-modern .sg-table-scroll:has(> table.sg-cards) { background: transparent; box-shadow: none; }
html.sg-modern .table thead th,
html.sg-modern .table th { padding: 10px 16px; }
html.sg-modern .table td { padding: 11px 16px; }
html.sg-modern .table tbody tr:last-child td { border-bottom: 0; }
html.sg-modern .table tbody tr { transition: background-color 0.12s ease; }

/* Numeric columns (marked by ui-modern.js) line up on the right with even-width digits. */
html.sg-modern .table:not(.sg-cards) th.sg-num,
html.sg-modern .table:not(.sg-cards) td.sg-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Two-column label/value tables (marked by ui-modern.js): muted labels, firmer values. */
html.sg-modern .table.sg-kv:not(.sg-cards) td:first-child { color: var(--sg-text-2); width: 42%; }
html.sg-modern .table.sg-kv:not(.sg-cards) td:last-child { font-weight: 500; color: var(--sg-text); }

/* Buttons inside table rows stay compact with a mouse; touch keeps the 44px targets. */
@media (pointer: fine) {
    html.sg-modern .table:not(.sg-cards) td .btn:not(.btn-lg) {
        min-height: 32px;
        padding: 5px 12px;
        font-size: 13px;
        line-height: 1.4;
        border-radius: 8px;
    }
}
/* Order-number buttons: a tinted pill instead of a solid amber block. */
html.sg-modern .table td .btn-warning {
    background: #fff4dc;
    border: 1px solid #f3d08a;
    color: #6b4300 !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
}
html.sg-modern .table td .btn-warning:hover,
html.sg-modern .table td .btn-warning:focus-visible {
    background: #ffe7b0 !important;
    border-color: #e8b955 !important;
    color: #573600 !important;
}

/* ------------------------------------------------ color pickers (Spectrum) */
/* Every product/frame/mat color field: an input-like field with a color bar, a white
   popover, rounded swatches, a hex input and the app's buttons. */
html.sg-modern .sp-replacer,
html.sg-modern .sp-replacer:hover {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    min-height: 40px;
    padding: 6px !important;
    border: 1px solid var(--sg-border-strong) !important;
    border-radius: var(--sg-radius-sm);
    background: var(--sg-surface) !important;
    box-shadow: var(--sg-shadow-sm);
    cursor: pointer;
}
html.sg-modern .sp-replacer:hover { border-color: var(--sg-muted) !important; }
html.sg-modern .sp-replacer.sp-active { border-color: var(--sg-primary) !important; box-shadow: var(--sg-focus); }
html.sg-modern .sp-preview {
    flex: 1;
    height: 26px !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
html.sg-modern .sp-preview-inner { border-radius: 4px; }

html.sg-modern .sp-container {
    padding: 12px;
    border: 1px solid var(--sg-border) !important;
    border-radius: 12px !important;
    background: var(--sg-surface) !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
    font-family: var(--sg-font);
    z-index: 1060;
}
html.sg-modern .sp-container:not(.sp-hidden) { display: flex !important; align-items: flex-start; }
html.sg-modern .sp-palette-container {
    float: none;
    margin: 0 !important;
    padding: 0 12px 0 0 !important;
    border-right: 1px solid var(--sg-border) !important;
}
html.sg-modern .sp-picker-container { float: none; width: 200px; margin: 0 !important; padding: 0 0 0 12px !important; border: 0 !important; }
html.sg-modern .sp-palette .sp-thumb-el {
    width: 22px;
    height: 22px;
    margin: 3px;
    border: 0 !important;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
    transition: transform 0.1s ease;
}
html.sg-modern .sp-palette .sp-thumb-el:hover { transform: scale(1.1); }
html.sg-modern .sp-palette .sp-thumb-el.sp-thumb-active { box-shadow: 0 0 0 2px var(--sg-surface), 0 0 0 4px var(--sg-primary); }
html.sg-modern .sp-palette .sp-thumb-inner { border-radius: 5px; }
html.sg-modern .sp-palette-row-selection { margin-top: 6px; }
html.sg-modern .sp-color,
html.sg-modern .sp-hue { border: 0 !important; border-radius: 8px; overflow: visible; }
html.sg-modern .sp-sat, html.sg-modern .sp-val { border-radius: 8px; }
html.sg-modern .sp-dragger {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
}
html.sg-modern .sp-slider {
    height: 8px;
    left: -3px;
    right: -3px;
    border: 2px solid #fff;
    border-radius: 4px;
    background: transparent;
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
html.sg-modern .sp-input-container { float: none; width: 100%; margin: 10px 0 0; }
html.sg-modern .sp-input {
    width: 100%;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--sg-border-strong) !important;
    border-radius: 6px;
    background: var(--sg-surface) !important;
    color: var(--sg-text);
    font: 500 13.5px ui-monospace, SFMono-Regular, Menlo, monospace;
}
html.sg-modern .sp-input:focus { border-color: var(--sg-primary) !important; box-shadow: var(--sg-focus); outline: 0; }
html.sg-modern .sp-input.sp-validation-error { border-color: var(--sg-danger) !important; background: var(--sg-danger-50) !important; }
html.sg-modern .sp-button-container {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    float: none;
    width: 100%;
    margin-top: 12px !important;
}
html.sg-modern .sp-cancel,
html.sg-modern .sp-cancel:hover {
    display: inline-flex;
    align-items: center;
    top: 0 !important;
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid var(--sg-border-strong);
    border-radius: 6px;
    background: var(--sg-surface);
    color: var(--sg-text-2) !important;
    font: 600 13.5px var(--sg-font);
    text-decoration: none !important;
}
html.sg-modern .sp-cancel:hover { background: var(--sg-surface-2); color: var(--sg-text) !important; }
html.sg-modern .sp-choose {
    min-height: 34px;
    padding: 6px 16px !important;
    border: 1px solid var(--sg-primary) !important;
    border-radius: 6px !important;
    background: var(--sg-primary) !important;
    color: #fff !important;
    font: 600 13.5px var(--sg-font) !important;
    box-shadow: none !important;
}
html.sg-modern .sp-choose:hover { background: var(--sg-primary-600) !important; border-color: var(--sg-primary-600) !important; }
@media (max-width: 575.98px) {
    html.sg-modern .sp-container:not(.sp-hidden) { flex-direction: column; max-width: calc(100vw - 24px); }
    html.sg-modern .sp-palette-container { padding: 0 0 12px !important; border-right: 0 !important; border-bottom: 1px solid var(--sg-border) !important; }
    html.sg-modern .sp-picker-container { width: 100%; padding: 12px 0 0 !important; }
}

/* Inline help icons beside labels (were absolutely positioned at a fixed offset). */
html.sg-modern .label-tip {
    position: static !important;
    left: auto !important;
    top: auto !important;
    margin-left: 6px;
    font-size: 18px;
    vertical-align: -2px;
}
/* Keep each palette row on one line (Spectrum caps the palette at 220px). */
html.sg-modern .sp-palette { max-width: none !important; }
html.sg-modern .sp-palette-row { display: flex; flex-wrap: nowrap; }
html.sg-modern .sp-cancel, html.sg-modern .sp-choose { height: 34px; line-height: 20px !important; }
html.sg-modern .sp-palette-toggle {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid var(--sg-border-strong);
    border-radius: 6px;
    background: var(--sg-surface);
    color: var(--sg-text-2);
    font: 600 13px var(--sg-font);
}
/* Phones: swatches first (ui.util.js) in a bottom sheet that cannot open off-screen. */
@media (max-width: 575.98px) {
    html.sg-modern .sp-container:not(.sp-hidden) {
        position: fixed !important;
        top: auto !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        max-width: none;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        align-items: stretch;
    }
    html.sg-modern .sp-palette-container { border-bottom: 0 !important; }
    html.sg-modern .sp-palette-row { justify-content: space-between; }
    html.sg-modern .sp-palette .sp-thumb-el { width: 28px; height: 28px; margin: 3px 0; }
}
/* Cancel (a link) and Apply (a button) share one box so they read as a matched pair. */
html.sg-modern .sp-button-container { align-items: center; }
html.sg-modern .sp-button-container .sp-cancel,
html.sg-modern .sp-button-container .sp-choose {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 36px !important;
    min-height: 0 !important;
    min-width: 84px;
    margin: 0 !important;
    padding: 0 16px !important;
    line-height: 1 !important;
    vertical-align: middle;
    float: none !important;
}

/* ------------------------------------------------------- QA polish pass */
/* The DataTables "Search:" label inside floating-label forms stays inline. */
html.sg-modern .floating-labels .table-searching label { position: static !important; top: auto !important; left: auto !important; transform: none !important; }

/* Add Size sat 28px up over the table summary. */
html.sg-modern #add-size { top: 0 !important; float: none !important; margin-bottom: 12px; }

/* Thumbnails inside table rows stay small so tables do not overflow their card. */
html.sg-modern .table:not(.sg-cards) td img { max-width: 96px; max-height: 64px; width: auto; height: auto; object-fit: cover; border-radius: 6px; }

/* Card-mode footer totals (th cells) get the same label/value rows as body cells. */
html.sg-modern table.sg-cards > tfoot th {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    width: auto !important;
    padding: 4px 0 !important;
    border: 0 !important;
    white-space: normal !important;
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 600;
    color: var(--sg-text);
}
html.sg-modern table.sg-cards > tfoot th::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 48%;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--sg-muted);
}
html.sg-modern table.sg-cards > tfoot th[data-label=""]::before { display: none; }
html.sg-modern table.sg-cards > tfoot th.sg-cell-empty { display: none; }
html.sg-modern table.sg-cards > tfoot th.sg-cell-spanning { display: block; text-align: left !important; font-size: 15px !important; padding-bottom: 6px !important; }
html.sg-modern table.sg-cards > tfoot th.sg-cell-spanning span { margin: 0 !important; }
html.sg-modern .table:not(.sg-cards) tfoot th.sg-num { text-align: right; font-variant-numeric: tabular-nums; }

/* In-person session modal: no strip of content below the sticky footer. */
html.sg-modern .ips-modal .modal-body { padding-bottom: 0 !important; }

/* Forms: no 4px label jump on invalid fields; one font for inputs and dropdowns. */
html.sg-modern .floating-labels .form-group > label { padding-left: 0 !important; }
html.sg-modern .form-control,
html.sg-modern .floating-labels .form-control { font-family: var(--sg-font) !important; }
html.sg-modern .select2-container .select2-selection__rendered { font-size: 14.5px; }
html.sg-modern .floating-labels [class*="col-"]:has(> .form-control) { display: flex; flex-direction: column; }
html.sg-modern .floating-labels [class*="col-"]:has(> .form-control) > label {
    order: -1;
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin-bottom: 6px;
    font-size: 13.5px !important;
    color: var(--sg-text-2) !important;
}

/* Open dropdown lists: emerald highlight, aligned option text. */
html.sg-modern .select2-container--bootstrap .select2-results__option--highlighted[aria-selected],
html.sg-modern .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--sg-primary-50) !important; color: var(--sg-primary-700) !important; }
html.sg-modern .select2-results__option { padding: 8px 12px; font-family: var(--sg-font); font-size: 14px; }
html.sg-modern .select2-results__option[aria-selected=true] { font-weight: 600; }

/* Date picker: emerald selection instead of Bootstrap 3 blue. */
html.sg-modern .bootstrap-datetimepicker-widget { font-family: var(--sg-font); }
html.sg-modern .bootstrap-datetimepicker-widget table td.active,
html.sg-modern .bootstrap-datetimepicker-widget table td.active:hover,
html.sg-modern .bootstrap-datetimepicker-widget table td span.active { background: var(--sg-primary) !important; color: #fff !important; text-shadow: none !important; border-radius: 6px; }
html.sg-modern .bootstrap-datetimepicker-widget table td.day,
html.sg-modern .bootstrap-datetimepicker-widget table td span { border-radius: 6px; }
html.sg-modern .bootstrap-datetimepicker-widget table td.today::before { border-bottom-color: var(--sg-primary) !important; }
html.sg-modern .bootstrap-datetimepicker-widget a[data-action],
html.sg-modern .bootstrap-datetimepicker-widget .btn { color: var(--sg-text-2) !important; }

/* Image cards: buttons no longer sit on the card's bottom edge. */
html.sg-modern .el-card-item .el-card-content { padding: 0 12px 12px; }

/* Dialog Cancel buttons are quiet secondary actions, not pink calls to action. */
html.sg-modern .modal-footer .btn-danger[data-dismiss="modal"] { background: var(--sg-surface) !important; border: 1px solid var(--sg-border-strong) !important; color: var(--sg-text-2) !important; }
html.sg-modern .modal-footer .btn-danger[data-dismiss="modal"]:hover { background: var(--sg-surface-2) !important; color: var(--sg-text) !important; }

/* "Success" buttons join the emerald primary family (no cyan beside emerald). */
html.sg-modern .btn-success { background: var(--sg-primary) !important; border-color: var(--sg-primary) !important; color: #fff !important; }
html.sg-modern .btn-success:hover,
html.sg-modern .btn-success:active,
html.sg-modern .btn-success.active { background: var(--sg-primary-600) !important; border-color: var(--sg-primary-600) !important; color: #fff !important; }

/* Tour and alert buttons use the app's font and primary color. */
html.sg-modern .hopscotch-bubble .hopscotch-nav-button.next { background: var(--sg-primary) !important; border-color: var(--sg-primary) !important; color: #fff !important; }
html.sg-modern .swal2-popup,
html.sg-modern .swal2-styled { font-family: var(--sg-font) !important; }
html.sg-modern .swal2-styled { border-radius: 8px !important; font-weight: 600 !important; }

/* Phone menu icon at a tappable size; status badges centered beside page titles. */
html.sg-modern .sg-nav-toggle i { font-size: 24px; }
html.sg-modern .page-titles h1 .label,
html.sg-modern .page-titles h1 .badge { vertical-align: middle; position: relative; top: -2px; }
/* Switches never wrap or shrink (card-mode cells allow wrapping, which squeezed the knob). */
html.sg-modern .bootstrap-switch,
html.sg-modern .bootstrap-switch * { white-space: nowrap !important; overflow-wrap: normal !important; }
html.sg-modern .bootstrap-switch { flex: 0 0 auto; max-width: none !important; }
/* Switch segments keep their measured widths instead of shrinking like table cells in a narrow
   column (which the plugin then measured and baked in). */
html.sg-modern .bootstrap-switch .bootstrap-switch-container { display: flex !important; }
html.sg-modern .bootstrap-switch .bootstrap-switch-container > span,
html.sg-modern .bootstrap-switch .bootstrap-switch-container > label { display: block !important; flex: 0 0 auto; }
html.sg-modern .bootstrap-switch .bootstrap-switch-container > input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
html.sg-modern .table:not(.sg-cards) td img { width: 96px; height: 64px; max-height: none; }

/* Explicit native tax choices: the legacy theme hides unstyled checkbox inputs. */
html input.sg-tax-checkbox[type="checkbox"] {
  position: static !important;
  left: auto !important;
  opacity: 1 !important;
  appearance: auto;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}
html input.sg-tax-checkbox[type="checkbox"] + label {
  padding-left: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
html input.sg-tax-checkbox[type="checkbox"] + label::before,
html input.sg-tax-checkbox[type="checkbox"] + label::after {
  display: none !important;
}
