/* 
 * OnScene360 Admin CSS - Premium Glassmorphism Interface
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #0a0b10;
    --card-bg: rgba(18, 18, 26, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);

    --primary: #be0e2c;
    /* OnScene360 Crimson */
    --primary-glow: rgba(190, 14, 44, 0.4);
    --accent: #e53251;
    /* Light Crimson */

    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --sidebar-width: 260px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(190, 14, 44, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(229, 50, 81, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 15, 20, 0.7);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--card-border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon-wrapper {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    padding: 0 1rem;
    margin-top: 1rem;
    flex: 1;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
}

.menu-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform var(--transition-speed);
}

.menu-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.menu-link.active {
    color: var(--text-primary);
    background: rgba(190, 14, 44, 0.15);
    border-color: rgba(190, 14, 44, 0.3);
    box-shadow: 0 0 15px rgba(190, 14, 44, 0.1);
}

.menu-link.active svg {
    stroke: var(--accent);
    transform: scale(1.1);
}

/* Sidebar Submenu Accordion / Collapsible */
.has-submenu .submenu-list {
    list-style: none;
    padding-left: 1.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.25s ease;
}

.has-submenu.open .submenu-list {
    max-height: 600px;
    opacity: 1;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.submenu-chevron {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.has-submenu.open .submenu-chevron {
    transform: rotate(180deg);
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.submenu-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.submenu-link.active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(190, 14, 44, 0.12);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #4B5563;
}

.page-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.system-status {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: border-color var(--transition-speed), transform var(--transition-speed);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #4B5563;
    margin-top: 0.5rem;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border: 1px solid var(--card-border);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

/* Secondary statistics visualizer */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Charts & Trends */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.progress-list {
    margin-top: 1rem;
}

.progress-item {
    margin-bottom: 1.25rem;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.progress-label-name {
    font-weight: 500;
    color: #4B5563;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    box-shadow: 0 0 8px var(--primary);
}

/* Custom Table View */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}

.custom-table td {
    padding: 1.1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.custom-table tbody tr {
    transition: background-color var(--transition-speed);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--accent);
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #4B5563;
    border-color: var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #4B5563;
}

.btn-icon {
    padding: 0.4rem;
    border-radius: 8px;
}

/* Filter Controls Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-input-group {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.filter-input-group svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    color: #4B5563;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(190, 14, 44, 0.15);
}

.filter-input-group .form-control {
    padding-left: 2.5rem;
}

.select-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-control option {
    background-color: #1a1a24;
    color: #4B5563;
}

/* Pagination */
.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-links {
    display: flex;
    gap: 0.25rem;
}

.pagination-links .page-item {
    display: inline-block;
}

.pagination-links .page-link {
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.pagination-links .page-link:hover {
    background: rgba(255, 255, 255, 0.07);
}

.pagination-links .active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Detailed Report Layout */
.report-details-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 2rem;
    align-items: start;
}

.details-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #4B5563;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-section-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.data-label {
    color: var(--text-secondary);
}

.data-value {
    color: #4B5563;
    font-weight: 500;
    text-align: right;
    max-width: 65%;
    word-break: break-word;
}

/* Maps Visualizer Widget */
.map-placeholder {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #1e1e2d;
    border: 1px solid var(--card-border);
}

.map-visual {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.65;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 15, 20, 0.4);
    text-align: center;
    padding: 1rem;
}

.map-overlay svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
    filter: drop-shadow(0 2px 8px var(--primary-glow));
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

.map-address {
    font-size: 0.8rem;
    color: #4B5563;
    font-weight: 500;
}

/* Photo Gallery & Lightbox */
.evidence-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.evidence-thumb-container {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
    cursor: pointer;
}

.evidence-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.evidence-thumb-container:hover .evidence-thumb {
    transform: scale(1.08);
}

.evidence-label-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.35rem;
    font-size: 0.65rem;
    text-align: center;
    color: #4B5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal lightbox style */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
}

.lightbox-caption {
    color: #4B5563;
    text-align: center;
    margin-top: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    color: #4B5563;
    font-size: 2rem;
    cursor: pointer;
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Alert Message */
.alert {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* Utility classes */
.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media(max-width: 1024px) {
    .report-details-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Login Page Specific Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(190, 14, 44, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(229, 50, 81, 0.1) 0%, transparent 50%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 24px;
    background: rgba(26, 26, 36, 0.45);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.login-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    margin: 0 auto 1.25rem auto;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: white;
}

.login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #4B5563;
    letter-spacing: 0.5px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-icon-group {
    position: relative;
}

.input-icon-group svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    transition: color var(--transition-speed);
}

.input-icon-group .form-control {
    padding-left: 2.75rem;
}

.input-icon-group .form-control:focus+svg {
    color: var(--accent);
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
    border-radius: 12px;
    font-size: 1rem;
    margin-top: 1rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Audio Player */
.custom-audio-player {
    background: rgba(15, 15, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-icon-badge {
    background: rgba(190, 14, 44, 0.15);
    border: 1px solid rgba(190, 14, 44, 0.3);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.audio-title-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4B5563;
}

.audio-subtitle-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.audio-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.audio-wave span {
    width: 3px;
    background: var(--accent);
    border-radius: 3px;
    height: 20%;
    transition: height 0.2s ease;
}

.audio-wave.playing span {
    animation: audio-bounce 1.2s infinite ease-in-out;
}

.audio-wave.playing span:nth-child(2) {
    animation-delay: 0.15s;
}

.audio-wave.playing span:nth-child(3) {
    animation-delay: 0.3s;
}

.audio-wave.playing span:nth-child(4) {
    animation-delay: 0.45s;
}

.audio-wave.playing span:nth-child(5) {
    animation-delay: 0.6s;
}

@keyframes audio-bounce {

    0%,
    100% {
        height: 20%;
    }

    50% {
        height: 100%;
    }
}

.audio-timeline-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.audio-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    min-width: 38px;
}

.audio-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.audio-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--primary-glow);
    cursor: pointer;
    margin-top: -3.5px;
    transition: transform 0.1s ease;
}

.audio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.audio-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--primary-glow);
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.audio-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
}

.audio-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.audio-playback-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.audio-control-btn:hover {
    color: #4B5563;
    background: rgba(255, 255, 255, 0.05);
}

.audio-control-btn.play-pause-btn {
    background: var(--primary);
    color: #4B5563;
    width: 36px;
    height: 36px;
    box-shadow: 0 3px 10px var(--primary-glow);
}

.audio-control-btn.play-pause-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.audio-control-btn svg {
    width: 18px;
    height: 18px;
}

.audio-control-btn.play-pause-btn svg {
    width: 16px;
    height: 16px;
}

.audio-extra-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-speed-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.audio-speed-badge:hover {
    color: #4B5563;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.audio-volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #4B5563;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    /* Controlled dynamically by JS */
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 1010;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
    left: -4rem;
}

.lightbox-next {
    right: -4rem;
}

@media(max-width: 768px) {
    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-nav {
        background: rgba(0, 0, 0, 0.5);
        font-size: 2rem;
        width: 40px;
        height: 40px;
    }
}

.lightbox-download {
    position: absolute;
    bottom: -3.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(190, 14, 44, 0.2);
    border: 1px solid rgba(190, 14, 44, 0.4);
    color: #4B5563;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    z-index: 1010;
}

.lightbox-download:hover {
    background: var(--primary);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 12px var(--primary-glow);
    color: #4B5563;
}

/* ========================================================== */
/* ========================================================== */
/* Light Mode Theme Overrides */
/* ========================================================== */
body[data-theme="light"] {
    --bg-dark: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 0, 0, 0.08);

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
}

body[data-theme="light"] {
    background-color: #ffffff;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(190, 14, 44, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(229, 50, 81, 0.02) 0%, transparent 45%);
    color: var(--text-primary);
}

body[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid var(--card-border);
}

body[data-theme="light"] .brand-title {
    color: #111827;
}

body[data-theme="light"] .menu-link {
    color: var(--text-secondary);
}

body[data-theme="light"] .menu-link:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .menu-link.active {
    color: #be0e2c;
    background: rgba(190, 14, 44, 0.08);
    border-color: rgba(190, 14, 44, 0.2);
}

body[data-theme="light"] .page-title h1 {
    color: #111827;
}

body[data-theme="light"] .stat-value {
    color: #111827;
}

body[data-theme="light"] .stat-icon {
    background: rgba(0, 0, 0, 0.02);
}

body[data-theme="light"] .custom-table td {
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .custom-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

body[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.03);
    color: #111827;
    border-color: var(--card-border);
}

body[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .form-control {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--card-border);
    color: #000000;
}

body[data-theme="light"] .form-control:focus {
    background: rgba(0, 0, 0, 0.04);
    color: #000000;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select {
    color: #000000;
}

body[data-theme="light"] .select-control option {
    background-color: #ffffff;
    color: #000000;
}

body[data-theme="light"] .details-section-title {
    color: #111827;
}

body[data-theme="light"] .data-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .data-value {
    color: #111827;
}

body[data-theme="light"] .map-placeholder {
    background: #e5e7eb;
}

body[data-theme="light"] .map-overlay {
    background: rgba(255, 255, 255, 0.4);
}

body[data-theme="light"] .map-address {
    color: #111827;
}

body[data-theme="light"] .custom-audio-player {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .audio-title-text {
    color: #111827;
}

body[data-theme="light"] .audio-slider {
    background: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .audio-control-btn:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .audio-speed-badge {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
}

body[data-theme="light"] .audio-speed-badge:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .audio-volume-slider {
    background: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .audio-volume-slider::-webkit-slider-thumb {
    background: #111827;
}

body[data-theme="light"] .audio-volume-slider::-moz-range-thumb {
    background: #111827;
}

body[data-theme="light"] .login-container {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(190, 14, 44, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(229, 50, 81, 0.04) 0%, transparent 50%);
}

body[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .login-title {
    color: #111827;
}

body[data-theme="light"] .progress-label-name {
    color: #111827;
}

body[data-theme="light"] .progress-bar-bg {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .pagination-links .page-link {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

body[data-theme="light"] .pagination-links .page-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.01);
}

body[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Responsive navigation
   - The sidebar menu scrolls on its own when it is taller than the screen.
   - Below 1100px the sidebar becomes a slide-out drawer opened by the menu button.
   - Content shrinks to fit: wide tables scroll sideways, inline form grids stack on phones.
   ========================================================================== */
.sidebar {
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.sidebar-brand,
.sidebar-footer {
    flex-shrink: 0;
}

.sidebar-menu {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 1rem;
    /* Scrolls by wheel / touch / trackpad, without showing a scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.main-content {
    min-width: 0;
    max-width: 100%;
}

.main-content img,
.main-content video,
.main-content canvas {
    max-width: 100%;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

@media (max-height: 700px) {
    .sidebar-brand {
        padding: 1.25rem 1.5rem 1rem 1.5rem;
    }

    .sidebar-footer {
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 1100px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        background: rgba(15, 15, 20, 0.97);
        z-index: 1001;
        max-width: 85vw;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.45);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        border: 1px solid var(--card-border);
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
        cursor: pointer;
    }

    .sidebar-toggle svg {
        width: 22px;
        height: 22px;
    }

    .top-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .top-header-title {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        min-width: 0;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    body[data-theme="light"] .sidebar {
        background: #fff;
    }

    body[data-theme="light"] .sidebar-toggle {
        background: #fff;
        color: #111827;
    }
}

@media (max-width: 768px) {
    .page-title h1 {
        font-size: 1.35rem;
    }

    .header-actions>form,
    .header-actions>div {
        margin-right: 0 !important;
    }

    .glass-card {
        padding: 1rem;
    }
}

@media (max-width: 640px) {

    /* Stack two/three-column inline form grids on phones */
    .main-content [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .main-content [style*="display: flex"][style*="justify-content: space-between"] {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}