/* Docker Manager UI - Custom styles */

/* Global theme variables to override Bootstrap and align with theme guide */
:root {
    --primary-bg: #121212;
    --secondary-bg: #1A1A1A;
    --accent-color: #53A4F3;
    --primary-color: #FAB124;
    --secondary-color: #53A4F3;
    --success-color: #50C073;
    --danger-color: #F44336;
    --warning-color: #f39c12;
    --info-color: #53A4F3;
    --text-color: #E8E8E8;
    --border-color: #2A2A2A;
    --card-bg: #1E1E1E;
    --card-header: #252525;
    --border-radius: 0.5rem;
}

/* Dark theme - applied by default or when data-bs-theme="dark" */
[data-bs-theme="dark"], body {
    --bs-body-bg: var(--primary-bg);
    --bs-body-color: var(--text-color);
    --bs-border-color: var(--border-color);
    --bs-primary: var(--primary-color);
    --bs-secondary: var(--secondary-color);
    --bs-success: var(--success-color);
    --bs-danger: var(--danger-color);
    --bs-border-radius: var(--border-radius);
}

/* Light theme overrides */
[data-bs-theme="light"] {
    --primary-bg: #FFFFFF;
    --secondary-bg: #F8F8F8;
    --card-bg: #FFFFFF;
    --card-header: #F0F0F0;
    --text-color: #1A1A1A;
    --border-color: #E2E2E2;
    --bs-body-bg: #FFFFFF;
    --bs-body-color: #1A1A1A;
    --bs-border-color: #E2E2E2;
    --bs-primary: var(--primary-color);
    --bs-secondary: var(--secondary-color);
    --bs-success: var(--success-color);
    --bs-danger: var(--danger-color);
    --bs-border-radius: var(--border-radius);
}

/* System status card fix for light mode */
[data-bs-theme="light"] .sidebar .card {
    background-color: #F5F7F9 !important;
    color: #1A1A1A !important;
    border: 1px solid #E2E2E2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Top navbar fix for light mode */
[data-bs-theme="light"] .navbar {
    background-color: #fff !important;
    color: #1A1A1A !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
[data-bs-theme="light"] .navbar .navbar-brand,
[data-bs-theme="light"] .navbar .nav-link,
[data-bs-theme="light"] .navbar .navbar-toggler,
[data-bs-theme="light"] .navbar .btn {
    color: #1A1A1A !important;
    border-color: #E2E2E2;
}
[data-bs-theme="light"] .navbar .btn-outline-light {
    color: #1A1A1A !important;
    border-color: #E2E2E2;
    background: transparent;
}
[data-bs-theme="light"] .navbar .btn-outline-light:hover {
    background: #E2E2E2;
    color: #1A1A1A;
}

/* Navbar styling */
.navbar-brand img {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    object-fit: contain;
    vertical-align: middle;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sidebar (for larger screens) */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    padding: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
    z-index: 100;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--secondary-bg);
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--bs-body-color);
    padding: 1rem;
}

.sidebar .nav-link.active {
    background-color: var(--accent-color);
    color: white;
}

.sidebar .nav-link.active:hover {
    color: #1A1A1A !important;
}

.sidebar .nav-link:hover {
    background-color: rgba(52, 152, 219, 0.15);
}

.sidebar .nav-link i {
    margin-right: 8px;
    width: 24px;
    text-align: center;
}

/* Main content area */
.main-content {
    margin-left: 0;
    padding-top: 0;
    min-width: 0;
}

#fleet-preset-banner-slot {
    max-width: 100%;
}

#fleet-preset-banner {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

#fleet-preset-banner .fleet-preset-banner-body {
    line-height: 1.45;
}

#fleet-preset-banner code {
    font-size: 0.9em;
}

@media (min-width: 992px) {
    .main-content {
        margin-left: 250px;
    }
}

/* Container status cards */
.container-card .card-header {
    transition: background-color 0.3s ease;
}

.container-card .badge {
    font-size: 0.8rem;
}

/* Volume cards */
.volume-card .card-header {
    background-color: rgba(52, 73, 94, 0.8);
}

/* Logs styling */
.log-content {
    font-family: 'Courier New', monospace;
    background-color: #F5F7F9;
    color: #222;
    border-radius: 8px;
    padding: 15px;
    white-space: pre-wrap;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #E2E2E2;
}

.log-line {
    line-height: 1.5;
    font-size: 0.9rem;
}

.log-number {
    color: #95a5a6;
    display: inline-block;
    min-width: 40px;
    user-select: none;
}

/* Git status */
.git-status {
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.branch-info, .commit-info {
    font-size: 0.9rem;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Environment variables */
.text-mask {
    font-family: monospace;
}

/* Container status colors */
.container-running {
    color: var(--success-color);
}

.container-exited {
    color: var(--danger-color);
}

.container-paused {
    color: var(--warning-color);
}

/* Dashboard cards */
.dashboard-card {
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.dashboard-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Dashboard counter */
.counter {
    font-size: 2.5rem;
    font-weight: bold;
    color: #222;
}

/* Form elements */
.form-control, .form-select {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: var(--border-color);
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(0, 0, 0, 0.15);
    color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        height: auto;
        padding-top: 0;
    }
    
    .sidebar .nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .sidebar .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Empty state styling */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--bs-body-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Custom card heights */
.fixed-height-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fixed-height-card .card-body {
    flex: 1;
    overflow: auto;
}

/* Browse container styling */
.browse-container {
    position: relative;
    min-height: 300px;
}

.directory-link {
    text-decoration: none;
    display: block;
    padding: 0.25rem;
}

.directory-link:hover {
    background-color: rgba(52, 152, 219, 0.15);
    border-radius: 4px;
}

/* Tooltips */
.tooltip {
    font-size: 0.8rem;
}

/* File colors in volume browser */
.file-row {
    color: #dcdcdc;
}

.directory-row {
    color: #3498db;
}

/* Status indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-running {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.status-stopped {
    background-color: var(--danger-color);
}

.status-paused {
    background-color: var(--warning-color);
}

/* Footer */
.footer {
    margin-top: 3rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--bs-body-color);
    opacity: 0.7;
}

/* Card and button styles for theme guide alignment */
.card, .dashboard-card, .volume-card, .container-card, .app-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover, .dashboard-card:hover, .volume-card:hover, .container-card:hover, .app-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
}
.btn-primary:hover {
    background-color: #E09B1F;
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
}
.btn-secondary:hover {
    background-color: #4689CC;
}
.btn-success {
    background-color: var(--success-color);
    color: #fff;
    border: none;
}
.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
    border: none;
}

/* Table improvements */
.table {
    background-color: #FAFAFA;
    border-radius: 8px;
    border: 1px solid #E2E2E2;
    overflow: hidden;
}

/* System status card */
.sidebar .card {
    background-color: #F5F7F9;
    color: #222;
    border: 1px solid #E2E2E2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-radius: 8px;
}

/* Button improvements */
.btn, .btn-primary, .btn-outline-primary {
    border-radius: 6px;
    font-weight: 500;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Light mode overrides */
[data-bs-theme="light"] .card,
[data-bs-theme="light"] .dashboard-card,
[data-bs-theme="light"] .volume-card,
[data-bs-theme="light"] .container-card,
[data-bs-theme="light"] .app-card {
    background-color: #fff !important;
    color: #1A1A1A !important;
    border: 1px solid #E2E2E2;
}
[data-bs-theme="light"] .card-header,
[data-bs-theme="light"] .dashboard-card .card-header,
[data-bs-theme="light"] .container-card .card-header {
    background-color: #F0F0F0 !important;
    color: #1A1A1A !important;
}
[data-bs-theme="light"] .bg-success-subtle,
[data-bs-theme="light"] .bg-danger-subtle,
[data-bs-theme="light"] .bg-warning-subtle,
[data-bs-theme="light"] .bg-info-subtle,
[data-bs-theme="light"] .bg-primary-subtle,
[data-bs-theme="light"] .bg-secondary-subtle {
    background-color: #F0F0F0 !important;
    color: #1A1A1A !important;
}
[data-bs-theme="light"] .text-muted {
    color: #555 !important;
}

/* Fix card header text in dark mode */
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .dashboard-card .card-header,
[data-bs-theme="dark"] .container-card .card-header {
    background-color: #252525 !important;
    color: #E8E8E8 !important;
}

/* Fix filter containers input text and placeholder in light mode */
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
    color: #222 !important;
    background-color: #fff !important;
}
[data-bs-theme="light"] .form-control::placeholder {
    color: #888 !important;
    opacity: 1;
}

/* Dark mode overrides */
[data-bs-theme="dark"] .dashboard-card,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .volume-card,
[data-bs-theme="dark"] .container-card,
[data-bs-theme="dark"] .app-card {
    background-color: #222426 !important;
    color: #f5f5f5 !important;
    border: 1px solid #2a2a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
[data-bs-theme="dark"] .dashboard-card .card-title,
[data-bs-theme="dark"] .dashboard-card .card-body,
[data-bs-theme="dark"] .dashboard-card .card-footer {
    color: #f5f5f5 !important;
}
[data-bs-theme="dark"] .dashboard-card .card-title {
    font-weight: 600;
}
[data-bs-theme="dark"] .dashboard-card .card-body {
    color: #e0e0e0 !important;
}
[data-bs-theme="dark"] .dashboard-card .card-footer {
    color: #b0b0b0 !important;
}
[data-bs-theme="dark"] .dashboard-card .icon {
    opacity: 0.9;
}
[data-bs-theme="dark"] .dashboard-card.bg-success-subtle {
    background-color: #1e2e1e !important;
    color: #b6fcb6 !important;
}
[data-bs-theme="dark"] .dashboard-card.bg-danger-subtle {
    background-color: #2e1e1e !important;
    color: #fcb6b6 !important;
}
[data-bs-theme="dark"] .dashboard-card.bg-info-subtle {
    background-color: #1e2630 !important;
    color: #b6d7fc !important;
}
[data-bs-theme="dark"] .dashboard-card.bg-primary-subtle {
    background-color: #23213a !important;
    color: #d1c6fc !important;
}
[data-bs-theme="dark"] .dashboard-card.bg-warning-subtle {
    background-color: #2e2a1e !important;
    color: #fcecb6 !important;
}
[data-bs-theme="dark"] .system-status-card {
    background-color: #222426 !important;
    color: #f5f5f5 !important;
    border: 1px solid #2a2a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
[data-bs-theme="dark"] .dashboard-card .counter {
    color: #fff !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
[data-bs-theme="dark"] .git-status,
[data-bs-theme="dark"] .git-repo-card,
[data-bs-theme="dark"] .git-repo-list {
    background-color: #222426 !important;
    color: #f5f5f5 !important;
    border: 1px solid #2a2a2a;
}

/* Light mode overrides */
[data-bs-theme="light"] .input-group-text {
    background-color: #F0F0F0 !important;
    color: #1A1A1A !important;
    border-color: #E2E2E2 !important;
}

/* Dark mode overrides */
[data-bs-theme="dark"] .input-group-text {
    background-color: #252525 !important;
    color: #E8E8E8 !important;
    border-color: #2A2A2A !important;
}

/* Volume table grid styles */
.volume-table-container {
    margin-left: 12px;
    margin-right: 12px;
}
.volume-table th:first-child, .volume-table td:first-child {
    text-align: center;
    width: 40px;
}
.volume-table .fa-database {
    font-size: 1.25rem;
    vertical-align: middle;
    opacity: 0.85;
}
.volume-table {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.volume-table th, .volume-table td {
    vertical-align: middle;
    white-space: nowrap;
}
.volume-table th {
    background: var(--card-header);
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}
.volume-table td {
    background: var(--card-bg);
    color: var(--text-color);
}
.volume-table .btn-group .btn {
    min-width: 36px;
}
@media (max-width: 767.98px) {
    .volume-table th, .volume-table td {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    .volume-table {
        font-size: 0.95rem;
    }
}

/* Network table grid styles */
.network-table-container {
    margin-left: 12px;
    margin-right: 12px;
}
.network-table th:first-child, .network-table td:first-child {
    text-align: center;
    width: 40px;
}
.network-table .fa-project-diagram {
    font-size: 1.25rem;
    vertical-align: middle;
    opacity: 0.85;
}
.network-table {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.network-table th, .network-table td {
    vertical-align: middle;
    white-space: nowrap;
}
.network-table th {
    background: var(--card-header);
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}
.network-table td {
    background: var(--card-bg);
    color: var(--text-color);
}
.network-table .btn-group .btn {
    min-width: 36px;
}
@media (max-width: 767.98px) {
    .network-table th, .network-table td {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    .network-table {
        font-size: 0.95rem;
    }
}

/* App table grid styles */
.app-table-container {
    margin-left: 12px;
    margin-right: 12px;
}
.app-table th:first-child, .app-table td:first-child {
    text-align: center;
    width: 40px;
}
.app-table .fa-cube {
    font-size: 1.25rem;
    vertical-align: middle;
    opacity: 0.85;
}
.app-table {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.app-table th, .app-table td {
    vertical-align: middle;
    white-space: nowrap;
}
.app-table th {
    background: var(--card-header);
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}
.app-table td {
    background: var(--card-bg);
    color: var(--text-color);
}
.app-table .btn-group .btn {
    min-width: 36px;
}
@media (max-width: 767.98px) {
    .app-table th, .app-table td {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    .app-table {
        font-size: 0.95rem;
    }
}

/* Container table grid styles */
.container-table-container {
    margin-left: 12px;
    margin-right: 12px;
}
.container-table th:first-child, .container-table td:first-child {
    text-align: center;
    width: 40px;
}
.container-table .fa-box {
    font-size: 1.25rem;
    vertical-align: middle;
    opacity: 0.85;
}
.container-table {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.container-table th, .container-table td {
    vertical-align: middle;
    white-space: nowrap;
}
.container-table th {
    background: var(--card-header);
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}
.container-table td {
    background: var(--card-bg);
    color: var(--text-color);
}
.container-table .btn-group .btn {
    min-width: 36px;
}
@media (max-width: 767.98px) {
    .container-table th, .container-table td {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    .container-table {
        font-size: 0.95rem;
    }
}

.container-table th:nth-child(2), .container-table td:nth-child(2) {
    min-width: 180px;
    max-width: 260px;
    white-space: normal;
}
.container-table td .fa-globe, .container-table td .fa-plug {
    margin-right: 4px;
    opacity: 0.85;
}

.container-table td .fa-play,
.container-table td .fa-stop,
.container-table td .fa-pause,
.container-table td .fa-question-circle,
.container-table td .fa-sync-alt,
.container-table td .fa-redo,
.container-table td .fa-exclamation-triangle,
.container-table td .fa-ban {
    font-size: 1.1em;
    vertical-align: middle;
    margin-right: 4px;
}

.container-table td .badge.d-block {
    display: block;
    width: fit-content;
    min-width: 90px;
    margin-bottom: 2px;
    text-align: left;
}
.container-table td .badge.d-block:last-child {
    margin-bottom: 0;
}

/* General file input style for modals (light background) */
.modal input[type="file"],
#unified-import-file[type="file"] {
    background-color: #f8f9fa;
    color: #222;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
}
.modal input[type="file"]::-webkit-file-upload-button,
#unified-import-file[type="file"]::-webkit-file-upload-button {
    background: #fff;
    color: #222;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}
.modal input[type="file"]::file-selector-button,
#unified-import-file[type="file"]::file-selector-button {
    background: #fff;
    color: #222;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}

/* Custom badge for Updated */
.badge-updated {
    background-color: #ff9800;
    color: #fff;
}

/* Details button for diff */
.compose-diff-details-btn {
    color: #007bff;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0 0.5rem;
    font-size: 0.95em;
    cursor: pointer;
}
.compose-diff-details-btn:focus {
    outline: none;
    text-decoration: underline;
}

.diff-value-truncate {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: top;
}

#manage-app-env-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 0.5rem;
    background: var(--card-bg);
}
[data-bs-theme="light"] #manage-app-env-list {
    background: #fff;
    border-color: #e2e2e2;
}
[data-bs-theme="dark"] #manage-app-env-list {
    background: #181818;
    border-color: #2a2a2a;
}

.edit-custom-env-btn {
    min-width: 90px;
    max-width: 120px;
    text-align: center;
}

#restore-compose-file-input[type="file"] {
    background-color: #f8f9fa;
    color: #222;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
}
#restore-compose-file-input[type="file"]::-webkit-file-upload-button {
    background: #fff;
    color: #222;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}
#restore-compose-file-input[type="file"]::file-selector-button {
    background: #fff;
    color: #222;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
}

/* Make restore-compose-modal wider */
#restore-compose-modal .modal-dialog {
    max-width: 900px;
    width: 90%;
}

/* Improve Add App dropdown menu hover and selected colors */
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: #f5f6fa;
    color: #222;
}
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background-color: #e9ecef;
    color: #222;
}

.container-table td .text-muted {
    color: #555 !important;
}

.container-table td .text-muted.small {
    font-size: 0.875em !important;
    line-height: 1.5;
}

/* Custom button colors for app actions */
.btn-outline-green {
    color: #3ca96b;
    border-color: #3ca96b;
    background: transparent;
}
.btn-outline-green:hover, .btn-outline-green:focus {
    background: #3ca96b;
    color: #fff;
    border-color: #3ca96b;
}

.btn-outline-darkgray {
    color: #444;
    border-color: #444;
    background: transparent;
}
.btn-outline-darkgray:hover, .btn-outline-darkgray:focus {
    background: #444;
    color: #fff;
    border-color: #444;
}

/* Compact navbar system status */
#navbar-system-status {
    display: grid !important;
    grid-template-columns: repeat(2, auto);
    gap: 2px 12px;
    font-size: 1.05em;
    align-items: center;
    justify-items: start;
    padding: 0;
    min-width: unset;
    background: none;
    box-shadow: none;
}
#navbar-system-status span {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    justify-content: flex-start;
}
.docker-status-indicator {
    position: absolute;
    right: -2px;
    bottom: -2px;
    font-size: 0.85em;
    line-height: 1;
    pointer-events: none;
}
#navbar-system-status .fa-microchip,
#navbar-system-status .fa-memory,
#navbar-system-status .fa-hdd,
#navbar-system-status .fa-docker,
#navbar-system-status .fa-check-circle,
#navbar-system-status .fa-times-circle {
    font-size: 1em;
    vertical-align: middle;
    margin: 0;
}
@media (max-width: 767.98px) {
    #navbar-system-status {
        display: none !important;
    }
}

.action-row-hover:hover, .action-row-hover:focus {
    background-color: #e7f1fa;
    transition: background 0.15s;
}

[data-bs-theme="dark"] input[type="file"]::file-selector-button {
    background: var(--secondary-bg, #222);
    color: var(--text-color, #fff);
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
[data-bs-theme="dark"] input[type="file"]::file-selector-button:hover,
[data-bs-theme="dark"] input[type="file"]::file-selector-button:focus {
    background: var(--primary-color, #FAB124);
    color: #222;
    border-color: var(--primary-color, #FAB124);
}

.inspect-container pre {
  white-space: pre-wrap;
  word-break: break-all;
}

/* Postgres Connections Table Layout */
.postgres-table-container {
  margin: 0 auto;
  max-width: 1200px;
  background: var(--bs-body-bg, #fff);
  border-radius: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem 1rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.wide-container {
  max-width: 1400px !important;
}
.postgres-table-list-panel {
  flex: 0 0 400px;
  min-width: 400px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.postgres-tools-panel {
  flex: 1 1 0;
  min-width: 260px;
  max-width: 100%;
  background: var(--card-bg, #f8f9fa);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 0.25rem 1rem;
  margin-left: auto;
}
.postgres-table {
  background: transparent;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0;
  width: 100%;
}
.postgres-table th,
.postgres-table td {
  vertical-align: middle;
  border-top: none;
  border-bottom: 1px solid #e9ecef;
  background: transparent;
  text-align: left;
}
.postgres-table th:first-child,
.postgres-table td:first-child {
  width: 36px;
  text-align: center;
}
.postgres-table tr {
  cursor: pointer;
  transition: background 0.12s;
}
.postgres-table tr:hover {
  background: var(--bs-light, #f5f7fa);
}
.postgres-table tr.selected {
  background: #e9ecef;
  color: #222;
}
.postgres-table tr.selected .text-muted {
  color: #222 !important;
}
.postgres-table thead th {
  background: var(--bs-light, #f8f9fa);
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}
.postgres-table tr:last-child td {
  border-bottom: none;
}
@media (max-width: 600px) {
  .postgres-table-container {
    padding: 0.25rem 0.25rem;
  }
  .postgres-table th, .postgres-table td {
    font-size: 0.95rem;
    padding: 0.4rem 0.3rem;
  }
}

.pg-conn-card {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 0.75rem 1rem;
  transition: background 0.12s, box-shadow 0.12s;
  border: 1.5px solid transparent;
  cursor: pointer;
  min-height: 56px;
}
.pg-conn-card.selected {
  background: #e9ecef;
  border-color: #bfc8d6;
}
.pg-conn-card:hover {
  background: #f1f3f7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pg-conn-card .pg-conn-icon {
  font-size: 1.3rem;
  color: #8a6ee8;
  margin-right: 0.9rem;
}
.pg-conn-card .pg-conn-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.pg-conn-card .pg-conn-name {
  font-weight: 600;
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-conn-card .pg-conn-host {
  color: #888;
  font-size: 0.97rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-conn-card .pg-conn-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: 1rem;
}
.pg-conn-card .btn {
  min-width: 32px;
  padding: 0.25rem 0.5rem;
}
/* Tools panel header row */
.pg-conn-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.pg-conn-header-main {
  flex: 1 1 0;
  min-width: 0;
}
.pg-conn-header-name {
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-conn-header-host {
  color: #888;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-conn-header-meta {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  font-size: 0.98rem;
  color: #444;
}
.pg-conn-header-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.pg-conn-header-meta i {
  color: #b6b6b6;
}

.pg-conn-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.pg-conn-summary-main {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.pg-conn-summary-name {
  font-weight: 600;
  font-size: 1.18rem;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-conn-summary-host {
  color: #888;
  font-size: 1.01rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-conn-summary-meta {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  font-size: 1.01rem;
  color: #444;
  align-items: center;
  justify-content: flex-end;
}
.pg-conn-summary-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.pg-conn-summary-meta i {
  color: #b6b6b6;
}
@media (max-width: 900px) {
  .pg-conn-summary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .pg-conn-summary-main {
    text-align: left;
  }
  .pg-conn-summary-meta {
    justify-content: flex-start;
  }
}

/* Force light background for file input button in restore modal, regardless of theme */
#pg-restore-form input[type='file']::file-selector-button {
    background: #fff !important;
    color: #222 !important;
    border: 1px solid #e2e2e2 !important;
}

/* Redis Connections Table Layout (mirrors Postgres) */
.redis-table-container {
  margin: 0 auto;
  max-width: 1200px;
  background: var(--bs-body-bg, #fff);
  border-radius: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem 1rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.redis-table-list-panel {
  flex: 0 0 400px;
  min-width: 400px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.redis-tools-panel {
  flex: 1 1 0;
  min-width: 260px;
  max-width: 100%;
  background: var(--card-bg, #f8f9fa);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 0.25rem 1rem;
  margin-left: auto;
}

.redis-conn-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bs-light, #f8f9fa);
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  border: 1px solid #e9ecef;
}
.redis-conn-card.selected {
  background: #e9ecef;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.redis-conn-card:hover {
  background: #f5f7fa;
}
.redis-conn-card .redis-conn-icon {
  font-size: 1.5em;
  color: #d82c20;
  min-width: 36px;
  text-align: center;
}
.redis-conn-card .redis-conn-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.redis-conn-card .redis-conn-name {
  font-weight: 600;
  font-size: 1.1em;
  color: #222;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.redis-conn-card .redis-conn-host {
  font-size: 0.95em;
  color: #888;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.redis-conn-card .redis-conn-actions {
  display: flex;
  gap: 0.5rem;
}
.redis-conn-card .btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.95em;
}

/* Force light background for file input button in Redis restore modal, regardless of theme */
#redis-tools-tabpane-backup input[type='file']::file-selector-button {
    background: #fff !important;
    color: #222 !important;
    border: 1px solid #e2e2e2 !important;
}

/* Redis Keyspace Folder Browser Styles (compact/dense) */
.redis-keyspace-tab-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.2em;
  min-height: 420px;
}
.redis-keyspace-tree-container {
  min-width: 270px;
  max-width: 400px;
  flex: 0 0 300px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid #e2e2e2;
  background: none;
}
.redis-keyspace-tree {
  list-style: none;
  padding-left: 0.7em;
  margin: 0;
  font-size: 0.97em;
}
.redis-keyspace-tree li {
  margin: 0.05em 0;
  line-height: 1.35;
  font-size: 0.97em;
  padding: 0.05em 0.1em;
}
.redis-keyspace-key {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s, color 0.12s;
}
.redis-keyspace-key.selected {
  background: #ffe9c2;
  color: #222;
  font-weight: 600;
  border-left: 3px solid #fab124;
}
[data-bs-theme="dark"] .redis-keyspace-key.selected {
  background: #3a2e1a;
  color: #fff;
  border-left: 3px solid #fab124;
}
.redis-keyspace-key:hover {
  background: #f5f7fa;
  color: #222;
}
[data-bs-theme="dark"] .redis-keyspace-key:hover {
  background: #232426;
  color: #fff;
}
.redis-keyspace-folder > i {
  color: #fab124;
  font-size: 1.08em;
  margin-right: 0.18em;
}
.redis-keyspace-key > i {
  color: #888;
  font-size: 1.08em;
  margin-right: 0.18em;
}
.redis-keyspace-folder > span,
.redis-keyspace-key > span {
  font-size: 0.97em;
}
.redis-keyspace-folder .btn-link {
  font-size: 0.92em;
  margin-left: 0.1em;
  padding: 0 0.1em;
}
.redis-keyspace-children {
  margin-left: 0.7em;
  border-left: 1px dotted #e2e2e2;
  padding-left: 0.4em;
}

/* Redis Key Details Panel Styles (compact, inline, larger) */
.redis-key-details-panel {
  flex: 1 1 0;
  min-width: 220px;
  max-width: 700px;
  background: #fff;
  border-left: 1px solid #e2e2e2;
  box-shadow: none;
  padding: 0.9em 1.3em 0.9em 1.5em;
  z-index: 1;
  overflow-y: auto;
  height: 100%;
  font-size: 1.01em;
  margin-left: 0.5em;
}
[data-bs-theme="dark"] .redis-key-details-panel {
  background: #232426;
  border-left: 1px solid #2a2a2a;
  color: #f5f5f5;
}
.redis-key-value-pre {
  background: #f8f9fa;
  color: #222;
  border-radius: 3px;
  padding: 0.3em 0.5em;
  font-size: 1em;
  max-height: 320px;
  overflow: auto;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', monospace;
  margin-bottom: 0.5em;
  margin-top: 0.2em;
}
[data-bs-theme="dark"] .redis-key-value-pre {
  background: #232426;
  color: #f5f5f5;
}

.redis-keyspace-breadcrumb {
  font-size: 0.93em;
  color: #888;
  margin-bottom: 0.2em;
  display: flex;
  align-items: center;
  gap: 0.2em;
  flex-wrap: wrap;
  width: 100%;
  min-height: 1.7em;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.2em;
  background: none;
}
.redis-keyspace-breadcrumb i.fa-folder {
  color: #fab124;
  margin-right: 0.13em;
  font-size: 1em;
}
.redis-keyspace-breadcrumb i.fa-key {
  color: #888;
  margin-right: 0.13em;
  font-size: 1em;
}
.redis-keyspace-breadcrumb span {
  font-size: 0.93em;
  color: #444;
}
[data-bs-theme="dark"] .redis-keyspace-breadcrumb span {
  color: #eee;
}
.redis-keyspace-breadcrumb .text-muted {
  color: #aaa !important;
}

.redis-key-value-pre {
  background: #f8f9fa;
  color: #222;
  border-radius: 3px;
  padding: 0.15em 0.35em;
  font-size: 0.91em;
  max-height: 180px;
  overflow: auto;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', monospace;
  margin-bottom: 0.3em;
  margin-top: 0.12em;
}
[data-bs-theme="dark"] .redis-key-value-pre {
  background: #232426;
  color: #f5f5f5;
}

/* Modern dashboard card styles */
.modern-dashboard-card {
    border-radius: 12px;
    box-shadow: none;
    border: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.04) 100%);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    min-height: 170px;
}
.modern-dashboard-card:hover {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.08) 100%);
    box-shadow: 0 4px 16px rgba(80,164,243,0.08);
}
.modern-dashboard-card .icon {
    font-size: 3.2rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.modern-dashboard-card .counter {
    font-size: 2.8rem;
    font-weight: 700;
    color: #222;
    letter-spacing: -1px;
    margin-top: 0.5rem;
}
.modern-dashboard-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.2rem;
}
@media (max-width: 767.98px) {
    .modern-dashboard-card {
        min-height: 120px;
    }
    .modern-dashboard-card .icon {
        font-size: 2.2rem;
    }
    .modern-dashboard-card .counter {
        font-size: 1.8rem;
    }
}

/* Modern horizontal dashboard card styles */
.modern-dashboard-card-horizontal {
    border-radius: 12px;
    box-shadow: none;
    border: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.04) 100%);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    min-height: 90px;
    padding: 0;
    margin-bottom: 0.5rem;
}
.modern-dashboard-card-horizontal:hover {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.08) 100%);
    box-shadow: 0 4px 16px rgba(80,164,243,0.08);
}
.modern-dashboard-card-horizontal .icon {
    font-size: 2.2rem;
    margin-left: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
}
.metric-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}
.metric-label {
    font-size: 1.02rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.1rem;
    letter-spacing: 0.01em;
}
.metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #222;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 0;
}
@media (max-width: 991.98px) {
    .modern-dashboard-card-horizontal {
        min-height: 70px;
    }
    .modern-dashboard-card-horizontal .icon {
        font-size: 1.5rem;
        min-width: 1.7rem;
    }
    .metric-value {
        font-size: 1.1rem;
    }
}

/* App/Container list row styles for DataGrid dataRowTemplate - full width version */
.app-list-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    flex-wrap: nowrap;
    background: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    min-height: 56px;
    transition: background 0.12s;
    cursor: pointer;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.app-list-row:hover {
    background: #f5f7fa;
    box-shadow: none;
}
.app-list-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
}
.app-list-status {
    width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-list-actions {
    width: 120px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    min-width: 0;
}
.dx-datagrid-rowsview, .dx-scrollable-container {
    padding: 0 !important;
    margin: 0 !important;
}

#history-cpu-gauge, #history-ram-gauge, #history-disk-gauge {
  border: 1px solid #e0e0e0 !important;
  min-height: 110px;
  min-width: 110px;
  background: #f8f9fa;
}

/* Traefik Utility Styles */
#traefik-yaml-editor {
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 1.05em;
  background: var(--card-bg, #232426);
  color: var(--bs-body-color, #e8e8e8);
  border-radius: 6px;
  min-height: 320px;
  resize: vertical;
}
#traefik-status.text-success {
  color: #50C073 !important;
}
#traefik-status.text-danger {
  color: #F44336 !important;
}
#traefik-file-filename {
  vertical-align: middle;
}

/* Traefik Visual Editor Compact Styles */
#traefik-services-list table {
  font-size: 0.93em;
}
#traefik-services-list th, #traefik-services-list td {
  padding: 0.35em 0.5em;
}
#traefik-services-list .btn, #traefik-services-list .btn-xs {
  min-width: 26px;
  padding: 0.15rem 0.4rem;
  font-size: 0.92em;
}
#traefik-yaml-editor {
  font-size: 0.97em;
  min-height: 120px;
  padding: 0.4em 0.6em;
}
#traefik-editor-tabs .nav-link {
  font-size: 0.97em;
  padding: 0.25em 0.7em;
}
#service-modal .modal-body, #router-modal .modal-body {
  padding: 1rem 1.2rem 0.5rem 1.2rem;
}
#service-modal .form-control-sm, #router-modal .form-control-sm {
  font-size: 0.95em;
  padding: 0.25rem 0.5rem;
}
#service-modal .modal-footer, #router-modal .modal-footer {
  padding: 0.4rem 1.2rem;
}
