/* ============================================
   FONT FACES - Inter Font Family
   ============================================ */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Regular.ttf');
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-ExtraLight.ttf') format('truetype');
    font-weight: 200;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Light.ttf') format('truetype');
    font-weight: 300;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Regular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Medium.ttf') format('truetype');
    font-weight: 500;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-SemiBold.ttf') format('truetype');
    font-weight: 600;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Bold.ttf') format('truetype');
    font-weight: 700;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-ExtraBold.ttf') format('truetype');
    font-weight: 800;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Black.ttf') format('truetype');
    font-weight: 900;
}

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --fade: 60px;
}

body.user-is-tabbing :focus-visible {
    outline: 2px solid var(--surface-brand-surface-brand-primary);
    outline-offset: 2px;
}

body.user-is-tabbing .input-group input:focus-visible,
body.user-is-tabbing .input-group textarea:focus-visible,
body.user-is-tabbing .input-group select:focus-visible {
    outline: none;
}

body:not(.user-is-tabbing) :focus-visible {
    outline: none;
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    scrollbar-width: thin;
    scrollbar-color: var(--surface-surface-tertiary) var(--surface-surface-bg);
    line-height: 1;
}

html,
body {
    font-size: var(--font-s);
    color: var(--text-text-secondary);
    font-style: normal;
}

body,
input,
select,
option {
    background-color: var(--surface-surface-bg);
}

#footer {
    background-color: var(--surface-surface-primary);
}

code {
    background: transparent !important;
}

.bg-surface {
    background-color: var(--surface-surface-bg) !important;
}

mark {
    background-color: yellow;
    color: black;
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */
/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--surface-surface-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-surface-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-surface-tertiary);
}

/* ============================================
   LINKS & ANCHORS
   ============================================ */
a,
.a {
    all: unset;
    display: inline-block;
    cursor: pointer;
}

a:hover,
.a:hover {
    text-decoration: underline;
}

.btn:hover {
    text-decoration: none;
}

/* ============================================
   BUTTONS
   ============================================ */
button,
.btn {
    padding: 10px 14px;
    font-size: var(--font-s);
    font-weight: 600;
    align-content: center;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-text-body);
    box-sizing: border-box;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--surface-brand-surface-brand-primary);
    color: var(--white);
    box-shadow: var(--box-shadow-xs);
}

.btn-primary:hover {
    background-color: var(--surface-brand-surface-brand-quaternary);
}

.btn-primary:active {
    background-color: var(--surface-brand-surface-brand-click);
}

.btn-secondary {
    background-color: var(--surface-surface-light);
    border: 1px solid var(--surface-surface-extra);
    box-shadow: var(--box-shadow-xs);
}

.btn-secondary:hover {
    background-color: var(--surface-surface-secondary);
}

.btn-secondary.active, .btn-secondary:focus {
    background-color: var(--surface-surface-tertiary);
}

.btn-secondary.active:hover {
    background-color: var(--surface-surface-secondary);
}

.btn-light {
    background-color: var(--surface-button-surface-button-primary);
    color: var(--surface-button-text-button-secondary);
    border: 1px solid var(--surface-surface-tertiary);
    box-shadow: var(--box-shadow-xs);
}

.btn-light:hover {
    background-color: var(--surface-button-surface-button-hover);
}

.btn-light:active, .btn-light.active {
    background-color: var(--surface-button-surface-button-focused);
}

table tfoot button {
    font-size: var(--font-s);
    border-radius: 8px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb ul {
    font-size: var(--font-s);
}

.breadcrumb i {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    font-size: var(--font-xl);
    background: var(--surface-surface-primary);
    border-radius: 100%;
}

.breadcrumb ul li a {
    color: var(--text-text-body);
}

.breadcrumb ul li a:hover {
    color: var(--surface-brand-surface-brand-primary);
}

.breadcrumb ul li:first-child a,
.word-ellipsis {
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 145px;
    display: inline-block;
    overflow: hidden;
}

.breadcrumb ul li a:first-child:hover {
    text-decoration: none;
}

.breadcrumb ul li::after {
    content: "\e9e9";
    font-family: 'munnichit-icons' !important;
    color: var(--surface-surface-tertiary);
    margin: 0 10px;
    display: inline-block;
}

.breadcrumb ul li:last-child:not(:only-child) span {
    box-shadow: var(--box-shadow-sm);
}

.breadcrumb ul li:last-child::after {
    display: none;
}

.breadcrumb ul li:first-child {
    position: relative;
}

.breadcrumb ul li:first-child::before {
    content: "\e9e9";
    font-family: 'munnichit-icons' !important;
    color: var(--surface-surface-tertiary);
    margin: 0 10px 0 0;
    position: absolute;
    left: -22px;
    display: inline-block;
}

.breadcrumb ul:has(> li:last-child + li) li:last-child {
    padding: 6px 8px;
    background: var(--surface-surface-primary);
    color: var(--text-text-secondary);
    border-radius: 6px;
}

/* ============================================
   DROPUP PANEL
   ============================================ */
.dropup-panel {
    left: 20px;
    bottom: 100%;
    background: var(--surface-surface-bg);
    border: 1px solid var(--surface-surface-tertiary);
    box-shadow: var(--box-shadow-sm);
    padding: 2px 4px;
    min-width: 150px;
    max-width: calc(100vw - 32px);
}

.dropup-panel.dropup-panel-active {
    display: block !important;
}

.dropup-panel ul li a {
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    margin: 2px 0;
}

body.compact-mode .dropup-panel ul li a {
    padding: 6px 10px;
}

.dropup-panel ul li a:hover {
    background: var(--surface-surface-secondary) !important;
}

.dropup-panel ul li.active a {
    background: var(--surface-surface-primary);
}

/* ============================================
   SIDEBAR
   ============================================ */
aside {
    inset: 0 auto 0 0;
    width: var(--sb-width);
    border-right: 1px solid var(--surface-surface-tertiary);
    background: var(--surface-surface-bg);
}

aside ul {
    gap: 4px;
}

aside>div:first-of-type {
    margin: 0 11px;
}

aside>div:first-of-type input {
    max-height: 34px;
}

aside>div:first-of-type span {
    padding: 8px 12px !important;
}

aside>div:last-of-type {
    padding: 0 16px 16px 16px;
}

aside>div:last-of-type hr {
    margin: 16px 0;
    align-self: center;
    border-color: var(--surface-surface-secondary);
}

aside .input-group span {
    background: transparent;
}

aside>nav {
    padding: 0 16px 0 16px !important;
}

aside a.menu-item {
    padding: 6px 12px;
}

aside div>div nav i {
    color: var(--text-text-tertiary);
}

/* Sidebar - Expanded State */
.sb-expanded aside nav span,
.sb-expanded aside input[type="text"],
.sb-expanded aside label {
    display: block !important;
}

.sb-expanded aside nav a {
    display: flex;
    justify-content: start;
}

.sb-expanded aside nav nav a {
    min-height: 0;
}

.sb-expanded aside nav i {
    display: block !important;
}

.sb-expanded .logo-icon {
    display: none;
}

.sb-expanded aside nav ul li .mnh-icon-chevron-right {
    display: block;
}

.sb-expanded .sidebar-logo .logo-text {
    display: inline-block !important;
}

.sb-expanded aside ul {
    max-width: 100% !important;
}

.sb-expanded .sb-search span {
    padding: 8px 12px !important;
}

.sb-expanded aside>nav,
.sb-expanded aside div>nav {
    display: block !important;
}

.sb-expanded .toggle-nav {
    margin: 0 8px !important;
}

.sb-expanded aside>div:last-of-type>div {
    margin: 0 8px;
}

.sb-expanded .navs-parent>nav ul {
    width: 100%;
}

.sb-expanded .navs-parent>div {
    padding: 16px !important;
}

.sb-expanded .collapse-icon {
    display: inline-block;
}

.sb-expanded .expand-icon{
    display: none;
}

.sb-expanded .collapsed-logo,
.sb-expanded .action-notification  {
    display: none !important;
}

body.sb-expanded .sidebar-search-icon {
    cursor: pointer;
}

/* Sidebar - Collapsed State */
body:not(.sb-expanded) #removeSearch {
    display: none !important;
}

body:not(.sb-expanded) aside li a span,
body:not(.sb-expanded) aside nav ul li .mnh-icon-chevron-right {
    width: 0 !important;
}

body:not(.sb-expanded) .expand-icon {
    display: inline-block;
}

body:not(.sb-expanded) .expanded-logo {
    display: none !important;
}

body:not(.sb-expanded) .brand {
    justify-content: start !important;
}

body:not(.sb-expanded) .brand [data-collapse-desktop] {
    display: none !important;
}

body:not(.sb-expanded) .brand:hover [data-collapse-desktop] {
    display: flex !important;
}

body:not(.sb-expanded) .collapsed-logo:hover~.collapse i,
.collapse:hover i {
    color: var(--text-brand-text-brand-primary) !important;
}

body:not(.sb-expanded) aside .justify-end {
    justify-content: center !important;
}

body:not(.sb-expanded) aside .keep-justify-end {
    justify-content: flex-end !important;
}

body:not(.sb-expanded) .collapse {
    display: none !important;
}

body:not(.sb-expanded) #brand-wrapper:hover #logo-stack,
body:not(.sb-expanded) aside:hover #logo-stack {
    display: none !important;
}

body:not(.sb-expanded) #brand-wrapper:hover #brand-icon {
    display: none !important;
}

body:not(.sb-expanded) #brand-wrapper:hover .collapse,
body:not(.sb-expanded) aside:hover .collapse {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body:not(.sb-expanded) .sb-collapsed-none {
    display: none;
}

/* Sidebar - Logo Styles */
.collapsed-logo {
    background-image: var(--logo-icon);
    width: 45px;
    background-size: contain;
    height: 35px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
}

.expanded-logo {
    background-image: var(--logo-img-bg);
    width: 110px;
    background-size: contain;
    height: 32px;
    flex-shrink: 0;
    background-repeat: no-repeat;
}

.collapse-icon {
    display: inline-block;
}

.expand-icon {
    display: none;
}

/* Sidebar - Navigation Parent */
.navs-parent>nav {
    padding: 16px !important;
}

.navs-parent nav.sticky-list {
    border-top: 1px solid var(--surface-surface-tertiary);
    padding-top: 16px !important;
}

aside .navs-parent>nav ul {
    width: 46px;
}

.aside ul {
    max-width: 38px;
    gap: 4px;
}

/* ============================================
   NAVIGATION
   ============================================ */
nav .active-parent:before {
    background-color: var(--surface-surface-tertiary);
}

nav a {
    color: var(--text-text-secondary);
}

nav>ul>li>ul>li a {
    color: var(--text-text-body);
}

nav i {
    color: var(--surface-surface-quaternary);
}

nav a.active i,
nav a:hover i {
    color: var(--text-brand-text-brand-primary);
}

nav ul>li>ul::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 15px;
    width: 2px;
    height: calc(100% - 30px);
    background-color: var(--surface-surface-tertiary);
    z-index: 10;
}

nav ul>li>ul>li:last-child:before {
    content: "";
    position: absolute;
    left: 18px;
    top: 20px;
    width: 5px;
    height: calc(100% - 35px);
}

nav ul li span {
    margin-right: auto;
}

.card,
nav ul li a.active,
nav ul li a:hover,
nav ul li a:focus {
    background-color: var(--surface-surface-primary);
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-content {
    max-height: 0;
    opacity: 0;
}

.dropdown.active .dropdown-content {
    opacity: 1;
    max-height: 100%;
}

.dropdown.active>.mnh-icon-chevron-right {
    transform: rotate(90deg);
}

.dropdown-list {
    max-height: 170px;
    overflow-y: auto;
    top: 35px;
}

.dropdown-list div {
    padding: 10px 14px;
    cursor: pointer;
}

.dropdown-list div:hover {
    background-color: var(--surface-surface-primary);
}

.dropdown-item.active {
    background-color: var(--surface-surface-primary);
}

.action-notification{
    font-style: normal;
    top: 1px;
    right: 6px;
    height: 16px;
    width: 16px; 
}

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
    margin-left: 5px;
    display: inline-block;
    position: relative;
    font-weight: 400;
    cursor: help;
}

.sticky_actions .tooltip {
    display: flex;
}

.tooltip:before {
    content: "\eb44";
    font-family: 'munnichit-icons' !important;
}

.tooltip-text {
    position: fixed;
    background-color: var(--grey-800);
    color: var(--white);
    padding: 11px 14px 12px 14px;
    border-radius: 8px;
    z-index: 9999;
    max-width: 400px;
    box-shadow: var(--box-shadow-sm);
    white-space: normal;
    opacity: 0;
    visibility: hidden;
}

.tooltip-text:focus {
    outline: none;
}

.tooltip-text.visible {
    opacity: 1;
    visibility: visible;
}

.tooltip-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
    background: inherit;
    transform: rotate(45deg);
}

.tooltip.warning .tooltip-text {
    background-color: var(--surface-warning-surface-primary);
    color: var(--text-warning-text-primary);
}

.tooltip.warning .tooltip-arrow {
    background-color: var(--surface-warning-surface-primary);
}

/* ============================================
   INPUTS & FORMS
   ============================================ */
label {
    color: var(--text-text-body);
    font-weight: 600;
}

/* Number Input Spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Input Group */
.input-group {
    color: var(--text-text-primary);
    box-shadow: var(--box-shadow-xs);
    display: flex;
    width: 100%;
    border: 1px solid var(--surface-surface-tertiary);
    border-radius: 8px;
}

.input-group>label,
.input-group p {
    font-size: var(--font-xs);
}

.input-group span {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    white-space: nowrap;
    background: var(--surface-surface-primary);
    color: var(--text-text-tertiary);
}

.input-group input,
.input-group textarea,
.input-group select {
    border: 0;
    padding: 10px 14px;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    position: relative;
    font-size: var(--font-s);
    color: var(--text-text-primary);
    line-height: 1.2;
}

.input-group textarea {
    background-color: var(--surface-surface-bg);
}

.input-group span:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-right: 1px solid var(--surface-surface-tertiary);
}

.input-group span:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-left: 1px solid var(--surface-surface-tertiary);
}

.input-group>span:first-child+input,
.input-group>span:first-child+textarea,
.input-group>span:first-child+select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group>input+span,
.input-group>textarea+span,
.input-group>select+span {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group:has(span:first-child):not(:has(span:last-child)) input,
.input-group:has(span:first-child):not(:has(span:last-child)) textarea,
.input-group:has(span:first-child):not(:has(span:last-child)) select {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.input-group:has(span:last-child):not(:has(span:first-child)) input,
.input-group:has(span:last-child):not(:has(span:first-child)) textarea,
.input-group:has(span:last-child):not(:has(span:first-child)) select {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group:not(:has(span)) input,
.input-group:not(:has(span)) textarea,
.input-group:not(:has(span)) select {
    border-radius: 8px;
}

.input-group:has(span:first-child) input,
.input-group:has(span:first-child) textarea,
.input-group:has(span:first-child) select,
.input-group:has(span:last-child) input,
.input-group:has(span:last-child) textarea,
.input-group:has(span:last-child) select {
    border-radius: 0;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--surface-surface-quaternary);
    font-family: var(--font-family);
}

.input-group:hover {
    border: 1px solid var(--surface-brand-surface-brand-secondary);
    box-shadow: var(--box-shadow-sm);
    outline: 1px solid var(--surface-brand-surface-brand-secondary);
}

.input-group:focus-within {
    box-shadow: var(--box-shadow-sm);
    outline: 1px solid var(--surface-brand-surface-brand-secondary);
}

body.user-is-tabbing .input-group:focus-within {
    outline: none;
    box-shadow: var(--box-shadow-sm), 0 0 0 2px var(--surface-brand-surface-brand-primary);
}

body:not(.user-is-tabbing) .input-group input:focus-visible,
body:not(.user-is-tabbing) .input-group textarea:focus-visible,
body:not(.user-is-tabbing) .input-group select:focus-visible {
    outline: none;
}

.input-group input:disabled,
.input-group textarea:disabled {
    color: var(--text-text-body);
    background: var(--surface-surface-primary);
}

.input-group:has(input:disabled):hover {
    border: 1px solid var(--surface-surface-tertiary);
    box-shadow: var(--box-shadow-sm);
    outline: none;
}

.input-group.error {
    border: 1px solid var(--surface-error-surface-secondary);
}

.muted {
    font-weight: 400;
    margin-top: 4px;
    font-size: var(--font-xs);
}

/* Select Dropdown */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px !important;
    background: var(--surface-surface-bg) url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="3" viewBox="0 0 6 3" fill="none"><path d="M1 0.5L3 2.5L5 0.5" stroke="grey" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 10px center;
    background-size: 16px;
    border-radius: 8px;
    cursor: pointer;
}

select[multiple] {
    background: none;
    padding: 0;
}

select option {
    padding: 10px;
    color: var(--text-text-primary);
}


/* ============================================
   CUSTOM SELECT DROPDOWN
   ============================================ */
/* Hide original select immediately to prevent FOUC */
select.dropdown-list {
    display: none !important;
    visibility: hidden !important;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.custom-select-input {
    width: 100%;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="3" viewBox="0 0 6 3" fill="none"><path d="M1 0.5L3 2.5L5 0.5" stroke="grey" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    position: relative;
    padding-right: 36px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-wrapper.is-open .custom-select-input {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="3" viewBox="0 0 6 3" fill="none"><path d="M1 2.5L3 0.5L5 2.5" stroke="grey" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

/* When inside input-group, remove border and adjust styling */
.input-group .custom-select-wrapper {
    border: 0;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group .custom-select-input {
    border: 0;
    border-radius: 0;
    background-position: right 10px center;
    padding-right: 36px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-group .custom-select-wrapper:first-child .custom-select-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .custom-select-wrapper:last-child .custom-select-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-input:focus {
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05), 0 0 0 4px var(--surface-surface-secondary);
    border-color: var(--surface-brand-surface-brand-secondary);
}

.custom-select-input:disabled {
    background-color: var(--surface-surface-primary);
    color: var(--text-text-body);
    cursor: not-allowed;
    opacity: 0.6;
}

.custom-select-wrapper.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.custom-select-wrapper.disabled .custom-select-input {
    cursor: not-allowed;
}

.custom-select-wrapper.disabled .custom-select-tags {
    opacity: 0.6;
    pointer-events: none;
}

.custom-select-tags {
    padding: 4px;
    border: 1px solid var(--surface-surface-tertiary);
    border-radius: 8px;
    background-color: var(--surface-surface-bg);
    min-height: 42px;
    margin-bottom: 4px;
}

.custom-select-tags:focus-within {
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05), 0 0 0 4px var(--surface-surface-secondary);
    outline: 1px solid var(--surface-brand-surface-brand-secondary);
}

.custom-select-multiple-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background-color: var(--surface-surface-primary);
    border: 1px solid var(--surface-surface-tertiary);
    border-radius: 6px;
    font-size: var(--font-xs);
    color: var(--text-text-primary);
    margin: 2px;
}

.custom-select-tag-close {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--text-text-secondary);
    font-weight: 600;
    padding: 0 2px;
    transition: color 0.2s ease;
}

.custom-select-tag-close:hover {
    color: var(--text-text-primary);
}

.custom-select-dropdown {
    position: fixed;
    z-index: 9999;
    background-color: var(--surface-surface-bg);
    border: 1px solid var(--surface-surface-tertiary);
    border-radius: 8px;
    box-shadow: 0px 5px 10px 1px rgba(16, 24, 40, 0.2);
    max-height: 350px;
    overflow: hidden;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
}

.custom-select-search-input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--surface-surface-tertiary);
    border-radius: 8px 8px 0 0;
    background-color: var(--surface-surface-bg);
    color: var(--text-text-primary);
    font-size: var(--font-s);
    outline: none;
    box-sizing: border-box;
}

.custom-select-search-input:focus {
    outline: none;
    background-color: var(--surface-surface-bg);
}

.custom-select-search-input::placeholder {
    color: var(--text-text-secondary);
}

.custom-select-options-container {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 300px;
}

/* On mobile/short viewports: cap height so the list fits on screen and stays scrollable */
@media (max-width: 768px), (max-height: 600px) {
    .custom-select-dropdown {
        max-height: min(350px, calc(100vh - 100px));
        max-height: min(350px, calc(100dvh - 100px));
    }
    .custom-select-options-container {
        max-height: min(300px, calc(100vh - 200px));
        max-height: min(300px, calc(100dvh - 200px));
        -webkit-overflow-scrolling: touch;
    }
}

.custom-select-options-container::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options-container::-webkit-scrollbar-track {
    background: var(--surface-surface-primary);
    border-radius: 4px;
}

.custom-select-options-container::-webkit-scrollbar-thumb {
    background: var(--surface-surface-tertiary);
    border-radius: 4px;
}

.custom-select-options-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-text-secondary);
}

.custom-select-option {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-text-primary);
    font-size: var(--font-s);
    transition: background-color 0.15s ease;
    user-select: none;
}

.custom-select-option:hover:not(.disabled) {
    background-color: var(--surface-surface-primary);
}

.custom-select-option.active {
    background-color: var(--surface-surface-primary);
}

.custom-select-option.selected {
    background-color: var(--surface-brand-surface-brand-secondary);
    color: var(--white);
    font-weight: 500;
}

.custom-select-option.selected:hover:not(.disabled) {
    background-color: var(--surface-brand-surface-brand-secondary);
}

.custom-select-option.disabled {
    color: var(--text-text-body);
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.custom-select-group {
    padding: 8px 14px 8px 14px;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--surface-surface-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.custom-select-group-item {
    padding-left: 24px;
}

.custom-select-no-results {
    padding: 10px 14px;
    color: var(--text-text-body);
    font-size: var(--font-s);
    text-align: center;
    font-style: italic;
}

.custom-select-chevron {
    display: none; /* Hidden as we use background image on input */
}


/* ============================================
   RADIO BUTTONS
   ============================================ */
.radio.disabled {
    pointer-events: none;
}

.radio:not(.disabled) label::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--surface-brand-surface-brand-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.radio:hover {
    outline-width: 1px;
}

.radio:hover,
.radio.checked:not(.disabled) {
    border-color: var(--surface-brand-surface-brand-secondary);
    outline: 1px solid var(--surface-brand-surface-brand-secondary);
}

.radio:not(.disabled) input[type="radio"]:checked+label {
    background: var(--surface-surface-bg);
    border: 2px solid var(--surface-brand-surface-brand-primary);
}

.radio input[type="radio"]:checked:not(.disabled)+label::after {
    opacity: 1;
}

/* Radio - Success Variant */
.radio.success label::after {
    background: var(--surface-success-surface-secondary);
}

.radio.success:hover,
.radio.success.checked {
    border-color: var(--surface-success-surface-secondary);
    outline: 1px solid var(--surface-success-surface-secondary);
}

.radio.success input[type="radio"]:checked+label {
    border: 2px solid var(--surface-success-surface-secondary);
}

.radio.success>div:first-child>span:has(i) {
    background-color: var(--surface-success-surface-primary);
    color: var(--text-success-text-primary);
}

/* Radio - Warning Variant */
.radio.warning label::after {
    background: var(--surface-warning-surface-secondary);
}

.radio.warning:hover,
.radio.warning.checked {
    border-color: var(--surface-warning-surface-secondary);
    outline: 1px solid var(--surface-warning-surface-secondary);
}

.radio.warning input[type="radio"]:checked+label {
    border: 2px solid var(--surface-warning-surface-secondary);
}

.radio.warning>div:first-child>span:has(i) {
    background-color: var(--surface-warning-surface-primary);
    color: var(--text-warning-text-primary);
}

/* ============================================
   CHECKBOXES
   ============================================ */
.checkbox>span:first-of-type {
    border-radius: 4px;
}

.checkbox:has(div):hover,
.checkbox.checked:has(div) {
    border-color: var(--surface-brand-surface-brand-secondary);
    outline: 1px solid var(--surface-brand-surface-brand-secondary);
}

.checkbox:hover>span:first-of-type,
.checkbox.checked>span:first-of-type {
    border: 1px solid var(--surface-brand-surface-brand-primary);
}

.checkbox>span:first-of-type::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: 2px solid var(--surface-brand-surface-brand-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
}

.checkbox.checked>span:first-of-type::before {
    opacity: 1 !important;
}

.checkbox input[type="checkbox"] {
    position: absolute;
    bottom: 50%;
    left: 25px;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.checkbox.disabled,
.checkbox input:disabled+span {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox - Success Variant */
.checkbox.success:has(div):hover,
.checkbox.success.checked:has(div) {
    border-color: var(--surface-success-surface-secondary);
    outline: 1px solid var(--surface-success-surface-secondary);
}

.checkbox.success:hover>span:first-of-type,
.checkbox.success.checked>span:first-of-type {
    border: 1px solid var(--surface-success-surface-secondary);
    background: var(--surface-success-surface-primary);
}

.checkbox.success>span:first-of-type::before {
    background: var(--surface-success-surface-primary);
    border-color: var(--surface-success-surface-secondary);
}

/* Checkbox - Warning Variant */
.checkbox.warning:has(div):hover,
.checkbox.warning.checked:has(div) {
    border-color: var(--surface-warning-surface-secondary);
    outline: 1px solid var(--surface-warning-surface-secondary);
}

.checkbox.warning:hover>span:first-of-type,
.checkbox.warning.checked>span:first-of-type {
    border: 1px solid var(--surface-warning-surface-secondary);
    background: var(--surface-warning-surface-primary);
}

.checkbox.warning>span:first-of-type::before {
    background: var(--surface-warning-surface-primary);
    border-color: var(--surface-warning-surface-secondary);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background-color: var(--surface-surface-primary);
    border-radius: 8px;
}

.card span:first-of-type {
    color: var(--text-text-primary);
}

.important-card {
    border-color: var(--surface-brand-surface-brand-subtle);
    color: var(--text-brand-text-brand-secondary);
}

.important-card a {
    font-weight: 600;
}

.important-card i {
    color: var(--surface-brand-surface-brand-secondary);
}

/* ============================================
   PILLS
   ============================================ */
.pill {
    padding: 5px 10px 5px 20px;
    border-radius: 16px;
    position: relative;
    font-weight: 500;
    display: block;
    float: left;
}

.pill:before {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    position: absolute;
    border-radius: 100%;
    top: calc(50% - 2.5px);
    left: 8px;
}

.pill.bg-light:before {
    background: var(--surface-surface-quaternary);
}

.pill.bg-success:before {
    background: var(--surface-success-surface-secondary);
}

.pill.bg-danger:before {
    background: var(--surface-error-surface-secondary);
}

.pill.bg-warning:before {
    background: var(--surface-warning-surface-secondary);
}

/* ============================================
   TABS
   ============================================ */
#tab-container {
    margin-bottom: 32px;
}

#tabs {
    border-bottom: 1px solid var(--surface-surface-tertiary);
    width: 100%;
}

#tabs a {
    padding: 10px 0;
    margin: 0 5px;
    font-weight: 400;
    text-align: center;
    border: 1px solid transparent;
    color: var(--text-text-body);
    border-bottom: 2px solid transparent;
}

#tabs a:first-child {
    margin-left: 0;
}

#tabs a:last-child {
    margin-right: 0;
}

#tabs a.active{
    border-bottom: 2px solid var(--surface-brand-surface-brand-primary) !important;
    color: var(--text-text-tertiary);
    font-weight: 600;
}

#tabs a:hover {
    border-bottom: 2px solid var(--surface-surface-tertiary);
}

#tabs a.active,
#tabs a:hover {
    text-decoration: none;
}

#tabs a.active i span{
    color: var(--text-brand-text-brand-primary) !important;
    background-color: var(--white) !important;
    border: 1px solid var(--surface-brand-surface-brand-primary) !important;
    outline: 1px solid var(--white) !important;
}

#tabs a.active i {
    background: var(--surface-brand-surface-brand-primary) !important;
    color: var(--white);
}

#tabs a:hover i {
    background: var(--surface-surface-tertiary);
}

#tabs a i {
    background: var(--surface-surface-secondary);
    color: var(--surface-surface-quaternary);
    padding: 5px;
    border-radius: 100%;
    margin-right: 5px;
}

#tabs .exclamation {
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
}
/* ============================================
   TABLES
   ============================================ */
.table-parent {
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--surface-surface-tertiary);
}

.table {
    --table-scroll-offset: 0px;
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.table:not(:has(+ .flex.justify-center.mt-10.mb-10)) {
    border-radius: 8px;
}

.table::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 15px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: linear-gradient(90deg, rgba(16, 24, 40, 0.16), rgba(16, 24, 40, 0));
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    z-index: 2;
    transform: translateX(var(--table-scroll-offset, 0));
    will-change: transform;
}

.table.has-scroll-left::before {
    opacity: 1;
}

.table-parent > .table:has(~ * > #pagesList) {
  border-bottom: 1px solid var(--surface-surface-secondary);
}

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background-color: transparent;
}

table th,
table td {
    padding: 10px 24px;
    background-color: inherit;
    text-align: left;
    font-size: var(--font-s);
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

table th strong,
table td strong {
    font-size: inherit;
}

table thead th {
    color: var(--text-text-primary);
    background-color: var(--surface-surface-primary);
    white-space: nowrap;
}

table tbody tr {
    background-color: var(--surface-surface-bg);
    border-top: 1px solid var(--surface-surface-secondary);
}

table tbody tr:hover {
    background: var(--surface-surface-primary) !important;
}

table tbody tr:nth-child(even) {
    background-color: var(--surface-surface-light);
}

table tbody .sticky_actions {
    background-color: inherit;
}

table tbody tr td:first-of-type i {
    color: var(--surface-surface-extra);
}

/* Table - Row Types */
.header-row {
    color: var(--text-text-quaternary);
    background: var(--surface-surface-light) !important;
}

.header-row td {
    padding: 6px 24px;
}

/* Table - Sticky Actions */
th.sticky_actions,
td.sticky_actions {
    position: sticky;
    z-index: 3;
    right: 0;
    overflow: visible;
}

th.sticky_actions {
    text-align: right;
}

td.sticky_actions span {
    width: max-content;
}

.table.is-scrollable th.sticky_actions,
.table.is-scrollable td.sticky_actions {
    border-left: 1px solid var(--surface-surface-secondary);
}

.table.has-scroll-right th.sticky_actions::after,
.table.has-scroll-right td.sticky_actions::after {
    opacity: 1;
}

.table.has-scroll-left th.sticky_actions,
.table.has-scroll-left td.sticky_actions,
.table.has-scroll-right th.sticky_actions,
.table.has-scroll-right td.sticky_actions {
    filter: drop-shadow(-1px 0 0 var(--surface-surface-secondary));
}

.table.has-scroll-right th.sticky_actions,
.table.has-scroll-right td.sticky_actions {
    border-bottom-color: var(--surface-surface-secondary);
}

.actions-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
    height: 100%;
}

.actions-toggle .actions-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--surface-surface-quaternary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.actions-toggle .actions-menu:hover {
    color: var(--text-text-secondary);
}

.actions-desktop {
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.actions-mobile {
    right: 30px;
    display: flex;
    gap: 10px;
    background: var(--surface-surface-bg);
    border: 1px solid var(--surface-surface-tertiary);
    border-radius: 8px;
    padding: 10px;
    box-shadow: var(--box-shadow-sm);
    z-index: 10;
}

.actions-mobile a {
    color: var(--surface-surface-quaternary);
}

.actions-mobile a:hover {
    color: var(--text-text-secondary);
}

.tables-dropdown-menu {
    overflow-y: auto;
    max-height: 400px;
    min-width: 250px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tables-dropdown-menu::-webkit-scrollbar {
    display: none;
}

th.sticky_actions::after,
td.sticky_actions::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 4;
}

th.sticky_actions::after,
td.sticky_actions::after {
    left: -15px;
    right: auto;
    background: linear-gradient(to left, rgba(16, 24, 40, 0.16), rgba(16, 24, 40, 0));
}

/* Table - Actions */
.actions {
    color: var(--surface-surface-quaternary);
    font-size: 18px;
}

.actions a:hover {
    text-decoration: none;
    color: var(--text-text-secondary);
}

.actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Table - Toggle Icon */
.toggle-icon {
    display: inline-block;
    transform-origin: 50% 50%;
    margin-right: 6px;
}

.toggle-icon.rotated {
    transform: rotate(90deg);
}

/* Table - Sort Icon */
.sort-icon {
    margin-left: 5px;
    cursor: pointer;
}

.sort-icon i {
    font-weight: 800;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 50%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    max-width: 500px;
    transform: translateX(250px);
}

.toast {
    --delay: 7s;
    min-width: 400px;
    max-width: 100%;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: var(--box-shadow-sm);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.5s forwards, fadeOut 0.5s ease-out var(--delay) forwards;
}

.toast.success {
    background: var(--surface-success-surface-primary);
    color: var(--text-success-text-primary);
}

.toast.warning {
    background: var(--surface-warning-surface-primary);
    color: var(--text-warning-text-primary);
}

.toast.danger {
    background: var(--surface-error-surface-primary);
    color: var(--text-error-text-primary);
}

/* ============================================
   TOGGLE BUTTON
   ============================================ */
.toggle.active {
    box-shadow: var(--box-shadow-inset-xs);
    background-color: var(--surface-surface-light);
}

/* ============================================
   SCROLL FADE
   ============================================ */
.scroll-fade {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

.scroll-fade.fade-right {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - var(--fade)), transparent);
    mask-image: linear-gradient(to right, black calc(100% - var(--fade)), transparent);
}

.scroll-fade.fade-left {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black var(--fade));
    mask-image: linear-gradient(to right, transparent 0, black var(--fade));
}

.scroll-fade.fade-left.fade-right {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black var(--fade), black calc(100% - var(--fade)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black var(--fade), black calc(100% - var(--fade)), transparent 100%);
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
    display: inline-flex;
    align-items: center;
    text-align: center;
    width: 100%;
    color: var(--text-text-tertiary);
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--grey-300);
}

.divider:not(:empty)::before {
    margin-right: 0.75em;
}

.divider:not(:empty)::after {
    margin-left: 0.75em;
}

/* ============================================
   IMPORTANT ICON
   ============================================ */
.important-icon {
    font-size: var(--font-m);
    border-radius: 8px;
}

/* ============================================
   ACCESSIBILITY BAR
   ============================================ */
#accessibility-bar {
    background-color: #FFFFFF80;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

[data-theme="dark"] #accessibility-bar {
    background-color: #1C1C1C80;
}

/* Appearance Dropup */
#appearance-dropup {
    width: clamp(260px, calc(100vw - 48px), 330px);
    padding: 12px;
}

@media (max-width: 768px) {
    #appearance-dropup {
        position: absolute;
        top: auto;
        bottom: 100%;
        left: 20px;
        right: auto;
        width: min(330px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        min-width: min(260px, calc(100vw - 24px));
    }
}

#appearance-dropup .radio {
    border: 0;
    outline: none !important;
    padding: 0;
}

#appearance-dropup a {
    box-shadow: none;
}

aside nav #appearance-dropup .toggle {
    display: inline-flex !important;
    cursor: pointer;
    align-items: center;
}

aside nav #appearance-dropup a.active i {
    color: var(--surface-button-text-button-secondary);
}
/* Hidden checkbox */
.toggle input {
    display: none;
}

/* Track */
.toggle-track {
    width: 44px;
    height: 24px;
    background: var(--surface-surface-primary);
    border-radius: 999px;
    position: relative;
    border: 1px solid var(--surface-surface-tertiary);
    transition: background 0.25s ease;
}

/* Thumb */
.toggle-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: transform 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Checked state */
.toggle input:checked + .toggle-track {
    background: var(--surface-brand-surface-brand-primary);
}

.toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

/* ============================================
   SCREEN READER ONLY (Accessibility)
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Ensure focus indicators are visible for keyboard navigation */
.custom-select-input:focus-visible {
    outline: 2px solid var(--surface-brand-surface-brand-secondary);
    outline-offset: 2px;
}

.custom-select-option:focus {
    outline: 2px solid var(--surface-brand-surface-brand-secondary);
    outline-offset: -2px;
}

/* Aria-live region styling */
[role="status"][aria-live] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============================================
   COMPACT MODE
   ============================================ */
body.compact-mode table th,
body.compact-mode table td { padding: 5px 10px; }
body.compact-mode .p-30 { padding: 20px;}
body.compact-mode .p-20 { padding: 10px;}
body.compact-mode .p-10 { padding: 5px; }

body.compact-mode .fs-2xl { font-size: var(--font-l); }
body.compact-mode .fs-xl { font-size: var(--font-m); }
body.compact-mode .fs-l { font-size: var(--font-s); }
body.compact-mode .fs-m { font-size: var(--font-s); }
body.compact-mode .fs-s { font-size: var(--font-s); }
body.compact-mode .fs-xs { font-size: var(--font-xs); }

/* Scale table text in compact mode */
body.compact-mode table th,
body.compact-mode table td {
    font-size: var(--font-s);
}

/* Scale buttons and other common elements in compact mode */
body.compact-mode button,
body.compact-mode .btn,
body.compact-mode table tfoot button,
body.compact-mode .breadcrumb ul {
    font-size: var(--font-s);
}

/* Scale input fields in compact mode */
body.compact-mode .input-group input,
body.compact-mode .input-group textarea,
body.compact-mode .input-group select {
    font-size: var(--font-s);
}

/* Scale input group labels in compact mode (they use --font-xs as base) */
body.compact-mode .input-group > label,
body.compact-mode .input-group p {
    font-size: var(--font-xs);
}

/* Scale tabs, labels, and other text elements in compact mode */
body.compact-mode #tabs a,
body.compact-mode label,
body.compact-mode h1,
body.compact-mode h2,
body.compact-mode h3,
body.compact-mode h4,
body.compact-mode h5,
body.compact-mode h6,
body.compact-mode p,
body.compact-mode li,
body.compact-mode span {
    font-size: var(--font-s);
}

body.compact-mode button,
body.compact-mode main .btn,
body.compact-mode .input-group input,
body.compact-mode .input-group textarea,
body.compact-mode .input-group select {
    padding: 6px 10px;
}

/* ============================================
   STANDARD MODE (when neither compact nor large)
   ============================================ */
body:not(.compact-mode):not(.large-mode) .fs-2xl { font-size: var(--font-2xl); }
body:not(.compact-mode):not(.large-mode) .fs-xl { font-size: var(--font-xl); }
body:not(.compact-mode):not(.large-mode) .fs-l { font-size: var(--font-l); }
body:not(.compact-mode):not(.large-mode) .fs-m { font-size: var(--font-m); }
body:not(.compact-mode):not(.large-mode) .fs-s { font-size: var(--font-s); }
body:not(.compact-mode):not(.large-mode) .fs-xs { font-size: var(--font-xs); }

/* Scale table text in standard mode */
body:not(.compact-mode):not(.large-mode) table th,
body:not(.compact-mode):not(.large-mode) table td {
    font-size: var(--font-m);
}

/* Scale buttons and other common elements in standard mode */
body:not(.compact-mode):not(.large-mode) button,
body:not(.compact-mode):not(.large-mode) .btn,
body:not(.compact-mode):not(.large-mode) table tfoot button,
body:not(.compact-mode):not(.large-mode) .breadcrumb ul {
    font-size: var(--font-m);
}

/* Scale input fields in standard mode */
body:not(.compact-mode):not(.large-mode) .input-group input,
body:not(.compact-mode):not(.large-mode) .input-group textarea,
body:not(.compact-mode):not(.large-mode) .input-group select {
    font-size: var(--font-m);
}

/* Scale input group labels in standard mode */
body:not(.compact-mode):not(.large-mode) .input-group > label,
body:not(.compact-mode):not(.large-mode) .input-group p {
    font-size: var(--font-s);
}

/* Scale tabs, labels, and other text elements in standard mode */
body:not(.compact-mode):not(.large-mode) #tabs a,
body:not(.compact-mode):not(.large-mode) label,
body:not(.compact-mode):not(.large-mode) h1,
body:not(.compact-mode):not(.large-mode) h2,
body:not(.compact-mode):not(.large-mode) h3,
body:not(.compact-mode):not(.large-mode) h4,
body:not(.compact-mode):not(.large-mode) h5,
body:not(.compact-mode):not(.large-mode) h6,
body:not(.compact-mode):not(.large-mode) p,
body:not(.compact-mode):not(.large-mode) li,
body:not(.compact-mode):not(.large-mode) span {
    font-size: var(--font-m);
}

/* ============================================
   large MODE
   ============================================ */
body.large-mode .fs-2xl { font-size: var(--font-3xl); }
body.large-mode .fs-xl { font-size: var(--font-2xl); }
body.large-mode .fs-l { font-size: var(--font-xl); }
body.large-mode .fs-m { font-size: var(--font-l); }
body.large-mode .fs-s { font-size: var(--font-m); }
body.large-mode .fs-xs { font-size: var(--font-s); }

/* Scale table text in large mode */
body.large-mode table th,
body.large-mode table td {
    font-size: var(--font-l);
}

/* Scale buttons and other common elements in large mode */
body.large-mode button,
body.large-mode .btn,
body.large-mode table tfoot button,
body.large-mode .breadcrumb ul {
    font-size: var(--font-l);
}

/* Scale input fields in large mode */
body.large-mode .input-group input,
body.large-mode .input-group textarea,
body.large-mode .input-group select {
    font-size: var(--font-l);
}

/* Scale input group labels in large mode (they use --font-xs as base, scale like .fs-xs) */
body.large-mode .input-group > label,
body.large-mode .input-group p {
    font-size: var(--font-m);
}

/* Scale tabs, labels, and other text elements in large mode */
body.large-mode #tabs a,
body.large-mode label,
body.large-mode h1,
body.large-mode h2,
body.large-mode h3,
body.large-mode h4,
body.large-mode h5,
body.large-mode h6,
body.large-mode p,
body.large-mode li,
body.large-mode span {
    font-size: var(--font-l);
}

/* Ensure footer text elements are the same size */
#footer,
#footer a,
#footer span {
    font-size: var(--font-xs) !important;
}

body.compact-mode #footer,
body.compact-mode #footer a,
body.compact-mode #footer span {
    font-size: var(--font-xs) !important;
}

body:not(.compact-mode):not(.large-mode) #footer,
body:not(.compact-mode):not(.large-mode) #footer a,
body:not(.compact-mode):not(.large-mode) #footer span {
    font-size: var(--font-xs) !important;
}

body.large-mode #footer,
body.large-mode #footer a,
body.large-mode #footer span {
    font-size: var(--font-s) !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .toggle-label::before,
    .toggle-label::after {
        transition: none;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    #header .important-card {
        background: var(--primary-50);
        padding: 10px;
        border: none;
    }

    #tabs {
        border: 0;
    }

    #tabs a {
        margin: 0;
        width: 100%;
        float: left;
        text-align: left;
        border-bottom: 1px solid var(--grey-300);
    }

    #tabs a:first-child,
    #tabs a:last-child {
        margin-left: unset;
        margin-right: unset;
    }

    #toast-container {
        left: 30px;
        right: 30px;
        max-width: 100%;
        transform: translateX(0px);
    }

    .toast {
        min-width: auto;
        width: 100%;
        max-width: 100%;
    }
}

/* Modal Overlay - Reusable class for all modals */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.75);
}