/* ============================================================
   No Wrong Door — Global Stylesheet
   De-Material-ized MudBlazor theme overrides
   ============================================================ */

/* --- Font --- */
html, body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #FAFAF8;
    color: #1A1A2E;
}

/* --- MudBlazor CSS variable overrides (de-Material) --- */
:root {
    /* Border radius — rounder than Material's 4px */
    --mud-default-borderradius: 10px;

    /* Kill the cold grey Material ripple feel */
    --mud-ripple-color: rgba(27, 94, 68, 0.12);

    /* Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #C8C6BE #F0EFE8;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #F0EFE8;
}
::-webkit-scrollbar-thumb {
    background: #C8C6BE;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #A8A69E;
}

/* --- Drawer: dark forest green, not Material grey --- */
.mud-drawer {
    background-color: #112D23 !important;
    border-right: none !important;
}

.mud-drawer .mud-nav-link {
    color: #A8D5BC !important;
    border-radius: 8px !important;
    margin: 2px 10px !important;
    padding: 8px 12px !important;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.mud-drawer .mud-nav-link:hover,
.mud-drawer .mud-nav-link.active {
    background-color: rgba(82, 183, 136, 0.18) !important;
    color: #D4EDE1 !important;
}

.mud-drawer .mud-nav-link.active {
    background-color: rgba(82, 183, 136, 0.22) !important;
    border-left: 3px solid #52B788;
    padding-left: 9px !important;
}

.mud-nav-group .mud-nav-group-title {
    color: rgba(212, 237, 225, 0.5) !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding: 12px 22px 4px !important;
}

/* --- App bar --- */
.mud-appbar {
    background-color: #1B5E44 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* --- Buttons: no ALL-CAPS, no harsh shadows --- */
.mud-button-root {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}

.mud-button-filled.mud-button-filled-primary {
    background-color: #1B5E44 !important;
    box-shadow: 0 1px 3px rgba(17,45,35,0.2) !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background-color: #134534 !important;
    box-shadow: 0 3px 8px rgba(17,45,35,0.25) !important;
}

.mud-button-filled.mud-button-filled-secondary {
    background-color: #F4A261 !important;
    color: #1A1A2E !important;
    box-shadow: 0 1px 3px rgba(17,45,35,0.15) !important;
}

/* --- Cards: clean, no heavy elevation --- */
.mud-card {
    border-radius: 12px !important;
    border: 1px solid #E2E0D8 !important;
    box-shadow: 0 1px 4px rgba(17,45,35,0.07) !important;
    background-color: #FFFFFF !important;
}

.mud-card:hover {
    box-shadow: 0 4px 14px rgba(17,45,35,0.10) !important;
}

/* --- Paper: warm background, no harsh shadows --- */
.mud-paper {
    background-color: #FFFFFF;
    border-radius: 10px !important;
}

.mud-paper-outlined {
    border: 1px solid #E2E0D8 !important;
    box-shadow: none !important;
}

/* --- Chips: rounded, not pill-shaped by default --- */
.mud-chip {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.8125rem !important;
}

/* --- Input fields: clean border, warm focus --- */
.mud-input-outlined .mud-input-outlined-border {
    border-color: #C8C6BE !important;
    border-radius: 8px !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: #1B5E44 !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: #1B5E44 !important;
    border-width: 1.5px !important;
}

/* --- Tables --- */
.mud-table .mud-table-head .mud-table-row .mud-table-cell {
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #4A5568 !important;
    background-color: #F0EFE8 !important;
}

/* --- Tabs: underline style, not Material pill --- */
.mud-tab {
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: 0.9375rem !important;
    letter-spacing: 0 !important;
}

.mud-tab.mud-tab-active {
    font-weight: 600 !important;
    color: #1B5E44 !important;
}

.mud-tabs-tabbar-indicator {
    background-color: #1B5E44 !important;
    height: 2px !important;
    border-radius: 2px !important;
}

/* --- Badges, alerts --- */
.mud-alert-filled-success { background-color: #27AE60 !important; }
.mud-alert-filled-warning { background-color: #E67E22 !important; }
.mud-alert-filled-error   { background-color: #C0392B !important; }
.mud-alert-filled-info    { background-color: #2471A3 !important; }

.mud-alert {
    border-radius: 10px !important;
}

/* --- Snackbar --- */
.mud-snackbar {
    border-radius: 10px !important;
    font-weight: 500 !important;
}

/* --- Dialog --- */
.mud-dialog {
    border-radius: 14px !important;
}

.mud-dialog-title {
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

/* --- Progress / spinner --- */
.mud-progress-circular svg circle {
    stroke: #1B5E44 !important;
}

/* --- Blazor error UI --- */
#blazor-error-ui {
    background: #FFF3CD;
    bottom: 0;
    border-top: 2px solid #E67E22;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #1A1A2E;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    font-size: 1rem;
}

/* --- Form validation --- */
.valid.modified:not([type=checkbox]) {
    outline: 1.5px solid #27AE60;
    border-radius: 6px;
}

.invalid {
    outline: 1.5px solid #C0392B;
    border-radius: 6px;
}

.validation-message {
    color: #C0392B;
    font-size: 0.8125rem;
    margin-top: 2px;
}

/* --- Utility classes --- */
.nwd-section {
    padding: 2.5rem 2rem;
}

.nwd-hero {
    background: linear-gradient(135deg, #1B5E44 0%, #134534 100%);
    color: #FFFFFF;
}

.nwd-surface {
    background-color: #FFFFFF;
    border: 1px solid #E2E0D8;
    border-radius: 12px;
    padding: 1.5rem;
}

.nwd-stat {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #1B5E44;
    line-height: 1;
}

.nwd-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4A5568;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.nwd-badge-urgent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(192, 57, 43, 0.1);
    color: #C0392B;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.nwd-badge-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(39, 174, 96, 0.1);
    color: #1E8449;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}
