/* EGINT SOC Intelligence System - Pure Black Theme */

:root {
    --bg-primary: #000000;
    --bg-secondary: #050505;
    --bg-card: #0a0a0a;
    --bg-card-hover: #141414;
    --border-color: #1a1a1a;
    --border-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #d0d0d0;
    --text-muted: #707070;
    --color-green: #00ff88;
    --color-red: #ff3333;
    --color-blue: #0088ff;
    --color-orange: #ffaa00;
    --color-yellow: #ffff00;
    --color-purple: #bb00ff;
    --color-cyan: #00d4ff;
    --accent: #ffffff;
    --accent-2: #d0d0d0;
    --accent-glow: rgba(255, 255, 255, 0.1);
    --shadow-1: 0 10px 40px rgba(0, 0, 0, 0.9);
    --shadow-2: 0 20px 60px rgba(0, 0, 0, 0.95);
    --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.1);
    --sidebar-width: 260px;
    --header-height: 70px;
    --font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 25%, #000000 50%, #0a0a0a 75%, #000000 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Scrollbar - Hidden for all */
::-webkit-scrollbar {
    display: none !important;
}

::-webkit-scrollbar-track {
    display: none !important;
}

::-webkit-scrollbar-thumb {
    display: none !important;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide scrollbar for overflow elements */
[style*="overflow-x: auto"], 
[style*="overflow-y: auto"],
[style*="overflow: auto"] {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

[style*="overflow-x: auto"]::-webkit-scrollbar,
[style*="overflow-y: auto"]::-webkit-scrollbar,
[style*="overflow: auto"]::-webkit-scrollbar {
    display: none !important;
}

/* Top Navigation Header */
.top-header {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(12px);
}

.header-top {
    text-align: center;
    margin-bottom: 1rem;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-title {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-1);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon {
    color: var(--accent-2);
    font-size: 16px;
}

.nav-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.nav-center {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.realtime-clock {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.nav-right {
    display: flex;
    align-items: center;
}

.lang-switcher {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-blue);
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 45px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.lang-switcher:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: #e2e8f0;
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--bg-card-hover);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.username {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.user-role::before {
    content: '@';
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fecaca;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}

.nav-tab {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: rgba(30, 30, 30, 0.9);
    border-color: var(--accent);
    color: var(--text-primary);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #000000;
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}

/* Main Content */
.main-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 12px;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.metric-card {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-1);
}

.metric-card:hover {
    background: rgba(15, 15, 15, 0.95);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.metric-icon {
    color: var(--accent-2);
    font-size: 14px;
}

.metric-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.metric-subtitle {
    color: var(--text-muted);
    font-size: 10px;
}

.metric-value {
    color: var(--text-primary);
    font-size: 30px;
    font-weight: 700;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.change-arrow {
    font-size: 12px;
}

.change-arrow.up {
    color: var(--color-red);
}

.change-arrow.down {
    color: var(--color-green);
}

.change-value {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}

.chart-card {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow-1);
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.chart-half {
    grid-column: span 6;
}

.chart-third {
    grid-column: span 4;
}

.chart-quarter {
    grid-column: span 3;
}

.chart-full {
    grid-column: span 12;
}

.chart-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.chart-card canvas {
    max-height: 200px;
}

/* World Map Container */
.world-map-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    grid-column: span 6;
}

#world-map {
    width: 100%;
    height: 250px;
    background: linear-gradient(180deg, #0b1224 0%, #0f1d38 100%);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-green { background: var(--color-green); }
.legend-yellow { background: var(--color-yellow); }
.legend-orange { background: var(--color-orange); }
.legend-red { background: var(--color-red); }
.legend-blue { background: var(--color-blue); }

/* Table Styles */
.table-container {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(15, 15, 15, 0.9);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: var(--text-primary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-active, .status-assigned {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-green);
}

.status-unassigned, .status-emergency, .status-new {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-red);
}

.status-in_progress, .status-on_mission {
    background: rgba(33, 150, 243, 0.2);
    color: var(--color-blue);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-orange);
}

.status-completed, .status-closed, .status-resolved {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-green);
}

.status-off_duty {
    background: rgba(112, 112, 112, 0.2);
    color: var(--text-muted);
}

/* Priority Badges */
.priority-critical {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-red);
}

.priority-high {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-orange);
}

.priority-medium {
    background: rgba(235, 179, 8, 0.2);
    color: var(--color-yellow);
}

.priority-low {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-green);
}

.priority-urgent {
    background: rgba(156, 39, 143, 0.2);
    color: var(--color-purple);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #000000;
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.25);
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow), 0 16px 30px rgba(0, 212, 255, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-red), #ff5555);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(255, 51, 51, 0.35);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(255, 51, 51, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    background: rgba(20, 20, 20, 0.95);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Cards */
.card {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-body {
    padding: 16px;
}

/* Agent Items in Lists */
.agent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(15, 15, 15, 0.8);
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.agent-item:hover {
    background: rgba(20, 20, 20, 0.95);
}

.agent-item.status-active { border-left-color: var(--color-green); }
.agent-item.status-on_mission { border-left-color: var(--color-blue); }
.agent-item.status-emergency { border-left-color: var(--color-red); }

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.agent-info {
    flex: 1;
}

.agent-name {
    font-weight: 500;
    font-size: 14px;
}

.agent-code {
    font-size: 11px;
    color: var(--text-muted);
}

.agent-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Case Items */
.case-item {
    padding: 12px;
    background: rgba(15, 15, 15, 0.8);
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 3px solid;
    transition: all 0.3s ease;
}

.case-item:hover {
    background: rgba(20, 20, 20, 0.95);
}

.case-item.priority-critical { border-left-color: var(--color-red); }
.case-item.priority-high { border-left-color: var(--color-orange); }
.case-item.priority-medium { border-left-color: var(--color-yellow); }

.case-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.case-number {
    font-size: 11px;
    color: var(--color-blue);
}

.case-title {
    font-weight: 500;
    font-size: 14px;
}

.case-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.progress-bar {
    height: 4px;
    background: var(--bg-card-hover);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-blue);
    transition: width 0.3s ease;
}

/* Intelligence Items */
.intel-item {
    padding: 12px;
    background: rgba(15, 15, 15, 0.8);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.intel-item:hover {
    background: rgba(20, 20, 20, 0.95);
    border-color: var(--accent);
}

.intel-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.intel-number {
    font-size: 11px;
    color: var(--color-blue);
}

.intel-time {
    font-size: 11px;
    color: var(--text-muted);
}

.intel-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.intel-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 11px;
}

.reliability {
    padding: 2px 8px;
    border-radius: 4px;
}

.reliability.verified {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-green);
}

.reliability.high {
    background: rgba(33, 150, 243, 0.2);
    color: var(--color-blue);
}

.reliability.medium {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-orange);
}

/* Communication Items */
.comm-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.comm-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.comm-type.broadcast {
    background: rgba(156, 39, 176, 0.2);
    color: var(--color-purple);
}

.comm-type.sos {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-red);
}

.comm-type.direct {
    background: rgba(33, 150, 243, 0.2);
    color: var(--color-blue);
}

.comm-type.alert {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-orange);
}

.comm-subject {
    font-weight: 500;
    margin-bottom: 4px;
}

.comm-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Incident Cards */
.incident-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid;
    margin-bottom: 16px;
}

.incident-card.severity-critical { border-left-color: var(--color-red); }
.incident-card.severity-high { border-left-color: var(--color-orange); }
.incident-card.severity-medium { border-left-color: var(--color-yellow); }

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.incident-number {
    font-size: 11px;
    color: var(--text-muted);
}

.incident-type {
    font-weight: 600;
    font-size: 14px;
}

.incident-description {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

.incident-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

/* Team Cards */
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.team-name {
    font-size: 16px;
    font-weight: 600;
}

.team-code {
    font-size: 11px;
    color: var(--color-blue);
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.2);
    border-radius: 4px;
}

.team-leader {
    color: var(--text-secondary);
    font-size: 13px;
}

.team-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-member {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.2);
    color: var(--color-red);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    min-width: 300px;
    box-shadow: var(--shadow-2);
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--color-green); }
.toast.error { border-left: 4px solid var(--color-red); }
.toast.warning { border-left: 4px solid var(--color-orange); }
.toast.info { border-left: 4px solid var(--color-blue); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.99) 0%, rgba(0, 0, 0, 0.99) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-2);
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.logo i {
    color: #ffffff;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 0 10px 3px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s ease;
    border-radius: 8px;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-left: 3px solid #ffffff;
    padding-left: 11px;
}

.nav-item.active i {
    color: #ffffff;
}

/* Navigation Categories */
.nav-category {
    margin: 12px 0;
}

.nav-category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 20px);
    padding: 10px 14px;
    margin: 0 10px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    font-family: var(--font-family);
}

.nav-category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

.nav-category-icon {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-category-btn.expanded .nav-category-icon {
    transform: rotate(-180deg);
}

.nav-submenu {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.show {
    display: flex;
    flex-direction: column;
    max-height: 500px;
    margin-top: 4px;
}

.nav-submenu .nav-item {
    padding-left: 28px;
    font-size: 13px;
    margin: 2px 8px;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: var(--accent-2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.badge {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* View Sections */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-half, .chart-third, .chart-quarter, .chart-full {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Analysis Section Styles */
.analysis-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.period-selector {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.period-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid var(--border-color);
}

.period-btn:last-child {
    border-right: none;
}

.period-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--color-blue);
    color: white;
}

.analysis-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analysis-refresh:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Timeline Container */
.timeline-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.timeline-events {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-event {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid;
}

.timeline-event.type-case { border-left-color: var(--color-blue); }
.timeline-event.type-intel { border-left-color: var(--color-purple); }
.timeline-event.type-incident { border-left-color: var(--color-red); }
.timeline-event.type-task { border-left-color: var(--color-green); }

.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.timeline-event.type-case .timeline-icon { background: rgba(33, 150, 243, 0.2); color: var(--color-blue); }
.timeline-event.type-intel .timeline-icon { background: rgba(156, 39, 176, 0.2); color: var(--color-purple); }
.timeline-event.type-incident .timeline-icon { background: rgba(244, 67, 54, 0.2); color: var(--color-red); }
.timeline-event.type-task .timeline-icon { background: rgba(76, 175, 80, 0.2); color: var(--color-green); }

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.timeline-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Analysis Map Container */
.analysis-map-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

#hotspots-map {
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, #0a1628 0%, #0d1f3c 100%);
    border-radius: 8px;
}

/* Insight Cards */
.insight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid;
}

.insight-card.type-warning { border-left-color: var(--color-orange); }
.insight-card.type-critical { border-left-color: var(--color-red); }
.insight-card.type-success { border-left-color: var(--color-green); }
.insight-card.type-info { border-left-color: var(--color-blue); }

.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.insight-icon {
    font-size: 16px;
}

.insight-icon.warning { color: var(--color-orange); }
.insight-icon.critical { color: var(--color-red); }
.insight-icon.success { color: var(--color-green); }
.insight-icon.info { color: var(--color-blue); }

.insight-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.insight-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-metric {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.insight-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ============================================
   Login Page Styles
   ============================================ */

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header i {
    font-size: 48px;
    color: var(--color-blue);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form .input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .input-group i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
}

.login-form .input-group input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-form .input-group input:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.login-form .toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.login-form .toggle-password:hover {
    color: var(--text-primary);
}

.login-btn {
    background: var(--color-blue);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Login page form validation */
.login-form .input-group input:invalid:not(:placeholder-shown) {
    border-color: var(--color-red);
}

.login-form .input-group input:valid:not(:placeholder-shown) {
    border-color: var(--color-green);
}

/* ============================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Touch Targets - Minimum 44px for mobile */
.touch-target {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1001;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-logo i {
    color: var(--color-blue);
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-btn span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

.mobile-actions-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.sidebar-close-btn:hover {
    color: var(--text-primary);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav-item.active {
    color: var(--color-blue);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

/* Offline Indicator */
.offline-indicator {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-orange);
    color: white;
    padding: 12px 16px;
    font-size: 13px;
    z-index: 999;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.offline-indicator.show {
    display: flex;
}

/* Pull to Refresh */
.pull-to-refresh {
    display: none;
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    padding: 12px 24px;
    align-items: center;
    gap: 12px;
    z-index: 998;
    transition: top 0.3s ease;
}

.pull-to-refresh.refreshing {
    top: 60px;
}

.pull-icon {
    font-size: 18px;
    color: var(--color-blue);
}

.pull-icon.rotating i {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pull-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Mobile-Optimized Forms */
.mobile-optimized-form input,
.mobile-optimized-form select,
.mobile-optimized-form textarea {
    min-height: 44px;
    font-size: 16px !important; /* Prevents iOS zoom */
}

/* Chart swipeable containers */
.chart-card {
    position: relative;
    overflow: hidden;
}

.chart-card.swipeable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.chart-card.swipeable canvas {
    scroll-snap-align: center;
    min-width: 100%;
}

/* Responsive Tables */
.table-container {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.data-table {
    min-width: 800px; /* Force horizontal scroll on mobile */
}

/* Card View for Tables on Mobile */
@media (max-width: 768px) {
    .table-container.card-view .data-table {
        display: block;
        min-width: 100%;
    }

    .table-container.card-view thead {
        display: none;
    }

    .table-container.card-view tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 12px;
        background: var(--bg-card);
    }

    .table-container.card-view td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 14px;
    }

    .table-container.card-view td:last-child {
        border-bottom: none;
    }

    .table-container.card-view td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        margin-right: 16px;
    }
}

/* ============================================
   TABLET BREAKPOINT (768px)
   ============================================ */

@media (max-width: 768px) {
    /* Show mobile elements */
    .mobile-header {
        display: flex;
    }

    .hamburger-btn {
        display: flex;
    }

    .mobile-actions-btn {
        display: flex;
    }

    .sidebar-close-btn {
        display: block;
    }

    .sidebar-overlay {
        display: block;
    }

    .bottom-nav {
        display: flex;
    }

    .pull-to-refresh {
        display: flex;
    }

    /* Hide sidebar by default */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Adjust main content */
    .main-content {
        margin-left: 0 !important;
        padding-top: 60px;
        padding-bottom: 65px;
    }

    /* Adjust top header */
    .top-header {
        display: none; /* Hide desktop header on mobile */
    }

    /* Stack metrics vertically */
    .metrics-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-value {
        font-size: 24px;
    }

    /* Stack charts */
    .charts-grid {
        grid-template-columns: 1fr !important;
    }

    .chart-half,
    .chart-third,
    .chart-quarter,
    .chart-full {
        grid-column: span 12 !important;
    }

    .chart-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    /* Responsive charts */
    .chart-card canvas {
        max-height: 200px !important;
    }

    /* World map responsive */
    #world-map {
        height: 200px;
    }

    #live-map {
        height: 300px !important;
    }

    #hotspots-map {
        height: 250px !important;
    }

    /* Adjust typography */
    .header-title {
        font-size: 20px;
    }

    .chart-title {
        font-size: 14px;
    }

    /* Modal responsive */
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 140px);
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    /* Form adjustments */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Toast notifications */
    #toast-container {
        top: auto;
        bottom: 80px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Hide less important elements */
    .nav-center {
        display: none;
    }

    /* Button sizing */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 8px 14px;
    }

    /* Table card view */
    .table-container {
        border-radius: 0;
    }

    /* Timeline adjustments */
    .timeline-event {
        flex-direction: column;
        gap: 12px;
    }

    .timeline-icon {
        align-self: flex-start;
    }

    /* Insight cards */
    .insight-cards {
        grid-template-columns: 1fr;
    }

    /* Team cards */
    .team-card {
        padding: 16px;
    }

    /* Incident cards */
    .incident-card {
        padding: 12px;
    }

    /* Agent/Case items */
    .agent-item,
    .case-item,
    .intel-item,
    .comm-item {
        padding: 10px;
    }

    .agent-meta,
    .case-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Hide non-essential sidebar items on mobile */
    .sidebar-nav .admin-only {
        display: none;
    }
}

/* ============================================
   MOBILE BREAKPOINT (480px)
   ============================================ */

@media (max-width: 480px) {
    /* Adjust sidebar */
    .sidebar {
        width: 280px;
    }

    /* Reduce spacing */
    .main-container {
        padding: 12px;
    }

    .metric-card {
        padding: 12px;
    }

    .chart-card {
        padding: 12px;
    }

    /* Smaller text */
    .header-title {
        font-size: 18px;
    }

    .metric-value {
        font-size: 20px;
    }

    .metric-title {
        font-size: 11px;
    }

    /* Compact charts */
    .chart-card canvas {
        max-height: 150px !important;
    }

    #world-map {
        height: 150px;
    }

    #live-map {
        height: 250px !important;
    }

    #hotspots-map {
        height: 200px !important;
    }

    /* Adjust bottom nav */
    .bottom-nav {
        height: 60px;
        padding: 0 4px;
    }

    .bottom-nav-item {
        padding: 6px 8px;
        min-height: 40px;
    }

    .bottom-nav-item i {
        font-size: 18px;
    }

    .bottom-nav-item span {
        font-size: 9px;
    }

    /* Adjust mobile header */
    .mobile-header {
        height: 56px;
        padding: 0 12px;
    }

    .mobile-logo {
        font-size: 16px;
    }

    /* Smaller modal */
    .modal-content {
        margin: 12px;
    }

    /* Adjust forms */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
        padding: 10px 14px;
    }

    /* Badge adjustments */
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Status badges */
    .status-badge {
        font-size: 10px;
        padding: 3px 10px;
    }

    /* Reduce animation on mobile */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }

    /* Simplified view */
    .metric-subtitle {
        display: none;
    }

    /* Card simplification */
    .case-meta,
    .intel-meta,
    .agent-meta {
        font-size: 10px;
    }

    /* Hide chart legends on very small screens */
    canvas {
        font-size: 10px !important;
    }

    /* Adjust map legend */
    .map-legend {
        gap: 8px;
    }

    .legend-item {
        font-size: 10px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Lazy loading images */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* Optimize chart rendering on mobile */
@media (max-width: 768px) {
    /* Disable animations in charts */
    canvas {
        image-rendering: optimizeSpeed;
    }

    /* Disable hover effects on mobile */
    .metric-card:hover,
    .chart-card:hover,
    .card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Simplified transitions */
    .nav-item,
    .nav-tab,
    .btn {
        transition: background-color 0.2s ease;
    }
}

/* Font size adjustments for readability */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    body {
        font-size: 14px;
        line-height: 1.5;
    }

    .metric-value {
        font-size: 22px;
    }

    .chart-title {
        font-size: 13px;
    }

    .data-table td {
        font-size: 12px;
    }
}

/* Print styles for mobile */
@media print {
    .mobile-header,
    .bottom-nav,
    .sidebar,
    .offline-indicator,
    .pull-to-refresh {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-header {
        height: 50px;
    }

    .bottom-nav {
        height: 50px;
    }

    .main-content {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    /* Compact metrics in landscape */
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Crisper borders on retina displays */
    .border-color {
        border-width: 0.5px;
    }

    /* Adjust icon sizes */
    .metric-icon,
    .nav-icon {
        font-size: 15px;
    }
}

/* Dark mode optimizations (already dark, but ensure OLED black) */
@media (max-width: 480px) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #0a0a0a;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .mobile-header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-top: max(0px, env(safe-area-inset-top));
    }

    .bottom-nav {
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        height: calc(65px + env(safe-area-inset-bottom));
    }
}

/* Focus states for keyboard accessibility */
.btn:focus,
.nav-item:focus,
.bottom-nav-item:focus {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

/* Hamburger menu animation states */
.hamburger-btn span {
    transform-origin: center;
}

/* Smooth scrollbar for desktop */
@media (min-width: 769px) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) var(--bg-secondary);
    }
}

/* ========================================
   Reports Styles
   ======================================== */

.report-generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.report-form {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.report-info-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.report-info-section h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 2px solid var(--color-blue);
    padding-bottom: 10px;
}

.report-types-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.report-type-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--color-blue);
    transition: all 0.3s ease;
}

.report-type-card:hover {
    background: var(--bg-hover);
    border-left-color: var(--color-cyan);
    transform: translateX(5px);
}

.report-type-card i {
    color: var(--color-blue);
    font-size: 20px;
    margin-bottom: 10px;
}

.report-type-card h5 {
    color: var(--text-primary);
    margin: 10px 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.report-type-card p {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.form-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .report-generator-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .report-form,
    .report-info-section {
        padding: 15px;
    }

    .report-types-list {
        gap: 10px;
    }

    .report-type-card {
        padding: 12px;
    }

    .checkbox-group {
        gap: 8px;
    }
}

/* Loading state for report generation */
.report-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.report-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   AGENT MOBILE UI - Bottom Navigation
   ================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

.bottom-nav.active {
    display: flex;
}

.bottom-nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    transition: all 0.3s ease;
    border-top: 3px solid transparent;
    font-size: 12px;
}

.bottom-nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #ffffff;
    border-top-color: #00d4ff;
}

.bottom-nav-item.active {
    background: rgba(0, 212, 255, 0.05);
}

/* Agent Views */
.agent-view {
    display: none;
    padding: 20px 0 90px 0;
    min-height: 100vh;
    animation: slideUp 0.3s ease;
}

.agent-view {
    display: none;
    padding: 15px 0 90px 0;
}

.agent-view.active {
    display: block;
}

.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-container {
    padding: 0 15px;
}

.agent-container h2 {
    color: #ffffff;
    margin: 20px 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 15px 20px 15px;
    width: 100%;
    box-sizing: border-box;
}

.task-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-card:active,
.task-card:hover {
    border-color: #00d4ff;
    background: rgba(20, 20, 20, 1);
    transform: translateY(-2px);
}

.task-card h3 {
    color: #ffffff;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.task-card p {
    color: #aaa;
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

.task-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 5px;
    margin-top: 8px;
}

.task-badge.priority-high {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
}

.task-badge.priority-medium {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.task-badge.priority-low {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

.task-badge.status-pending {
    background: rgba(100, 150, 255, 0.2);
    color: #64a0ff;
}

.task-badge.status-in_progress {
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
}

.task-badge.status-completed {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

/* Report Form */
.agent-report-form {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.agent-report-form .form-group {
    display: flex;
    flex-direction: column;
}

.agent-report-form label {
    color: #ffffff;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.agent-report-form input,
.agent-report-form select,
.agent-report-form textarea {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.agent-report-form input:focus,
.agent-report-form select:focus,
.agent-report-form textarea:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.agent-report-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Location Info */
.location-info {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.location-info p {
    color: #aaa;
    margin: 10px 0;
    font-size: 14px;
}

.location-info strong {
    color: #ffffff;
}

/* Profile Info */
.profile-info {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.profile-avatar {
    font-size: 80px;
    color: #00d4ff;
    margin-bottom: 15px;
}

#agent-profile-details {
    text-align: left;
}

#agent-profile-details p {
    color: #aaa;
    margin: 10px 0;
    font-size: 14px;
}

#agent-profile-details strong {
    color: #ffffff;
}

/* Buttons */
.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #00d4ff;
    color: #000000;
}

.btn-primary:active,
.btn-primary:hover {
    background: #00f0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.btn-danger {
    background: #ff4444;
    color: #ffffff;
}

.btn-danger:active,
.btn-danger:hover {
    background: #ff6666;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .main-content {
        padding-bottom: 0;
    }

    .sidebar {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    /* Show bottom nav for agent role */
    body.agent-role .bottom-nav {
        display: flex;
    }

    body.agent-role .sidebar {
        display: none !important;
    }

    .agent-view {
        padding: 15px 0 80px 0;
    }

    .agent-container {
        padding: 0 15px;
    }

    /* Adjust main dashboard padding when bottom nav is visible */
    #dashboard-section {
        padding-bottom: 20px;
    }
}

@media (orientation: landscape) and (max-width: 900px) {
    .bottom-nav {
        height: 60px;
    }

    .bottom-nav-item {
        font-size: 11px;
    }

    .bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 2px;
    }

    body {
        padding-bottom: 60px;
    }
}
/* Agent Role Mobile Layout */
body.agent-role {
    padding-bottom: 70px !important;
}

body.agent-role .sidebar,
body.agent-role aside.sidebar,
body.agent-role #sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.agent-role .sidebar-overlay,
body.agent-role #sidebar-overlay {
    display: none !important;
}

body.agent-role .hamburger-btn,
body.agent-role #hamburger-btn {
    display: none !important;
    visibility: hidden !important;
}

body.agent-role .mobile-header {
    display: flex !important;
    visibility: visible !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 999;
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

body.agent-role .top-header,
body.agent-role header.top-header {
    display: none !important;
}

body.agent-role .main-content,
body.agent-role main.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    min-height: auto !important;
}

body.agent-role .main-container {
    padding: 0 !important;
    margin: 0 !important;
}

body.agent-role .view-section {
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
}

body.agent-role .view-section.active {
    display: block !important;
    padding: 70px 0 100px 0 !important;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.agent-role #dashboard-view {
    display: none !important;
    padding: 0 !important;
}

body.agent-role #dashboard-view.active {
    display: block !important;
    padding: 70px 0 100px 0 !important;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.agent-role .charts-grid,
body.agent-role .chart-card,
body.agent-role .dashboard-widgets,
body.agent-role .chart-quarter,
body.agent-role .chart-half,
body.agent-role .chart-third,
body.agent-role .chart-full {
    display: none !important;
}

body.agent-role .agent-view {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 130px) !important;
    padding: 15px 15px 100px 15px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    z-index: 500 !important;
    background: #000 !important;
    pointer-events: none !important;
}

body.agent-role .agent-view.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.agent-role .agent-container {
    padding: 0 !important;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

body.agent-role .agent-container h2 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 20px 0;
    padding: 0 15px;
}

body.agent-role .bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 70px !important;
    background: rgba(0, 0, 0, 0.95) !important;
    border-top: 1px solid rgba(0, 212, 255, 0.2) !important;
    z-index: 1000 !important;
    justify-content: space-around !important;
}

body.agent-role .bottom-nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 12px !important;
    transition: all 0.2s ease !important;
    border-radius: 0 !important;
    cursor: pointer !important;
}

body.agent-role .bottom-nav-item:hover {
    color: #00d4ff !important;
    background: rgba(0, 212, 255, 0.05) !important;
}

body.agent-role .bottom-nav-item.active {
    color: #00d4ff !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border-top: 3px solid #00d4ff !important;
}

body.agent-role .bottom-nav-item i {
    font-size: 24px !important;
    margin-bottom: 4px !important;
}

body.agent-role .bottom-nav-item span {
    display: block !important;
    font-size: 11px !important;
}

/* Agent role works on ANY screen size */
@media (max-width: 768px) {
    body.agent-role {
        padding-bottom: 70px;
    }

    body.agent-role .sidebar {
        display: none !important;
        visibility: hidden !important;
    }

    body.agent-role .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0;
    }

    body.agent-role .view-section {
        display: none;
    }

    body.agent-role .view-section.active {
        display: block;
    }

    body.agent-role #dashboard-view {
        display: none;
        margin: 0;
        padding: 15px 0 90px 0;
    }

    body.agent-role #dashboard-view.active {
        display: block;
    }

    body.agent-role .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 15px;
        margin: 15px 0;
    }

    body.agent-role .dashboard-metrics {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 15px;
        margin-bottom: 15px;
        margin-top: 15px;
    }

    body.agent-role .metric-card {
        background: rgba(20, 20, 20, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 15px;
        text-align: center;
    }

    body.agent-role .metric-card h3 {
        font-size: 24px;
        color: #00d4ff;
        margin: 10px 0 5px 0;
    }

    body.agent-role .metric-card p {
        font-size: 12px;
        color: #aaa;
        margin: 0;
    }
}    body.agent-role .dashboard-widgets {
        display: none !important;
    }

    body.agent-role .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Hide all charts on agent dashboard */
    body.agent-role .chart-card {
        display: none !important;
    }

    body.agent-role .chart-widget {
        display: none !important;
    }

    /* Show only essentials in agent dashboard */
    body.agent-role .latest-intelligence,
    body.agent-role .priority-cases-list,
    body.agent-role .active-agents-list,
    body.agent-role .recent-comms-list {
        display: none !important;
    }

    /* Mobile header adjustments for agent */
    body.agent-role .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
    }

    body.agent-role .mobile-logo {
        flex: 1;
        text-align: center;
    }

    body.agent-role .mobile-actions-btn {
        display: none;
    }
}

/* ==================== TRACER STYLES ==================== */

.tracer-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.tracer-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-cyan);
    background: var(--bg-card);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input {
    display: none;
}

.file-name {
    color: var(--text-secondary);
    font-size: 13px;
    flex: 1;
    padding: 8px 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-cyan), var(--color-blue));
    color: #000;
    border: 1px solid var(--color-cyan);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

.tracer-results {
    margin-top: 30px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-2);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

.tracer-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tracer-results-table thead {
    background: var(--bg-secondary);
}

.tracer-results-table th {
    padding: 12px;
    text-align: left;
    color: var(--color-cyan);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-light);
}

.tracer-results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
}

.tracer-results-table tr:hover {
    background: var(--bg-secondary);
}

.result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(0, 255, 136, 0.2);
    color: var(--color-green);
    border: 1px solid var(--color-green);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.2);
    color: var(--color-orange);
    border: 1px solid var(--color-orange);
}

.badge-danger {
    background: rgba(255, 51, 51, 0.2);
    color: var(--color-red);
    border: 1px solid var(--color-red);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 48px;
    opacity: 0.5;
    display: block;
    margin-bottom: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }

    .tracer-results-table {
        font-size: 12px;
    }

    .tracer-results-table th,
    .tracer-results-table td {
        padding: 8px;
    }
}