/* ============================================
   SaccoWorks – Layout Compatibility Layer
   Sidebar, Header, Main layout + Menu styles
   (site.css handles Tailwind utilities + components)
   ============================================ */

/* ── CSS Custom Properties for layout shell ── */
:root {
    --kt-sidebar-width: 264px;
    --kt-sidebar-collapsed-width: 78px;
    --kt-header-height: 60px;
    --sw-primary: #3b82f6;
    --sw-primary-dark: #2563eb;
    --sw-bg: #f8fafc;
    --sw-surface: #ffffff;
    --sw-border: #e2e8f0;
    --sw-text: #1e293b;
    --sw-text-muted: #64748b;
    --sw-danger: #dc2626;
    --sw-success: #059669;
    --sw-warning: #d97706;
    --sw-font: 'Inter', system-ui, -apple-system, sans-serif;
}

html.dark {
    --sw-bg: #0f172a;
    --sw-surface: #1e293b;
    --sw-border: #334155;
    --sw-text: #e2e8f0;
    --sw-text-muted: #94a3b8;
    color-scheme: dark;
}

/* ============================================
   LAYOUT: Sidebar + Header + Main
   ============================================ */

.kt-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: var(--kt-sidebar-width);
    display: flex;
    flex-direction: column;
    z-index: 20;
    background: var(--sw-surface);
    border-right: 1px solid var(--sw-border);
    transition: width 0.3s ease;
    overflow: hidden;
}

/* Sidebar collapse */
body.kt-sidebar-collapse .kt-sidebar { width: var(--kt-sidebar-collapsed-width); }
body.kt-sidebar-collapse .kt-sidebar .kt-sidebar-logo a img { max-width: 30px; }
body.kt-sidebar-collapse .kt-sidebar .kt-menu-title,
body.kt-sidebar-collapse .kt-sidebar .kt-menu-arrow,
body.kt-sidebar-collapse .kt-sidebar .kt-menu-heading,
body.kt-sidebar-collapse .kt-sidebar .kt-menu-bullet,
body.kt-sidebar-collapse .kt-sidebar #sidebarSearch,
body.kt-sidebar-collapse .kt-sidebar .kt-sidebar-header a span { display: none !important; }
body.kt-sidebar-collapse .kt-sidebar .kt-menu-icon { margin: 0 auto; }

/* Mobile sidebar */
@media (max-width: 1023px) {
    .kt-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    body.mobile-sidebar-open .kt-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }
    body.mobile-sidebar-open .sidebar-overlay { display: block; }
}

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

/* Sidebar header */
.kt-sidebar-header {
    display: flex; align-items: center;
    padding: 0 16px;
    height: var(--kt-header-height);
    border-bottom: 1px solid var(--sw-border);
    flex-shrink: 0;
}
.kt-sidebar-logo { min-width: 0; }
.kt-sidebar-logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.kt-sidebar-logo a img { height: 28px; width: auto; border-radius: 4px; }

/* Collapse toggle */
#sidebar_toggle {
    position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px solid var(--sw-border); background: var(--sw-surface);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 40; font-size: 12px; color: var(--sw-text-muted);
    transition: all 0.15s ease;
}
#sidebar_toggle:hover { background: var(--sw-bg); }
@media (max-width: 1023px) { #sidebar_toggle { display: none; } }

/* Sidebar scrollable content */
.kt-sidebar-content {
    flex: 1; overflow-y: auto;
    padding: 16px 8px 16px 0;
}
.kt-sidebar-content::-webkit-scrollbar { width: 4px; }
.kt-sidebar-content::-webkit-scrollbar-thumb { background: var(--sw-border); border-radius: 4px; }
#sidebar_scrollable { padding: 0 8px 0 16px; width: 100%; }

/* Sidebar search */
#sidebarSearch {
    width: 100%; padding: 8px 12px 8px 34px; font-size: 13px;
    border-radius: 8px; border: 1px solid var(--sw-border);
    background: var(--sw-bg); color: var(--sw-text); outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#sidebarSearch:focus {
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Header ── */
header#header, header[id="header"] {
    position: fixed; top: 0; right: 0;
    left: var(--kt-sidebar-width);
    height: var(--kt-header-height);
    display: flex; align-items: center;
    z-index: 10; background: var(--sw-surface);
    border-bottom: 1px solid var(--sw-border);
    padding: 0 20px;
    transition: left 0.3s ease;
}
body.kt-sidebar-collapse header#header,
body.kt-sidebar-collapse header[id="header"] { left: var(--kt-sidebar-collapsed-width); }
@media (max-width: 1023px) {
    header#header, header[id="header"] { left: 0; }
}

/* ── Main content ── */
main {
    margin-left: var(--kt-sidebar-width);
    padding-top: var(--kt-header-height);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}
body.kt-sidebar-collapse main { margin-left: var(--kt-sidebar-collapsed-width); }
@media (max-width: 1023px) { main { margin-left: 0; } }

/* ============================================
   SIDEBAR MENU
   ============================================ */

.kt-menu { display: flex; flex-direction: column; gap: 2px; }

.kt-menu-heading {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--sw-text-muted); padding: 16px 10px 6px;
}

.kt-menu-item { position: relative; }

.kt-menu-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 6px;
    color: var(--sw-text); font-size: 13px;
    cursor: pointer; text-decoration: none; line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}
.kt-menu-link:hover {
    background: rgba(59, 130, 246, 0.06);
    color: var(--sw-primary);
    text-decoration: none;
}

.kt-menu-icon {
    display: flex; align-items: center; justify-content: center;
    width: 20px; flex-shrink: 0; color: var(--sw-text-muted);
}
.kt-menu-icon i { font-size: 17px; }

.kt-menu-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; }

.kt-menu-arrow {
    display: flex; align-items: center;
    color: var(--sw-text-muted); font-size: 10px;
    transition: transform 0.2s ease;
}

/* Accordion */
.kt-menu-accordion {
    display: none; flex-direction: column; gap: 1px;
    padding-left: 10px; margin-left: 20px;
    border-left: 1px solid var(--sw-border);
}
.kt-menu-item-show > .kt-menu-accordion,
.kt-menu-item.show > .kt-menu-accordion { display: flex; }

/* Arrow rotation */
.kt-menu-item-show > .kt-menu-link .kt-menu-arrow,
.kt-menu-item.show > .kt-menu-link .kt-menu-arrow { transform: rotate(90deg); }

/* Arrow plus/minus toggle */
.arrow-plus { display: inline; font-size: 10px; }
.arrow-minus { display: none; font-size: 10px; }
.kt-menu-item-show > .kt-menu-link .arrow-plus { display: none; }
.kt-menu-item-show > .kt-menu-link .arrow-minus { display: inline; }

/* Active module highlight */
.kt-menu-item-here > .kt-menu-link { background: rgba(59, 130, 246, 0.08); }
.kt-menu-item-here > .kt-menu-link .kt-menu-icon,
.kt-menu-item-here > .kt-menu-link .kt-menu-title { color: var(--sw-primary); }

/* Sub-items */
.kt-menu-accordion .kt-menu-link { padding: 6px 10px; font-size: 13px; font-weight: 400; }

/* Bullet dot */
.kt-menu-bullet { display: flex; align-items: center; justify-content: center; width: 20px; flex-shrink: 0; }
.bullet-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--sw-text-muted); transition: background 0.15s ease; }

/* Active sub-item */
.kt-menu-item-active > .kt-menu-link { color: var(--sw-primary); font-weight: 600; }
.kt-menu-item-active > .kt-menu-link .bullet-dot { background: var(--sw-primary); width: 6px; height: 6px; }
.kt-menu-item-active > .kt-menu-link .kt-menu-title { color: var(--sw-primary); font-weight: 600; }

/* Sub-module dividers */
.hover-submenu-divider { border: none; border-top: 1px solid var(--sw-border); margin: 4px 10px; }
.hover-submenu-title { font-size: 11px; font-weight: 600; color: var(--sw-text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px 4px; }

/* ============================================
   HEADER COMPONENTS
   ============================================ */

.kt-btn-icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: none; background: transparent;
    color: var(--sw-text-muted); cursor: pointer;
    transition: background 0.15s ease;
}
.kt-btn-icon:hover { background: rgba(0, 0, 0, 0.05); }

/* Dropdowns */
#profileDropdown, #smsTopupPopup {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: var(--sw-surface); border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--sw-border); z-index: 50; min-width: 220px;
}

/* Mobile menu button */
button[data-kt-drawer-toggle] {
    width: 36px; height: 36px;
    display: none; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--sw-border);
    background: transparent; color: var(--sw-text-muted); cursor: pointer;
}
@media (max-width: 1023px) { button[data-kt-drawer-toggle] { display: inline-flex; } }

/* Hide mobile text */
@media (max-width: 767px) { .hide-mobile { display: none !important; } }

/* SMS banner */
#smsUrgentBanner {
    display: none; position: fixed;
    top: var(--kt-header-height); left: var(--kt-sidebar-width); right: 0;
    z-index: 9; background: var(--sw-danger); color: #fff;
    text-align: center; font-size: 13px; font-weight: 600; padding: 10px 16px; cursor: pointer;
}
#smsUrgentBanner.show { display: block; }
@media (max-width: 1023px) { #smsUrgentBanner { left: 0; } }

/* Notification modal */
#notificationOverlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); z-index: 9998;
}
#notificationOverlay.show { display: block; }

#notificationModal {
    position: fixed; top: 0; right: 0;
    width: 460px; max-width: 95vw; height: 100%;
    background: var(--sw-surface);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 9999; transform: translateX(100%);
    transition: transform 0.3s ease;
}
#notificationModal.show { transform: translateX(0); }

.notification-dot {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--sw-danger); border: 2px solid var(--sw-surface);
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb-wrapper { font-size: 13px; }
.breadcrumb-wrapper a, .bc-link {
    color: var(--sw-text-muted); font-size: 13px;
    transition: color 0.15s ease; text-decoration: none;
}
.breadcrumb-wrapper a:hover, .bc-link:hover { color: var(--sw-primary); text-decoration: none; }
.bc-link i { font-size: 13px; }
.bc-sep { color: var(--sw-text-muted); opacity: 0.5; padding: 0 4px; font-size: 9px; }
.bc-sep i { font-size: 9px; }
.bc-module { color: var(--sw-text-muted); font-size: 13px; }
.bc-current { color: var(--sw-text); font-weight: 500; font-size: 13px; }

/* ============================================
   DARK MODE (layout-specific overrides)
   ============================================ */

html.dark .kt-sidebar { background: #1e293b; border-color: #334155; }
html.dark header#header, html.dark header[id="header"] { background: #1e293b; border-color: #334155; }
html.dark #profileDropdown, html.dark #smsTopupPopup { background: #1e293b; border-color: #334155; }
html.dark #notificationModal { background: #1e293b; }
html.dark #sidebarSearch { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .kt-menu-link:hover { background: rgba(59, 130, 246, 0.1); }

/* ============================================
   PRINT
   ============================================ */

@media print {
    .kt-sidebar, header, #header, #mainSidebar,
    .notification-dot, #smsUrgentBanner,
    #notificationModal, #notificationOverlay,
    button[data-kt-drawer-toggle],
    #sidebar_toggle { display: none !important; }
    main { margin-left: 0 !important; padding-top: 0 !important; }
}

/* ============================================
   GLOBAL COMPONENTS
   Form inputs, buttons, tables, badges, cards
   Loaded via Modern.master — applies sitewide
   ============================================ */

/* ── Labels ── */
label, .form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
    font-family: var(--sw-font);
}

/* ── Inputs & Selects ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select,
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.48rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--sw-text, #1e293b);
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 0.45rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    font-family: var(--sw-font);
    line-height: 1.5;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    border-color: #004a99;
    box-shadow: 0 0 0 3px rgba(0,74,153,0.12);
}
/* Restore natural size for checkboxes/radios */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    display: inline-block;
    padding: 0;
    border: none;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}
input::placeholder, textarea::placeholder { color: #9ca3af; font-weight: 400; }
input[disabled], select[disabled], textarea[disabled],
.form-control[disabled], .form-control[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}
textarea.form-control { min-height: 90px; resize: vertical; }
/* Select arrow */
select, .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.48rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.45rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.18s;
    font-family: var(--sw-font);
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}
.btn-primary   { background: #004a99; color: #fff !important; border-color: #004a99; }
.btn-primary:hover { background: #003d80; border-color: #003d80; }
.btn-success   { background: #059669; color: #fff !important; border-color: #059669; }
.btn-success:hover { background: #047857; border-color: #047857; }
.btn-danger    { background: #dc2626; color: #fff !important; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-warning   { background: #d97706; color: #fff !important; border-color: #d97706; }
.btn-warning:hover { background: #b45309; border-color: #b45309; }
.btn-secondary { background: #f8fafc; color: #374151 !important; border-color: #d1d5db; }
.btn-secondary:hover { background: #f1f5f9; }
.btn-outline-secondary { background: #fff; color: #374151 !important; border-color: #d1d5db; }
.btn-outline-secondary:hover { background: #f8fafc; }
.btn-outline-primary { background: #fff; color: #004a99 !important; border-color: #004a99; }
.btn-outline-primary:hover { background: #eff6ff; }
.btn-sm  { padding: 0.28rem 0.7rem; font-size: 0.78rem; }
.btn-lg  { padding: 0.62rem 1.5rem; font-size: 0.95rem; }

/* ── Tables / GridViews ── */
.table-wrap {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    margin-bottom: 1rem;
}
table.table,
.table-wrap > table,
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-family: var(--sw-font);
    margin: 0;
}
table.table th,
.table-wrap > table th,
table.data-table th {
    background: #f8fafc;
    padding: 0.6rem 0.85rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
table.table td,
.table-wrap > table td,
table.data-table td {
    padding: 0.58rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    vertical-align: middle;
}
table.table tbody tr:hover,
.table-wrap > table tbody tr:hover,
table.data-table tbody tr:hover { background: #f8fafc; }
table.table tbody tr:last-child td,
.table-wrap > table tbody tr:last-child td,
table.data-table tbody tr:last-child td { border-bottom: none; }
/* Alternating rows (table-striped) */
table.table-striped tbody tr:nth-child(even) { background: #fafbfc; }
/* Compact variant */
table.table-sm th, table.table-sm td { padding: 0.35rem 0.65rem; }
/* Numeric column alignment */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-cyan   { background: #cffafe; color: #155e75; }

/* ── Cards ── */
.card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-body { padding: 1.5rem; }
.card-header {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    font-size: 0.875rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border-radius: 0.75rem 0.75rem 0 0;
}
.card-footer {
    padding: 0.9rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fff5f5; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Validation errors ── */
.text-danger, span.field-validation-error { color: #dc2626 !important; font-size: 0.75rem; }
.text-success { color: #059669 !important; }
.text-muted   { color: #6b7280 !important; font-size: 0.8rem; }

/* ── Layout helpers (Bootstrap-compatible) ── */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.d-grid { display: grid !important; }
.align-items-center { align-items: center !important; }
.align-items-start  { align-items: flex-start !important; }
.align-items-end    { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.flex-wrap    { flex-wrap: wrap !important; }
.flex-column  { flex-direction: column !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.p-0 { padding: 0 !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.small, .text-sm { font-size: 0.8rem !important; }
.w-100 { width: 100% !important; }
/* Bootstrap-compatible grid (basic 12-col at md breakpoint) */
.row { display: flex; flex-wrap: wrap; margin-left: -0.5rem; margin-right: -0.5rem; }
.row.g-2 { gap: 0.5rem; margin: 0; }
.row.g-3 { gap: 0.75rem; margin: 0; }
.row.g-4 { gap: 1rem; margin: 0; }
.col-md-6 { flex: 0 0 calc(50% - 0.75rem); max-width: calc(50% - 0.75rem); padding: 0; }
.col-md-4 { flex: 0 0 calc(33.333% - 0.75rem); max-width: calc(33.333% - 0.75rem); padding: 0; }
.col-md-8 { flex: 0 0 calc(66.666% - 0.75rem); max-width: calc(66.666% - 0.75rem); padding: 0; }
.col-md-3 { flex: 0 0 calc(25% - 0.75rem); max-width: calc(25% - 0.75rem); padding: 0; }
.col-md-9 { flex: 0 0 calc(75% - 0.75rem); max-width: calc(75% - 0.75rem); padding: 0; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; padding: 0; }
/* lg breakpoints */
.col-lg-8 { flex: 0 0 calc(66.666% - 0.75rem); max-width: calc(66.666% - 0.75rem); padding: 0; }
.col-lg-4 { flex: 0 0 calc(33.333% - 0.75rem); max-width: calc(33.333% - 0.75rem); padding: 0; }
@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9,
    .col-lg-4, .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Telerik Control Overrides ──────────────────────────────────────────────
   Prevent Tailwind preflight (site.css) and global input resets from
   breaking Telerik RadDatePicker, RadTabStrip, and RadGrid.
   Must come AFTER all other rules above (loaded last in Modern.master).
   ────────────────────────────────────────────────────────────────────────── */

/* RadDateInput text box — undo block/full-width imposed by global input rule */
.RadInput input[type="text"],
.RadDateInput input[type="text"],
.RadInput_Default input[type="text"],
.RadDateInput_Default input[type="text"] {
    display: inline-block !important;
    width: auto !important;
    -webkit-appearance: none !important;
}

/* RadPicker outer wrapper — keep it inline-table so the date+button sit on one row */
.RadPicker,
.RadPicker_Default {
    display: inline-table !important;
}

/* Calendar popup cell + trigger — hide the "Open the calendar popup." text.
   Telerik 2015 Bootstrap skin renders the trigger as <a>, not <input type="button">.
   Setting font-size:0 on the container hides text for ANY child element (a, input, span).
   Do NOT override background — Telerik skin sets the calendar icon as a sprite. */
td.rcCalPopup,
.rcCalPopup {
    display: inline-block !important;
    width: auto !important;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle !important;
    overflow: hidden !important;
}
td.rcCalPopup a,
td.rcCalPopup input,
.rcCalPopup a,
.rcCalPopup input {
    display: inline-block !important;
    font-size: 0 !important;
    color: transparent !important;
    overflow: hidden !important;
    cursor: pointer !important;
    vertical-align: middle !important;
}

/* ── Telerik RadTabStrip — pill-button style matching Configuration page tabs ─
   Tailwind preflight resets a{color:inherit} and *{border:0} which wipes all
   tab styling. We restore horizontal pill tabs with !important so it wins
   over both Tailwind and Telerik's embedded WebResource CSS.
   KEY: rtsLI must be inline-block (not block) to flow horizontally.
   ────────────────────────────────────────────────────────────────────────── */
.RadTabStrip .rtsLevel,
.RadTabStrip ul.rtsLevel {
    list-style: none !important;
    margin: 0 0 0 0 !important;
    padding: 6px 10px 0 10px !important;
    background: #f8fafc !important;
    border-radius: 10px 10px 0 0 !important;
    border: none !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    display: block !important;
}
.RadTabStrip .rtsLI,
.RadTabStrip li.rtsLI {
    display: inline-block !important;
    margin: 0 3px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    vertical-align: bottom !important;
}
.RadTabStrip a.rtsLink,
.RadTabStrip span.rtsLink {
    display: inline-block !important;
    padding: 9px 14px !important;
    border-radius: 8px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    border: none !important;
    background-color: transparent !important;
    line-height: 1.5 !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}
.RadTabStrip .rtsSelected > a.rtsLink,
.RadTabStrip a.rtsLink.rtsSelected,
.RadTabStrip .rtsSelected > span.rtsLink {
    background-color: #2563eb !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37,99,235,.22) !important;
}
.RadTabStrip .rtsHover > a.rtsLink,
.RadTabStrip a.rtsLink:hover,
.RadTabStrip span.rtsLink:hover {
    background-color: #e2e8f0 !important;
    color: #1e3a8a !important;
}
.RadTabStrip .rtsDisabled > a.rtsLink {
    color: #94a3b8 !important;
    pointer-events: none !important;
}
/* Tab content panels */
.rmpPageView {
    border: 1px solid #e2e8f0 !important;
    border-radius: 0 0 8px 8px !important;
    padding: 16px !important;
    background: #fff !important;
}

/* ── Telerik RadGrid ─────────────────────────────────────────────────────────
   Prevent Tailwind/compat table resets from overriding Telerik skin.
   ────────────────────────────────────────────────────────────────────────── */
.RadGrid table,
.RadGrid th,
.RadGrid td {
    font-family: var(--sw-font);
    font-size: 13px;
}
.RadGrid .rgMasterTable {
    width: 100%;
    border-collapse: collapse;
}
.RadGrid .rgHeader {
    white-space: nowrap;
}

/* Select2 within grids/filters */
.select2-container { width: 100% !important; }
