html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}



:root {
    --brand-primary: #6c1033; /* Burgundy */
    --brand-teal: #008080; /* Teal */
    --brand-teal-hover: #006666;
}

/* --- Global Table Styles --- */
/* Standardizes font size and header borders across all pages */
.table-app {
    font-size: 12px;
}

    .table-app th {
        border-top: inset;
        border-right: inset;
        border-left: inset;
        background-color: #f8f9fa; /* Optional: adds subtle contrast like in AllUserStats */
        vertical-align: middle;
    }

.table-row-hover {
    border: 1px solid transparent;
    transition: border 0.25s ease-in-out;
}

    .table-row-hover:hover {
        cursor: pointer;
    }

    .table-row-hover:hover td {
        background-color: rgba(108, 16, 51, 0.1);
    }

    .app-dark-mode .table-row-hover:hover td {
        background-color: rgba(255, 255, 255, 0.28);
    }

/* --- Checkbox Styling --- */
input[type=checkbox] {
    accent-color: var(--brand-teal) !important;
}

/* --- Button Styling --- */
/* Standardizes the small action buttons used in lists */
.btn-action {
    font-size: 12px !important;
    white-space: nowrap;
    min-width: 60px;
}

.btn-action-sm {
    font-size: 12px !important;
    width: 60px;
}

/* Override Success Button to Brand Teal globally to match existing pages */
.btn-success {
    background-color: var(--brand-teal) !important;
    border-color: var(--brand-teal) !important;
    color: #fff !important;
}

    .btn-success:hover, .btn-success:active, .btn-success:visited {
        background-color: var(--brand-teal-hover) !important;
        border-color: var(--brand-teal-hover) !important;
    }

/* Blazor.Bootstrap bundles its own CSS that can override Bootstrap's solid button backgrounds.
   Explicitly re-assert btn-danger fill so it renders correctly alongside btn-outline-danger. */
.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

    .btn-danger:hover, .btn-danger:active, .btn-danger:visited {
        background-color: #bb2d3b !important;
        border-color: #b02a37 !important;
    }

/* --- Layout Utils --- */
.bg-brand {
    background-color: var(--brand-primary) !important;
    color: #ffffff;
}

/* Center checkboxes in table cells */
.center-input {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Fixed Header Layout used in Chart pages */
.fixed-header-panel {
    position: fixed;
    top: 55px; /* Adjust based on your top nav height */
    left: 190px; /* Adjust based on your sidebar width */
    right: 0;
    width: auto;
    background-color: #f1f1f1;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Content wrapper to push content below fixed header */
.content-padded {
    margin-top: 80px;
    padding: 20px;
}

/* Text Area Resizer Styling */
textarea.app-textarea {
    resize: vertical;
    min-height: 100px;
    padding-bottom: 10px;
    box-sizing: border-box;
}

    textarea.app-textarea::-webkit-resizer {
        background-color: darkgrey;
        border-radius: 5px;
    }








/* --- Dark Mode --- */
.app-dark-mode {
    background-color: #000000 !important;
    color: #ffffff !important;
    min-height: 100vh; /* Ensures the black covers the full height even if content is short */
}

    /* Optional: This ensures links are visible on the black background */
    .app-dark-mode a {
        color: #8ed6fb;
    }

    /* Optional: Keeps inputs readable (Bootstrap defaults are white background/black text) */
    .app-dark-mode .form-control,
    .app-dark-mode .form-select {
        background-color: #2b2b2b;
        color: #fff;
        border-color: #444;
    }

    /* =============================== */
    /* Dark Mode Component Fixes  */
    /* =============================== */

    /* --- 1. Cards --- */
    .app-dark-mode .card {
        background-color: #212529; /* Dark Grey (Bootstrap Dark) */
        border-color: #495057;
        color: #e9ecef;
    }

    .app-dark-mode .card-header {
        background-color: #2c3034; /* Slightly lighter for contrast */
        border-bottom-color: #495057;
    }

    .app-dark-mode .card-footer {
        background-color: #2c3034;
        border-top-color: #495057;
    }

    /* --- 2. Tables --- */
    /* We override Bootstrap's local variables for tables within dark mode */
    .app-dark-mode .table {
        --bs-table-bg: transparent;
        --bs-table-color: #e9ecef;
        --bs-table-border-color: #495057;
        /* Striped rows: 5% white overlay gives a nice dark grey stripe */
        --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
        --bs-table-striped-color: #e9ecef;
        /* Hover effect: 7.5% white overlay */
        --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
        --bs-table-hover-color: #fff;
        color: #e9ecef;
        border-color: #495057;
    }

    /* Specific fix for our custom .table-app headers */
    .app-dark-mode .table-app th {
        background-color: #2c3034; /* Dark grey header */
        color: #ffffff;
        border-color: #495057;
    }

    /* --- 3. Modals --- */
    /* Since your modals are inside the content area, this handles them too */
    .app-dark-mode .modal-content {
        background-color: #212529;
        border-color: #495057;
        color: #e9ecef;
    }

    .app-dark-mode .modal-header,
    .app-dark-mode .modal-footer {
        border-color: #495057;
    }

    /* Inverts the 'X' close button to white so it is visible */
    .app-dark-mode .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

    /* --- 4. Inputs & Selects --- */
    /* Prevents blinding white input boxes */
    .app-dark-mode .form-control,
    .app-dark-mode .form-select {
        background-color: #2c3034;
        border-color: #495057;
        color: #fff;
    }

        .app-dark-mode .form-control:focus,
        .app-dark-mode .form-select:focus {
            background-color: #343a40;
            color: #fff;
            /* Uses your Teal brand color for the focus glow */
            border-color: var(--brand-teal);
            box-shadow: 0 0 0 0.25rem rgba(0, 128, 128, 0.25);
        }

        .app-dark-mode .form-control:disabled,
        .app-dark-mode .form-select:disabled {
            background-color: #1a1d20; /* Very dark for disabled */
            color: #6c757d;
        }



    /* --- Dark Mode Fixed Header Fix --- */
    .app-dark-mode .fixed-header-panel {
        background-color: #212529 !important; /* Dark Grey to match Bootstrap Dark theme */
        color: #ffffff !important;
        border-bottom-color: #495057 !important; /* Fixes the "border-bottom" visibility */
    }

        /* Fixes the inner container border (the box surrounding the filters) */
        .app-dark-mode .fixed-header-panel .container.border {
            border-color: #495057 !important;
        }

        /* OPTIONAL: Ensures the "Quick Search" labels and checkboxes standout */
        .app-dark-mode .fixed-header-panel label {
            color: #e9ecef;
        }


    /* --- Catch-all for inputs without "form-control" class --- */
    .app-dark-mode input,
    .app-dark-mode select,
    .app-dark-mode textarea {
        background-color: #2c3034 !important;
        color: #ffffff !important;
        border: 1px solid #495057;
    }

        /* --- Fix for Date Picker Calendar Icon & Popup --- */
        /* This tells the browser to render the native calendar popup in dark mode */
        .app-dark-mode input[type="date"],
        .app-dark-mode input[type="datetime-local"] {
            color-scheme: dark;
        }

        /* Optional: Fix for the focus state on these "raw" inputs */
        .app-dark-mode input:focus,
        .app-dark-mode select:focus,
        .app-dark-mode textarea:focus {
            outline: 2px solid var(--brand-teal);
            border-color: var(--brand-teal);
        }



    /* --- Fix for .bg-light (Daily Totals) in Dark Mode --- */
    .app-dark-mode .bg-light {
        /* Changes the pale background to a dark grey highlight */
        background-color: #343a40 !important;
        color: #ffffff !important;
        /* Optional: Adds a subtle border to separate it from normal rows */
        border-top: 1px solid #6c757d;
        border-bottom: 1px solid #6c757d;
    }




    /* --- Fix for Text Danger (Red) in Dark Mode --- */
    /* Makes the red brighter/lighter so it is readable against dark grey */
    .app-dark-mode .text-danger {
        color: #ff6b6b !important;
    }

    /* Optional: Fix for Secondary Buttons in Dark Mode header */
    /* Ensures they stand out against the dark header background */
    .app-dark-mode .fixed-header-panel .btn-secondary {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }

        .app-dark-mode .fixed-header-panel .btn-secondary:hover {
            background-color: #5c636a;
        }
