/* ===================================
   GLOBAL FONTS & BASE STYLES
=================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fafbfc;
    color: #222;
    /* Always show vertical scrollbar to prevent layout shift */
    overflow-y: scroll;
}
h1, h2, .login-button, .footer-heading {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
}
.custom-navbar,
.custom-navbar *,
.custom-footer,
.custom-footer * {
    font-family: 'champagne__limousinesregular', sans-serif !important;
}
.custom-footer .footer-heading,
.custom-navbar h1,
.custom-navbar h2 {
    font-family: 'champagne__limousinesbold', sans-serif !important;
}

/* ===================================
   FLASH TOASTS
=================================== */
.flash-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(360px, calc(100% - 2rem));
    z-index: 1080;
}
.flash-toast {
    --flash-accent: #0d6efd;
    border: none;
    border-left: 4px solid var(--flash-accent);
    border-radius: 1rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    background-color: #fff;
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    transition: transform 0.35s ease, opacity 1s ease;
}
.flash-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.flash-toast.hide,
.flash-toast:not(.show) {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
}
.flash-toast .toast-header {
    border-bottom: 0;
    background-color: rgba(15, 23, 42, 0.03);
    color: #0f172a;
    font-weight: 600;
    padding: 0.65rem 0.85rem;
}
.flash-toast .toast-body {
    padding: 0.9rem 1rem 1rem 1rem;
    color: #111827;
}
.flash-toast-icon {
    font-size: 1.25rem;
    margin-right: 0.35rem;
    color: var(--flash-accent);
}
.flash-toast-success {
    --flash-accent: #1f9254;
}
.flash-toast-danger {
    --flash-accent: #c0392b;
}
.flash-toast-warning {
    --flash-accent: #c27c0e;
}
.flash-toast-info {
    --flash-accent: #0d6efd;
}
@media (max-width: 576px) {
    .flash-toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .flash-toast {
        transition: none;
    }
}

/* ===================================
   APP DIALOG
=================================== */
.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 12, 18, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2000;
}
.app-dialog-backdrop[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
}
.app-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 35px 80px rgba(15, 23, 42, 0.35);
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    border: 1px solid rgba(15, 23, 42, 0.05);
}
.app-dialog-backdrop[data-visible="true"] .app-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.app-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0.5rem;
}
.app-dialog-title {
    font-family: 'champagne__limousinesbold', sans-serif;
    font-size: 1.15rem;
    margin: 0;
    color: #0f172a;
}
.app-dialog-body {
    padding: 0 1.5rem 1rem;
    color: #111827;
    font-size: 1rem;
}
.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem;
}
.app-dialog-confirm {
    background-color: #1f9254;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.35rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.app-dialog-confirm:hover,
.app-dialog-confirm:focus {
    background-color: #187445;
}
.app-dialog-cancel {
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    color: #6b7280;
}
.app-dialog[data-variant="danger"] .app-dialog-confirm {
    background-color: #c0392b;
}
.app-dialog[data-variant="warning"] .app-dialog-confirm {
    background-color: #c27c0e;
}
.app-dialog[data-variant="info"] .app-dialog-confirm {
    background-color: #227EBD;
}

/* ===================================
   NAVBAR STYLING
=================================== */
.navbar {
    background-color: #81A081;
    z-index: 1000;
    position: relative;
    margin-bottom: auto;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 2px 8px 0 rgba(129, 158, 129, 0.13);
}
.navbar-nav .nav-item .nav-link {
    padding: 10px 15px;
    position: relative;
    transition: color 0.3s;
}
.navbar-light .navbar-nav .nav-link {
    color: #222;
}
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #222;
    transition: width 0.3s;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}
.navbar-light .navbar-nav .nav-link.active,
.navbar-light .navbar-nav .nav-link:hover {
    color: #222;
}
.home {
    text-decoration: underline;
    text-underline-offset: 7px;
}
.mobile-nav-shell {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: #81A081;
    padding: 0.55rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(52, 84, 52, 0.25);
    box-shadow: 0 2px 8px rgba(32, 63, 32, 0.15);
    overflow: visible;
}
.mobile-nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.mobile-nav-brand {
    text-decoration: none;
}
.mobile-nav-logo {
    height: 52px;
    width: auto;
}
.mobile-nav-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.2);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.mobile-nav-toggle-icon,
.mobile-nav-toggle-icon::before,
.mobile-nav-toggle-icon::after {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #111;
    display: block;
    content: '';
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.mobile-nav-toggle-icon::before {
    transform: translateY(-6px);
}
.mobile-nav-toggle-icon::after {
    transform: translateY(6px);
}
.mobile-nav-toggle.is-open .mobile-nav-toggle-icon {
    background: transparent;
}
.mobile-nav-toggle.is-open .mobile-nav-toggle-icon::before {
    transform: rotate(45deg);
}
.mobile-nav-toggle.is-open .mobile-nav-toggle-icon::after {
    transform: rotate(-45deg);
}
.mobile-nav-menu {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.35rem);
    z-index: 1300;
    border: 1px solid rgba(31, 61, 31, 0.12);
    border-radius: 1rem;
    padding: 0.35rem;
    background: #fff;
    box-shadow: 0 15px 40px rgba(32, 63, 32, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.mobile-nav-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.mobile-nav-menu[hidden] {
    display: none;
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-nav-link i {
    font-size: 1.1rem;
}
.mobile-nav-link:hover,
.mobile-nav-link:focus,
.mobile-nav-link.active {
    background-color: #eaf3e9;
    color: #194D7D;
}
@media (min-width: 992px) {
    .mobile-nav-shell {
        display: none;
    }
}

/* ===================================
   LOGO STYLING
=================================== */
.logo {
    height: 100px;
    margin-bottom: auto;
}
.logo-login {
    width: 380px;
    height: 180px;
}

/* ===================================
   BUTTON STYLING
=================================== */
.login-button {
    background-color: #cfe2f3;
    border-radius: 2rem;
    cursor: pointer;
    font-family: 'champagne__limousinesbold', sans-serif;
    font-size: 1.25rem;
    transition: background 0.2s, color 0.2s;
}
.login-button:hover {
    background-color: #222;
    color: #fff;
}
.btn {
    margin-right: 5px;
}
@media (max-width: 768px) {
    .btn {
        margin-bottom: 5px;
    }
}

/* ===========================
   FOOTER STYLING
=========================== */
footer {
    background-color: #efce8c;
    padding: 50px 0 30px 0;
    color: #000;
    border-radius: 1rem 1rem 0 0;
}
.footer-heading {
    font-size: 1.25rem;
    font-family: 'champagne__limousinesbold', sans-serif;
    font-weight: 400;
    margin-bottom: 0.75rem;
}
.linkedin-wrapper {
    display: inline-block;
    margin-top: 8px;
}
.linkedin-logo {
    font-size: 24px;
    color: #000;
    transition: color 0.3s;
}
.linkedin-logo:hover {
    color: #0077b5;
}
.architect-logo {
    height: 100px;
    width: auto;
    max-width: 100%;
}
.custom-footer .row > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
@media (max-width: 767px) {
    .custom-footer .col-md-4 {
        text-align: center;
        margin-bottom: 2rem;
    }
    .custom-footer .col-md-4:last-child {
        justify-content: center !important;
    }
}

/* ===================================
   DASHBOARD STYLING
=================================== */
.card {
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 20px 0 rgba(44, 62, 80, 0.09);
    border: none !important;
}
.card-header {
    background: #eaf3e9 !important;
    color: #194D7D;
    font-weight: 600;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    border-bottom: 1px solid #d6e4da !important;
}
.dash-btn:hover {
    border-color: #222;
    background-color: #222;
    color: #fff;
}
.play-button {
    background-color: #194D7D;
    color: #fff;
    border-radius: 0.75rem;
    border: none;
    padding: 4px 16px;
    font-size: 1rem;
}
.container, .container-fluid {
    margin-top: 40px;
}
input[type="date"] {
    min-width: 120px;
    border-radius: 0.75rem;
    border: 1px solid #c8d6c2;
    padding: 4px 10px;
}

/* ===================================
   DETECTIONS TABLE - FIXED HEADER & ALIGNED COLUMNS
=================================== */
.card .table {
    margin-bottom: 0;
}
.table-hover tbody tr:hover {
    background-color: #f0f8ff;
}

/* --- FIX: BOTH THEAD AND TBODY AS BLOCKS --- */
.recent-detections-table thead,
.recent-detections-table tbody {
    display: block;
    width: 100%;
}
.recent-detections-table tbody {
    overflow-y: auto;
    background: #fff;
}
.recent-detections-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.recent-detections-table th,
.recent-detections-table td {
    vertical-align: middle !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.13rem 0.28rem;
    border-top: none;
    font-size: 12px;
    min-height: 22px;
}
.recent-detections-table th.actions-col,
.recent-detections-table td.actions-col {
    width: 75px;
    min-width: 60px;
    text-align: center;
}
.recent-detections-table th.species-col,
.recent-detections-table td.species-col {
    width: 215px;
}
/* Individual Column Widths */
.recent-detections-table th:nth-child(1),
.recent-detections-table td:nth-child(1) {
    width: 30px;            /* Checkbox */
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}
.recent-detections-table th:nth-child(2),
.recent-detections-table td:nth-child(2) { width: 75px; }   /* Actions */
.recent-detections-table th:nth-child(3),
.recent-detections-table td:nth-child(3) { width: 190px; }  /* Species */
.recent-detections-table th:nth-child(4),
.recent-detections-table td:nth-child(4) { width: 100px; }  /* Detected At */
.recent-detections-table th:nth-child(5),
.recent-detections-table td:nth-child(5) { width: 70px; }  /* Category */
.recent-detections-table th:nth-child(6),
.recent-detections-table td:nth-child(6) { width: 90px; }  /* Threat Level */
.recent-detections-table th:nth-child(7),
.recent-detections-table td:nth-child(7) {
    width: 120px;           /* Training */
    text-align: center;
    overflow: visible;
    text-overflow: clip;
}
.recent-detections-table th:nth-child(8),
.recent-detections-table td:nth-child(8) { width: 120px; }  /* Corrections */

.recent-detections-table th { background: #f6faf7; }
.recent-detections-table tbody tr:hover { background: #f0f8ff; }
/* Compact checkboxes */
.recent-detections-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0 2px;
    accent-color: #194D7D;
    cursor: pointer;
    vertical-align: middle;
}

/* --- SHARED TABLE CELL STYLES --- */
.table th, .table td {
    vertical-align: middle !important;
    font-size: 0.75rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
    background: #fff;
}
/* --- STICKY HEADER --- */
.table thead th {
    position: sticky;
    top: 0;
    background: #f6faf7;
    z-index: 2;
}

/* --- Play/Download Buttons: Always Round, Compact --- */
.btn-circle, .round-action-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1rem !important;
    border: none !important;
    background: #eaf3e9 !important;
    transition: background 0.18s, color 0.18s;
    line-height: 1;
    margin: 0 1.5px;
    box-shadow: 0 1px 4px rgba(44,62,80,0.07);
}
.btn-circle.btn-primary, .round-action-btn.btn-primary,
.play-button.btn-primary, .play-button.round-action-btn {
    background: #194D7D !important;
    color: #fff !important;
}
.btn-circle.btn-secondary, .round-action-btn.btn-secondary {
    background: #cfe2f3 !important;
    color: #194D7D !important;
}
.btn-circle:disabled, .btn-circle[disabled],
.round-action-btn:disabled, .round-action-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-circle:hover, .btn-circle:focus,
.round-action-btn:hover, .round-action-btn:focus {
    background: #194D7D !important;
    color: #fff !important;
}
.btn-circle i, .round-action-btn i {
    margin: 0 !important;
    font-size: 1em !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-download-group {
    display: flex !important;
    gap: 4px !important;
    justify-content: center;
    align-items: center;
}

/* ===================================
   AUDIO PLAYER
=================================== */
#waveformPlayerContainer {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    gap: 10px;
    padding: 8px;
}
#startTime,
#totalDuration {
    margin: 0 10px;
}
#timeDisplay {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    white-space: nowrap;
}
#timeDisplay .time-separator {
    opacity: 0.6;
}
#bufferBadge {
    white-space: nowrap;
    font-size: 0.85rem;
}
#waveform {
    min-width: 100px;
    height: 20px;
    flex-grow: 1;
}

@media (max-width: 576px) {
    #waveformPlayerContainer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    #waveformPlayerContainer #playPauseButton {
        align-self: center;
    }
    #timeDisplay {
        justify-content: center;
        margin-right: 0 !important;
        width: 100%;
    }
    #bufferBadge {
        text-align: center;
    }
    #waveformPlayerContainer #waveform {
        order: 4;
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        height: 28px;
    }
}

/* ===================================
   DETECTION CONTROLS & TABLE
=================================== */
.detection-controls-card .detection-search-group {
    gap: 10px;
}
.detection-controls-card .detection-search-group button {
    flex-shrink: 0;
}
.detection-controls-card .detection-correct-group {
    gap: 10px;
}
.detection-controls-card .detection-action-group {
    gap: 10px;
}
.detection-table-responsive {
    border-radius: 0 0 1rem 1rem;
}
.mobile-select-all {
    display: none;
    border-radius: 0.85rem;
    background: #f8fafb;
    padding: 0.75rem 1rem;
}

@media (max-width: 768px) {
    .detection-controls-card .detection-filter-field {
        margin-top: 8px;
    }
    .detection-controls-card .detection-action-group {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .detection-controls-card .detection-search-group {
        flex-direction: column;
        align-items: stretch;
    }
    .detection-controls-card .detection-search-group button {
        width: 100%;
        margin-left: 0 !important;
    }
    .detection-controls-card .detection-filter-field {
        margin-top: 8px !important;
    }
    .detection-controls-card .detection-correct-group {
        flex-direction: column;
        align-items: stretch;
    }
    .detection-controls-card .detection-correct-group .detection-toggle {
        width: 100%;
        justify-content: space-between;
        margin-left: 0 !important;
    }
    .detection-controls-card .detection-action-group {
        justify-content: center;
    }
    .detection-controls-card .detection-action-group button {
        flex: 1;
        min-width: 140px;
    }
    .mobile-select-all {
        display: none;
    }
    .mobile-select-all .form-check-input {
        display: none;
    }
    .detection-table-responsive {
        overflow: visible !important;
    }
    .recent-detections-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }
    .recent-detections-table thead {
        display: none;
    }
    .recent-detections-table tbody {
        display: block;
    }
    .recent-detections-table tbody tr {
        display: flex;
        align-items: center;
        gap: 12px;
        background: #fff;
        border-radius: 1rem;
        padding: 12px 16px;
        margin-bottom: 12px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
        border: 1px solid rgba(15, 23, 42, 0.05);
        overflow: visible;
    }
    .recent-detections-table tbody tr:last-child {
        margin-bottom: 0;
    }
    .recent-detections-table th,
    .recent-detections-table td {
        border: none;
        padding: 0;
        background: transparent;
    }
    .recent-detections-table td.col-select {
        display: none;
    }
    .recent-detections-table td.col-species {
        grid-area: species;
        font-size: 0.95rem;
        font-weight: 600;
        color: #0f172a;
        min-width: 0;
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        background: transparent;
        padding: 0;
    }
    .recent-detections-table td.col-species .species-name {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .recent-detections-table td.col-species::after {
        content: attr(data-detected);
        display: block;
        font-size: 0.78rem;
        font-weight: 500;
        color: #64748b;
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .recent-detections-table td.col-species[data-detected=""]::after {
        display: none;
    }
    .recent-detections-table td.col-actions {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        flex: 0 0 auto;
        min-width: 52px;
        padding: 0;
        flex-shrink: 0;
    }
    .recent-detections-table td.col-actions .d-flex {
        gap: 6px;
    }
    .recent-detections-table td.col-actions .btn-circle {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.85rem !important;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
        border: none;
    }
    .recent-detections-table td.col-actions .download-btn {
        display: none !important;
    }
    .recent-detections-table td.col-detected {
        display: none;
    }
    .recent-detections-table th:nth-child(5),
    .recent-detections-table td:nth-child(5),
    .recent-detections-table th:nth-child(6),
    .recent-detections-table td:nth-child(6),
    .recent-detections-table th:nth-child(7),
    .recent-detections-table td:nth-child(7),
    .recent-detections-table th:nth-child(8),
    .recent-detections-table td:nth-child(8) {
        display: none;
    }
}

/* ===================================
   WEATHER ICON
=================================== */
#weatherIcon {
    width: 120px;
    height: 120px;
    position: absolute;
    top: 0;
    right: 15px;
    display: block;
}

/* ===================================
   MISC MODERN & INPUTS
=================================== */
.input-wrapper {
    position: relative;
    display: inline-block;
}
.clear-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: none;
    font-size: 14px;
    color: #555;
}
.input-wrapper:hover .clear-button,
.input-wrapper input:focus + .clear-button {
    display: block;
}

input.form-control, select.form-select {
    border-radius: 0.75rem;
}
input[type="text"].form-control {
    border-radius: 0.75rem;
}
.input-group-text {
    background: #f4f9f5;
    border-radius: 0.75rem 0 0 0.75rem;
    border: none;
}
::-webkit-scrollbar {
    width: 7px;
    background: #eaeaea;
    border-radius: 7px;
}
::-webkit-scrollbar-thumb {
    background: #c4d7c1;
    border-radius: 7px;
}

/* ===================================
   MEDIA QUERIES
=================================== */
@media (max-width: 992px) {
    nav {
        margin: 0 20px;
    }
    .logo {
        margin-left: 20px;
    }
    .card, .card-header {
        border-radius: 1rem !important;
    }
}
@media (max-width: 575px) {
    .logo {
        display: none;
    }
    .container, .container-fluid {
        margin-top: 15px;
    }
    .recent-detections-table tbody {
        height: auto;
        max-height: none;
    }
}

/* Corrections column cell layout */
.recent-detections-table td.correction-cell,
.recent-detections-table th.correction-cell {
    position: relative;
    padding-right: 36px; /* Make space for button at right */
    text-align: left;
    min-width: 120px;
}

/* The value spans left */
.correction-value {
    display: inline-block;
    vertical-align: middle;
    max-width: 90%; /* Optional: Prevents text overlapping button */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Show button always, align right inside cell */
.clear-correction {
    position: absolute;
    top: 50%;
    right: 8px;   /* Space from cell edge */
    transform: translateY(-50%);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 13px;
    cursor: pointer;
    height: 22px;
    min-width: 22px;
    line-height: 1;
    z-index: 1;
    transition: background 0.18s, color 0.18s, border 0.18s;
}
.clear-correction:hover, .clear-correction:focus {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.management-table th.email-col, .management-table td.email-col { width: 300px; }
.management-table th.name-col, .management-table td.name-col { width: 260px; }
.management-table th.surname-col, .management-table td.surname-col { width: 260px; }
.management-table th.access-col, .management-table td.access-col { width: 50px; }
.management-table th.admin-col, .management-table td.admin-col { width: 50px; }
.management-table th.api-col, .management-table td.api-col { width: 50px; }
.management-table th.location-col, .management-table td.location-col { width: 220px; }

/* Dashboard metric cards: softer colors */
.row.g-4.mb-4 > .col-sm-6.col-lg-3:nth-child(1) .card {
  background: #4881C9 !important;   /* soft blue */
  color: #000 !important;
}
.row.g-4.mb-4 > .col-sm-6.col-lg-3:nth-child(2) .card {
  background: #6CC7A1 !important;   /* soft green */
  color: #000 !important;
}
.row.g-4.mb-4 > .col-sm-6.col-lg-3:nth-child(3) .card {
  background: #FFE29A !important;   /* pastel yellow */
  color: #222 !important;
}
.row.g-4.mb-4 > .col-sm-6.col-lg-3:nth-child(4) .card {
  background: #D4A8FF !important;   /* soft purple */
  color: #222 !important;
}
.row.g-4.mb-4 > .col-sm-6.col-lg-3 .card .fs-6,
.row.g-4.mb-4 > .col-sm-6.col-lg-3 .card .display-5 {
  color: inherit !important;
}

.dashboard-metric-card {
  min-height: 60px;
  max-height: 100px;
  padding: 0.4rem 0.7rem;
  border-radius: 1.5rem !important;
  box-shadow: 0 2px 8px rgba(60,60,90,0.07);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-metric-card .card-body {
  padding: 0.4rem 0.1rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dashboard-metric-card .card-icon {
  font-size: 1.1rem;
  width: 28px;
  height: 18px;
  margin-bottom: 0.15rem;
}

.dashboard-metric-card .fs-6 {
  font-size: 0.98rem;
  margin-bottom: 0.08rem !important;
}

.dashboard-metric-card .display-5 {
  font-size: 1.15rem !important;
}

.clickable-card { cursor: pointer; transition: box-shadow 0.2s; }
.clickable-card:hover { box-shadow: 0 0 0 0.15rem #364b99; }

.collapse .card-body {
    background: #fff !important;
    color: #333 !important;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px 0 rgba(30,40,90,0.04);
}
/* Ensures collapsed species lists look like other cards */
#uniqueSpeciesCollapse .card,
#activeSpeciesCollapse .card {
    background: #fff !important;
    color: #222 !important;
    border-radius: 1rem !important;
    box-shadow: 0 1px 6px 0 rgba(30,40,90,0.07);
    border: none !important;
}

#soundscapeRatioCollapse .card {
    background: #fff !important;
    color: #222 !important;
    border-radius: 1rem !important;
    box-shadow: 0 1px 6px 0 rgba(30,40,90,0.07);
    border: none !important;
}

#uniqueSpeciesCollapse .card-body,
#activeSpeciesCollapse .card-body {
    background: #fff !important;
    color: #222 !important;
    border-radius: 1rem !important;
    box-shadow: none !important;
    padding: 1rem 1.2rem !important;
}

#uniqueSpeciesList ul, #activeSpeciesList ul {
    margin-bottom: 0;
}
#uniqueSpeciesList li, #activeSpeciesList li {
    color: #2a3240 !important;
    font-size: 12px;
}
#uniqueSpeciesList span.text-muted,
#activeSpeciesList span.text-muted {
    color: #8b98a8 !important;

}
/* ===================================
   Custom Button Colors
=================================== */
.btn-primary {
    background-color: #227EBD !important;
    border-color: #227EBD !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #1e6ca8 !important;
    border-color: #1e6ca8 !important;
    color: #fff !important;
}

.btn-success {
    background-color: #6CC7A1 !important;
    border-color: #6CC7A1 !important;
    color: #000 !important;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #2e8e5d !important;
    border-color: #5ab88c !important;
    color: #000 !important;
}

.btn-warning {
    background-color: #bf9735 !important;
    border-color: #FFE29A !important;
    color: #222 !important;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background-color: #f0d68a !important;
    border-color: #f0d68a !important;
    color: #222 !important;
}

/* Gauge Styles */
.gauge {
    position: relative;
    width: 110px;
    height: 110px;
}
.gauge canvas,
.gauge .gauge-chart {
    width: 100% !important;
    height: 100% !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.05));
    display: block;
}
.gauge-value {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

/* =============================
   Reviews Fullscreen Mode
============================= */
body.reviews-fullscreen {
    overflow: hidden;
}

body.reviews-fullscreen .navbar,
body.reviews-fullscreen footer,
body.reviews-fullscreen .nav-tabs,
body.reviews-fullscreen #analytics {
    display: none !important;
}

body.reviews-fullscreen .container {
    max-width: 100% !important;
    padding: 0 1rem !important;
    margin: 0 !important;
}

body.reviews-fullscreen .container-fluid {
    padding: 0 1rem !important;
}

body.reviews-fullscreen #reviews .col-lg-12.mb-4 {
    margin-bottom: 0 !important;
    height: 100vh;
    height: 100dvh;
}

body.reviews-fullscreen #reviews .card.bg-light {
    height: 100%;
    border-radius: 0 !important;
}

body.reviews-fullscreen #reviews .card-body {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}
