html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
}

#app, .mud-layout {
    min-height: 100vh;
}

.mud-main-content {
    overflow-y: auto;
    height: calc(100vh - 64px);
    padding-bottom: 80px;
}

.mud-dialog {
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
}

.mud-dialog-content {
    overflow-y: auto !important;
    max-height: calc(90vh - 140px) !important;
    flex: 1 1 auto;
}

.mud-dialog-actions {
    padding: 16px 24px !important;
    margin-top: 16px;
    flex-shrink: 0;
    border-top: 1px solid rgba(0,0,0,0.12);
    background: white;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEz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M3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Remove unwanted space in nav menu when collapsed */
.mud-drawer-content {
    padding-top: 0 !important;
}

.mud-navmenu {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Target the first list in navmenu to remove top padding */
.mud-navmenu > .mud-list {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Remove space from nav group collapse containers */
.mud-nav-group .mud-collapse-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.mud-nav-group .mud-nav-group-items {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.mud-collapse-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

.mud-collapse-entered {
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove bottom margin from nav group headers */
.mud-nav-group > .mud-list-item {
    margin-bottom: 0 !important;
}

/* Target the list inside nav groups */
.mud-navmenu .mud-list {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove padding between nav group and its children */
.mud-nav-group .mud-list {
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure collapsed items have no extra space */
.mud-collapse-hidden {
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

/* All navigation group headers bold */
.mud-nav-group > .mud-list-item {
    font-weight: 600 !important;
}

.mud-nav-group > .mud-list-item .mud-list-item-text,
.mud-nav-group > .mud-list-item .mud-typography {
    font-weight: 600 !important;
}

/* Main navigation group header styling */
.nav-group-header > .mud-list-item {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
    border-left: 3px solid var(--mud-palette-primary) !important;
}

.nav-group-header > .mud-list-item .mud-list-item-text {
    color: var(--mud-palette-primary) !important;
}

.nav-group-header > .mud-list-item:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
}

.nav-group-header > .mud-list-item .mud-icon-root {
    color: var(--mud-palette-primary) !important;
}

/* Red asterisks for required/mandatory fields */
.mud-input-label-text::after,
.mud-input-label::after {
    content: "" !important;
}

.mud-input-required .mud-input-label-text::after {
    content: " *" !important;
    color: #f44336 !important;
    font-weight: bold !important;
}

label[for] .mud-input-label-text + span,
.mud-input-label span.mud-input-label-asterisk {
    color: #f44336 !important;
    font-weight: bold !important;
}

/* Ensure MudBlazor popovers/menus appear above dialogs and drawer */
.mud-popover-provider {
    z-index: 30000 !important;
}

.mud-popover {
    z-index: 30000 !important;
}

/* Fix for MudSelect dropdowns inside MudDialog - allow overflow */
.mud-dialog,
.mud-dialog-content,
.mud-dialog .mud-paper,
.mud-dialog-container,
.mud-dialog .mud-tabs-panels,
.mud-dialog .mud-tab-panel {
    overflow: visible !important;
}

/* Native HTML Select styled to match MudBlazor Outlined variant with floating label */
.mud-input-control-native {
    position: relative;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 4px;
}

.mud-input-control-native .mud-input-slot {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    background-color: transparent;
    transition: border-color 0.2s ease;
    min-height: 40px;
}

.mud-input-control-native .mud-input-slot:hover {
    border-color: rgba(0, 0, 0, 0.87);
}

.mud-input-control-native.focused .mud-input-slot {
    border-color: var(--mud-palette-primary, #1976d2);
    border-width: 2px;
}

.mud-input-control-native .mud-input-label {
    position: absolute;
    left: 12px;
    top: -9px;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    background-color: white;
    padding: 0 4px;
    font-weight: 400;
    line-height: 1;
    z-index: 1;
    transition: color 0.2s ease;
}

.mud-input-control-native.focused .mud-input-label {
    color: var(--mud-palette-primary, #1976d2);
}

.mud-input-control-native .mud-input-label.required::after {
    content: " *";
    color: #f44336;
}

.mud-input-control-native select {
    width: 100%;
    padding: 10px 32px 10px 12px;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    background-color: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(0,0,0,0.54)'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 24px;
    color: rgba(0, 0, 0, 0.87);
    line-height: 1.4375em;
}

.mud-input-control-native select:focus {
    outline: none;
}

.mud-input-control-native select:disabled {
    background-color: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
}

.mud-input-control-native select option {
    padding: 8px 12px;
}

/* Dense variant */
.mud-input-control-native.dense .mud-input-slot {
    min-height: 36px;
}

.mud-input-control-native.dense select {
    padding: 7px 32px 7px 12px;
    font-size: 0.875rem;
}

.mud-input-control-native.dense .mud-input-label {
    top: -8px;
    font-size: 0.7rem;
}

/* Legacy fallback classes for existing usage */
.native-select-wrapper {
    position: relative;
    width: 100%;
}

.native-select-wrapper label {
    display: block;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 4px;
    font-weight: 400;
}

.native-select-wrapper label.required::after {
    content: " *";
    color: #f44336;
    font-weight: bold;
}

.native-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    background-color: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(0,0,0,0.54)'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 32px;
}

.native-select:hover {
    border-color: rgba(0, 0, 0, 0.87);
}

.native-select:focus {
    outline: none;
    border-color: var(--mud-palette-primary, #1976d2);
    border-width: 2px;
}

.native-select:disabled {
    background-color: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
}

.native-select option {
    padding: 8px 12px;
}

.native-select.dense {
    padding: 6px 10px;
    font-size: 0.8125rem;
}

/* Gemini-style custom select - matches MudBlazor appearance */
.custom-mud-select {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-family: "Roboto", sans-serif;
    color: #424242;
    background-color: #fff;
    border: 1px solid #c4c4c4;
    border-radius: 4px;
    outline: none;
    transition: border 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23757575%22%20d%3D%22M7%2010l5%205%205-5z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.custom-mud-select:hover {
    border-color: #424242;
}

.custom-mud-select:focus {
    border: 2px solid var(--mud-palette-primary, #594AE2);
    padding: 7px 11px;
}

.custom-mud-select:disabled {
    background-color: #f5f5f5;
    color: #bdbdbd;
    cursor: not-allowed;
}

.custom-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
    display: block;
    font-weight: 500;
}

.custom-label.required::after {
    content: " *";
    color: #f44336;
}
