/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f7f8fa;
    color: #1f2937;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    padding-top: 52px; /* Reduced navbar height */
    padding-bottom: 0; /* Remove bottom padding */
    margin-left: 280px; /* Account for persistent sidebar */
    transition: background-color 0.3s ease, color 0.3s ease, margin-left 0.3s ease;
    font-size: 14px; /* Reduced base font size */
}

body.sidebar-collapsed {
    margin-left: 0;
}

/* Dark Mode Styles */
body[data-theme="dark"] {
    background-color: #0d1117;
    color: #c9d1d9;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3 {
    color: #f0f6fc;
}

body[data-theme="dark"] header {
    background-color: #161b22;
}

body[data-theme="dark"] footer {
    background-color: #161b22;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    background-color: #ffffff;
    color: #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    height: 52px;
    transition: left 0.3s ease;
}

body.sidebar-collapsed .navbar {
    left: 0;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 0.15s, color 0.15s;
    display: none; /* Hide by default on desktop when sidebar is expanded */
}

/* Show hamburger only when sidebar is collapsed on desktop */
body.sidebar-collapsed .hamburger-btn {
    display: block;
}

/* Always show hamburger on mobile */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }
}

.hamburger-btn:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.back-btn {
    color: #6b7280;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
}

.back-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
}

.breadcrumb a:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.breadcrumb-separator {
    color: #d1d5db;
    margin: 0 2px;
}

.breadcrumb-current {
    color: #1f2937;
    font-weight: 500;
}

.navbar-user {
    color: #374151;
    font-size: 13px;
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 8px;
    font-weight: 500;
}

.user-role {
    color: #6b7280;
    font-size: 12px;
    margin-left: 4px;
    font-weight: 400;
}

.logout-btn {
    color: #dc2626;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: transparent;
    border: 1px solid #e5e7eb;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Navbar Search */
.navbar-search {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.navbar-search-input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.9);
    color: #2e3e4e;
    font-size: 14px;
    width: 200px;
    height: 36px;
    outline: none;
    transition: width 0.3s, background-color 0.3s;
    box-sizing: border-box;
}

.navbar-search-input:focus {
    width: 250px;
    background-color: white;
}

.navbar-search-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
}

.navbar-search-btn:hover {
    background-color: #2980b9;
}

/* Responsive navbar search */
@media (max-width: 768px) {
    .navbar-search-input {
        width: 150px;
    }

    .navbar-search-input:focus {
        width: 180px;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    transition: left 0.3s ease, width 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    left: -280px;
}

.sidebar-header {
    background-color: #ffffff;
    color: #2e3e4e;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h3 {
    margin: 0;
    color: #2e3e4e;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-header h3 i {
    color: #1f8ef1;
}

.close-sidebar {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.close-sidebar:hover {
    background-color: #f0f0f0;
    color: #1f8ef1;
}

.sidebar-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h4 {
    color: #1f8ef1;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

.sidebar-section a, .quick-nav-link {
    display: block;
    color: #2e3e4e;
    text-decoration: none;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar-section a:hover, .quick-nav-link:hover {
    background-color: #e8f4ff;
    color: #1f8ef1;
}

.sidebar-section a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #1f8ef1;
}

.site-id-badge {
    display: inline-block;
    background-color: #e8f4ff;
    color: #1f8ef1;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
}

.sidebar-no-content {
    color: #999;
    font-size: 13px;
    padding: 10px 15px;
    font-style: italic;
    margin: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-logo {
    max-width: 75px;
    height: auto;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.sidebar-copyright {
    color: #6c757d;
    font-size: 12px;
    margin: 0;
    text-align: center;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

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

/* Sidebar Search */
.sidebar-search {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
}

.sidebar-search-form {
    display: flex;
    gap: 5px;
}

.sidebar-search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f5f5f5;
    transition: border-color 0.2s, background-color 0.2s;
}

.sidebar-search-input:focus {
    outline: none;
    border-color: #1f8ef1;
    background-color: #ffffff;
}

.sidebar-search-btn {
    background: none;
    color: #1f8ef1;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-size: 16px;
}

.sidebar-search-btn:hover {
    background-color: rgba(31, 142, 241, 0.1);
    color: #1570cd;
}

/* Sidebar Theme Toggle */
.sidebar-theme-toggle {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sidebar-theme-toggle:hover {
    background-color: #f5f5f5;
}

.sidebar-theme-toggle span {
    font-size: 14px;
    color: #2e3e4e;
    font-weight: 500;
}

.sidebar-theme-toggle i {
    font-size: 18px;
    color: #1f8ef1;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1002;
    max-width: 400px;
}

.flash-message {
    background-color: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

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

.flash-message button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #999;
}

.flash-message button:hover {
    color: #333;
}

.flash-success {
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.flash-danger {
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.flash-warning {
    border-left: 4px solid #f39c12;
    color: #f39c12;
}

.flash-info {
    border-left: 4px solid #3498db;
    color: #3498db;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 16px 24px;
}

header {
    background-color: #ffffff;
    color: #1f2937;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

h1 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

h2 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

h3 {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

button, input[type="submit"] {
    background-color: #3b82f6;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s, box-shadow 0.15s;
}

button:hover, input[type="submit"]:hover {
    background-color: #2563eb;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

input[type="text"], input[type="password"], input[type="email"], select {
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    display: inline-block;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

form {
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

table th, table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

nav a {
    color: #1f8ef1;
    text-decoration: none;
    padding: 10px 20px;
    font-weight: 500;
}

nav a:hover {
    background-color: #f4f6f9;
    border-radius: 5px;
}

footer {
    background-color: #f9fafb;
    color: #6b7280;
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 32px;
    font-size: 13px;
}

/* Styles for the modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Login Modals */
.modal-content {
    max-width: 500px;
    border-radius: 8px;
}

.modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}

.modal-description {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-body {
    padding: 0;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.modal-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: #00684a;
    box-shadow: 0 0 0 3px rgba(0, 104, 74, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-footer .btn-primary {
    background-color: #00684a;
    color: white;
}

.modal-footer .btn-primary:hover {
    background-color: #005a3f;
}

.modal-footer .btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.modal-footer .btn-secondary:hover {
    background-color: #d1d5db;
}

/* Dark mode support for modals */
body[data-theme="dark"] .modal-header h2,
body[data-theme="dark"] .modal-body .form-group label {
    color: #f0f6fc;
}

body[data-theme="dark"] .modal-description {
    color: #8b949e;
}

body[data-theme="dark"] .modal-body .form-control {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .modal-body .form-control:focus {
    border-color: #00ed64;
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
}

body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-footer {
    border-color: #30363d;
}

body[data-theme="dark"] .modal-footer .btn-secondary {
    background-color: #21262d;
    color: #c9d1d9;
}

body[data-theme="dark"] .modal-footer .btn-secondary:hover {
    background-color: #30363d;
}

body[data-theme="dark"] .close:hover,
body[data-theme="dark"] .close:focus {
    color: #c9d1d9;
}

/* Added styles for merged units */
.linked-icon {
    font-size: 18px;
    color: #007bff;
}

.locked input,
.locked select {
    background-color: #e9e9e9;
    pointer-events: none;
}

.child-unit {
    display: none;  /* Start with child units hidden */
    background-color: #f9f9f9;
}

.child-unit.locked input,
.child-unit.locked select {
    background-color: #e9e9e9;
    pointer-events: none;
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.project-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}

.project-card-header {
    background-color: #f9fafb;
    color: #1f2937;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.project-card-header h3 {
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
}

.project-id-badge {
    background-color: #1e40af;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-card-body {
    padding: 12px 16px;
}

.project-card-body p {
    margin: 6px 0;
    font-size: 13px;
    line-height: 1.5;
}

.project-card-footer {
    padding: 10px 16px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin-top: 20px;
    color: #6c757d;
}

.empty-state p {
    margin: 10px 0 20px;
}

/* List styles for locations, IDFs, etc */
.item-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.item-list li {
    background: white;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.item-list li:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.item-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.site-id-badge {
    background-color: #eff6ff;
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
    border: 1px solid #bfdbfe;
}

.item-list li a:hover {
    color: #1f2937;
}

.item-list li a i {
    margin-right: 8px;
    color: #3b82f6;
    font-size: 14px;
}

/* Action buttons container */
.action-buttons {
    margin: 16px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 6px;
    padding: 20px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}

.dashboard-card-icon {
    font-size: 36px;
    color: #3b82f6;
    margin-bottom: 12px;
}

.dashboard-card h3 {
    margin: 8px 0;
    color: #111827;
    font-size: 15px;
}

.dashboard-card p {
    color: #6b7280;
    font-size: 13px;
    margin: 8px 0 16px;
    line-height: 1.5;
}

.dashboard-card .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Location Cards */
.location-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.location-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    overflow: hidden;
}

.location-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}

.location-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.location-card-header {
    background-color: #f9fafb;
    color: #1f2937;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.location-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.location-card-header h3 i {
    margin-right: 8px;
}

.site-id-header {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1976D2; /* Blue for light theme */
}

.location-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
}

.location-card-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.location-address,
.location-contact {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.location-address > i,
.location-contact > i {
    font-size: 20px;
    color: #1f8ef1;
    margin-top: 2px;
    flex-shrink: 0;
}

.address-details,
.contact-details {
    flex: 1;
}

.address-details p,
.contact-details p {
    margin: 4px 0;
    color: #2e3e4e;
    line-height: 1.5;
}

.address-details p.region {
    margin-top: 8px;
    color: #6c757d;
    font-size: 14px;
}

.contact-details p {
    font-size: 14px;
}

.contact-details p i {
    margin-right: 6px;
    color: #6c757d;
    font-size: 12px;
}

.contact-details p strong {
    color: #2e3e4e;
}

/* Button Styles for Location Cards */
.btn-success {
    background-color: #00d084;
    color: white;
}

.btn-success:hover {
    background-color: #00b871;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background-color: #d97706;
    border-color: #d97706;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Icon-only buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin: 0 4px;
}

.btn-icon:first-child {
    margin-left: 0;
}

.btn-icon i {
    margin: 0;
    font-size: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* Filter and Sort Toolbar Styles */
.filter-toolbar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
}

.filter-form {
    margin: 0;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2e3e4e;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    line-height: 20px;
}

.filter-group label i {
    color: #1f8ef1;
    font-size: 14px;
    width: 14px;
    text-align: center;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    margin: 0;
    height: 42px;
    box-sizing: border-box;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #1f8ef1;
    box-shadow: 0 0 0 3px rgba(31, 142, 241, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.filter-actions .btn {
    padding: 10px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    height: 42px;
    box-sizing: border-box;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Responsive adjustments for filter toolbar */
@media (max-width: 1024px) {
    .filter-controls {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-controls {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        width: 100%;
    }

    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Microsoft SSO Login Styles */
.login-divider {
    text-align: center;
    margin: 30px 0 20px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background-color: #ddd;
}

.login-divider span {
    background-color: #f4f6f9;
    padding: 0 15px;
    position: relative;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.sso-login {
    margin-top: 20px;
}

.microsoft-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background-color: white;
    color: #5e5e5e;
    border: 1px solid #8c8c8c;
    border-radius: 5px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
}

.microsoft-login-btn:hover {
    background-color: #f3f3f3;
    border-color: #5e5e5e;
}

.microsoft-login-btn svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Mobile Responsiveness and Touch Optimization
   ========================================================================== */

/* Tablet and smaller devices */
@media (max-width: 1024px) {
    /* Reduce padding on container for more screen real estate */
    .container {
        padding: 15px;
    }

    /* Stack dashboard cards in 2 columns on tablets */
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Reduce project card minimum width */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* Reduce location card minimum width */
    .location-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobile devices (landscape and portrait) */
@media (max-width: 768px) {
    /* Body adjustments */
    body {
        padding-top: 55px; /* Reduce navbar height on mobile */
    }

    /* Navbar mobile optimization */
    .navbar {
        padding: 8px 12px;
        height: 55px;
        flex-wrap: wrap;
    }

    .navbar-left {
        gap: 8px;
        flex: 0 0 auto;
    }

    .navbar-right {
        gap: 8px;
    }

    /* Hide breadcrumb on mobile to save space */
    .breadcrumb {
        display: none;
    }

    /* Hide back button text, keep icon only */
    .back-btn {
        padding: 8px 12px;
    }

    .back-btn span {
        display: none;
    }

    /* Navbar search - make it collapsible */
    .navbar-search {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        padding: 10px;
        display: none;
        z-index: 999;
    }

    .navbar-search.active {
        display: flex;
    }

    .navbar-search-input {
        width: 100%;
        flex: 1;
    }

    .navbar-search-input:focus {
        width: 100%;
    }

    /* Hide user role text on mobile */
    .user-role {
        display: none;
    }

    /* Logout button - icon only */
    .logout-btn {
        padding: 8px 12px;
    }

    .logout-btn span {
        display: none;
    }

    /* Navbar user - compact */
    .navbar-user {
        font-size: 12px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Flash messages - make them full width on mobile */
    .flash-messages {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .flash-message {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* Container adjustments */
    .container {
        padding: 10px;
    }

    /* Headers */
    header {
        padding: 15px 10px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    /* Dashboard and project cards - single column on mobile */
    .dashboard-cards,
    .projects-grid,
    .location-cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Card padding adjustments */
    .dashboard-card {
        padding: 20px 15px;
    }

    .project-card-body,
    .location-card-body {
        padding: 15px;
    }

    /* Project card header */
    .project-card-header {
        padding: 12px 15px;
    }

    .project-card-header h3 {
        font-size: 16px;
    }

    /* Table responsiveness - make tables horizontally scrollable */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        margin: 15px -10px; /* Negative margin to allow full width scroll */
    }

    table {
        min-width: 600px; /* Ensure table doesn't collapse too much */
        font-size: 14px;
    }

    table th,
    table td {
        padding: 8px;
        font-size: 13px;
    }

    /* Make select and input elements more touch-friendly */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    select,
    button,
    .btn {
        min-height: 44px; /* Apple's recommended minimum touch target */
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Form inputs */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        padding: 12px 15px;
    }

    /* Buttons */
    button,
    input[type="submit"],
    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Action buttons - stack vertically on mobile */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Modal adjustments for mobile */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }

    /* Sidebar adjustments */
    .sidebar {
        width: 280px;
        left: -280px;
    }

    .sidebar.collapsed {
        left: -280px;
    }

    .sidebar-content {
        padding: 15px;
    }

    /* On mobile, sidebar is hidden by default */
    body {
        margin-left: 0;
    }

    .navbar {
        left: 0;
    }

    /* Show overlay when sidebar is open on mobile */
    .sidebar:not(.collapsed) ~ .sidebar-overlay {
        display: block;
    }

    /* Item list adjustments */
    .item-list li a {
        padding: 12px 15px;
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .site-id-badge {
        margin-left: 0;
        align-self: flex-start;
    }

    /* Footer - ensure it doesn't overlap content on mobile */
    footer {
        position: relative;
        margin-top: 30px;
    }

    /* Filter toolbar mobile optimization */
    .filter-toolbar {
        padding: 15px;
    }

    /* Action menu - make touch-friendly */
    .action-button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }

    .action-menu-content {
        min-width: 200px;
        right: 0; /* Align to right edge on mobile */
    }

    .action-menu-content a {
        padding: 14px 16px;
        font-size: 15px;
    }

    /* Location card responsive adjustments */
    .location-address,
    .location-contact {
        flex-direction: row;
    }

    .address-details p,
    .contact-details p {
        font-size: 13px;
    }
}

/* Small mobile devices (portrait phones) */
@media (max-width: 480px) {
    /* Even more compact navbar */
    .navbar {
        padding: 6px 10px;
        height: 50px;
    }

    body {
        padding-top: 50px;
    }

    .hamburger-btn,
    .back-btn,
    .logout-btn {
        padding: 6px 10px;
        font-size: 18px;
    }

    /* Hide username on very small screens */
    .navbar-user {
        display: none;
    }

    /* Headers - smaller font sizes */
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    /* Tables - allow more compression */
    table {
        min-width: 500px;
        font-size: 13px;
    }

    table th,
    table td {
        padding: 6px;
        font-size: 12px;
    }

    /* Smaller cards */
    .dashboard-card {
        padding: 15px 12px;
    }

    .project-card-body,
    .location-card-body {
        padding: 12px;
    }

    /* Dashboard icon size */
    .dashboard-card-icon {
        font-size: 36px;
    }

    /* Modal - full screen on small devices */
    .modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    /* Flash messages */
    .flash-messages {
        top: 55px;
        right: 5px;
        left: 5px;
    }

    .flash-message {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Container */
    .container {
        padding: 8px;
    }

    /* Sidebar */
    .sidebar {
        width: 100%;
        left: -100%;
    }

    .sidebar.collapsed {
        left: -100%;
    }

    /* Item list */
    .item-list li a {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 900px) and (orientation: landscape) {
    /* Reduce vertical padding in landscape mode */
    .container {
        padding: 10px 20px;
    }

    header {
        padding: 10px 20px;
    }

    .dashboard-cards,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch device optimizations (for all touch-enabled devices) */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    a,
    button,
    .btn,
    select,
    input {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .project-card:hover,
    .location-card:hover,
    .dashboard-card:hover,
    .item-list li:hover {
        transform: none;
    }

    /* Make action menu easier to use on touch */
    .action-menu-content a {
        padding: 16px 18px;
    }
}

/* High DPI screens (Retina displays) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles - hide navigation and optimize for printing */
@media print {
    .navbar,
    .sidebar,
    .sidebar-overlay,
    footer,
    .action-menu,
    .filter-toolbar,
    .hamburger-btn,
    .logout-btn {
        display: none !important;
    }

    body {
        padding-top: 0;
    }

    .container {
        max-width: none;
    }

    table {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Profile/Entity Header Styles (Modern SaaS-style)
   ========================================================================== */

.entity-header {
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.entity-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.entity-header-title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.entity-header-subtitle {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 16px;
}

.entity-header-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.entity-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entity-meta-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.entity-meta-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}

/* Tab Navigation */
.tab-navigation {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    padding: 0 24px;
}

.tab-link {
    padding: 12px 16px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-link:hover {
    color: #111827;
}

.tab-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-badge {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tab-link.active .tab-badge {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ==========================================================================
   Filter/Sort Modal Styles (ClickUp-style)
   ========================================================================== */

/* Filter Modal Button in Header */
.filter-modal-btn {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.filter-modal-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-modal-btn i {
    font-size: 12px;
    color: #6b7280;
}

/* Filter/Sort Modal Overlay */
.filter-sort-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Filter/Sort Modal Content */
.filter-sort-modal-content {
    position: absolute;
    top: 100px;
    right: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.2s ease-out;
}

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

/* Dynamic positioning for icon-triggered modals */
.filter-sort-modal-content.positioned-near-icon {
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    animation: fadeInScale 0.15s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Header */
.filter-sort-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-sort-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2e3e4e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-sort-modal-header h3 i {
    font-size: 15px;
    color: #1f8ef1;
}

.close-modal-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.close-modal-btn:hover {
    background-color: #f0f0f0;
    color: #2e3e4e;
}

/* Modal Body */
.filter-sort-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.filter-sort-modal-body .filter-group {
    margin-bottom: 16px;
}

.filter-sort-modal-body .filter-group:last-child {
    margin-bottom: 0;
}

.filter-sort-modal-body .filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.filter-sort-modal-body .filter-group label i {
    margin-right: 4px;
    color: #1f8ef1;
    font-size: 12px;
}

.filter-sort-modal-body .filter-input,
.filter-sort-modal-body .filter-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.filter-sort-modal-body .filter-input:focus,
.filter-sort-modal-body .filter-select:focus {
    outline: none;
    border-color: #1f8ef1;
    box-shadow: 0 0 0 3px rgba(31, 142, 241, 0.1);
}

/* Modal Footer */
.filter-sort-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.filter-sort-modal-footer .btn {
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-sort-modal-footer .btn-secondary {
    background-color: #ffffff;
    color: #6c757d;
    border: 1px solid #ced4da;
}

.filter-sort-modal-footer .btn-secondary:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.filter-sort-modal-footer .btn-primary {
    background-color: #1f8ef1;
    color: white;
    border: none;
}

.filter-sort-modal-footer .btn-primary:hover {
    background-color: #1570cd;
    box-shadow: 0 2px 8px rgba(31, 142, 241, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filter-sort-modal-content {
        width: 90%;
        right: 5%;
        top: 80px;
    }

    .filter-modal-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .filter-modal-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .filter-sort-modal-content {
        width: 95%;
        right: 2.5%;
        top: 70px;
    }
}

/* ==========================================================================
   Dark Mode Theme Styles
   ========================================================================== */

/* Dark Mode Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    min-width: 36px;
    box-sizing: border-box;
}

.theme-toggle-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.theme-toggle-btn .theme-icon {
    transition: transform 0.3s ease;
}

/* Navbar Dark Mode */
body[data-theme="dark"] .navbar {
    background-color: #161b22;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

body[data-theme="dark"] .navbar-search-input {
    background-color: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .navbar-search-input:focus {
    background-color: #161b22;
    border-color: #58a6ff;
}

body[data-theme="dark"] .navbar-search-btn {
    background-color: #238636;
}

body[data-theme="dark"] .navbar-search-btn:hover {
    background-color: #2ea043;
}

body[data-theme="dark"] .breadcrumb a {
    color: #58a6ff;
}

body[data-theme="dark"] .breadcrumb-current {
    color: #f0f6fc;
}

body[data-theme="dark"] .user-role {
    color: #58a6ff;
}

body[data-theme="dark"] .navbar-user {
    color: #c9d1d9;
}

body[data-theme="dark"] .hamburger-btn {
    background-color: transparent;
    color: #58a6ff;
}

body[data-theme="dark"] .hamburger-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

/* Sidebar Dark Mode */
body[data-theme="dark"] .sidebar {
    background-color: #161b22;
    border-right: 1px solid #30363d;
}

body[data-theme="dark"] .sidebar-header {
    background-color: #0d1117;
}

body[data-theme="dark"] .close-sidebar {
    color: #58a6ff !important;
    background: none !important;
    border: none !important;
}

body[data-theme="dark"] .close-sidebar:hover {
    background-color: rgba(88, 166, 255, 0.1) !important;
    color: #58a6ff !important;
}

body[data-theme="dark"] .sidebar-search {
    background-color: #0d1117;
    border-bottom: 1px solid #30363d;
}

body[data-theme="dark"] .sidebar-search-input {
    background-color: #161b22;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .sidebar-search-input:focus {
    border-color: #58a6ff;
    background-color: #0d1117;
}

body[data-theme="dark"] .sidebar-search-btn {
    background: none;
    color: #58a6ff;
}

body[data-theme="dark"] .sidebar-search-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

body[data-theme="dark"] .sidebar-theme-toggle {
    background-color: #0d1117;
    border-bottom: 1px solid #30363d;
}

body[data-theme="dark"] .sidebar-theme-toggle:hover {
    background-color: #161b22;
}

body[data-theme="dark"] .sidebar-theme-toggle span {
    color: #c9d1d9;
}

body[data-theme="dark"] .sidebar-theme-toggle i {
    color: #58a6ff;
}

body[data-theme="dark"] .sidebar-section h4 {
    color: #58a6ff;
    border-bottom: 1px solid #30363d;
}

body[data-theme="dark"] .sidebar-section a,
body[data-theme="dark"] .quick-nav-link {
    color: #c9d1d9;
}

body[data-theme="dark"] .sidebar-section a:hover,
body[data-theme="dark"] .quick-nav-link:hover {
    background-color: rgba(88, 166, 255, 0.1);
}

body[data-theme="dark"] .site-id-badge {
    background-color: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

body[data-theme="dark"] .sidebar-no-content {
    color: #6e7681;
}

body[data-theme="dark"] .sidebar-footer {
    background-color: rgba(0,0,0,0.2);
    border-top: 1px solid #30363d;
}

body[data-theme="dark"] .sidebar-copyright {
    color: #8b949e;
}

/* Entity Header Dark Mode */
body[data-theme="dark"] .entity-header {
    background-color: #161b22;
    border-color: #30363d;
}

body[data-theme="dark"] .entity-header-title h1 {
    color: #c9d1d9;
}

body[data-theme="dark"] .entity-header-subtitle {
    color: #8b949e;
}

/* Cards Dark Mode */
body[data-theme="dark"] .project-card,
body[data-theme="dark"] .location-card,
body[data-theme="dark"] .dashboard-card {
    background: #161b22;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    border: 1px solid #30363d;
}

body[data-theme="dark"] .project-card:hover,
body[data-theme="dark"] .location-card:hover,
body[data-theme="dark"] .dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

body[data-theme="dark"] .project-card-header,
body[data-theme="dark"] .location-card-header {
    background: linear-gradient(135deg, #1f6feb 0%, #1158c7 100%);
}

body[data-theme="dark"] .project-card-footer {
    background-color: #0d1117;
    border-top: 1px solid #30363d;
}

body[data-theme="dark"] .dashboard-card-icon {
    color: #58a6ff;
}

body[data-theme="dark"] .location-card-body p,
body[data-theme="dark"] .project-card-body p {
    color: #c9d1d9;
}

body[data-theme="dark"] .location-address > i,
body[data-theme="dark"] .location-contact > i {
    color: #58a6ff;
}

/* Table Dark Mode */
body[data-theme="dark"] table {
    background-color: #161b22;
}

body[data-theme="dark"] table th {
    background-color: #0d1117;
    color: #f0f6fc;
    border-bottom: 1px solid #30363d;
}

body[data-theme="dark"] table td {
    border-bottom: 1px solid #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] table tr:hover {
    background-color: rgba(88, 166, 255, 0.05);
}

/* Form Elements Dark Mode */
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] select {
    background-color: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

body[data-theme="dark"] input[type="text"]:focus,
body[data-theme="dark"] input[type="password"]:focus,
body[data-theme="dark"] input[type="email"]:focus,
body[data-theme="dark"] select:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

body[data-theme="dark"] .locked input,
body[data-theme="dark"] .locked select,
body[data-theme="dark"] .child-unit.locked input,
body[data-theme="dark"] .child-unit.locked select {
    background-color: #1c2128;
}

body[data-theme="dark"] .child-unit {
    background-color: #0d1117;
}

/* Button Dark Mode */
body[data-theme="dark"] button,
body[data-theme="dark"] input[type="submit"] {
    background-color: #238636;
}

body[data-theme="dark"] button:hover,
body[data-theme="dark"] input[type="submit"]:hover {
    background-color: #2ea043;
}

body[data-theme="dark"] .btn-primary {
    background-color: #1f6feb;
}

body[data-theme="dark"] .btn-primary:hover {
    background-color: #1158c7;
}

body[data-theme="dark"] .btn-secondary {
    background-color: #30363d;
}

body[data-theme="dark"] .btn-secondary:hover {
    background-color: #484f58;
}

/* Keep DELETE button red in dark mode */
body[data-theme="dark"] .btn-danger {
    background-color: #dc3545;
}

body[data-theme="dark"] .btn-danger:hover {
    background-color: #c82333;
}

body[data-theme="dark"] .btn-warning {
    background-color: #f59e0b;
}

body[data-theme="dark"] .btn-warning:hover {
    background-color: #d97706;
}

body[data-theme="dark"] .project-id-badge {
    background-color: #1f6feb;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .location-card-actions {
    border-top: 1px solid #30363d;
}

body[data-theme="dark"] .site-id-header {
    color: #58a6ff; /* Brighter blue for better visibility in dark theme */
}

/* Modal Dark Mode */
body[data-theme="dark"] .modal {
    background-color: rgba(1, 4, 9, 0.5);
}

body[data-theme="dark"] .modal-content {
    background-color: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .close {
    color: #8b949e;
}

body[data-theme="dark"] .close:hover,
body[data-theme="dark"] .close:focus {
    color: #c9d1d9;
}

/* Flash Messages Dark Mode */
body[data-theme="dark"] .flash-message {
    background-color: #161b22;
    border: 1px solid #30363d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

body[data-theme="dark"] .flash-success {
    border-left: 4px solid #238636;
    color: #3fb950;
}

body[data-theme="dark"] .flash-danger {
    border-left: 4px solid #da3633;
    color: #f85149;
}

body[data-theme="dark"] .flash-warning {
    border-left: 4px solid #d29922;
    color: #f0883e;
}

body[data-theme="dark"] .flash-info {
    border-left: 4px solid #1f6feb;
    color: #58a6ff;
}

body[data-theme="dark"] .flash-message button {
    color: #8b949e;
}

body[data-theme="dark"] .flash-message button:hover {
    color: #c9d1d9;
}

/* List Items Dark Mode */
body[data-theme="dark"] .item-list li {
    background: #161b22;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid #30363d;
}

body[data-theme="dark"] .item-list li:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

body[data-theme="dark"] .item-list li a {
    color: #c9d1d9;
}

body[data-theme="dark"] .item-list li a:hover {
    color: #58a6ff;
}

body[data-theme="dark"] .item-list li a i {
    color: #58a6ff;
}

body[data-theme="dark"] .site-id-badge {
    background-color: #1f6feb;
}

/* Filter Toolbar Dark Mode */
body[data-theme="dark"] .filter-toolbar {
    background: #161b22;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    border: 1px solid #30363d;
}

body[data-theme="dark"] .filter-group label {
    color: #f0f6fc;
}

body[data-theme="dark"] .filter-group label i {
    color: #58a6ff;
}

body[data-theme="dark"] .filter-input,
body[data-theme="dark"] .filter-select {
    background-color: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .filter-input:focus,
body[data-theme="dark"] .filter-select:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

/* Empty State Dark Mode */
body[data-theme="dark"] .empty-state {
    color: #8b949e;
}

body[data-theme="dark"] .empty-state h3 {
    color: #8b949e;
}

/* Nav Links Dark Mode */
body[data-theme="dark"] nav a {
    color: #58a6ff;
}

body[data-theme="dark"] nav a:hover {
    background-color: rgba(88, 166, 255, 0.1);
}

/* Microsoft SSO Login Dark Mode */
body[data-theme="dark"] .login-divider span {
    background-color: #0d1117;
    color: #8b949e;
}

body[data-theme="dark"] .login-divider::before {
    background-color: #30363d;
}

body[data-theme="dark"] .microsoft-login-btn {
    background-color: #161b22;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .microsoft-login-btn:hover {
    background-color: #1c2128;
    border-color: #58a6ff;
}

/* Misc Dark Mode */
body[data-theme="dark"] .linked-icon {
    color: #58a6ff;
}

body[data-theme="dark"] .logout-btn {
    background-color: #da3633;
    color: #ffffff;
    border-color: #da3633;
}

body[data-theme="dark"] .logout-btn:hover {
    background-color: #f85149;
    color: #ffffff;
    border-color: #f85149;
}

/* Filter/Sort Modal Dark Mode */
body[data-theme="dark"] .filter-modal-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
    border-color: rgba(255, 255, 255, 0.15);
}

body[data-theme="dark"] .filter-modal-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
}

body[data-theme="dark"] .filter-sort-modal {
    background-color: rgba(1, 4, 9, 0.8);
}

body[data-theme="dark"] .filter-sort-modal-content {
    background-color: #161b22;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid #30363d;
}

body[data-theme="dark"] .filter-sort-modal-header {
    border-bottom: 1px solid #30363d;
}

body[data-theme="dark"] .filter-sort-modal-header h3 {
    color: #f0f6fc;
}

body[data-theme="dark"] .filter-sort-modal-header h3 i {
    color: #58a6ff;
}

body[data-theme="dark"] .close-modal-btn {
    color: #8b949e;
}

body[data-theme="dark"] .close-modal-btn:hover {
    background-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .filter-sort-modal-body .filter-group label {
    color: #c9d1d9;
}

body[data-theme="dark"] .filter-sort-modal-body .filter-group label i {
    color: #58a6ff;
}

body[data-theme="dark"] .filter-sort-modal-body .filter-input,
body[data-theme="dark"] .filter-sort-modal-body .filter-select {
    background-color: #0d1117;
    color: #c9d1d9;
    border-color: #30363d;
}

body[data-theme="dark"] .filter-sort-modal-body .filter-input:focus,
body[data-theme="dark"] .filter-sort-modal-body .filter-select:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

body[data-theme="dark"] .filter-sort-modal-footer {
    background-color: #0d1117;
    border-top: 1px solid #30363d;
}

body[data-theme="dark"] .filter-sort-modal-footer .btn-secondary {
    background-color: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
}

body[data-theme="dark"] .filter-sort-modal-footer .btn-secondary:hover {
    background-color: #30363d;
    border-color: #484f58;
}

body[data-theme="dark"] .filter-sort-modal-footer .btn-primary {
    background-color: #1f6feb;
}

body[data-theme="dark"] .filter-sort-modal-footer .btn-primary:hover {
    background-color: #1158c7;
    box-shadow: 0 2px 8px rgba(31, 111, 235, 0.4);
}

/* ==========================================================================
   Hierarchical Tree View Styles (ClickUp-style)
   ========================================================================== */

.hierarchy-tree {
    margin: 20px 0;
}

.tree-floor,
.tree-idf,
.tree-row,
.tree-rack {
    margin-bottom: 4px;
    position: relative;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.tree-node:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    z-index: 10001;
}

.toggle-icon {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s ease;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.node-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.node-label {
    font-weight: 500;
    color: #2e3e4e;
    flex: 1;
}

.node-count {
    font-size: 12px;
    color: #6c757d;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    transition: all 0.2s;
}

/* Hover effect for clickable node counts */
.node-count[onclick]:hover {
    background: #e5e7eb;
    color: #374151;
    cursor: pointer;
}

/* Tooltip styling for node-count badges */
.node-count[data-tooltip] {
    position: relative;
}

.node-count[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.node-count[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
}

.node-count:hover[data-tooltip]::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.node-count:hover[data-tooltip]::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.rack-details {
    font-size: 12px;
    color: #6c757d;
}

.configure-label {
    color: #e74c3c;
    font-weight: 500;
}

/* Floor node styling */
.floor-node {
    background: white;
    border: 1px solid #d1d5db;
    font-weight: 500;
}

.floor-node:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.floor-node .toggle-icon {
    color: #6b7280;
}

.floor-node .node-icon {
    color: #6366f1;
}

.floor-node .node-label {
    color: #111827;
}

.floor-node .node-count {
    background: #f3f4f6;
    color: #6b7280;
}

/* IDF node styling */
.idf-node {
    background: white;
    border: 1px solid #d1d5db;
    font-weight: 500;
}

.idf-node:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.idf-node .toggle-icon {
    color: #6b7280;
}

.idf-node .node-icon {
    color: #3b82f6;
}

.idf-node .node-label {
    color: #111827;
}

.idf-node .node-count {
    background: #f3f4f6;
    color: #6b7280;
}

/* Row node styling */
.row-node {
    background: white;
    border: 1px solid #d1d5db;
}

.row-node:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.row-node .toggle-icon {
    color: #6b7280;
}

.row-node .node-icon {
    color: #10b981;
}

.row-node .node-label {
    color: #111827;
}

.row-node .node-count {
    background: #f3f4f6;
    color: #6b7280;
}

/* Rack link styling */
.rack-link {
    text-decoration: none;
    cursor: pointer;
}

.rack-link:hover {
    background: #e8f4ff;
}

.rack-link .node-icon {
    color: #1f8ef1;
}

.rack-link .node-label {
    color: #2e3e4e;
}

.rack-link.unconfigured {
    background: #fff5f5;
}

.rack-link.unconfigured:hover {
    background: #ffe5e5;
}

.rack-link.unconfigured .node-icon {
    color: #e74c3c;
}

/* Rack link wrapper for configured racks with action icons */
.rack-link-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px 12px;
    transition: all 0.15s ease;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.rack-link-wrapper:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    z-index: 10001;
}

.tree-node-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    flex: 1;
    color: inherit;
}

.tree-node-link .node-icon {
    color: #1f8ef1;
    font-size: 16px;
    flex-shrink: 0;
}

.tree-node-link .node-label {
    font-weight: 500;
    color: #2e3e4e;
    flex: 1;
}

.tree-node-link .rack-details {
    font-size: 12px;
    color: #6c757d;
}

.rack-link-wrapper:hover .rack-details {
    display: none;
}

/* Tree node action icons (ClickUp-style) */
.tree-node-actions {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding-left: 8px;
}

.tree-node:hover .tree-node-actions,
.rack-link-wrapper:hover .tree-node-actions {
    display: flex;
}

.tree-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    position: relative;
}

.tree-action-icon:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Tooltip styling using data-tooltip attribute */
.tree-action-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tree-action-icon[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
}

.tree-action-icon:hover[data-tooltip]::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.tree-action-icon:hover[data-tooltip]::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Floor node action icons - white background for visibility */
.floor-node .tree-action-icon {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.floor-node .tree-action-icon:hover {
    background: white;
    color: #667eea;
    border-color: white;
}

/* IDF node action icons - white background for visibility */
.idf-node .tree-action-icon {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.idf-node .tree-action-icon:hover {
    background: white;
    color: #1f8ef1;
    border-color: white;
}

/* Row node action icons - white background for visibility */
.row-node .tree-action-icon {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.row-node .tree-action-icon:hover {
    background: white;
    color: #28a745;
    border-color: white;
}

/* Tree children container */
.tree-children {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 2px solid #e9ecef;
    margin-top: 4px;
    overflow: visible;
    transition: all 0.3s ease;
}

/* Collapsed state */
.collapsed > .tree-children {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.tree-empty {
    padding: 8px 12px;
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 4px 0;
}

/* Dark Mode for Tree View */
body[data-theme="dark"] .tree-node {
    background: #0d1117;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .tree-node:hover {
    background: #161b22;
    border-color: #484f58;
}

body[data-theme="dark"] .node-label {
    color: #c9d1d9;
}

body[data-theme="dark"] .node-count {
    background: #0d1117;
    color: #8b949e;
}

body[data-theme="dark"] .node-count[onclick]:hover {
    background: #21262d;
    color: #c9d1d9;
}

body[data-theme="dark"] .toggle-icon {
    color: #8b949e;
}

body[data-theme="dark"] .floor-node {
    background: #0d1117;
    border: 1px solid #30363d;
    font-weight: 500;
}

body[data-theme="dark"] .floor-node:hover {
    background: #161b22;
    border-color: #484f58;
}

body[data-theme="dark"] .floor-node .toggle-icon {
    color: #8b949e;
}

body[data-theme="dark"] .floor-node .node-icon {
    color: #a371f7;
}

body[data-theme="dark"] .floor-node .node-label {
    color: #c9d1d9;
}

body[data-theme="dark"] .floor-node .node-count {
    background: #21262d;
    color: #8b949e;
}

body[data-theme="dark"] .idf-node {
    background: #0d1117;
    border: 1px solid #30363d;
    font-weight: 500;
}

body[data-theme="dark"] .idf-node:hover {
    background: #161b22;
    border-color: #484f58;
}

body[data-theme="dark"] .idf-node .toggle-icon {
    color: #8b949e;
}

body[data-theme="dark"] .idf-node .node-icon {
    color: #58a6ff;
}

body[data-theme="dark"] .idf-node .node-label {
    color: #c9d1d9;
}

body[data-theme="dark"] .idf-node .node-count {
    background: #21262d;
    color: #8b949e;
}

body[data-theme="dark"] .row-node {
    background: #0d1117;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .row-node:hover {
    background: #161b22;
    border-color: #484f58;
}

body[data-theme="dark"] .row-node .toggle-icon {
    color: #8b949e;
}

body[data-theme="dark"] .row-node .node-icon {
    color: #3fb950;
}

body[data-theme="dark"] .row-node .node-label {
    color: #c9d1d9;
}

body[data-theme="dark"] .row-node .node-count {
    background: #21262d;
    color: #8b949e;
}

body[data-theme="dark"] .rack-link:hover {
    background: #0d1117;
}

body[data-theme="dark"] .rack-link .node-icon {
    color: #58a6ff;
}

body[data-theme="dark"] .rack-link .node-label {
    color: #c9d1d9;
}

body[data-theme="dark"] .rack-link.unconfigured {
    background: #1a1212;
}

body[data-theme="dark"] .rack-link.unconfigured:hover {
    background: #2d1616;
}

body[data-theme="dark"] .rack-link.unconfigured .node-icon {
    color: #f85149;
}

body[data-theme="dark"] .tree-children {
    border-left-color: #30363d;
}

body[data-theme="dark"] .tree-empty {
    background: #0d1117;
    color: #8b949e;
    border: 1px solid #30363d;
}

/* Dark Mode for Tree Action Icons */
body[data-theme="dark"] .tree-action-icon {
    background: rgba(255, 255, 255, 0.05);
    color: #8b949e;
    border-color: #30363d;
}

body[data-theme="dark"] .tree-action-icon:hover {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-color: #58a6ff;
}

body[data-theme="dark"] .floor-node .tree-action-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #8b949e;
    border-color: rgba(255, 255, 255, 0.15);
}

body[data-theme="dark"] .floor-node .tree-action-icon:hover {
    background: rgba(163, 113, 247, 0.15);
    color: #a371f7;
    border-color: #a371f7;
}

body[data-theme="dark"] .idf-node .tree-action-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #8b949e;
    border-color: rgba(255, 255, 255, 0.15);
}

body[data-theme="dark"] .idf-node .tree-action-icon:hover {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-color: #58a6ff;
}

body[data-theme="dark"] .row-node .tree-action-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #8b949e;
    border-color: rgba(255, 255, 255, 0.15);
}

body[data-theme="dark"] .row-node .tree-action-icon:hover {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border-color: #3fb950;
}

body[data-theme="dark"] .rack-link-wrapper {
    background: #0d1117;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .rack-link-wrapper:hover {
    background: #161b22;
    border-color: #484f58;
}

body[data-theme="dark"] .tree-node-link .node-icon {
    color: #58a6ff;
}

body[data-theme="dark"] .tree-node-link .node-label {
    color: #c9d1d9;
}

/* Mobile responsive for tree view */
@media (max-width: 768px) {
    .tree-children {
        margin-left: 16px;
        padding-left: 8px;
    }

    .tree-node {
        padding: 8px 10px;
        font-size: 14px;
    }

    .node-icon {
        font-size: 14px;
    }

    .toggle-icon {
        font-size: 11px;
        width: 14px;
    }

    .node-count {
        font-size: 11px;
        padding: 2px 6px;
    }

    .rack-details {
        font-size: 11px;
    }

    /* Show action icons on mobile without requiring hover */
    .tree-node-actions {
        display: flex;
        gap: 2px;
    }

    .tree-action-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Disable tooltips on mobile */
    .tree-action-icon[data-tooltip]::after,
    .tree-action-icon[data-tooltip]::before,
    .node-count[data-tooltip]::after,
    .node-count[data-tooltip]::before {
        display: none !important;
    }

    .rack-link-wrapper {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .tree-children {
        margin-left: 12px;
        padding-left: 6px;
    }

    .tree-node {
        padding: 7px 8px;
        font-size: 13px;
    }

    .node-count {
        display: none;
    }
}

/* ==========================================================================
   Two-Pane Layout (MongoDB Data Explorer Style)
   ========================================================================== */

/* Prevent body scrollbar when using two-pane layout */
body:has(.two-pane-container) {
    overflow: hidden;
}

/* Remove container padding when using two-pane layout */
.container:has(.two-pane-container) {
    padding-bottom: 0;
    overflow: hidden;
}

.two-pane-container {
    display: flex;
    gap: 0;
    height: calc(100vh - 140px); /* Navbar (52px) + Header (~60px) + Container top padding (16px) + margin (12px) */
    background-color: #f7f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

/* Left Pane - Hierarchical Navigation */
.left-pane {
    width: 20%;
    min-width: 250px;
    max-width: 400px;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    resize: horizontal;
    position: relative;
}

.left-pane-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.left-pane-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.left-pane-content {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
}

/* Resize handle */
.left-pane::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    background-color: transparent;
    transition: background-color 0.2s;
}

.left-pane:hover::after {
    background-color: #d1d5db;
}

/* Right Pane - Content Display */
.right-pane {
    flex: 1;
    background-color: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Tab Bar */
.tab-bar {
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 12px 0;
    display: flex;
    align-items: flex-end;
    min-height: 44px;
    overflow: hidden; /* Hide any scrollbars */
}

.tab-list {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: hidden;
    flex: 1;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.tab-list::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    color: #4b5563;
    transition: all 0.2s;
    max-width: 200px;
}

.tab:hover {
    background-color: #d1d5db;
}

.tab.active {
    background-color: #ffffff;
    color: #111827;
    font-weight: 500;
    border-color: #e5e7eb;
    border-bottom: 1px solid #ffffff;
    margin-bottom: -1px;
}

.tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.tab-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s;
}

.tab-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #111827;
}

.tab.active .tab-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.right-pane-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.right-pane-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.right-pane-content {
    padding: 24px;
    flex: 1;
}

/* Empty state for right pane */
.right-pane-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    text-align: center;
}

.right-pane-empty i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.right-pane-empty h3 {
    color: #374151;
    margin: 0 0 8px 0;
    font-size: 18px;
}

.right-pane-empty p {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

/* Selected state for left pane items */
.tree-node.selected,
.rack-link-wrapper.selected {
    background: #eff6ff !important;
    border: 1px solid #3b82f6 !important;
}

.tree-node.selected .node-label,
.rack-link-wrapper.selected .node-label {
    color: #1e40af !important;
    font-weight: 500;
}

/* Info cards in right pane */
.info-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.info-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    text-align: right;
}

/* Action buttons in right pane */
.right-pane-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Iframe content in right pane */
.right-pane-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

.right-pane-content.iframe-mode {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Back button for iframe mode */
.iframe-back-button {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iframe-back-button button {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s, border-color 0.15s;
}

.iframe-back-button button:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

/* Dark Mode for Two-Pane Layout */
body[data-theme="dark"] .two-pane-container {
    background-color: #0d1117;
    border-color: #30363d;
}

body[data-theme="dark"] .left-pane {
    background-color: #161b22;
    border-right-color: #30363d;
}

body[data-theme="dark"] .left-pane-header {
    background-color: #0d1117;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .left-pane-header h3 {
    color: #c9d1d9;
}

body[data-theme="dark"] .right-pane {
    background-color: #0d1117;
}

body[data-theme="dark"] .right-pane-header {
    background-color: #161b22;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .tab-bar {
    background-color: #0d1117;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .tab {
    background-color: #21262d;
    border-color: #30363d;
    color: #8b949e;
}

body[data-theme="dark"] .tab:hover {
    background-color: #30363d;
}

body[data-theme="dark"] .tab.active {
    background-color: #161b22;
    color: #f0f6fc;
    border-color: #30363d;
    border-bottom-color: #161b22;
}

body[data-theme="dark"] .tab-close {
    color: #8b949e;
}

body[data-theme="dark"] .tab-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f0f6fc;
}

body[data-theme="dark"] .right-pane-title {
    color: #f0f6fc;
}

body[data-theme="dark"] .right-pane-empty {
    color: #8b949e;
}

body[data-theme="dark"] .right-pane-empty i {
    color: #30363d;
}

body[data-theme="dark"] .right-pane-empty h3 {
    color: #c9d1d9;
}

body[data-theme="dark"] .tree-node.selected,
body[data-theme="dark"] .rack-link-wrapper.selected {
    background: #161b22 !important;
    border: 1px solid #58a6ff !important;
}

body[data-theme="dark"] .tree-node.selected .node-label,
body[data-theme="dark"] .rack-link-wrapper.selected .node-label {
    color: #58a6ff !important;
}

body[data-theme="dark"] .info-card {
    background: #161b22;
    border-color: #30363d;
}

body[data-theme="dark"] .info-card h4 {
    color: #c9d1d9;
}

body[data-theme="dark"] .info-row {
    border-bottom-color: #21262d;
}

body[data-theme="dark"] .info-label {
    color: #8b949e;
}

body[data-theme="dark"] .info-value {
    color: #f0f6fc;
}

body[data-theme="dark"] .right-pane-iframe {
    background: #0d1117;
}

body[data-theme="dark"] .iframe-back-button {
    background: #161b22;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .iframe-back-button button {
    background: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
}

body[data-theme="dark"] .iframe-back-button button:hover {
    background: #30363d;
    border-color: #484f58;
}

/* Mobile responsive for two-pane layout */
@media (max-width: 1024px) {
    .left-pane {
        width: 30%;
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .two-pane-container {
        flex-direction: column;
        height: auto;
    }

    .left-pane {
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: 300px;
        resize: none;
    }

    .left-pane::after {
        display: none;
    }

    .right-pane {
        min-height: 400px;
    }
}

/* ==========================================================================
   Dark Mode for Location Floorplan
   ========================================================================== */
body[data-theme="dark"] .floor-tab {
    background: #21262d;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .floor-tab:hover {
    background: #30363d;
}

body[data-theme="dark"] .floor-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

body[data-theme="dark"] .floorplan-container {
    background: #161b22;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    border: 1px solid #30363d;
}

body[data-theme="dark"] .upload-section {
    background: #0d1117;
    border-color: #30363d;
}

body[data-theme="dark"] .floorplan-canvas-wrapper {
    border-color: #30363d;
    background: #0d1117;
}

body[data-theme="dark"] .device-label {
    background: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

body[data-theme="dark"] .stats-bar {
    background: #0d1117;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .stat-label {
    color: #8b949e;
}

body[data-theme="dark"] .stat-value {
    color: #c9d1d9;
}

body[data-theme="dark"] .stat-item i {
    color: #58a6ff;
}

body[data-theme="dark"] .zoom-level {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

body[data-theme="dark"] .legend {
    background: #161b22;
    border-color: #30363d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

body[data-theme="dark"] .legend-title {
    color: #c9d1d9;
}

body[data-theme="dark"] .legend-item {
    color: #8b949e;
}

body[data-theme="dark"] .callout-line {
    background: #8b949e;
}

/* ==========================================================================
   Dark Mode for Location Devices (Edit Device Form)
   ========================================================================== */
body[data-theme="dark"] .device-form {
    background-color: #161b22;
    border-color: #30363d;
}

body[data-theme="dark"] .form-grid {
    border-color: #30363d;
}

body[data-theme="dark"] .form-group label {
    color: #c9d1d9;
}

body[data-theme="dark"] .section-title {
    color: #c9d1d9;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .section-title i {
    color: #58a6ff;
}

/* ==========================================================================
   Dark Mode for Migration Forms
   ========================================================================== */
body[data-theme="dark"] .form-section {
    background-color: #161b22;
    border-color: #30363d;
}

body[data-theme="dark"] .form-section h3 {
    color: #c9d1d9;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .form-section h3 i {
    color: #58a6ff;
}

body[data-theme="dark"] .section-description {
    color: #8b949e;
}

body[data-theme="dark"] .readonly-field {
    background-color: #0d1117;
    border-color: #30363d;
}

body[data-theme="dark"] .readonly-field label {
    color: #c9d1d9;
}

body[data-theme="dark"] .readonly-value {
    color: #c9d1d9;
}

body[data-theme="dark"] .input-prefix {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .checkbox-label,
body[data-theme="dark"] .radio-label {
    background-color: #21262d;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .checkbox-label:hover,
body[data-theme="dark"] .radio-label:hover {
    background-color: #30363d;
}

body[data-theme="dark"] .preview-item {
    border-color: #30363d;
    background-color: #161b22;
}

body[data-theme="dark"] .preview-filename {
    background-color: #0d1117;
    color: #c9d1d9;
}

body[data-theme="dark"] .preview-filesize {
    color: #8b949e;
    background-color: #0d1117;
}

body[data-theme="dark"] .preview-metadata {
    background-color: #161b22;
    border-top-color: #30363d;
}

body[data-theme="dark"] .preview-metadata label {
    color: #c9d1d9;
}

body[data-theme="dark"] .preview-metadata input,
body[data-theme="dark"] .preview-metadata textarea {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .preview-metadata input:focus,
body[data-theme="dark"] .preview-metadata textarea:focus {
    background-color: #161b22;
    border-color: #58a6ff;
}

body[data-theme="dark"] .form-text {
    color: #8b949e;
}

/* ==========================================================================
   Dark Mode for Migration Details (View Migration)
   ========================================================================== */
body[data-theme="dark"] .migration-details {
    color: #c9d1d9;
}

body[data-theme="dark"] .detail-section {
    background-color: #161b22;
    border-color: #30363d;
}

body[data-theme="dark"] .detail-section h3 {
    color: #c9d1d9;
    border-bottom-color: #30363d;
}

body[data-theme="dark"] .detail-section h3 i {
    color: #58a6ff;
}

body[data-theme="dark"] .detail-section p {
    color: #c9d1d9;
}

body[data-theme="dark"] .detail-row label {
    color: #8b949e;
}

body[data-theme="dark"] .detail-row span {
    color: #c9d1d9;
}

body[data-theme="dark"] .notes-content {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .badge-planned {
    background-color: #854d0e;
    color: #fef3c7;
}

body[data-theme="dark"] .badge-in-progress {
    background-color: #155e75;
    color: #cffafe;
}

body[data-theme="dark"] .badge-completed {
    background-color: #166534;
    color: #d1fae5;
}

body[data-theme="dark"] .badge-cancelled {
    background-color: #991b1b;
    color: #fecaca;
}

body[data-theme="dark"] .checklist-item {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .checklist-item.completed {
    border-left-color: #2ea043;
}

body[data-theme="dark"] .checklist-item i {
    color: #2ea043;
}

body[data-theme="dark"] .no-data {
    color: #8b949e;
}

body[data-theme="dark"] .image-item-with-meta {
    border-color: #30363d;
    background-color: #161b22;
}

body[data-theme="dark"] .photo-metadata {
    background-color: #0d1117;
    border-top-color: #30363d;
}

body[data-theme="dark"] .photo-filename {
    color: #c9d1d9;
}

body[data-theme="dark"] .photo-description {
    color: #8b949e;
    border-top-color: #30363d;
}

body[data-theme="dark"] .modal {
    background-color: rgba(0,0,0,0.5);
}

body[data-theme="dark"] .modal-close {
    color: #c9d1d9;
}

body[data-theme="dark"] .modal-close:hover,
body[data-theme="dark"] .modal-close:focus {
    color: #58a6ff;
}

/* ==========================================================================
   Splash Video
   ========================================================================== */
.splash-video-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.splash-video-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* Dark Mode for Splash Video */
body[data-theme="dark"] .splash-video-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
/* ========================================================================== 
   MongoDB-Style Login Page 
   ========================================================================== */

/* Reset for MongoDB login page */
.mongodb-login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Main container - split screen layout */
.mongodb-login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Sidebar - Login Form */
.mongodb-login-sidebar {
    flex: 0 0 480px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.mongodb-login-content {
    width: 100%;
    max-width: 380px;
}

/* Logo/Brand */
.mongodb-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    font-size: 24px;
    font-weight: 600;
    color: #001E2B;
}

.mongodb-logo i {
    font-size: 28px;
    color: #00ED64;
}

/* Alert Messages */
.mongodb-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.mongodb-alert-success {
    background-color: #E3FCF7;
    color: #00684A;
    border: 1px solid #00ED64;
}

.mongodb-alert-error {
    background-color: #FFE5E5;
    color: #C00000;
    border: 1px solid #FF6B6B;
}

.mongodb-alert i {
    font-size: 16px;
}

/* Login Title */
.mongodb-login-title {
    font-size: 28px;
    font-weight: 600;
    color: #001E2B;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.mongodb-login-subtitle {
    font-size: 14px;
    color: #5C6C75;
    margin: 0 0 32px 0;
}

/* Links */
.mongodb-link {
    color: #00684A;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.mongodb-link:hover {
    color: #00ED64;
    text-decoration: underline;
}

/* SSO Buttons */
.mongodb-sso-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.mongodb-sso-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1.5px solid #E7EAEC;
    border-radius: 8px;
    background-color: #ffffff;
    color: #001E2B;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mongodb-sso-btn:hover:not(:disabled) {
    border-color: #00684A;
    background-color: #F9FAFB;
}

.mongodb-sso-btn svg {
    flex-shrink: 0;
}

/* Divider */
.mongodb-divider {
    position: relative;
    text-align: center;
    margin: 28px 0;
}

.mongodb-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background-color: #E7EAEC;
}

.mongodb-divider span {
    background-color: #ffffff;
    padding: 0 16px;
    position: relative;
    color: #5C6C75;
    font-size: 13px;
    font-weight: 500;
}

/* Login Form */
.mongodb-login-form {
    margin-bottom: 16px;
}

.mongodb-form-group {
    margin-bottom: 20px;
}

.mongodb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #001E2B;
    margin-bottom: 8px;
}

.mongodb-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #E7EAEC;
    border-radius: 8px;
    font-size: 15px;
    color: #001E2B;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.mongodb-input:focus {
    outline: none;
    border-color: #00684A;
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
}

.mongodb-input::placeholder {
    color: #889397;
}

/* Primary Button */
.mongodb-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background-color: #00684A;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.mongodb-btn-primary:hover {
    background-color: #00ED64;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 104, 74, 0.2);
}

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

/* Footer Links */
.mongodb-login-footer {
    text-align: center;
    margin-top: 20px;
}

.mongodb-link-small {
    font-size: 13px;
    color: #5C6C75;
    text-decoration: none;
}

.mongodb-link-small:hover {
    color: #00684A;
    text-decoration: underline;
}

/* Right Panel - Promotional Content */
.mongodb-promo-panel {
    flex: 1;
    background: linear-gradient(135deg, #00684A 0%, #003D2E 50%, #001E2B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.mongodb-promo-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

/* Promo Text */
.mongodb-promo-text {
    margin-bottom: 60px;
}

.mongodb-promo-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.mongodb-promo-description {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.mongodb-promo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00ED64;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mongodb-promo-link:hover {
    gap: 12px;
    color: #5DF39A;
}

.mongodb-promo-link i {
    font-size: 14px;
}

/* Network Rack Image Composition */
.rack-composition {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Left Image */
.rack-left {
    flex: 0 0 35%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center Column (containing top-right, center, and bottom images) */
.rack-center-column {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Top Right Image */
.rack-top-right {
    flex: 0 0 30%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center Image (Interface - Main Focus) */
.rack-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Bottom Image */
.rack-bottom {
    flex: 0 0 30%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Styling */
.rack-image {
    overflow: hidden;
    border-radius: 8px;
}

.rack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rack-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* Center image gets special emphasis */
.rack-center img {
    box-shadow: 0 8px 32px rgba(0, 237, 100, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mongodb-login-sidebar {
        flex: 0 0 420px;
    }
    
    .mongodb-promo-panel {
        padding: 40px;
    }
    
    .mongodb-promo-title {
        font-size: 36px;
    }

    .rack-composition {
        height: 400px;
        gap: 12px;
    }

    .rack-center-column {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .mongodb-login-container {
        flex-direction: column;
    }
    
    .mongodb-login-sidebar {
        flex: 0 0 auto;
        min-height: auto;
        padding: 30px 20px;
    }
    
    .mongodb-promo-panel {
        min-height: 400px;
        padding: 40px 20px;
    }
    
    .mongodb-promo-title {
        font-size: 28px;
    }
    
    .mongodb-promo-description {
        font-size: 15px;
    }

    .rack-composition {
        height: 350px;
        flex-direction: column;
        gap: 10px;
    }

    .rack-left {
        flex: 0 0 auto;
        width: 100%;
        height: 30%;
    }

    .rack-center-column {
        flex: 1;
        width: 100%;
        gap: 10px;
    }
    
    .mongodb-sso-buttons {
        flex-direction: column;
    }
}

/* Dark Mode Support for MongoDB Login */
body[data-theme="dark"] .mongodb-login-sidebar {
    background-color: #0d1117;
}

body[data-theme="dark"] .mongodb-login-title {
    color: #c9d1d9;
}

body[data-theme="dark"] .mongodb-login-subtitle,
body[data-theme="dark"] .mongodb-link-small {
    color: #8b949e;
}

body[data-theme="dark"] .mongodb-logo {
    color: #c9d1d9;
}

body[data-theme="dark"] .mongodb-input {
    background-color: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .mongodb-input:focus {
    border-color: #00ED64;
}

body[data-theme="dark"] .mongodb-sso-btn {
    background-color: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
}

body[data-theme="dark"] .mongodb-sso-btn:hover:not(:disabled) {
    background-color: #1c2128;
    border-color: #00684A;
}

body[data-theme="dark"] .mongodb-divider::before {
    background-color: #30363d;
}

body[data-theme="dark"] .mongodb-divider span {
    background-color: #0d1117;
}

body[data-theme="dark"] .mongodb-form-group label {
    color: #c9d1d9;
}

/* ========================================
   Toast Notification System
   ======================================== */

.toast-container {
    position: fixed;
    top: 80px; /* Below navbar */
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none; /* Allow clicking through container */
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: auto; /* Toast itself is clickable */
    min-width: 300px;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover,
.toast-close:focus {
    opacity: 1;
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Toast type styles */
.toast-success {
    border-left-color: #28a745;
    color: #155724;
    background-color: #d4edda;
}

.toast-success i {
    color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
    color: #721c24;
    background-color: #f8d7da;
}

.toast-error i {
    color: #dc3545;
}

.toast-warning {
    border-left-color: #ffc107;
    color: #856404;
    background-color: #fff3cd;
}

.toast-warning i {
    color: #ffc107;
}

.toast-info {
    border-left-color: #17a2b8;
    color: #0c5460;
    background-color: #d1ecf1;
}

.toast-info i {
    color: #17a2b8;
}

/* Dark mode support */
body[data-theme="dark"] .toast {
    background-color: #1f2937;
}

body[data-theme="dark"] .toast-success {
    background-color: #064e3b;
    color: #6ee7b7;
}

body[data-theme="dark"] .toast-error {
    background-color: #7f1d1d;
    color: #fca5a5;
}

body[data-theme="dark"] .toast-warning {
    background-color: #78350f;
    color: #fcd34d;
}

body[data-theme="dark"] .toast-info {
    background-color: #164e63;
    color: #67e8f9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s;
        transform: none;
    }

    .toast-visible {
        transform: none;
    }
}

/* ========================================
   Confirmation Modal System
   ======================================== */

.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001; /* Above toast notifications */
    align-items: center;
    justify-content: center;
}

.confirm-modal.active {
    display: flex;
}

.confirm-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.confirm-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.confirm-modal-close:hover,
.confirm-modal-close:focus {
    background-color: #f8f9fa;
    color: #dc3545;
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.confirm-modal-header {
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-icon {
    font-size: 32px;
    color: #ffc107;
    flex-shrink: 0;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #212529;
}

.confirm-modal-body {
    padding: 0 24px 24px;
}

.confirm-modal-body p {
    margin: 0 0 16px;
    color: #495057;
    font-size: 1rem;
    line-height: 1.5;
}

.confirm-modal-body p:last-child {
    margin-bottom: 0;
}

.confirm-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.confirm-warning i {
    color: #856404;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.confirm-warning strong {
    color: #856404;
}

.confirm-modal-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-modal-actions .btn {
    min-width: 120px;
}

/* Dark mode support */
body[data-theme="dark"] .confirm-modal-content {
    background-color: #1f2937;
}

body[data-theme="dark"] .confirm-modal-header h3 {
    color: #f3f4f6;
}

body[data-theme="dark"] .confirm-modal-body p {
    color: #d1d5db;
}

body[data-theme="dark"] .confirm-warning {
    background-color: #78350f;
    border-left-color: #fbbf24;
}

body[data-theme="dark"] .confirm-warning i,
body[data-theme="dark"] .confirm-warning strong {
    color: #fcd34d;
}

body[data-theme="dark"] .confirm-modal-close {
    color: #9ca3af;
}

body[data-theme="dark"] .confirm-modal-close:hover,
body[data-theme="dark"] .confirm-modal-close:focus {
    background-color: #374151;
    color: #f87171;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .confirm-modal-content {
        animation: none;
    }
}

