/* Navigation and workflow belong only to the modern presentation. */
.workspace-only { display:none; }
html[data-theme="modern"] .workspace-only { display:block; }
html[data-theme="modern"] .has-workspace { --workspace-rail:240px; --workspace-content-max:1440px; }
html[data-theme="modern"] .has-workspace > .topbar .nav { display:none; }
html[data-theme="modern"] .has-workspace > .topbar,
html[data-theme="modern"] .has-workspace > .container,
html[data-theme="modern"] .has-workspace > .footer { margin-left:var(--workspace-rail); }
/* Center within the remaining workspace, not within the entire viewport. */
html[data-theme="modern"] .has-workspace > .container {
    width:calc(100% - var(--workspace-rail));
    max-width:var(--workspace-content-max);
    margin-left:max(var(--workspace-rail), calc((100% + var(--workspace-rail) - var(--workspace-content-max)) / 2));
    margin-right:auto;
    padding:24px 28px 40px;
}
html[data-theme="modern"] .has-workspace .topbar-inner { max-width:none; min-height:76px; }
html[data-theme="modern"] .has-workspace .topbar .brand { font-size:14px; }
html[data-theme="modern"] .has-workspace .topbar .brand-mark { width:32px;height:32px;flex-basis:32px; }
html[data-theme="modern"] .has-workspace .topbar .brand-mark svg { width:26px;height:26px; }
html[data-theme="modern"] .theme-toggle { margin-left:auto; white-space:nowrap; }
html[data-theme="modern"] .workspace-sidebar { position:fixed;inset:0 auto 0 0;width:240px;z-index:30;background:#fff;border-right:1px solid #e6eaf2;padding:28px 16px 20px;overflow-y:auto; }
html[data-theme="modern"] .workspace-wordmark { display:flex;align-items:center;gap:10px;font-size:15px;line-height:1.5;overflow-wrap:anywhere; }
html[data-theme="modern"] .workspace-wordmark > span { display:grid;place-items:center;flex:0 0 34px;height:34px;border-radius:10px;background:#635bff;color:white;font-size:22px; }
html[data-theme="modern"] .workspace-caption { font-size:12px;color:#718096;margin:10px 0 28px; }
html[data-theme="modern"] .workspace-group { margin-bottom:24px; }
html[data-theme="modern"] .workspace-group-title { color:#758096;font-size:11px;letter-spacing:.03em;font-weight:700;margin:16px 10px 8px; }
html[data-theme="modern"] .workspace-group a,
html[data-theme="modern"] .workspace-mobile-menu nav a { display:flex;align-items:center;gap:12px;padding:12px 10px;margin:3px 0;border-radius:10px;font-size:13px;font-weight:600;color:#465168; }
html[data-theme="modern"] .workspace-group a > span { width:22px;text-align:center;font-size:19px; }
html[data-theme="modern"] .workspace-group a:hover,
html[data-theme="modern"] .workspace-mobile-menu a:hover { background:#f7f7ff; }
html[data-theme="modern"] .workspace-only a[aria-current="page"] { background:#eeedff;color:#5148d8;box-shadow:inset 3px 0 #635bff; }
html[data-theme="modern"] .workspace-account { border-top:1px solid #e6eaf2;padding:16px 10px;display:grid;gap:6px;font-size:12px;overflow-wrap:anywhere; }
html[data-theme="modern"] .workspace-account > span { color:#718096; }
html[data-theme="modern"] .workspace-account a { margin-top:8px;color:#667085; }
html[data-theme="modern"] .workspace-mobile-menu { display:none; }
html[data-theme="modern"] .workspace-skip { position:fixed;left:12px;top:-100px;background:#fff;padding:12px;z-index:1100; }
html[data-theme="modern"] .workspace-skip:focus { top:12px; }
html[data-theme="modern"] .workspace-context { margin-bottom:24px; }
html[data-theme="modern"] .workspace-breadcrumb { display:flex;flex-wrap:wrap;gap:8px;font-size:12px;color:#718096; }
html[data-theme="modern"] .workspace-breadcrumb a { color:#5148d8; }
html[data-theme="modern"] .workspace-context p { font-size:13px;color:#64748b;line-height:1.7;margin:12px 0; }
html[data-theme="modern"] .workspace-shortcuts { display:flex;gap:8px;flex-wrap:wrap; }
html[data-theme="modern"] .workspace-shortcuts a { display:flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid #dedbf9;border-radius:12px;background:white;color:#5148d8;font-size:13px;font-weight:700;min-height:44px; }
html[data-theme="modern"] .workspace-shortcuts a:hover { background:#eeedff; }
html[data-theme="modern"] .workspace-fold { margin:14px 0;border:1px solid #e6eaf2;border-radius:14px;background:#fff;min-width:0; }
html[data-theme="modern"] .workspace-fold > summary { padding:14px 16px;cursor:pointer;color:#465168;font-size:13px;font-weight:700;line-height:1.6; }
html[data-theme="modern"] .workspace-fold[open] > summary { border-bottom:1px solid #edf0f5; }
html[data-theme="modern"] .workspace-fold-body { padding:16px;min-width:0; }
html[data-theme="modern"] .workspace-filter-fold { grid-column:1/-1;margin:0;background:#fafbff; }
html[data-theme="modern"] .workspace-filter-fold .workspace-fold-body,
html[data-theme="modern"] .workspace-stats-fold .workspace-fold-body { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));gap:14px; }
html[data-theme="modern"] .workspace-filter-summary { display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:12px 0;font-size:12px;color:#64748b; }
html[data-theme="modern"] .workspace-filter-summary span { background:#eeefff;padding:5px 9px;border-radius:7px;color:#5148d8;overflow-wrap:anywhere; }
html[data-theme="modern"] .has-workspace .filter-bar { grid-template-columns:repeat(auto-fit,minmax(min(185px,100%),1fr));padding:0;border:0;box-shadow:none;background:transparent; }
html[data-theme="modern"] .has-workspace :is(.form-grid,.filter-bar,.csv-upload-grid) > * { min-width:0; }
html[data-theme="modern"] .has-workspace :is(.form-grid,.grid-cards) { grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); }
html[data-theme="modern"] .has-workspace :is(.link-table-wrap,.csv-panel,.csv-review-panel,.users-panel,.link-panel,.user-form-panel) { min-width:0;max-width:100%; }
html[data-theme="modern"] .has-workspace :is(input,select,textarea) { min-width:0;max-width:100%; }
html[data-theme="modern"] .has-workspace input:is([type="checkbox"],[type="radio"]) { min-height:0;box-shadow:none; }
html[data-theme="modern"] .has-workspace .stat-num { font-size:clamp(24px,2.2vw,34px);overflow-wrap:anywhere; }
html[data-theme="modern"] :is(.workspace-fold,.fx-calculator) .card { box-shadow:none; }
html[data-theme="modern"] .workspace-period-fold > .workspace-fold-body { padding:0; }
html[data-theme="modern"] .workspace-period-fold > .workspace-fold-body > .card { margin:0;border:0;background:transparent; }
html[data-theme="modern"] .workspace-fold .csv-history { margin:0;padding:0;border:0; }
html[data-theme="modern"] .has-workspace .fx-calculator { margin-top:24px; }
html[data-theme="modern"] :is(.workspace-only a,.workspace-only summary,.workspace-fold summary):focus-visible { outline:3px solid #8178ff;outline-offset:3px; }
html[data-theme="modern"] .has-workspace button:disabled { cursor:not-allowed;opacity:.55;transform:none; }
@media(max-width:1100px) {
    html[data-theme="modern"] .has-workspace { --workspace-rail:0px; }
    html[data-theme="modern"] .workspace-sidebar { display:none; }
    html[data-theme="modern"] .has-workspace > :is(.topbar,.container,.footer) { margin-left:0; }
    html[data-theme="modern"] .has-workspace .topbar-inner { flex-direction:row;align-items:center;padding:12px 16px;min-height:64px; }
    html[data-theme="modern"] .has-workspace .topbar .brand { flex:1;min-width:0; }
    html[data-theme="modern"] .has-workspace .theme-toggle { width:auto; }
    html[data-theme="modern"] .workspace-mobile-menu { display:block;position:relative;z-index:31;background:#fff;border-bottom:1px solid #e6eaf2; }
    html[data-theme="modern"] .workspace-mobile-menu > summary { padding:14px 18px;cursor:pointer;font-size:14px;font-weight:700; }
    html[data-theme="modern"] .workspace-mobile-menu > summary span { color:#718096;font-size:12px;margin-left:12px; }
    html[data-theme="modern"] .workspace-mobile-menu nav { position:absolute;top:100%;left:12px;right:12px;background:#fff;border:1px solid #e6eaf2;border-radius:14px;padding:8px 16px;max-height:70vh;overflow:auto;box-shadow:0 16px 32px #17203322; }
}
@media(max-width:768px) {
    html[data-theme="modern"] .has-workspace > .container { padding:18px 12px 32px; }
    html[data-theme="modern"] .workspace-shortcuts { display:grid;grid-template-columns:1fr; }
    html[data-theme="modern"] .workspace-shortcuts a { padding:10px 12px; }
    html[data-theme="modern"] .workspace-fold-body { padding:12px; }
    html[data-theme="modern"] .has-workspace :is(.list-toolbar,.csv-upload-actions,.users-head-actions) { flex-wrap:wrap; }
    html[data-theme="modern"] .has-workspace :is(.filter-bar,.link-stats,.users-stats,.top-three-grid,.user-summary-grid,.csv-upload-grid) { grid-template-columns:minmax(0,1fr); }
    html[data-theme="modern"] .has-workspace:is([data-page="dashboard"],[data-page="admin_overview"]) > .container > .grid-cards,
    html[data-theme="modern"] .has-workspace .link-stats { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
    html[data-theme="modern"] .has-workspace .grid-cards > .card { min-width:0;padding:14px; }
    html[data-theme="modern"] .has-workspace .grid-cards .stat-num { font-size:24px; }
    html[data-theme="modern"] .has-workspace .month-picker-panel { position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;z-index:950; }
    html[data-theme="modern"] .workspace-filter-summary { line-height:1.6; }
    html[data-theme="modern"] .has-workspace .table-wrap { max-width:100%; }
}
@media(prefers-reduced-motion:reduce) {
    html[data-theme="modern"] .has-workspace :is(.btn,.nav a,input,select,textarea) { transition:none; }
}
