/* =================================================================
   BWS Admin Components - Specialized Styles
   ================================================================= */

/* Map Containers (global) */
#map-container,
#realtime-map-container {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    position: relative;
}

#mqttMap,
#realtimeMap,
#mapid {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
}

/* Page Layout Styles - Updated for Sidebar */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #f9fafb;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
    margin-bottom: 0.5rem;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 8px;
    color: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Enhanced Mobile Status Cards */
.status-card-mobile {
    position: relative;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid #6366f1;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.status-card-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.status-card-mobile.bg-primary {
    border-left-color: #4f46e5;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(31, 41, 55, 0.8) 100%);
}

.status-card-mobile.bg-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(31, 41, 55, 0.8) 100%);
}

.status-card-mobile.bg-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(31, 41, 55, 0.8) 100%);
}

.status-card-mobile.bg-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(31, 41, 55, 0.8) 100%);
}

.status-card-mobile.bg-danger {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(31, 41, 55, 0.8) 100%);
}

.status-card-mobile.border-success {
    border-left-color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.status-card-mobile.border-danger {
    border-left-color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.status-card-mobile .icon {
    font-size: 1.25rem;
    opacity: 0.9;
    color: #6366f1;
    min-width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-card-mobile .content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.status-card-mobile .title {
    font-size: 0.9rem;
    margin-bottom: 0;
    display: block;
}

/* Value at bottom and small-size variants */
.status-card-mobile .value {
    display: block;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-card-mobile .value-bottom {
    margin-top: auto; /* push to bottom of card content */
}
.status-card-mobile .value-small .value-text {
    font-size: 0.95rem;
}
.status-card-mobile .value-small .value-suffix {
    font-size: 0.8rem;
}

/* Compact variant for status cards */
.status-card-compact {
    padding: 0.8rem 0.9rem;
    gap: 0.6rem; /* tighter spacing */
}
.status-card-compact .icon {
    font-size: 1.1rem;
    min-width: 26px; /* was ~40px global */
}
.status-card-compact .title {
    font-size: 0.9rem;
}
.status-card-compact .value .value-text {
    font-size: 1.05rem;
}
.status-card-compact .small {
    font-size: 0.8rem;
}

/* Mobile Floating Action Button */
.mobile-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-fab:hover,
.mobile-fab:active {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
    color: white;
}

.mobile-fab:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 2rem;
    position: relative;
    margin-left: 0 !important; /* Override sidebar margin for login page */
}

.login-card {
    background: rgba(31, 41, 55, 0.95);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(79, 70, 229, 0.3);
    backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #f9fafb;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #d1d5db;
    font-size: 1rem;
    margin: 0;
}

.login-input {
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(107, 114, 128, 0.3);
    border-radius: 12px;
    color: #f9fafb;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.login-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: rgba(17, 24, 39, 0.9);
    color: #f9fafb;
}

.login-input::placeholder {
    color: #9ca3af;
}

.form-floating label {
    color: #d1d5db;
    font-weight: 500;
}

.remember-me-checkbox {
    accent-color: #4f46e5;
    transform: scale(1.1);
}

.form-check-label {
    color: #d1d5db;
    font-weight: 500;
    margin-left: 0.5rem;
}

.login-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
}

.forgot-password-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(107, 114, 128, 0.2);
}

.admin-info-panel {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(17, 24, 39, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(10px);
    max-width: 300px;
}

.admin-info-panel h6 {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 1rem;
}

.credentials-info {
    background: rgba(31, 41, 55, 0.6);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.credentials-info p {
    margin: 0.5rem 0;
    color: #f9fafb;
    font-size: 0.875rem;
}

.credential-text {
    background: rgba(79, 70, 229, 0.2);
    color: #a5b4fc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.text-warning {
    color: #f59e0b !important;
}

.text-danger {
    color: #ef4444 !important;
}

/* Access Denied Page Styles */
.access-denied-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 2rem;
    margin-left: 0 !important; /* Override sidebar margin */
}

.access-denied-card {
    background: rgba(31, 41, 55, 0.95);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(20px);
}

.access-denied-icon {
    margin-bottom: 2rem;
}

.access-denied-title {
    color: #f9fafb;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.access-denied-message {
    color: #d1d5db;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.user-info-panel {
    background: rgba(17, 24, 39, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid rgba(107, 114, 128, 0.3);
    text-align: left;
}

.current-user {
    color: #3b82f6;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.user-roles {
    color: #f59e0b;
    font-weight: 500;
    margin: 0;
}

.not-logged-in-panel {
    background: rgba(79, 70, 229, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.login-prompt {
    color: #d1d5db;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.action-buttons {
    margin: 2rem 0;
}

.help-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(107, 114, 128, 0.3);
    text-align: left;
}

.help-section h6 {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 1rem;
}

.help-section ul {
    color: #d1d5db;
    list-style: none;
    padding: 0;
}

.help-section li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.help-section li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 404 Not Found Styles */
.not-found-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.not-found-card {
    background: rgba(31, 41, 55, 0.8);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(107, 114, 128, 0.3);
    backdrop-filter: blur(10px);
}

.not-found-icon {
    margin-bottom: 2rem;
}

.not-found-title {
    color: #f9fafb;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.not-found-message {
    color: #d1d5db;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.not-found-actions {
    margin-bottom: 3rem;
}

.helpful-links {
    text-align: left;
    padding-top: 2rem;
    border-top: 1px solid rgba(107, 114, 128, 0.3);
}

.helpful-links h6 {
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 1rem;
}

.helpful-links ul {
    list-style: none;
    padding: 0;
}

.helpful-links li {
    margin-bottom: 0.5rem;
}

.helpful-links a {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.helpful-links a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: rgba(107, 114, 128, 0.8);
    border: 1px solid rgba(107, 114, 128, 0.5);
    color: #f9fafb;
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 1);
    color: #f9fafb;
}

.btn-outline-primary {
    border: 2px solid #4f46e5;
    color: #4f46e5;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #4f46e5;
    color: white;
}

.btn-outline-secondary {
    border: 2px solid rgba(107, 114, 128, 0.5);
    color: #d1d5db;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: rgba(107, 114, 128, 0.2);
    color: #f9fafb;
}

/* DMARC Reports Styles */
.dmarc-table {
    background: rgba(31, 41, 55, 0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dmarc-table td, .dmarc-table th {
    vertical-align: middle;
    text-align: center;
    padding: 1rem;
    font-size: 0.95rem;
    word-break: break-word;
    border-color: rgba(107, 114, 128, 0.2);
}

.dmarc-table th {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: #f9fafb;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.dmarc-table tbody tr {
    transition: all 0.3s ease;
}

.dmarc-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.1) !important;
    transform: scale(1.01);
}

.dmarc-org {
    white-space: normal;
    word-break: break-word;
    max-width: 220px;
    font-weight: 500;
}

.dmarc-action {
    white-space: nowrap;
    max-width: 90px;
}

.lookup-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.lookup-btn:hover {
    transform: rotate(10deg) scale(1.1);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: white;
}

.lookup-btn:active {
    transform: rotate(5deg) scale(1.05);
}

/* Table Row Status Colors */
.table-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-left: 4px solid #ef4444;
}

.table-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-left: 4px solid #f59e0b;
}

.table-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-left: 4px solid #10b981;
}

/* IP Lookup Styles */
.ip-lookup-container {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.ip-input-group {
    position: relative;
    margin-bottom: 2rem;
}

.ip-input {
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(107, 114, 128, 0.3);
    border-radius: 12px;
    color: #f9fafb;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.ip-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
    background: rgba(17, 24, 39, 0.9);
}

.ip-check-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 1rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.ip-check-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
}

.ip-check-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ip-result-card {
    background: rgba(31, 41, 55, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid rgba(107, 114, 128, 0.2);
    backdrop-filter: blur(10px);
}

.ip-result-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(107, 114, 128, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ip-result-item:last-child {
    border-bottom: none;
}

.ip-result-label {
    font-weight: 600;
    color: #d1d5db;
    min-width: 120px;
}

.ip-result-value {
    color: #f9fafb;
    text-align: right;
    flex: 1;
}

/* System Monitor Styles */
.log-section {
    background: rgba(31, 41, 55, 0.8);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(107, 114, 128, 0.2);
    backdrop-filter: blur(10px);
}

.log-type-selector {
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(107, 114, 128, 0.3);
    border-radius: 8px;
    color: #f9fafb;
    padding: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.log-type-selector:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.filter-toggle {
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(107, 114, 128, 0.3);
    border-radius: 6px;
    margin-right: 0.5rem;
    accent-color: #4f46e5;
}

.filter-label {
    color: #d1d5db;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Log Entry Status Styles */
.failed-log, .ban-log, .error-log, .auth-failure-log {
    background: rgba(239, 68, 68, 0.15) !important;
    border-left: 4px solid #ef4444;
    color: #fca5a5 !important;
}

.accepted-log, .unban-log, .connected-log {
    background: rgba(16, 185, 129, 0.15) !important;
    border-left: 4px solid #10b981;
    color: #6ee7b7 !important;
}

.closed-log, .found-log, .connection-log {
    background: rgba(245, 158, 11, 0.15) !important;
    border-left: 4px solid #f59e0b;
    color: #fcd34d !important;
}

.invalid-log, .disconnected-log {
    background: rgba(236, 72, 153, 0.15) !important;
    border-left: 4px solid #ec4899;
    color: #f9a8d4 !important;
}

/* Permanent Bans Styles */
.banned-ip-card {
    background: rgba(31, 41, 55, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.banned-ip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.ban-status-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unban-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.unban-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Modal Enhancements */
.ip-reputation-modal .modal-content {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.ip-reputation-modal .modal-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-bottom: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 16px 16px 0 0;
}

.ip-reputation-modal .modal-title {
    color: #f9fafb;
    font-weight: 700;
    font-size: 1.25rem;
}

.ip-reputation-modal .btn-close {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 1.25rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.ip-reputation-modal .btn-close:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

/* RBL Status Indicators */
.rbl-clean {
    color: #10b981;
    font-weight: 600;
}

.rbl-listed {
    color: #ef4444;
    font-weight: 600;
}

.rbl-hits-list {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
    border-left: 4px solid #ef4444;
}

.rbl-hits-list li {
    color: #fca5a5;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

/* Status Indicators */
.status-success {
    color: #10b981;
    font-weight: 600;
}

.status-warning {
    color: #f59e0b;
    font-weight: 600;
}

.status-danger {
    color: #ef4444;
    font-weight: 600;
}

.status-info {
    color: #3b82f6;
    font-weight: 600;
}

/* Charts Container */
.chart-container {
    background: rgba(31, 41, 55, 0.8);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(107, 114, 128, 0.2);
    backdrop-filter: blur(10px);
}

.chart-title {
    color: #f9fafb;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Page Headers */
.page-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(79, 70, 229, 0.2);
    backdrop-filter: blur(10px);
}

.page-title {
    color: #f9fafb;
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
    text-align: center;
}

.page-subtitle {
    color: #d1d5db;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Animation Classes */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Sticky Headers */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
}

/* Filter Controls */
.filter-controls {
    background: rgba(31, 41, 55, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(107, 114, 128, 0.2);
    backdrop-filter: blur(10px);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dark scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-collapsed .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .toast-container {
        top: 70px; /* Below mobile header */
        right: 1rem;
        left: 1rem;
        width: auto;
    }
    
    /* Map containers on mobile */
    #map-container,
    #realtime-map-container {
        height: 50vh;
        min-height: 300px;
    }

    #mqttMap,
    #realtimeMap,
    #mapid {
        height: 50vh;
        min-height: 300px;
    }

    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem;
    }
    
    .admin-info-panel {
        position: static;
        margin-top: 2rem;
        max-width: 100%;
    }
    
    .access-denied-container {
        padding: 1rem;
    }
    
    .access-denied-card {
        padding: 2rem;
    }
    
    .access-denied-title {
        font-size: 2rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .not-found-title {
        font-size: 1.5rem;
    }
    
    .dmarc-table td, .dmarc-table th {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .ip-lookup-container {
        padding: 1rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.95rem;
    }
    
    .lookup-btn {
        padding: 0.375rem;
        font-size: 0.875rem;
    }

    /* Mobile status cards optimizations */
    .status-card-mobile {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .status-card-mobile .icon {
        font-size: 1.3rem;
        min-width: 36px;
    }

    .status-card-mobile .title {
        font-size: 0.85rem;
    }

    .status-card-mobile .value {
        font-size: 1rem;
    }

    /* Improve mobile FAB positioning */
    .mobile-fab {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Better mobile chart containers */
    .chart-container {
        padding: 1rem;
        margin: 1rem 0;
    }

    .chart-title {
        font-size: 1.1rem;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .status-card-mobile {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .status-card-mobile .icon {
        font-size: 1.2rem;
        min-width: 32px;
    }

    .status-card-mobile .title {
        font-size: 0.8rem;
    }

    .status-card-mobile .value {
        font-size: 0.95rem;
    }

    .mobile-fab {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        bottom: 1rem;
        right: 1rem;
    }

    .page-title {
        font-size: 1.3rem;
    }
}

/* Smaller icons for compact status cards */
.status-card-compact .icon {
    min-width: 26px; /* was ~40px global */
    font-size: 0.95rem; /* smaller icon */
    line-height: 1;
}
.status-card-compact {
    gap: 0.6rem; /* tighter spacing */
}
/* On small screens, shrink even more */
@media (max-width: 768px) {
    .status-card-compact .icon {
        min-width: 22px;
        font-size: 0.9rem;
    }
}
