/* Legacy browser fallback for Windows 7-era browsers (especially IE11). */
html.legacy-browser, html.legacy-browser body { margin:0; font-family:Arial,Helvetica,sans-serif; color:#1e293b; background:#f8fafc; }
html.legacy-browser * { box-sizing:border-box; }
html.legacy-browser a { color:inherit; }
html.legacy-browser button, html.legacy-browser input, html.legacy-browser select, html.legacy-browser textarea { font:inherit; }
html.legacy-browser input, html.legacy-browser select, html.legacy-browser textarea { max-width:100%; border:1px solid #cbd5e1; padding:8px; background:#fff; }
html.legacy-browser button { cursor:pointer; padding:8px 12px; border:1px solid #cbd5e1; background:#fff; }
html.legacy-browser table { width:100%; border-collapse:collapse; }
html.legacy-browser th, html.legacy-browser td { padding:8px; border:1px solid #e2e8f0; text-align:left; }
html.legacy-browser img, html.legacy-browser svg { max-width:100%; }
html.legacy-browser aside { position:fixed; top:0; bottom:0; left:0; width:286px; overflow:auto; background:#020617; color:#fff; z-index:50; }
html.legacy-browser aside a { display:block; padding:10px 12px; color:#cbd5e1; text-decoration:none; }
html.legacy-browser aside a:hover { background:#1e293b; color:#fff; }
html.legacy-browser aside details { margin:10px 0; }
html.legacy-browser aside details > summary { display:block; padding:10px 12px; color:#94a3b8; background:#0f172a; cursor:pointer; }
html.legacy-browser aside details > div { padding-left:8px; }
html.legacy-browser header { position:relative; z-index:30; padding:14px; background:#fff; border-bottom:1px solid #e2e8f0; }
html.legacy-browser .min-h-screen { min-height:100vh; }
html.legacy-browser .erapor-page-content { padding:18px; max-width:1680px; margin:0 auto; }
html.legacy-browser .hidden { display:none !important; }
html.legacy-browser .flex { display:block; }
html.legacy-browser .inline-flex { display:inline-block; }
html.legacy-browser .grid { display:block; }
html.legacy-browser .overflow-x-auto { overflow-x:auto; }
html.legacy-browser .rounded, html.legacy-browser [class*="rounded-"] { border-radius:4px; }
html.legacy-browser [class*="bg-white"], html.legacy-browser [class*="bg-slate-50"], html.legacy-browser [class*="bg-slate-100"] { background:#fff; }
html.legacy-browser [class*="border"] { border-color:#e2e8f0; }
html.legacy-browser .text-white { color:#fff; }
html.legacy-browser aside .text-slate-300, html.legacy-browser aside .text-slate-400 { color:#cbd5e1; }
html.legacy-browser .text-center { text-align:center; }
html.legacy-browser .text-right { text-align:right; }
html.legacy-browser .font-bold, html.legacy-browser .font-semibold { font-weight:bold; }
html.legacy-browser .w-full { width:100%; }
html.legacy-browser .mx-auto { margin-left:auto; margin-right:auto; }
html.legacy-browser .p-4, html.legacy-browser .p-5 { padding:16px; }
html.legacy-browser .px-3, html.legacy-browser .px-4 { padding-left:12px; padding-right:12px; }
html.legacy-browser .py-2, html.legacy-browser .py-3 { padding-top:8px; padding-bottom:8px; }
html.legacy-browser .mb-4 { margin-bottom:16px; }
html.legacy-browser .mt-4 { margin-top:16px; }
html.legacy-browser .space-y-1 > * + *, html.legacy-browser .space-y-2 > * + *, html.legacy-browser .space-y-3 > * + * { margin-top:8px; }
html.legacy-browser .peer-checked\:block { display:none; }
html.legacy-browser #sidebar-toggle:checked ~ aside { transform:translateX(0); }
/* PATCH-140: removed overly broad sibling selector */
html.legacy-browser .backdrop-blur-sm, html.legacy-browser .backdrop-blur-xl { background:#fff; }
html.legacy-browser .erapor-card, html.legacy-browser .erapor-login-card { background:#fff; border:1px solid #e2e8f0; padding:16px; }
html.legacy-browser .erapor-btn { display:inline-block; padding:9px 14px; border:1px solid #cbd5e1; text-decoration:none; }
html.legacy-browser .erapor-btn-primary { background:#0f766e; color:#fff; }
html.legacy-browser .erapor-alert { padding:12px; margin:10px 0; border:1px solid #cbd5e1; }
@media screen and (min-width:768px) {
 html.legacy-browser .md\\:pl-\\[286px\\] { margin-left:286px; }
 html.legacy-browser .md\\:hidden { display:none !important; }
 html.legacy-browser .md\\:block { display:block !important; }
}
@media screen and (max-width:767px) {
 html.legacy-browser aside { transform:translateX(-100%); }
 html.legacy-browser #sidebar-toggle:checked ~ aside { transform:translateX(0); }
 html.legacy-browser .erapor-page-content { padding:12px; }
}

html.legacy-browser #sidebar-toggle { position:absolute; left:-9999px; }
html.legacy-browser #sidebar-toggle:checked ~ aside { left:0; transform:none; }
/* PATCH-140: overlay controlled exclusively by scoped selector below */
html.legacy-browser .fixed.inset-0 { position:fixed; top:0; right:0; bottom:0; left:0; }
html.legacy-browser .fixed.inset-y-0 { position:fixed; top:0; bottom:0; }
html.legacy-browser .absolute { position:absolute; }
html.legacy-browser .relative { position:relative; }
html.legacy-browser .block { display:block; }
html.legacy-browser .inline-block { display:inline-block; }
html.legacy-browser .w-64 { width:256px; }
html.legacy-browser .w-\\[286px\\] { width:286px; }
html.legacy-browser .text-sm { font-size:14px; }
html.legacy-browser .text-xs { font-size:12px; }
html.legacy-browser .text-lg { font-size:18px; }
html.legacy-browser .text-xl, html.legacy-browser .text-2xl { font-size:22px; }
html.legacy-browser .font-medium { font-weight:500; }
html.legacy-browser .border-b { border-bottom:1px solid #e2e8f0; }
html.legacy-browser .border-t { border-top:1px solid #e2e8f0; }
html.legacy-browser .shadow-sm, html.legacy-browser .shadow-lg, html.legacy-browser .shadow-xl, html.legacy-browser .shadow-2xl { box-shadow:0 2px 8px rgba(0,0,0,.08); }
html.legacy-browser .text-blue-600 { color:#2563eb; }
html.legacy-browser .text-emerald-700 { color:#047857; }
html.legacy-browser .bg-blue-600 { background:#2563eb; }
html.legacy-browser .bg-slate-900, html.legacy-browser .bg-slate-950 { background:#0f172a; }
html.legacy-browser .bg-emerald-600 { background:#059669; }
html.legacy-browser .text-slate-900 { color:#0f172a; }
html.legacy-browser .text-slate-600 { color:#475569; }
html.legacy-browser .text-slate-500 { color:#64748b; }
html.legacy-browser .text-red-600 { color:#dc2626; }
html.legacy-browser .overflow-hidden { overflow:hidden; }
html.legacy-browser .overflow-y-auto { overflow-y:auto; }
html.legacy-browser .truncate { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
html.legacy-browser .max-w-full { max-width:100%; }
html.legacy-browser form { margin-bottom:12px; }
html.legacy-browser label { display:inline-block; margin-bottom:4px; }
html.legacy-browser input[type=checkbox], html.legacy-browser input[type=radio] { width:auto; }
html.legacy-browser details:not([open]) > *:not(summary) { display:none; }


/* Master table toolbar fallback */
.master-table-toolbar{display:block;padding:12px;border:1px solid #e2e8f0;border-bottom:0;background:#fff;overflow:hidden}
.master-search-wrap{display:inline-block;vertical-align:middle;margin-right:12px}
.master-search-wrap input{width:280px;max-width:100%;padding:8px 10px;border:1px solid #cbd5e1;border-radius:6px}
.master-search-wrap button{padding:4px 8px;margin-left:-34px;border:0;background:transparent;color:#64748b}
.master-table-controls{display:inline-block;vertical-align:middle}
.master-table-controls select,.master-table-controls button{padding:7px 10px;border:1px solid #cbd5e1;border-radius:6px;background:#fff}
.master-table-controls button{margin-left:10px;background:#ecfdf5;border-color:#a7f3d0;color:#047857;font-weight:bold;cursor:pointer}
.master-table-pager{padding:10px 12px;border:1px solid #e2e8f0;border-top:0;background:#fff;color:#64748b;font-size:13px;overflow:hidden}
.master-pager-buttons{float:right}.master-pager-buttons button{margin-left:4px;padding:4px 9px;border:1px solid #cbd5e1;background:#fff;border-radius:5px}.master-pager-buttons button.active{background:#0f766e;color:#fff}
@media screen and (max-width:767px){.master-search-wrap{display:block;margin:0 0 8px}.master-search-wrap input{width:100%}.master-table-controls{display:block}.master-pager-buttons{float:none;margin-top:8px}}
html.legacy-browser .master-table-toolbar,html.legacy-browser .master-table-pager{font-family:Arial,Helvetica,sans-serif}
html.legacy-browser .master-table-toolbar input,html.legacy-browser .master-table-toolbar select{background:#fff;color:#1e293b}

/* PATCH-135: only legacy mode; modern browsers remain unchanged. */
@media screen and (min-width:768px) {
 html.legacy-browser aside {left:0!important;transform:none!important;display:block!important;}
 html.legacy-browser .min-h-screen.md\:pl-\[286px\] {margin-left:286px!important;}
 html.legacy-browser header label[for="sidebar-toggle"] {display:none!important;}
 html.legacy-browser .fixed.inset-0.z-40 {display:none!important;}
}
@media screen and (max-width:767px) {
 html.legacy-browser aside {left:-286px!important;transform:none!important;}
 html.legacy-browser.legacy-sidebar-open aside {left:0!important;}
 html.legacy-browser.legacy-sidebar-open .fixed.inset-0.z-40 {display:block!important;}
 html.legacy-browser:not(.legacy-sidebar-open) .fixed.inset-0.z-40 {display:none!important;}
}
/* When native details is unavailable, JS controls visibility explicitly. */
html.legacy-browser details[data-legacy-details="1"] > * {display:block;}
html.legacy-browser details[data-legacy-details="1"][data-legacy-open="0"] > *:not(summary) {display:none!important;}
html.legacy-browser details[data-legacy-details="1"][data-legacy-open="1"] > *:not(summary) {display:block!important;}

/* PATCH-137: Chrome 109 desktop structure. Scoped to legacy mode only. */
@media (min-width:768px) {
 html.legacy-browser body > input#sidebar-toggle + div + aside {display:flex!important;flex-direction:column!important;width:286px!important;left:0!important;top:0!important;bottom:0!important;transform:none!important;}
 html.legacy-browser body > .min-h-screen {margin-left:286px!important;min-width:0!important;}
 html.legacy-browser body > .min-h-screen > header label[for="sidebar-toggle"] {display:none!important;}
 html.legacy-browser .md\:block {display:block!important;}
 html.legacy-browser .md\:hidden {display:none!important;}
}
html.legacy-browser aside .flex {display:flex;align-items:center;gap:10px;}
html.legacy-browser aside .flex-col {flex-direction:column;align-items:stretch;}
html.legacy-browser aside a.flex {display:flex!important;align-items:center;gap:12px;}
html.legacy-browser header.flex {display:flex;align-items:center;justify-content:space-between;}
html.legacy-browser header .flex {display:flex;align-items:center;gap:12px;}
html.legacy-browser .grid {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;}
@media(min-width:640px){html.legacy-browser .sm\:grid-cols-2 {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(min-width:1280px){html.legacy-browser .xl\:grid-cols-4 {grid-template-columns:repeat(4,minmax(0,1fr));}}
html.legacy-browser .dashboard-card {background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:20px;min-width:0;}
html.legacy-browser .dashboard-card-content {display:flex!important;justify-content:space-between;align-items:flex-start;gap:12px;}
html.legacy-browser .dashboard-card-icon {display:flex!important;align-items:center;justify-content:center;min-width:52px;min-height:52px;}
html.legacy-browser .dashboard-card-icon svg {width:23px;height:23px;}
html.legacy-browser .erapor-page-content {width:100%;max-width:1680px;}
html.legacy-browser .erapor-page-content .flex {display:flex;gap:10px;}
html.legacy-browser .erapor-page-content .flex-col {flex-direction:column;}
html.legacy-browser .erapor-page-content .justify-between {justify-content:space-between;}
html.legacy-browser .erapor-page-content .items-center {align-items:center;}
html.legacy-browser .erapor-page-content .items-start {align-items:flex-start;}
html.legacy-browser .erapor-page-content .hidden {display:none!important;}
@media(min-width:768px){html.legacy-browser .erapor-page-content .md\:block {display:block!important;}}
html.legacy-browser aside .hidden {display:none!important;}
html.legacy-browser aside details[open] > div {display:block;}
html.legacy-browser aside details:not([open]) > div {display:none;}

/* PATCH-138: visible, accessible menu control in legacy browsers regardless of viewport. */
html.legacy-browser #legacy-menu-button {display:inline-flex!important;align-items:center;gap:8px;position:relative;z-index:60;padding:10px 14px;border:1px solid #94a3b8;border-radius:10px;background:#fff;color:#0f172a;font-weight:700;cursor:pointer;}
html.legacy-browser #legacy-menu-button svg {width:20px;height:20px;flex-shrink:0;}
html.legacy-browser header label[for="sidebar-toggle"] {display:none!important;}
html.legacy-browser aside {visibility:visible;}
@media screen and (min-width:768px) {
 html.legacy-browser.legacy-sidebar-closed aside {left:-286px!important;transform:none!important;}
 html.legacy-browser.legacy-sidebar-closed body > .min-h-screen {margin-left:0!important;}
 html.legacy-browser.legacy-sidebar-closed .min-h-screen.md\:pl-\[286px\] {margin-left:0!important;}
}
@media screen and (max-width:767px) {
 html.legacy-browser.legacy-sidebar-open aside {left:0!important;transform:none!important;}
}

/* PATCH-139: sidebar content visibility; scoped exclusively to compatibility mode. */
html.legacy-browser #legacy-app-sidebar { display:flex!important; flex-direction:column!important; background-color:#020617!important; color:#e2e8f0!important; opacity:1!important; }
html.legacy-browser #legacy-app-sidebar > div { display:block!important; flex-shrink:0; }
html.legacy-browser #legacy-app-sidebar > div.overflow-y-auto { display:block!important; flex:1 1 auto!important; min-height:0; overflow-y:auto!important; visibility:visible!important; opacity:1!important; }
html.legacy-browser #legacy-app-sidebar a { display:flex!important; align-items:center!important; color:#cbd5e1!important; visibility:visible!important; opacity:1!important; text-decoration:none; }
html.legacy-browser #legacy-app-sidebar a.bg-blue-600 { background-color:#2563eb!important; color:#fff!important; }
html.legacy-browser #legacy-app-sidebar summary { display:flex!important; align-items:center; justify-content:space-between; color:#cbd5e1!important; visibility:visible!important; opacity:1!important; }
html.legacy-browser #legacy-app-sidebar details[open] > div { display:block!important; }
html.legacy-browser #legacy-app-sidebar details:not([open]) > div { display:none!important; }
html.legacy-browser #legacy-app-sidebar .text-slate-500 { color:#94a3b8!important; }
html.legacy-browser #legacy-app-sidebar .text-white { color:#fff!important; }
html.legacy-browser #legacy-app-sidebar svg { width:20px; height:20px; flex-shrink:0; }
html.legacy-browser #legacy-app-sidebar .truncate { display:block; min-width:0; }

/* PATCH-140: isolate sidebar overlay and keep application content visible. */
html.legacy-browser body > div.min-h-screen { display:block!important; visibility:visible!important; opacity:1!important; }
html.legacy-browser body > div.min-h-screen > header,
html.legacy-browser body > div.min-h-screen > main { visibility:visible!important; opacity:1!important; }
html.legacy-browser body > input#sidebar-toggle + div.fixed.inset-0.z-40 { display:none!important; pointer-events:none!important; }
html.legacy-browser.legacy-sidebar-open body > input#sidebar-toggle + div.fixed.inset-0.z-40 { display:none!important; }
@media(max-width:767px){
 html.legacy-browser.legacy-sidebar-open body > input#sidebar-toggle + div.fixed.inset-0.z-40 {display:block!important;pointer-events:auto!important;background:rgba(2,6,23,.55)!important;}
}
html.legacy-browser #legacy-app-sidebar { z-index:50!important; }
html.legacy-browser #legacy-menu-button { z-index:60!important; }
