/* ------------------- GLOBAL ------------------- */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

.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;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ------------------- LOADING ------------------- */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            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;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 283;
    }

    50% {
        stroke-dashoffset: 70;
        transform: rotate(45deg);
    }

    100% {
        stroke-dashoffset: 283;
        transform: rotate(360deg);
    }
}

/* ------------------- TABLES ------------------- */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
}

    table th, table td {
        border: 1px solid #ddd;
        padding: 0.5rem 0.75rem;
        text-align: left;
    }

    table th {
        background-color: #f5f5f5;
        font-weight: bold;
    }

/* ------------------- TOAST ------------------- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100; /* Always above loading spinner */
    pointer-events: auto;
}

.toast {
    background: #333;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    opacity: 0.95;
    transition: opacity 0.3s ease;
}

    .toast.success {
        background: #28a745;
    }

    .toast.error {
        background: #dc3545;
    }

    .toast.info {
        background: #17a2b8;
    }

    .toast.warning {
        background: #ffc107;
        color: #212529;
    }

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    animation: fadeInOut 4s forwards;
    color: #fff; /* default white text */
}

/* Success style */
.toast-success {
    background-color: #28a745; /* green */
}

/* Error style */
.toast-error {
    background-color: #dc3545; /* red */
}

/* Warning style */
.toast-warning {
    background-color: #ffc107; /* yellow/orange */
    color: #000; /* black text for better contrast */
}

/* Info style */
.toast-info {
    background-color: #17a2b8; /* blue */
}

/* ------------------- CODE ------------------- */
code {
    color: #c02d76;
    font-family: Consolas, monospace;
    font-size: 0.95rem;
}
/* ------------------- BLAZOR ERROR UI ------------------- */
#blazor-error-ui {
    background: lightyellow;
    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;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ------------------- NAV MENU ------------------- */
/* ------------------- SIDEBAR NAV ------------------- */

.nav-scrollable {
    min-height: 100vh;
    width: 250px;
    padding: 0.5rem 0 1.5rem;
    color: #fff;
    overflow-y: auto;
}

/* Top-level group headers */
.menu-header {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem 0.55rem 1rem;
    margin: 0.1rem 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(220, 232, 250, 0.75);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .menu-header .menu-title {
        flex: 1;
        line-height: 1.3;
    }

    .menu-header:hover {
        background: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.95);
    }

    .menu-header.active {
        background: rgba(255,255,255,0.14);
        color: #fff;
        font-weight: 600;
    }

/* Sidebar nav-link base — scoped component handles active/hover */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    margin: 0.05rem 0.5rem;
    border-radius: 5px;
    font-size: 0.855rem;
    color: rgba(200, 218, 242, 0.78);
    transition: background-color 0.12s ease, color 0.12s ease;
    text-decoration: none;
}
