:root {
    --primary-green: #2ecc71;
    --primary-blue: #0d6efd; /* The blue from your logo */
    --dark-bg: #0f111a;      /* Darker background to match your image */
    --card-bg: #1a1d29;      /* Slightly lighter for the box */
    --text-light: #e9ecef;
    --border-color: #2a2d3d;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* New Wrapper to stack header and box */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

/* Brand Header Styles */
.brand-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo {
    background-color: var(--primary-blue);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.8rem;
}

.logo svg {
    width: 24px;
    height: 24px;
    color: white; /* Make the shield white */
}

.brand-name {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

/* The Box */
.auth-container {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color); /* Added subtle border like the image */
    width: 100%;
    box-sizing: border-box;
}

/* Centered Form Header */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 { 
    color: white; 
    margin: 0 0 0.5rem 0; 
    font-size: 1.4rem;
}

.form-header p.subtitle { 
    color: #a0a5b5; 
    margin: 0; 
    font-size: 0.95rem; 
}

/* Inputs */
.input-group { 
    margin-bottom: 1.2rem; 
}

input[type="text"], 
input[type="email"], 
input[type="password"] {
    width: 100%;
    padding: 12px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    box-sizing: border-box;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary-blue); /* Updated focus color to match logo */
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-blue); /* Switched button to blue to match branding */
    border: none;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.3s;
    margin-top: 0.5rem;
}

.btn-primary:hover { 
    background: #0b5ed7; 
}

/* Footer Link */
.footer-text { 
    margin-top: 1.5rem; 
    text-align: center; 
    font-size: 0.9rem; 
}

.footer-text a { 
    color: var(--primary-blue); 
    text-decoration: none; 
}

.footer-text a:hover { 
    text-decoration: underline; 
}
/* --- SentinelCloud Toast Alert System --- */
.sentinel-toast {
    position: fixed;
    top: 20px;
    right: -350px; /* Hidden off-screen initially */
    width: 300px;
    padding: 15px 20px;
    background-color: #1a1f2e;
    border-left: 4px solid #3b82f6;
    color: #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: right 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
}

.sentinel-toast.show {
    right: 20px; /* Slides in */
}

/* Red styling for security errors */
.sentinel-toast.toast-error {
    border-left-color: #ef4444;
}

/* Green styling for success messages */
.sentinel-toast.toast-success {
    border-left-color: #10b981;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    line-height: 1.4;
    font-weight: 500;
}
/* --- SentinelCloud Dashboard Layout --- */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    background-color: #0b0f19; /* Slightly darker than login screen */
    margin: 0;
    align-items: stretch;
    justify-content: flex-start;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #111827;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.sidebar-brand h2 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
}


.nav-links {
    list-style: none;
    padding: 0 15px;
    margin: 0;
    flex-grow: 1;
}

.nav-links li a {
    display: block;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.nav-links li a.active {
    background-color: var(--primary-blue);
    color: #ffffff;
}

.nav-links li a:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: #94a3b8;
}

.btn-logout {
    display: block;
    text-align: center;
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    transition: 0.3s;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: #fff;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.top-bar h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.status-badge.live {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #111827;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 10px 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.text-blue { color: #3b82f6; }
.text-red { color: #ef4444; }

/* Data Tables */
.data-panel {
    background-color: #111827;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px;
}

.data-panel h2 {
    font-size: 1.2rem;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.data-table td {
    font-size: 0.9rem;
    color: #e2e8f0;
}

.ip-text {
    font-family: monospace;
    color: #94a3b8;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-login { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.text-center { text-align: center; color: #94a3b8; }
/* --- Dashboard Specific Upgrades --- */

/* Split the tables side-by-side on large screens */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Make tables scrollable if they get too long */
.data-panel {
    max-height: 500px;
    overflow-y: auto;
}

/* Ensure table headers stay at the top when scrolling */
.data-table th {
    position: sticky;
    top: 0;
    background-color: #111827;
    z-index: 10;
}

/* Badge System based on SQL Schema Statuses */
.badge-critical { 
    background-color: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-medium { 
    background-color: rgba(245, 158, 11, 0.1); 
    color: #f59e0b; 
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-low { 
    background-color: rgba(59, 130, 246, 0.1); 
    color: #3b82f6; 
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-online { 
    background-color: rgba(16, 185, 129, 0.1); 
    color: #10b981; 
}

.badge-action {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    font-family: monospace;
}

/* Error Banner for DB faults */
.error-banner {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    color: #e2e8f0;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}
/* --- Live Video Grid Styles --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: #111827;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-header {
    padding: 12px 15px;
    background-color: #1f2937;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.node-name { font-weight: 600; color: #fff; }
.node-location { color: #94a3b8; }

.video-placeholder {
    aspect-ratio: 16 / 9;
    background-color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #4b5563;
}

.live-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: bold;
    background: rgba(0,0,0,0.6);
    padding: 2px 8px;
    border-radius: 4px;
}
/* --- Filter Bar Styles --- */
.filter-bar {
    background-color: #111827;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-form label {
    color: #94a3b8;
    font-weight: 500;
}

.filter-form select {
    background-color: #1f2937;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.filter-form select:focus {
    border-color: #3b82f6;
}

.node-owner {
    font-size: 0.75rem;
    padding: 2px 6px;
}

.mt-2 { margin-top: 10px; }
.text-sm { font-size: 0.85rem; color: #94a3b8; }
/* --- Resolve Action Button --- */
.btn-resolve {
    background-color: transparent;
    color: #10b981;
    border: 1px solid #10b981;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-resolve:hover {
    background-color: #10b981;
    color: #fff;
}

.btn-resolve:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* --- Resolved Badge --- */
.badge-resolved {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}
/* --- Modal Overlay Styles --- */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background-color: #111827;
    width: 100%;
    max-width: 450px;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover { color: #ef4444; }

.modal-box .form-group input, .modal-box .form-group select {
    background-color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px;
}
.modal-box .form-group select option { background-color: #1f2937; }
/* --- Video Archives Grid --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.video-card {
    background-color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.video-player {
    width: 100%;
    border-radius: 4px;
    background-color: #000;
}
.video-meta {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
}
.status-badges {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}
.encryption-badge {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.sync-badge {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
/* Sidebar Category Divisions */
.sidebar-category {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 5px 20px;
    margin: 0;
    font-weight: 600;
}