@import url("hysec-itembank.css?v=20260909-itembank-2");
@import url('style-guidelines.css?v=20260909-ui-fixes-1');
@import url('dialog-overrides.css?v=20260908-1');

:root {
    --calendar-type-0-color: var(--success-color);
    --calendar-type-0-rgb: var(--success-rgb);
    --calendar-type-1-color: var(--error-color);
    --calendar-type-1-rgb: var(--error-rgb);
    --calendar-type-2-color: #2196F3;
    --calendar-type-2-rgb: 33, 150, 243;
    --calendar-type-3-color: rgba(var(--primary-text-rgb), 0.95);
    --calendar-type-3-rgb: var(--primary-text-rgb);
    --calendar-type-4-color: #9C27B0;
    --calendar-type-4-rgb: 156, 39, 176;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--accent-color);
}

/* .btn-primary styles removed as they should be handled elsewhere (e.g., style-guidelines or component library) */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--accent-color), 0 0 0 0.25rem var(--glow-color);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--error-color);
}

.validation-message {
    color: var(--error-color);
}

#blazor-error-ui {
    background: var(--secondary-background);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--primary-text);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--error-color);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--primary-text);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--secondary-background);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent-color);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--primary-text);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

body {
    overflow-x: hidden;
}

html,
body {
    scrollbar-gutter: auto;
}

/* Global scrollbar skin aligned with ItemBank colors. */
html,
body,
html body * {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-color-rgb), 0.34) var(--scrollbar-track) !important;
}

html body *::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
}

html body *::-webkit-scrollbar-track {
    background: var(--scrollbar-track) !important;
    border-radius: 999px !important;
}

html body *::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-color-rgb), 0.3) !important;
    border: 2px solid var(--scrollbar-thumb-border) !important;
    border-radius: 999px !important;
}

html body *::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-color-rgb), 0.38) !important;
}

html body *::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Training Textfield Styling */
.training-textfield .mud-input-slot {
    padding-left: 12px !important;
    padding-right: 12px !important;
}


.action-column-left-align {
    display: flex; /* Make the td a flex container */
    justify-content: flex-start; /* Align content to the start (left) */
    align-items: center; /* Vertically center items if needed */
    /* padding-left: 16px; /* Add some padding to the left if desired, adjust as needed */
}

.sticky-tldr {
    position: sticky;
    top: 20px; /* Adjust as needed based on header height */
    align-self: flex-start;
    z-index: 1;
}

/* Calendar Widget Hover Effect */
.event-item {
    transition: all var(--duration-fast, 0.15s) ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.025);
    margin-bottom: 4px;
    padding: var(--space-2, 8px);
    border-radius: var(--radius-sm, 12px);
    border: 1px solid transparent;
}

.event-item:hover {
    background: rgba(var(--accent-color-rgb, 228, 167, 56), 0.1);
    border-color: rgba(var(--accent-color-rgb, 228, 167, 56), 0.16);
}

.events-list, .widget-content {
    overflow-x: auto;
    overflow-y: auto;
    padding-right: 4px; /* Space for scrollbar */
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MARKDOWN CONTENT STYLING (Global - for dynamically rendered Markdown)
   ═══════════════════════════════════════════════════════════════════════════════ */

.markdown-content {
    font-family: var(--hy-font-family, 'Jura', sans-serif);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    color: var(--primary-text);
}

/* Paragraphs */
.markdown-content p {
    margin: 0 0 0.75em 0;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

/* Bold */
.markdown-content strong,
.markdown-content b {
    font-weight: 700;
    color: rgba(var(--primary-text-rgb), 0.95);
}

/* Italic */
.markdown-content em,
.markdown-content i {
    font-style: italic;
}

/* Strikethrough */
.markdown-content del,
.markdown-content s {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Underline */
.markdown-content ins,
.markdown-content u {
    text-decoration: underline;
}

/* Code inline */
.markdown-content code {
    background: rgba(var(--accent-color-rgb), 0.1);
    border: 1px solid rgba(var(--accent-color-rgb), 0.3);
    border-radius: var(--radius-xs);
    padding: 0.15em 0.4em;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

/* Code blocks */
.markdown-content pre {
    background: rgba(10, 12, 16, 0.6);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    border-radius: 8px;
    padding: 1em;
    margin: 0.75em 0;
    overflow-x: auto;
}

.markdown-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85em;
    color: rgba(var(--primary-text-rgb), 0.9);
}

/* Blockquotes */
.markdown-content blockquote {
    border-left: 4px solid rgba(var(--accent-color-rgb), 0.5);
    background: rgba(var(--accent-color-rgb), 0.05);
    margin: 0.75em 0;
    padding: 0.75em 1em;
    color: rgba(var(--primary-text-rgb), 0.8);
    border-radius: 0 8px 8px 0;
}

.markdown-content blockquote p {
    margin: 0;
}

/* Lists */
.markdown-content ul,
.markdown-content ol {
    margin: 0.75em 0;
    padding-left: 1.75em;
}

.markdown-content li {
    margin: 0.35em 0;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

/* Nested lists */
.markdown-content ul ul,
.markdown-content ol ol,
.markdown-content ul ol,
.markdown-content ol ul {
    margin: 0.25em 0;
}

/* Links */
.markdown-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted rgba(var(--accent-color-rgb), 0.5);
    transition: all 0.2s ease;
}

.markdown-content a:hover {
    color: #f0b84a;
    border-bottom-color: #f0b84a;
}

/* Headers */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-family: var(--hy-font-family, 'Jura', sans-serif);
    color: var(--primary-text-strong);
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: none;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content h1 { font-size: 1.4em; }
.markdown-content h2 { font-size: 1.25em; }
.markdown-content h3 { font-size: 1.1em; }
.markdown-content h4 { font-size: 1em; }
.markdown-content h5 { font-size: 0.95em; }
.markdown-content h6 { font-size: 0.9em; }

/* Horizontal rule */
.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(var(--accent-color-rgb), 0.3);
    margin: 1.5em 0;
}

/* Tables */
.markdown-content table {
    border-collapse: collapse;
    margin: 0.75em 0;
    width: 100%;
    min-width: min(100%, 420px);
    max-width: 100%;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(10, 12, 16, 0.26);
}

.markdown-content th,
.markdown-content td {
    border: 1px solid rgba(var(--accent-color-rgb), 0.15);
    padding: 0.6em 1em;
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
}

.markdown-content th[align="center"],
.markdown-content td[align="center"] {
    text-align: center;
}

.markdown-content th[align="right"],
.markdown-content td[align="right"] {
    text-align: right;
}

.markdown-content th {
    background: rgba(var(--accent-color-rgb), 0.1);
    font-weight: 600;
    color: var(--accent-color);
    font-family: var(--hy-font-family, 'Jura', sans-serif);
    font-size: 0.85em;
    letter-spacing: 0.02em;
    text-transform: none;
}

.markdown-content tr:nth-child(even) {
    background: rgba(18, 22, 30, 0.3);
}

.markdown-content table p,
.markdown-content table ul,
.markdown-content table ol {
    margin-top: 0;
    margin-bottom: 0;
}

/* Task lists */
.markdown-content .task-list-item,
.markdown-content li:has(> input[type="checkbox"]:first-child) {
    list-style: none;
    margin-left: -1.35em;
}

.markdown-content input[type="checkbox"] {
    accent-color: var(--accent-color);
    margin: 0 0.45em 0 0;
    vertical-align: -0.12em;
}

/* Definition lists */
.markdown-content dl {
    margin: 0.75em 0;
}

.markdown-content dt {
    color: var(--primary-text-strong);
    font-weight: 700;
}

.markdown-content dd {
    margin: 0.25em 0 0.65em 1.25em;
    color: rgba(var(--primary-text-rgb), 0.82);
}

/* Footnotes */
.markdown-content .footnotes {
    margin-top: 1.1em;
    padding-top: 0.75em;
    border-top: 1px solid rgba(var(--accent-color-rgb), 0.18);
    color: rgba(var(--primary-text-rgb), 0.76);
    font-size: 0.9em;
}

.markdown-content .footnote-ref,
.markdown-content .footnote-back-ref,
.markdown-content .footnote-backref {
    color: var(--accent-color);
    border-bottom: none;
}

/* Images */
.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.75em 0;
    border: 1px solid rgba(var(--accent-color-rgb), 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PERFORMANCE MODE - Disables all expensive CSS effects during drag/resize
   Applied to <html> element by JavaScript during window manipulation
   ═══════════════════════════════════════════════════════════════════════════ */
/* NOTE: performance-mode is toggled during window drag/resize.
    It must NOT affect the whole desktop, otherwise non-window UI (e.g. desktop widgets)
    will have animations disabled/enabled repeatedly, which can look like a re-fade.
    Scope it to windows only. */
html.performance-mode .app-window,
html.performance-mode .app-window *,
html.performance-mode .app-window *::before,
html.performance-mode .app-window *::after {
    /* Disable all blur effects - these are EXTREMELY expensive during animation */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* Disable transitions to prevent layout thrashing */
    transition: none !important;
    /* Disable animations inside windows only */
    animation: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DEFAULT PERFORMANCE OPTIMIZATIONS
   By default, expensive effects are disabled for better performance
   Users can enable "High Fidelity Mode" to get premium visuals
   ═══════════════════════════════════════════════════════════════════════════ */

/* When NOT in high-fidelity mode, disable blur globally */
html:not(.high-fidelity-mode) .app-window,
html:not(.high-fidelity-mode) .start-menu-container,
html:not(.high-fidelity-mode) .start-menu-overlay,
html:not(.high-fidelity-mode) .taskbar,
html:not(.high-fidelity-mode) .window-header,
html:not(.high-fidelity-mode) .tray-popup,
html:not(.high-fidelity-mode) .mud-dialog,
html:not(.high-fidelity-mode) .mud-popover-paper,
html:not(.high-fidelity-mode) .context-menu {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Disable infinite animations when not in high-fidelity mode */
html:not(.high-fidelity-mode) .avatar-ring,
html:not(.high-fidelity-mode) .status-dot,
html:not(.high-fidelity-mode) .category-title::before,
html:not(.high-fidelity-mode) .glow-pulse,
html:not(.high-fidelity-mode) .subtle-glow,
html:not(.high-fidelity-mode) [class*="pulse"],
html:not(.high-fidelity-mode) [class*="glow"],
html:not(.high-fidelity-mode) .scanline-overlay {
    animation: none !important;
}

.mud-dialog-title .mud-typography,
.mud-dialog-content .mud-typography-h6,
.mud-table-root thead th,
.mud-simple-table thead th,
.mud-table-head {
    color: var(--primary-text-strong) !important;
}

/* Shared sticky-table system.
   Use hysec-sticky-table-shell/header/body for custom grid tables,
   hysec-native-sticky-table for native tables, and keep Mud fixed-header tables
   aligned with the same header geometry and chrome. */
html body .hysec-sticky-table-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden !important;
    isolation: isolate;
}

html body .hysec-sticky-table-body,
html body .mud-table-container,
html body .mud-data-grid {
    scrollbar-color: rgba(var(--accent-color-rgb), 0.32) transparent;
}

html body .hysec-sticky-table-body::-webkit-scrollbar,
html body .mud-table-container::-webkit-scrollbar,
html body .mud-data-grid::-webkit-scrollbar {
    width: var(--sticky-table-scrollbar-size);
    height: var(--sticky-table-scrollbar-size);
}

html body .hysec-sticky-table-body::-webkit-scrollbar-track,
html body .mud-table-container::-webkit-scrollbar-track,
html body .mud-data-grid::-webkit-scrollbar-track {
    background: transparent;
}

html body .hysec-sticky-table-body::-webkit-scrollbar-thumb,
html body .mud-table-container::-webkit-scrollbar-thumb,
html body .mud-data-grid::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-color-rgb), 0.28);
    border-radius: 999px;
}

html body .hysec-sticky-table-body::-webkit-scrollbar-thumb:hover,
html body .mud-table-container::-webkit-scrollbar-thumb:hover,
html body .mud-data-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-color-rgb), 0.4);
}

html body .hysec-sticky-table-header,
html body .mud-table-sticky-header .mud-table-head,
html body .mud-table-sticky-header .mud-table-root thead,
html body .mud-table-sticky-header .mud-data-grid-header,
html body .mud-data-grid .mud-table-sticky-header .mud-data-grid-header,
html body .tm-header-row,
html body .tm-member-header,
html body .tm-category-header,
html body .tm-training-header,
html body .tm-summary-header {
    background: var(--sticky-table-header-overlay), var(--sticky-table-header-bg) !important;
    border-bottom-color: var(--sticky-table-header-border) !important;
    backdrop-filter: blur(var(--sticky-table-header-blur)) !important;
    -webkit-backdrop-filter: blur(var(--sticky-table-header-blur)) !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.18) !important;
}

html body .hysec-sticky-table-header,
html body .mud-table-sticky-header .mud-table-head,
html body .mud-table-sticky-header .mud-table-root thead,
html body .tm-header-row {
    position: relative;
    overflow: hidden;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

html body .hysec-sticky-table-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--sticky-table-header-overlay), var(--sticky-table-header-bg);
    backdrop-filter: blur(var(--sticky-table-header-blur));
    -webkit-backdrop-filter: blur(var(--sticky-table-header-blur));
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

html body .hysec-sticky-table-header > *,
html body .mud-table-sticky-header .mud-table-head .mud-table-cell,
html body .mud-table-sticky-header .mud-table-root thead th,
html body .mud-table-sticky-header .mud-data-grid-header-cell {
    position: relative;
    z-index: 1;
}

html body .hysec-sticky-table-header {
    top: 0 !important;
    z-index: 12 !important;
    flex: 0 0 auto !important;
    align-items: center;
    min-height: var(--sticky-table-header-height);
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
}

html body .hysec-sticky-table-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto !important;
    scrollbar-gutter: stable;
}

html body .hysec-sticky-table-shell:has(> .hysec-native-sticky-table) {
    display: block;
    overflow: auto !important;
    scrollbar-gutter: stable;
}

html body .hysec-sticky-table-shell:has(> .hysec-native-sticky-table)::before,
html body .hysec-sticky-table-shell:has(> .hysec-native-sticky-table)::after {
    content: none;
}

html body .hysec-native-sticky-table {
    width: 100%;
    border-collapse: collapse;
    display: table;
}

html body .hysec-native-sticky-table thead,
html body .hysec-native-sticky-table tbody {
    display: table-header-group;
}

html body .hysec-native-sticky-table thead {
    position: static;
    background: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html body .hysec-native-sticky-table thead tr,
html body .hysec-native-sticky-table tbody tr {
    display: table-row;
}

html body .hysec-native-sticky-table tbody {
    display: table-row-group;
}

html body .hysec-native-sticky-table thead::before {
    content: none;
}

html body .hysec-native-sticky-table th {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    min-height: var(--sticky-table-header-height);
    padding: var(--sticky-table-header-cell-padding) !important;
    background-color: var(--sticky-table-header-bg) !important;
    background-image: var(--sticky-table-header-overlay) !important;
    background-repeat: repeat !important;
    backdrop-filter: blur(var(--sticky-table-header-blur)) !important;
    -webkit-backdrop-filter: blur(var(--sticky-table-header-blur)) !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.18) !important;
    border-bottom: 1px solid var(--sticky-table-header-border) !important;
    background-clip: padding-box !important;
}

html body .hysec-native-sticky-table th::before,
html body .hysec-native-sticky-table th::after {
    content: '';
    position: absolute;
    top: -1px;
    bottom: -1px;
    background-color: var(--sticky-table-header-bg);
    background-image: var(--sticky-table-header-overlay);
    pointer-events: none;
}

html body .hysec-native-sticky-table th:first-child::before {
    left: -1px;
    width: 1px;
    border-top-left-radius: inherit;
}

html body .hysec-native-sticky-table th:last-child::after {
    right: calc(-1 * var(--sticky-table-scrollbar-size));
    width: calc(var(--sticky-table-scrollbar-size) + 1px);
    border-top-right-radius: inherit;
}

/* RSI sync tables use a split header/body layout so the scrollbar starts below the header
   and the rounded top corners stay visually closed. */
html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

html body .hysec-sticky-table-shell:has(> :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden !important;
    scrollbar-gutter: auto;
}

html body .hysec-sticky-table-shell:has(> :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table) > :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table {
    border-radius: inherit;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table thead {
    display: block;
    flex: 0 0 auto;
    padding-right: var(--sticky-table-scrollbar-size);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    background-color: var(--sticky-table-header-bg) !important;
    background-image: var(--sticky-table-header-overlay) !important;
    background-repeat: repeat !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.18) !important;
    backdrop-filter: blur(var(--sticky-table-header-blur)) !important;
    -webkit-backdrop-filter: blur(var(--sticky-table-header-blur)) !important;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(68vh, 720px);
    overflow: auto;
    scrollbar-gutter: stable;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody {
    scrollbar-color: rgba(var(--accent-color-rgb), 0.32) transparent;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody::-webkit-scrollbar {
    width: var(--sticky-table-scrollbar-size);
    height: var(--sticky-table-scrollbar-size);
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody::-webkit-scrollbar-track {
    background: transparent;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-color-rgb), 0.28);
    border-radius: 999px;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-color-rgb), 0.4);
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table thead tr,
html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody tr {
    display: grid;
    width: 100%;
    align-items: center;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody tr {
    border-bottom: 1px solid rgba(var(--primary-text-rgb), 0.08);
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody tr:last-child {
    border-bottom: none;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table th {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
    background: transparent !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table th::before,
html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table th::after {
    content: none !important;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table :is(th, td) {
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    box-sizing: border-box;
}

html body :is(.fleet-table, .paints-table, .ccu-table, .hangar-table).hysec-native-sticky-table tbody td {
    border-bottom: none !important;
}

html body .hysec-native-sticky-table th:first-child {
    border-top-left-radius: inherit;
}

html body .hysec-native-sticky-table th:last-child {
    border-top-right-radius: inherit;
}

html body .hysec-sticky-table-header .th,
html body .hysec-native-sticky-table th,
html body .mud-table-sticky-header .mud-table-head .mud-table-cell,
html body .mud-table-sticky-header .mud-table-root thead th,
html body .mud-table-sticky-header .mud-data-grid-header-cell,
html body .tm-member-header,
html body .tm-category-header,
html body .tm-summary-header {
    font-family: var(--hy-font-family, 'Jura', sans-serif) !important;
    font-size: var(--sticky-table-header-font-size) !important;
    font-weight: 600 !important;
    letter-spacing: var(--sticky-table-header-letter-spacing) !important;
    text-transform: uppercase !important;
    color: var(--sticky-table-header-text) !important;
    line-height: 1.2 !important;
}

html body .mud-table-sticky-header .mud-table-head .mud-table-cell,
html body .mud-table-sticky-header .mud-table-root thead th,
html body .mud-table-sticky-header .mud-data-grid-header-cell {
    min-height: var(--sticky-table-header-height);
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
    border-bottom: 1px solid var(--sticky-table-header-border) !important;
}

html body .mud-table-container:has(.mud-table-sticky-header),
html body .mud-data-grid:has(.mud-table-sticky-header) {
    position: relative;
    overflow: auto !important;
    scrollbar-gutter: stable;
}

html body .mud-table-container:has(.mud-table-sticky-header)::after,
html body .mud-data-grid:has(.mud-table-sticky-header)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: var(--sticky-table-scrollbar-size);
    height: var(--sticky-table-header-height);
    background: var(--sticky-table-header-overlay), var(--sticky-table-header-bg);
    border-bottom: 1px solid var(--sticky-table-header-border);
    border-top-right-radius: inherit;
    pointer-events: none;
    z-index: 4;
}

.mud-input-control.mud-input-focused .mud-input-outlined-border,
.mud-input-outlined.mud-input-root-focused .mud-input-outlined-border,
.mud-select:focus-within .mud-input-outlined-border,
.mud-autocomplete:focus-within .mud-input-outlined-border {
    box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb), 0.12) !important;
}

/* Taskbar popups are MudMenu portals, not children of Taskbar.razor in the DOM.
   Keep popup visuals global and enforce one visible frame to prevent double borders. */
.mud-popover:has(.taskbar-popup-surface) {
    margin-top: -12px;
    padding: 0 !important;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 22%),
        var(--panel-bg-solid) !important;
    background-color: var(--surface-0) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.mud-popover .taskbar-popup-surface {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    font-family: var(--hy-font-family, 'Jura', sans-serif);
}

/* Desktop inbox styles live in desktop-overview.css. */

/* Calendar popup */
.mud-popover .calendar-popup {
    width: 340px;
}

.mud-popover .calendar-popup .calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: transparent;
    border-bottom: 1px solid var(--panel-border);
}

.mud-popover .calendar-popup .calendar-header .nav-btn.hysec-icon-btn {
    padding: 0;
}

.mud-popover .calendar-popup .current-month {
    font-size: .9rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.04em;
}

.mud-popover .calendar-popup .calendar-grid {
    padding: var(--space-3);
}

.mud-popover .calendar-popup .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.mud-popover .calendar-popup .weekday {
    text-align: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(var(--accent-color-rgb), 0.6);
    letter-spacing: 0.06em;
    text-transform: none;
    padding: 6px 0;
}

.mud-popover .calendar-popup .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-1);
}

.mud-popover .calendar-popup .day {
    aspect-ratio: 1;
    padding: 0;
    min-width: 0;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(var(--primary-text-rgb), 0.75);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    position: relative;
}

.mud-popover .calendar-popup .day:hover:not(.empty) {
    background: rgba(var(--accent-color-rgb), 0.12);
    color: rgba(var(--primary-text-rgb), 0.95);
}

.mud-popover .calendar-popup .day.empty {
    cursor: default;
}

.mud-popover .calendar-popup .day.today {
    background: rgba(var(--accent-color-rgb), 0.15);
    border: 1px solid rgba(var(--accent-color-rgb), 0.4);
    color: var(--accent-color);
    font-weight: 700;
}

.mud-popover .calendar-popup .day.selected {
    background: rgba(var(--accent-color-rgb), 0.25);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.mud-popover .calendar-popup .day-dots {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    pointer-events: none;
}

.mud-popover .calendar-popup .day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(var(--primary-text-rgb), 0.55);
}

.mud-popover .calendar-popup .day-dot.type-0 { background: rgba(var(--calendar-type-0-rgb), 0.95); }
.mud-popover .calendar-popup .day-dot.type-1 { background: rgba(var(--calendar-type-1-rgb), 0.95); }
.mud-popover .calendar-popup .day-dot.type-2 { background: rgba(var(--calendar-type-2-rgb), 0.95); }
.mud-popover .calendar-popup .day-dot.type-3 { background: rgba(var(--calendar-type-3-rgb), 0.75); }
.mud-popover .calendar-popup .day-dot.type-4 { background: rgba(var(--calendar-type-4-rgb), 0.95); }

.mud-popover .calendar-popup .calendar-events {
    border-top: 1px solid var(--panel-border);
    max-height: 200px;
    overflow-y: auto;
}

.mud-popover .calendar-popup .events-header {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(var(--accent-color-rgb), 0.7);
    letter-spacing: 0.06em;
    text-transform: none;
    padding: 10px 14px;
    border-bottom: 1px solid var(--panel-border);
    background: var(--popover-footer-bg);
}

.mud-popover .calendar-popup .events-list {
    padding: var(--space-2);
}

.mud-popover .calendar-popup .event-item {
    width: 100%;
    text-align: left;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: rgba(var(--panel-bg-rgb), 0.5);
    border: 1px solid var(--panel-border);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.mud-popover .calendar-popup .event-item:hover {
    background: rgba(var(--accent-color-rgb), 0.08);
    border-color: var(--panel-border-hover);
}

.mud-popover .calendar-popup .event-subject {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mud-popover .calendar-popup .event-time {
    font-size: 0.75rem;
    color: rgba(var(--primary-text-rgb), 0.55);
}

.mud-popover .calendar-popup .loading-spinner {
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent-color);
    padding: 18px;
    letter-spacing: 0.04em;
}

.mud-popover .calendar-popup .no-events {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(var(--primary-text-rgb), 0.62);
    padding: 18px;
}


.mud-popover .calendar-popup .calendar-retry { display: block; margin: 12px auto 0; padding: 8px 14px; border: 1px solid var(--panel-border); border-radius: var(--radius-sm); color: var(--accent-color); background: transparent; font: inherit; cursor: pointer; }
.mud-popover .calendar-popup button:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; }

/* ─── HYSEC Global MudBlazor Form Component Overrides ──────────────────────
   Applies to MudTextField, MudSelect, MudNumericField, MudAutocomplete with
   Variant.Outlined. Removes double borders from wrapper+fieldset, applies
   the HYSEC dark-gold design language globally.
   ─────────────────────────────────────────────────────────────────────────── */

/* Reset outer wrapper chrome so only the fieldset border shows */
.mud-input-control:not(.military-autocomplete .mud-input-control):not(.hysec-tab-keepnative .mud-input-control) {
    box-shadow: none !important;
}

/* Paint the surface behind the input, never on its overlaid border fieldset. */
.mud-input-outlined {
    background: var(--field-border-bg, var(--field-surface-bg)) !important;
    border-radius: var(--radius-input) !important;
}
.mud-input-outlined.mud-input-root-focused,
.mud-input-control.mud-input-focused .mud-input-outlined {
    background: var(--field-border-bg, var(--field-surface-bg-focus)) !important;
}

/* Shared single-line density for text, search, select and autocomplete. */
.mud-input-outlined.mud-input-margin-dense:not(.mud-input-multiline) {
    min-height: 44px;
}

/* The visible border (fieldset .mud-input-outlined-border) */
.mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(var(--primary-text-rgb), 0.14) !important;
    border-radius: var(--radius-md) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition:
        border-color var(--duration-normal) var(--ease-smooth),
        background var(--duration-normal) var(--ease-smooth),
        box-shadow var(--duration-normal) var(--ease-smooth) !important;
}

/* Hover */
.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(var(--accent-color-rgb), 0.32) !important;
}

/* Focus */
.mud-input-outlined.mud-input-root-focused .mud-input-outlined-border,
.mud-input-control.mud-input-focused .mud-input-outlined-border {
    border-color: var(--accent-color) !important;
    background: transparent !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.12) !important;
}

/* Input text and background */
.mud-input-outlined .mud-input-slot,
.mud-input-outlined .mud-input-root {
    color: var(--primary-text) !important;
    font-family: var(--hy-font-family, 'Jura', sans-serif) !important;
    font-size: 0.92rem !important;
    background: transparent !important;
}

/* Placeholder */
.mud-input-outlined .mud-input-slot::placeholder,
.mud-input-outlined input::placeholder,
.mud-input-outlined textarea::placeholder {
    color: var(--field-placeholder) !important;
    opacity: 1 !important;
}

/* Floating label */
.mud-input-label-inputcontrol,
.mud-input-label {
    color: rgba(var(--primary-text-rgb), 0.52) !important;
    font-family: var(--hy-font-family, 'Jura', sans-serif) !important;
    font-size: 0.84rem !important;
}

.mud-input-root-focused ~ .mud-input-label-inputcontrol .mud-input-label,
.mud-input-root-not-empty ~ .mud-input-label-inputcontrol .mud-input-label,
.mud-input-shrink .mud-input-label {
    color: var(--accent-color) !important;
}

/* MudSelect / MudAutocomplete dropdown list font */
.mud-list {
    font-family: var(--hy-font-family, 'Jura', sans-serif) !important;
}

/* Prevent .mud-list from being a second scroll container inside popups */
.mud-popover .mud-list {
    overflow: visible !important;
}

/* Style the popup paper for select/autocomplete dropdowns only.
   Excludes taskbar tray popups which have their own .taskbar-popup-surface rule. */
.mud-popover-paper:has(.mud-list):not(:has(.taskbar-popup-surface)) {
    background: var(--surface-2) !important;
    border: 1px solid rgba(var(--accent-color-rgb), 0.16) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

.mud-list-item {
    color: var(--primary-text) !important;
    font-family: var(--hy-font-family, 'Jura', sans-serif) !important;
    font-size: 0.9rem !important;
}

.mud-list-item:hover,
.mud-list-item-clickable:hover {
    background: rgba(var(--accent-color-rgb), 0.1) !important;
    color: var(--accent-color) !important;
}

.mud-selected-item {
    background: rgba(var(--accent-color-rgb), 0.15) !important;
    color: var(--accent-color) !important;
}

/* MudSelect arrow icon */
.mud-select-input .mud-input-adornment .mud-icon-root,
.mud-input-outlined .mud-input-adornment .mud-icon-root {
    color: rgba(var(--primary-text-rgb), 0.48) !important;
}

.mud-input-root-focused .mud-input-adornment .mud-icon-root {
    color: var(--accent-color) !important;
}

/* MudCheckBox and MudRadioGroup inside forms */
.mud-checkbox .mud-button-root,
.mud-radio .mud-button-root {
    color: rgba(var(--primary-text-rgb), 0.62) !important;
}

.mud-checkbox.mud-checkbox-checked .mud-button-root,
.mud-radio.mud-checked .mud-button-root {
    color: var(--accent-color) !important;
}

/* hysec-filter-toolbar MudTextField — transparent inner, border on shell */
.hysec-filter-search .mud-input-outlined .mud-input-outlined-border {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.hysec-filter-search .mud-input-control {
    box-shadow: none !important;
}

.hysec-filter-search .mud-input-outlined .mud-input-slot,
.hysec-filter-search .mud-input-outlined input {
    padding: 0 !important;
}

.hysec-filter-search .mud-input-outlined-border {
    border: none !important;
}

.hysec-filter-search:focus-within .mud-input-outlined .mud-input-outlined-border {
    border: none !important;
    box-shadow: none !important;
}

/* MudSelect inside filter toolbar */
.hysec-filter-toolbar .mud-input-control:not(.hysec-filter-search *) .mud-input-outlined .mud-input-outlined-border,
.hysec-filter-toolbar > * > .mud-input-outlined .mud-input-outlined-border,
.hysec-filter-toolbar .mud-select .mud-input-outlined-border {
    background: var(--filter-control-bg) !important;
    border-color: rgba(var(--accent-color-rgb), 0.2) !important;
    border-radius: var(--radius-xs) !important;
}

.hysec-filter-toolbar .mud-select .mud-input-outlined .mud-input-slot,
.hysec-filter-toolbar .mud-select .mud-input-outlined input,
.hysec-filter-toolbar .mud-select .mud-select-input {
    color: var(--filter-control-text) !important;
}

.hysec-filter-toolbar .mud-select .mud-input-root-focused .mud-input-outlined-border {
    border-color: var(--accent-color) !important;
}

/* ── Global sticky table th — ItemBank-matching dark header with backdrop-filter ─
   Scoped CSS files set the final values on th directly; this global rule
   acts as a consistent fallback baseline.
   ──────────────────────────────────────────────────────────────────────────── */
.fleet-table th,
.ccu-table th,
.hangar-table th,
.paints-table th {
    background: var(--sticky-table-header-bg);
    backdrop-filter: blur(var(--sticky-table-header-blur));
    -webkit-backdrop-filter: blur(var(--sticky-table-header-blur));
    border-bottom: 1px solid var(--sticky-table-header-border);
}

/* HELIOS Control Plane baseline editor */
.helios-baseline-panel {
    border: 1px solid rgba(var(--accent-color-rgb), 0.18) !important;
    background: linear-gradient(180deg, rgba(var(--accent-color-rgb), 0.055), rgba(var(--primary-text-rgb), 0.018)) !important;
}

.helios-baseline-input,
.helios-baseline-editor,
.helios-baseline-preview {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-text-rgb), 0.14);
    background: rgba(0, 0, 0, 0.22);
    color: var(--primary-text);
    font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
    font-size: 0.86rem;
    line-height: 1.45;
    outline: none;
    transition: border-color var(--duration-normal, 160ms) var(--ease-smooth, ease), box-shadow var(--duration-normal, 160ms) var(--ease-smooth, ease), background-color var(--duration-normal, 160ms) var(--ease-smooth, ease);
}

.helios-baseline-input {
    min-height: 38px;
    padding: 0.55rem 0.7rem;
}

.helios-baseline-editor {
    min-height: 11rem;
    padding: 0.7rem 0.8rem;
    resize: vertical;
}

.helios-baseline-editor-wide {
    min-height: 18rem;
}

.helios-baseline-editor-tall {
    min-height: 16rem;
}

.helios-baseline-input:focus,
.helios-baseline-editor:focus {
    border-color: rgba(var(--accent-color-rgb), 0.56);
    box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb), 0.12);
    background: rgba(0, 0, 0, 0.28);
}

.helios-baseline-preview {
    min-height: 18rem;
    max-height: 34rem;
    overflow: auto;
    padding: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* DesktopEnv creates the docking preview under body, outside Blazor CSS isolation. */
.snap-preview {
    position:fixed;
    box-sizing:border-box;
    background:rgba(var(--accent-color-rgb),.07);
    border:1px solid rgba(var(--accent-color-rgb),.38);
    border-radius:var(--radius-lg,22px);
    box-shadow:inset 0 0 0 1px rgba(var(--primary-text-rgb),.04);
    z-index:9999;
    pointer-events:none;
    animation:window-snap-enter .16s ease-out both;
}
@keyframes window-snap-enter { from { opacity:0; } to { opacity:1; } }
@media (prefers-reduced-motion:reduce) { .snap-preview { animation:none; } }
