textarea {
    min-height: 50px !important;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }

    body {
        margin: 0 5px !important;
    }
}

.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;
}

html {
    position: relative;
    min-height: 100%;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Modernized styles for ASP.NET Core MVC with Bootstrap, mimicking JJCMS.css */
:root {
    --primary: #E0691A;
    --secondary: #6C757A;
    --background: #D9E3F6;
    --header-bg: #A9B9DF;
    --text: #454545;
    --white: #FFFFFF;
    --danger: #9D0B0B;
    --success: #019001;
    --table-alt: #EEEEEE;
    --table-hover: #CCCCCC;
    --bs-table-bg: transparent;
    --bs-nav-pills-link-active-color: #FFFFFF;
    --bs-nav-pills-link-active-bg: #A9B9DF;
    --error-message: red;
}

.nav-pills .nav-link.active {
    --bs-nav-pills-link-active-color: #FFFFFF;
    --bs-nav-pills-link-active-bg: #A9B9DF;
}

.nav-pills .nav-link {
    margin-right: 10px;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover {
        color: var(--secondary);
    }

/* Headings */
h1 {
    background: var(--secondary);
    color: var(--white);
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    border-radius: 0.25rem;
}

h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

h3 {
    background: var(--header-bg);
    color: var(--white);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    border-radius: 0.25rem;
}

h4 {
    background: var(--background);
    color: var(--secondary);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--text);
}

.form-control {
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 0.2rem rgba(224, 105, 26, 0.25);
    }

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

    .btn-primary:hover {
        background: var(--secondary);
        border-color: var(--secondary);
    }

.btn-danger {
    background: var(--danger);
    border-color: darken(var(--danger), 10%);
}

.btn-success {
    background: var(--success);
    border-color: darken(var(--success), 10%);
}

/* Tables */
.table {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

    .table thead th {
        background: var(--header-bg);
        /*color: var(--white);*/
        font-weight: 600;
        padding: 0.75rem;
    }

    .table tbody tr:nth-child(odd) {
        background: var(--table-alt);
    }

    .table tbody tr:nth-child(even) {
        background: darken(var(--table-alt), 5%);
    }

    .table tbody tr:hover:not(.no-highlight) {
        background: var(--table-hover);
        transition: background-color 0.2s ease;
    }

/* Custom JJCMS-like table */
.jjcms-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .jjcms-table th {
        background: var(--header-bg);
        color: var(--white);
        font-weight: 600;
        padding: 0.75rem;
    }

    .jjcms-table td {
        padding: 0.75rem;
        vertical-align: top;
        border: 1px solid var(--white);
    }

    .jjcms-table tr:nth-child(odd) {
        background: var(--table-alt);
    }

    .jjcms-table tr:hover:not(.no-highlight) {
        background: var(--table-hover);
    }

.displayNone {
    display: none;
}


.deleteContactOffender, SPAN.deleteAssignedContact, span.deleteRecord {
    background-image: url(../images/ui-icons_cd0a0a_256x240.png);
    background-position: -96px -128px;
    width: 16px;
    height: 16px;
    float: left;
    cursor: pointer;
    padding-left: 0px;
    padding-right: 0px;
}

/* Navigation */
.nav-link {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

    .nav-link:hover {
        color: var(--secondary);
        background: var(--table-alt);
    }

/* Dropdowns */
.dropdown-menu {
    background: var(--white);
    border: 1px solid var(--secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

.dropdown-item {
    color: var(--primary);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

    .dropdown-item:hover {
        background: var(--secondary);
        color: var(--white);
    }

/* Cards for widgets */
.card {
    border: none;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background: var(--header-bg);
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.card-body {
    padding: 1rem;
}

/* Validation */
.invalid-feedback {
    color: var(--error-message);
    font-weight: 500;
}

.form-control.is-invalid {
    border-color: var(--error-message);
    background: rgba(255, 0, 0, 0.05);
}

/* Custom components */
.bar {
    background: var(--secondary);
    color: var(--white);
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customize-widget {
    border: 2px solid var(--secondary);
    padding: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    border-radius: 0.375rem;
    margin: 0.75rem 0;
    transition: background-color 0.2s ease;
}

    .customize-widget:hover {
        background: rgba(224, 105, 26, 0.1);
    }

/* Layout */
.container {
    max-width: 1140px;
    background: var(--white);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Flexbox utilities */
.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Utilities */
.float-left {
    float: left;
}

.float-right {
    float: right;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.margin-5 {
    margin: 0.5rem;
}

.padding-5 {
    padding: 0.5rem;
}

.text-bold {
    font-weight: 600;
}

.text-red {
    color: var(--danger);
}

#StaffInvolvedTable, #OffenderInvolvedTable {
    padding: 10px;
    border: solid 1px #ccc;
    border-radius: 5px;
}

#staffInvolvedContainer, #offenderInvolvedContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    row-gap: 10px;
}

    #staffInvolvedContainer table, #offenderInvolvedContainer table {
        height: min-content;
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        margin: .5rem auto;
        width: 95%;
    }

    .navbar-brand {
        width: 70%;
    }

    .jjcms-table th, .jjcms-table td {
        padding: 0.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
    }


    #StaffInvolvedTable, #OffenderInvolvedTable {
        padding: 10px;
        border: solid 1px #ccc;
        border-radius: 5px;
        display: inline-block;
    }

    #staffInvolvedContainer, #offenderInvolvedContainer {
        display: block;
    }
}

/* Print styles */
@media print {
    body {
        background: var(--white);
    }

    .no-print {
        display: none;
    }

    .container {
        box-shadow: none;
    }

    .dataTable {
        box-shadow: none;
        background: var(--white);
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate,
    .no-print {
        display: none;
    }
}


table.dataTable > tbody > tr.child ul.dtr-details {
    text-wrap: auto !important;
}

.select2-container .select2-selection--single {
    height: 35px !important;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da !important;
    font-size: 0.875rem;
    border-radius: 0.375rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px !important;
}

.dataTable {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Table headers */
table.dataTable thead tr {
    background: var(--header-bg);
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem;
    border: none;
    border-bottom: 1px solid var(--white);
    text-align: left;
    vertical-align: middle;
}

table.dataTable thead tr th {
    background-color: var(--header-bg) !important;
    color: white;
}

/* Table rows */
table.dataTable tbody tr {
    background: var(--white);
    transition: background-color 0.2s ease;
}

    table.dataTable tbody tr:nth-child(odd) {
        background: var(--table-alt);
    }

    table.dataTable tbody tr:nth-child(even) {
        background: var(--table-alt-dark);
    }

    table.dataTable tbody tr:hover:not(.no-highlight) {
        background: var(--table-hover);
    }

/* Table cells */
table.dataTable tbody td {
    padding: 0.75rem;
    vertical-align: top;
    border: 1px solid var(--white);
    color: var(--text);
}

/* Highlighted cells */
table.dataTable span.highlight {
    background: #FFFF88;
    border-radius: 0.25rem;
    padding: 0.1rem 0.3rem;
}

table.dataTable span.column_highlight {
    background: #FFCC99;
    border-radius: 0.25rem;
    padding: 0.1rem 0.3rem;
}

/* DataTables controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
        font-size: 0.875rem;
        border: 1px solid var(--secondary);
        border-radius: 0.375rem;
        padding: 0.5rem;
        transition: border-color 0.2s ease;
    }

        .dataTables_wrapper .dataTables_filter input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 0.2rem rgba(224, 105, 26, 0.25);
        }

/* Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--primary) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border: none;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
        background: var(--secondary) !important;
        color: var(--white) !important;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: var(--primary) !important;
        color: var(--white) !important;
        font-weight: 600;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
        color: #888888 !important;
        cursor: default;
    }

/* Search panes */
div.dtsp-panesContainer div.dtsp-searchPane {
    margin-top: 1rem;
}

div.dtsp-searchPane input.dtsp-paneInputButton,
div.dtsp-searchPane button.dtsp-paneButton {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--white);
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

    div.dtsp-searchPane input.dtsp-paneInputButton:hover,
    div.dtsp-searchPane button.dtsp-paneButton:hover {
        background: var(--secondary);
        border-color: var(--secondary);
    }



.filterLabel {
    margin-right: 5px;
}

#globalLoadingOverlay {
    position: fixed; /* Crucial: fixes it to the viewport */
    top: 0;
    left: 0;
    width: 100vw; /* Covers full viewport width */
    height: 100vh; /* Covers full viewport height */
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
    z-index: 9999; /* Very high z-index to ensure it's on top of everything */
    /* Centering the spinner using Bootstrap's flexbox helpers */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Initially hidden with Bootstrap's d-none class */
    /* You apply and remove this class with JavaScript */
}


.dt-search {
    margin-bottom: 15px;
}

dt-info {
    margin: 5px 0;
}

.tileIcon i.fa {
    font-size: 75px;
    color: var(--header-bg);
}

.tileIcon {
    text-align: center;
}

td, th {
    padding: 5px;
}

.aiResponseContainer {
    background-color: #eee;
    border-radius: 5px;
    min-height: 28px;
    vertical-align: middle;
    line-height: 35px;
}

.select2-container {
    width: 100% !important;
}

.borderedTable {
    border: solid 1px #000;
    border-radius: 5px;
    padding: 5px;
}

.sw-btn-next {
    margin-left: 5px !important;
}

.sw-btn-prev {
    margin-left: 5px !important;
}

tr[data-url]:hover {
    cursor: pointer;
}

.error-message {
    border: 2px solid #ff0000;
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff0000;
    font-weight: bold;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

footer {
    margin-top: 25px;
}

.input-validation-error {
    border: 1px solid red !important;
}

label.error {
    color: red;
}

.toolbar {
    background-color: #eee;
}

.validation-error-icon {
    font-size: 20px;
    color: red;
    height: 20px;
    width: 20px;
    float: right;
}

.tile-count-indicator {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1.3em;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    position: absolute; /* Position it relative to the nearest positioned ancestor */
    top: 50%; /* Position it at the very top */
    right: 50%; /* Position it at the very right */
    transform: translate(50%, -50%) translate(35px, -25px); /* Adjust for centering the circle's center on the corner */
}

.involvedHeader {
    background-color: var(--header-bg) !important;
    color: white !important;
}

.classificationHeader {
    background-color: var(--table-alt) !important;
}

.activityClassificationContainer > table > tbody > tr > td, .activityClassificationContainer > table {
    background-color: var(--table-alt);
}

.loginIcon {
    font-size: 40px;
}

.loggedInIndicator {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 576px) {
    .loginName-sm {
        display: unset;
    }

    .loginName-lg {
        display: none;
    }
}

@media (min-width: 576px) {
    .loginName-sm {
        display: none;
    }

    .loginName-lg {
        display: unset;
    }
}

.caseNotesTabContent {
    border: 1px solid var(--bs-border-color);
    padding: 10px;
    border-radius: 10px;
}

tbody tr[data-url] {
    cursor: default;
}

tbody tr[data-url^="/"] {
    cursor: pointer;
}

fieldset {
    border: 1px solid var(--bs-border-color);
    padding: 10px;
    border-radius: 10px;
}

/* 1. Create the arrow using the ::after pseudo-element */
.caret-toggle::before {
    content: "";
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    margin-right: 0.5em;
    vertical-align: middle;
    /* Create the "V" shape */
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    /* ANIMATION: Smoothly rotate */
    transition: transform 0.3s ease;
}

/* 2. DEFINE STATE: OPEN (Bootstrap removes .collapsed class) */
/* When open, we want it pointing RIGHT */
.caret-toggle::before {
    transform: rotate(135deg);
}

/* 3. DEFINE STATE: CLOSED (Bootstrap adds .collapsed class) */
/* When closed, we want it pointing DOWN */
.caret-toggle.collapsed::before {
    transform: rotate(45deg);
}