
/* =========================================
   BITVI BRAND REFRESH — Cuida NF
   ========================================= */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #60A5FA;
    --primary-lighter: #DBEAFE;

    --secondary: #0F172A;
    --secondary-dark: #020617;
    --secondary-light: #334155;

    --accent: #38BDF8;
    --accent-dark: #0EA5E9;
    --accent-light: #E0F2FE;

    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #DC2626;
    --info: #0EA5E9;

    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.10);
    --shadow-md: 0 10px 15px rgba(15, 23, 42, 0.06), 0 4px 6px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 16px 30px rgba(15, 23, 42, 0.08), 0 6px 10px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.12);
}

html, body {
    background: #F8FAFC;
}

body {
    color: var(--gray-900);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.07), transparent 22%),
        linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
}

body main,
.site-main {
    background: transparent !important;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

.navbar {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
    padding: 0.85rem 0 !important;
}

.navbar-brand {
    color: var(--gray-900) !important;
    font-family: var(--font-sans) !important;
    font-weight: 700;
    gap: 0.875rem !important;
}

.navbar-brand .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #EFF6FF 0%, #DBEAFE 100%);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.navbar-brand .brand-mark img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.brand-title {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-title strong {
    font-size: 1rem;
    color: var(--gray-900);
}

.brand-title small {
    color: var(--gray-500);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.12);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    color: var(--gray-700) !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
    padding: 0.65rem 0.95rem !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: var(--primary-dark) !important;
    background: rgba(37, 99, 235, 0.08);
    opacity: 1 !important;
    text-decoration: none !important;
}

.navbar-nav .nav-link i {
    color: currentColor !important;
}

.dropdown-menu {
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow-lg);
    border-radius: 1rem;
    padding: 0.6rem;
}

.dropdown-item {
    border-radius: 0.75rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.notification-mini-card {
    border-radius: 999px !important;
    background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: none !important;
}

.notification-mini-card.has-notifications {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.16) !important;
}

.notification-mini-card .bi {
    color: var(--primary-dark) !important;
}

.message-toast {
    border-radius: 1rem !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.card,
.form-card,
.nearby-problems-card {
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: 1rem !important;
}

.card-header {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(241, 245, 249, 0.88));
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.btn {
    border-radius: 0.9rem !important;
    font-weight: 600 !important;
    box-shadow: none;
}

.btn-primary,
button.btn-primary,
.btn.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.btn-primary:hover,
button.btn-primary:hover,
.btn.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1E3A8A 100%) !important;
    border-color: transparent !important;
}

.btn-outline-primary {
    color: var(--primary-dark) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
    background: rgba(255, 255, 255, 0.95) !important;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    background: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

.btn-outline-secondary {
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: var(--gray-700) !important;
    background: #fff !important;
}

.btn-secondary {
    background: var(--gray-800) !important;
    border-color: var(--gray-800) !important;
}

.form-label {
    color: var(--gray-700) !important;
    font-weight: 600 !important;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
input[type="url"],
input[type="search"],
textarea,
select {
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-radius: 0.95rem !important;
    color: var(--gray-900);
    min-height: 48px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

textarea.form-control,
textarea {
    min-height: 120px;
}

.form-control:hover,
.form-select:hover,
textarea:hover,
select:hover {
    border-color: rgba(37, 99, 235, 0.35) !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: rgba(37, 99, 235, 0.8) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
    outline: none;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.form-check.compact,
.form-switch.compact {
    padding: 0.25rem 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.form-check-input,
input[type="checkbox"].form-check-input,
input[type="radio"].form-check-input,
input[type="checkbox"]:not(.btn-check),
input[type="radio"]:not(.btn-check) {
    flex-shrink: 0;
    width: 1.15rem !important;
    height: 1.15rem !important;
    margin: 0.2rem 0 0 0 !important;
    border: 1.5px solid rgba(100, 116, 139, 0.6) !important;
    background-color: #fff !important;
    accent-color: var(--primary);
    box-shadow: none !important;
}

input[type="checkbox"].form-check-input,
input[type="checkbox"]:not(.btn-check) {
    border-radius: 0.35rem !important;
}

input[type="radio"].form-check-input,
input[type="radio"]:not(.btn-check) {
    border-radius: 50% !important;
}

.form-check-input:checked,
input[type="checkbox"]:checked:not(.btn-check),
input[type="radio"]:checked:not(.btn-check) {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.form-check-input:focus,
input[type="checkbox"]:focus:not(.btn-check),
input[type="radio"]:focus:not(.btn-check) {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
    border-color: var(--primary) !important;
}

.form-check-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0 !important;
    color: var(--gray-700) !important;
}

.form-switch {
    padding-left: 0 !important;
}

.form-switch .form-check-input {
    width: 2.5rem !important;
    height: 1.35rem !important;
    margin-top: 0.05rem !important;
    border-radius: 999px !important;
    background-position: left center;
}

.form-switch .form-check-input:checked {
    background-position: right center;
}

.form-text {
    color: var(--gray-500) !important;
}

.invalid-feedback,
.text-danger.small,
.form-error {
    color: var(--danger) !important;
}

.alert-info {
    background: #EFF6FF !important;
    color: #1E3A8A !important;
    border-color: #BFDBFE !important;
}

.alert-success {
    background: #F0FDF4 !important;
    color: #166534 !important;
    border-color: #BBF7D0 !important;
}

.alert-warning {
    background: #FFF7ED !important;
    color: #9A3412 !important;
    border-color: #FED7AA !important;
}

.alert-danger {
    background: #FEF2F2 !important;
    color: #991B1B !important;
    border-color: #FECACA !important;
}

.site-main {
    min-height: calc(100vh - 210px);
}

.hero-surface,
.page-surface,
.auth-shell {
    position: relative;
}

.auth-shell {
    min-height: calc(100vh - 190px);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.12), transparent 32%),
        radial-gradient(circle at 100% 20%, rgba(14, 165, 233, 0.10), transparent 24%);
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.5rem;
    overflow: hidden;
    background: rgba(255,255,255,0.96);
    box-shadow: var(--shadow-xl);
}

.auth-hero {
    background: linear-gradient(180deg, #FFFFFF 0%, #EFF6FF 100%);
    padding: 3rem;
}

.auth-panel {
    background: #fff;
    padding: 3rem;
}

.auth-logo {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(145deg, #EFF6FF 0%, #DBEAFE 100%);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.auth-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.auth-subtitle {
    color: var(--gray-600);
    font-size: 1.025rem;
    margin-bottom: 0;
}

.auth-features {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.auth-feature-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    background: rgba(37, 99, 235, 0.10);
}

.auth-panel h3 {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.auth-link {
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
}

.auth-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-form .btn {
    min-height: 50px;
}

.auth-form .form-check {
    padding: 0.9rem 1rem;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--gray-200);
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 0.9rem;
    background: #fff;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.site-footer {
    margin-top: 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.94);
}

.site-footer-top {
    padding: 2.5rem 0 2rem;
}

.site-footer-bottom {
    padding: 1rem 0;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--gray-500);
    font-size: 0.92rem;
}

.footer-brand {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.footer-brand-mark {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #EFF6FF 0%, #DBEAFE 100%);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.footer-brand-mark img {
    width: 2rem;
    height: 2rem;
}

.footer-links,
.footer-contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 0.65rem;
    color: var(--gray-600);
}

.footer-links a,
.footer-contact a {
    color: var(--gray-600);
    text-decoration: none;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--primary-dark);
}

.section-title {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.list-group-item,
.nearby-problem-item {
    border-color: rgba(226, 232, 240, 0.9) !important;
}

@media (max-width: 991.98px) {
    .auth-hero,
    .auth-panel {
        padding: 2rem;
    }
    .brand-chip {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand .brand-title small {
        display: none;
    }
    .auth-shell {
        min-height: auto;
        padding: 1rem 0 2rem;
    }
    .auth-card {
        border-radius: 1.25rem;
    }
    .auth-hero,
    .auth-panel {
        padding: 1.5rem;
    }
    .form-check {
        gap: 0.75rem;
        padding: 0.85rem 0.9rem;
    }
    .site-footer-top {
        padding: 2rem 0 1.5rem;
    }
}

/* =========================================
   INTERNAL PAGES — UNIFIED BITVI UI
   ========================================= */

.site-main > .container,
.site-main > .container-fluid {
    position: relative;
}

.site-main h1,
.site-main h2 {
    letter-spacing: -0.025em;
}

.site-main h1 {
    font-size: clamp(1.8rem, 2.3vw, 2.45rem);
}

.site-main h2 {
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.site-main .lead,
.site-main .text-muted {
    color: var(--gray-500) !important;
}

.site-main .card-body {
    padding: 1.35rem;
}

.site-main .card-header {
    padding: 1rem 1.25rem;
}

.site-main .card-header h1,
.site-main .card-header h2,
.site-main .card-header h3,
.site-main .card-header h4,
.site-main .card-header h5,
.site-main .card-header h6 {
    margin-bottom: 0;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--gray-700);
    border-color: var(--gray-200);
}

.table thead th {
    color: var(--gray-500);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    border-bottom-width: 1px;
    background: var(--gray-50);
}

.table > :not(caption) > * > * {
    padding: 0.9rem 0.85rem;
}

.table-hover > tbody > tr:hover > * {
    background: rgba(37, 99, 235, 0.035);
}

.list-group {
    border-radius: 1rem;
    overflow: hidden;
}

.list-group-item {
    background: rgba(255,255,255,.92);
    padding: 1rem 1.1rem;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: rgba(37, 99, 235, 0.045);
    color: var(--gray-900);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.42em 0.68em;
}

.bg-primary,
.badge.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.pagination {
    gap: 0.35rem;
}

.page-link {
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem !important;
    color: var(--gray-700);
    background: #fff;
}

.page-link:hover {
    color: var(--primary-dark);
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.active > .page-link,
.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
}

.modal-content,
.offcanvas {
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-xl);
}

.modal-header,
.offcanvas-header {
    border-bottom: 1px solid var(--gray-200);
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
}

.nav-tabs {
    border-bottom: 1px solid var(--gray-200);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    border: 0;
    color: var(--gray-600);
    border-radius: 0.75rem 0.75rem 0 0;
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-dark);
    background: rgba(37,99,235,.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-dark);
    background: rgba(37,99,235,.08);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 1px dashed var(--gray-300);
    background: rgba(248,250,252,.72);
    border-radius: 1rem;
}

.empty-state i {
    color: var(--gray-400);
}

/* Django-generated radio lists */
ul[id^="id_"] {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

ul[id^="id_"] > li {
    margin-bottom: 0.6rem;
}

ul[id^="id_"] > li > label {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    cursor: pointer;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.9rem;
    background: #fff;
}

ul[id^="id_"] input[type="radio"],
ul[id^="id_"] input[type="checkbox"] {
    margin-top: 0.16rem !important;
}

/* Better switch rows without Bootstrap padding collision */
.form-check.form-switch {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem !important;
}

.form-check.form-switch .form-check-label {
    flex: 1;
}

/* Report form local green variables are visually remapped to BITVI blue. */
.form-card,
.nearby-problems-card,
.page-header,
.visibility-option {
    --primary-green: #2563EB !important;
    --primary-green-dark: #1D4ED8 !important;
    --primary-green-light: #EFF6FF !important;
}

.map-container:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 8px 24px rgba(37,99,235,.12) !important;
}

/* Mobile chrome */
.mobile-header {
    background: rgba(255,255,255,.94) !important;
    border-bottom: 1px solid rgba(226,232,240,.95) !important;
    box-shadow: 0 6px 18px rgba(15,23,42,.06) !important;
    backdrop-filter: blur(14px);
}

.mobile-title {
    color: var(--gray-900) !important;
}

.mobile-icon-btn {
    color: var(--primary-dark) !important;
    background: rgba(37,99,235,.07) !important;
}

.mobile-bottom-nav,
.bottom-nav {
    background: rgba(255,255,255,.96) !important;
    border-top: 1px solid var(--gray-200) !important;
    box-shadow: 0 -8px 24px rgba(15,23,42,.06) !important;
}

.mobile-bottom-nav .active,
.bottom-nav .active {
    color: var(--primary) !important;
}

/* Footer should not inherit older global footer rules. */
.site-footer,
.site-footer * {
    text-align: initial;
}

.site-footer h5,
.site-footer h6 {
    color: var(--gray-900);
}

@media (max-width: 767.98px) {
    .site-main {
        padding-top: 1.25rem !important;
    }
    .site-main .card-body {
        padding: 1.1rem;
    }
    .table-responsive {
        border: 1px solid var(--gray-200);
        border-radius: 1rem;
    }
}


/* =========================================
   RESPONSIVE SYSTEM — Desktop / Tablet / Mobile
   ========================================= */

/* A single content rail across the application. It grows on large displays,
   but never lets text/cards become excessively wide. */
.app-shell {
    width: min(100% - 2rem, 1480px);
    margin-inline: auto;
    padding-left: 0;
    padding-right: 0;
}

.site-main {
    width: 100%;
    overflow-x: clip;
}

/* Desktop: give the product enough breathing room on 1440–4K screens. */
@media (min-width: 1400px) {
    .app-shell {
        width: min(100% - 5rem, 1480px);
    }

    .site-main {
        padding-top: 2rem !important;
        padding-bottom: 3rem !important;
    }

    .dashboard-page h1 {
        font-size: 2.25rem;
        letter-spacing: -0.035em;
    }

    .dashboard-page .card-body {
        padding: 1.6rem;
    }

    .dashboard-main,
    .dashboard-sidebar {
        gap: 1.5rem !important;
    }
}

/* Normal notebooks / desktop */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .app-shell {
        width: min(100% - 3rem, 1280px);
    }

    .navbar-nav .nav-link {
        padding-inline: 0.72rem !important;
        font-size: 0.93rem;
    }

    .brand-chip {
        font-size: 0.7rem;
        padding-inline: 0.65rem;
    }
}

/* Navbar only expands when there is genuinely enough horizontal space. */
@media (max-width: 1199.98px) {
    .navbar {
        padding: 0.72rem 0 !important;
    }

    .navbar-collapse {
        margin-top: 0.85rem;
        padding: 0.85rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 1rem;
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 92px);
        overflow-y: auto;
    }

    .navbar-nav {
        gap: 0.25rem;
    }

    .navbar-nav .nav-link,
    .navbar-nav .btn {
        width: 100%;
        justify-content: flex-start;
    }

    .navbar-nav .btn {
        margin-top: 0.25rem;
    }

    .notification-icon-btn {
        display: inline-flex !important;
    }

    .notification-mini-card {
        width: 42px !important;
        height: 42px !important;
    }

    /* Tablet: dashboard becomes a single, readable column instead of squeezing 8/4 columns. */
    .dashboard-sidebar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .dashboard-sidebar > .card {
        height: 100%;
    }
}

/* Tablets (portrait and landscape) */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .app-shell {
        width: min(100% - 2.5rem, 980px);
    }

    .site-main {
        padding-top: 1.5rem !important;
    }

    .dashboard-header {
        margin-bottom: 1.25rem !important;
    }

    .dashboard-page h1 {
        font-size: 2rem;
    }

    .dashboard-page .card-body {
        padding: 1.35rem;
    }

    .dc-rank-layout {
        gap: 1rem !important;
    }

    .dc-stats-desktop {
        min-width: 250px;
        justify-content: space-around;
    }

    .table-responsive {
        border-radius: 1rem;
    }

    /* Generic two-column Bootstrap forms remain comfortable on tablets. */
    .form-section {
        padding: 1.75rem 1.5rem !important;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .app-shell {
        width: calc(100% - 1.25rem);
    }

    .navbar-brand {
        gap: 0.65rem !important;
        max-width: calc(100vw - 100px);
    }

    .navbar-brand .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .navbar-brand .brand-mark img {
        width: 23px;
        height: 23px;
    }

    .brand-title strong {
        font-size: 0.95rem;
    }

    .navbar-toggler {
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 0.8rem;
        padding: 0.45rem 0.55rem;
    }

    .site-main {
        padding-top: 0.75rem !important;
        padding-bottom: 1.5rem !important;
    }

    .dashboard-page {
        padding-top: 0.75rem !important;
        padding-bottom: 1.5rem !important;
    }

    .dashboard-header {
        align-items: stretch !important;
        margin-bottom: 1rem !important;
    }

    .dashboard-header > div:first-child {
        width: 100%;
    }

    .dashboard-header h1 {
        font-size: 1.65rem !important;
        line-height: 1.15;
    }

    .dashboard-header p {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .dashboard-header > .btn {
        width: 100%;
        min-height: 46px;
    }

    .dashboard-grid {
        --bs-gutter-y: 1rem;
    }

    .dashboard-main,
    .dashboard-sidebar {
        gap: 1rem !important;
    }

    .dashboard-sidebar {
        display: flex !important;
        flex-direction: column;
    }

    .dashboard-page .card {
        border-radius: 0.9rem !important;
    }

    .dashboard-page .card-body {
        padding: 1rem;
    }

    .dc-rank-layout {
        align-items: flex-start !important;
        flex-wrap: wrap;
    }

    .dc-rank-icon {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.3rem !important;
    }

    .dc-rank-layout > .flex-grow-1 {
        flex-basis: calc(100% - 62px);
    }

    .dc-stats-mobile {
        gap: 0.4rem;
        justify-content: space-between !important;
    }

    .dc-stats-mobile > div {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 0.25rem;
    }

    .dc-badge-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    .dc-problem {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .dc-problem > small {
        width: 100%;
        text-align: left;
    }

    .card-body > .d-flex.align-items-center.justify-content-between {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    /* Forms */
    .form-card,
    .nearby-problems-card,
    .card {
        overflow: hidden;
    }

    .form-section {
        padding: 1.25rem 1rem !important;
    }

    .form-section-title {
        font-size: 1rem !important;
    }

    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="file"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important; /* avoids iOS zoom */
        min-height: 46px;
        border-radius: 0.8rem !important;
    }

    .form-check {
        width: 100%;
    }

    .form-check-label {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .btn {
        min-height: 42px;
    }

    .btn-group,
    .d-flex.gap-2:not(.navbar-nav) {
        max-width: 100%;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 640px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-content {
        border-radius: 1rem;
    }

    .site-footer-top {
        padding-top: 1.5rem;
    }

    .footer-brand {
        flex-direction: column;
    }

    .site-footer-bottom {
        text-align: center;
    }
}

/* Extra-small devices */
@media (max-width: 399.98px) {
    .app-shell {
        width: calc(100% - 1rem);
    }

    .brand-title small {
        display: none !important;
    }

    .dashboard-header h1 {
        font-size: 1.5rem !important;
    }

    .dc-badge-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .form-check {
        padding: 0.75rem !important;
    }
}


/* === Form control hardening: checkbox/radio === */
/*
   Bootstrap and legacy page styles previously fought over native input
   dimensions. These rules deliberately own the rendering so radios and
   checkboxes stay circular/square on every browser and breakpoint.
*/
input[type="checkbox"].form-check-input:not(.form-switch .form-check-input),
input[type="radio"].form-check-input,
input[type="checkbox"]:not(.btn-check):not(.form-switch .form-check-input),
input[type="radio"]:not(.btn-check) {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-grid !important;
    place-content: center !important;
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    max-width: 1.15rem !important;
    height: 1.15rem !important;
    min-height: 1.15rem !important;
    max-height: 1.15rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1.5px solid #94A3B8 !important;
    background: #fff !important;
    box-shadow: none !important;
    vertical-align: middle;
}

input[type="radio"].form-check-input,
input[type="radio"]:not(.btn-check) {
    border-radius: 50% !important;
}

input[type="radio"].form-check-input::before,
input[type="radio"]:not(.btn-check)::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 120ms ease;
    background: #2563EB;
}

input[type="radio"].form-check-input:checked,
input[type="radio"]:checked:not(.btn-check) {
    background: #fff !important;
    border-color: #2563EB !important;
}

input[type="radio"].form-check-input:checked::before,
input[type="radio"]:checked:not(.btn-check)::before {
    transform: scale(1);
}

input[type="checkbox"].form-check-input:not(.form-switch .form-check-input),
input[type="checkbox"]:not(.btn-check):not(.form-switch .form-check-input) {
    border-radius: 0.32rem !important;
}

input[type="checkbox"].form-check-input:not(.form-switch .form-check-input):checked,
input[type="checkbox"]:checked:not(.btn-check):not(.form-switch .form-check-input) {
    background-color: #2563EB !important;
    border-color: #2563EB !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 0.82rem 0.82rem !important;
}

input[type="checkbox"].form-check-input:not(.form-switch .form-check-input):focus,
input[type="radio"].form-check-input:focus,
input[type="checkbox"]:focus:not(.btn-check):not(.form-switch .form-check-input),
input[type="radio"]:focus:not(.btn-check) {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13) !important;
}

/* Report privacy / visibility selectors */
.privacy-choice,
.visibility-option {
    display: block;
    width: 100%;
    padding: 1rem 1.05rem !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 0.95rem !important;
    background: #F8FAFC !important;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.privacy-choice:hover,
.visibility-option:hover {
    background: #FFFFFF !important;
    border-color: #BFDBFE !important;
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
    transform: none !important;
}

.privacy-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.privacy-choice-control {
    display: inline-flex;
    padding-top: 0.14rem;
    flex: 0 0 auto;
}

.privacy-choice-copy,
.visibility-option-copy {
    min-width: 0;
    flex: 1;
}

.privacy-choice-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0F172A;
    font-weight: 700;
    line-height: 1.35;
}

.privacy-choice-help {
    display: block;
    margin-top: 0.25rem;
    color: #64748B;
    font-size: 0.875rem;
}

.visibility-option-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.visibility-option .form-check-label {
    display: block !important;
    margin: 0 !important;
    color: #0F172A !important;
    line-height: 1.35;
}

.visibility-option .form-text {
    margin-top: 0.2rem !important;
    line-height: 1.45;
}

.visibility-option:has(input[type="radio"]:checked) {
    background: #EFF6FF !important;
    border-color: #60A5FA !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

@media (max-width: 576px) {
    .privacy-choice,
    .visibility-option {
        padding: 0.9rem !important;
    }

    .privacy-choice,
    .visibility-option-inner {
        gap: 0.7rem;
    }
}
