/* === Theme Variables === */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f24;
    --bg-card: #242a32;
    --bg-tertiary: #2e353e;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --text-primary: #f5f5f7;
    --text-secondary: #a0a5ad;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #34d399;
    --accent-error: #f87171;
    --accent-warning: #fbbf24;
    --border-color: #2e353e;
    --bg-success-subtle: rgba(52, 211, 153, 0.1);
    --bg-error-subtle: rgba(248, 113, 113, 0.1);
}

:root[data-theme="night-owl"] {
    --bg-primary: #011627;
    --bg-secondary: #0d2231;
    --bg-card: #1a3346;
    --bg-tertiary: #1d3b53;
    --text-primary: #d6deeb;
    --text-secondary: #8badc1;
    --accent-primary: #82aaff;
    --accent-secondary: #c792ea;
    --accent-success: #7fdbca;
    --accent-error: #ef5350;
    --accent-warning: #ffeb95;
    --border-color: #1d3b53;
}

:root[data-theme="nord"] {
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --bg-card: #434c5e;
    --bg-tertiary: #4c566a;
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --accent-primary: #88c0d0;
    --accent-secondary: #81a1c1;
    --accent-success: #a3be8c;
    --accent-error: #bf616a;
    --accent-warning: #ebcb8b;
    --border-color: #4c566a;
}

:root[data-theme="light-breeze"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-tertiary: #cbd5e1;
    --bg-hover: rgba(0, 0, 0, 0.05);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-error: #ef4444;
    --accent-warning: #f59e0b;
    --border-color: #cbd5e1;
}

/* === Base Styles === */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0.5rem; 
}

/* === Header === */
header {
    position: relative;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo {
    display: flex;
    
    color: var(--text-primary);
    max-height: 50px;
    width: auto;
    max-width: 200px;
    cursor: pointer;
    padding: 4px 8px;
    
    background: var(--bg-secondary);
    
    transition: all 0.2s ease;
    
    align-items: center;
    justify-content: center;
}

.logo:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === System Stats === */
.system-stats {
    display: flex;
    align-items: center;
    padding: 8px;
}

.stats-grid {
    display: flex;
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: var(--text-primary);
}

.stats-compact {
    display: none;
}

/* === Filter Controls === */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.0rem; /* Push down */
    margin-left: 1.5rem; /* Push right */
    margin-bottom: 0.25rem;
}

.filter-input, .filter-select {
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.filter-input {
    max-width: 300px;
    flex: 1;
    min-width: 120px;
}

.filter-input:focus, 
.filter-select:focus {
    border-color: var(--accent-primary);
}

.filters-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* === Filter Menu (Mobile) === */
.filter-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    width: 280px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.filter-menu.active {
    display: block;
}

.filter-menu select {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
}

/* === Tabs === */
.tabs {
    display: flex;
    background-color: var(--bg-secondary);
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.tab:hover {
    background-color: var(--bg-tertiary);
}

.tab.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
    background-color: var(--bg-tertiary);
}

.tab-icon {
    font-style: normal;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.tab-content {
    display: none;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 0 8px 8px 8px;
    
    margin-top: -2px;
}

.tab-content.active {
    display: block;
}

/* === Subtabs === */
.config-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 8px;
    max-width: 350px;
}

.subtab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.subtab.active { 
    background: var(--accent-primary); 
    color: white; 
}

.subtab-content { 
    display: none; 
}

.subtab-content.active { 
    display: block; 
}

/* === Enhanced Container Cards === */
.container-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    align-items: start !important;
}

.container-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 1rem;
    min-height: 100px; /* Much shorter */
    max-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.container-body {
    flex: 1 !important;
    justify-content: space-between !important;
    overflow: hidden !important;  /* ADD THIS to prevent content overflow */
}



.container-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.container-card.selected {
    border-color: var(--accent-success);
    background: var(--bg-success-subtle);
    transform: scale(0.98);
}

.container-header {
    display: flex;
    align-items: center;
    min-height: auto;
}

.container-name {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

/* Row 2: Host, Status, Uptime, More button */
.container-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.container-header-right {
    max-width: 60% !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
}




.container-name:hover {
    color: var(--accent-secondary);
    text-decoration: none;
}


.container-status-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Row 3: Ports (single line) */
.container-ports {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}


.container-ports:empty::before {
    content: "No ports";
    font-style: italic;
    opacity: 0.7;
}

/* === Status & Badges === */
.container-status {
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running { 
    background: var(--bg-success-subtle);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.status-stopped { 
    background: var(--bg-error-subtle);
    color: var(--accent-error);
    border: 1px solid var(--accent-error);
}

.uptime-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
}

.host-badge-small {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* === Stack Headers === */
.stack-header {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    grid-column: 1 / -1;
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stack-header:hover {
    background: var(--bg-tertiary);
}

.stack-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stack-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    align-items: center;
}

.stack-stats span {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

/* === Actions === */
/* Row 4: Actions */
.actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.actions .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* === Buttons === */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn:disabled { 
    background: var(--bg-secondary); 
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

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

.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #2dd4b8);
    color: white;
}

.btn-error {
    background: linear-gradient(135deg, var(--accent-error), #ff8a85);
    color: white;
}

.btn-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    min-width: 45px;
}

.btn-icon {
    padding: 0.4rem 0.6rem;
    font-size: 1.2rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.btn-icon:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
}

/* === Batch Mode === */
.batch-actions {
    display: none;
    margin-bottom: 1rem;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.batch-actions.visible {
    display: flex;
    flex-wrap: wrap;
}

.container-select, .batch-checkbox {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    accent-color: var(--accent-primary);
}
.host-badge-small,
.container-status,
.uptime-badge {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.container-select {
    z-index: 10 !important;
}
.batch-mode .container-select {
    display: block;
}

.batch-mode .container-card {
    padding-top: 2.5rem;
}

#toggle-batch-mode {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

#toggle-batch-mode.active {
    background: linear-gradient(135deg, var(--accent-success), #2dd4b8);
}

/* === Table View === */
.view {
    display: none;
}

.view.active {
    display: block;
}

#container-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
}

#container-table th,
#container-table td {
    border-right: 1px solid var(--border-color);
    padding: 0.75rem;
    vertical-align: middle;
    text-align: left;
}

#container-table th:last-child,
#container-table td:last-child {
    border-right: none;
}

#container-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#container-table th[onclick] {
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    padding-right: 1.5rem;
}

#container-table th[onclick]:hover {
    background: var(--bg-hover);
}

#container-table th[onclick]::after {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    content: ' ↕';
    font-size: 0.8em;
    opacity: 0.5;
}

#container-table th.sorted-asc::after {
    content: ' ↑';
    color: var(--accent-primary);
    opacity: 1;
}

#container-table th.sorted-desc::after {
    content: ' ↓';
    color: var(--accent-primary);
    opacity: 1;
}

#container-table td {
    border-bottom: 1px solid var(--border-color);
}

#container-table tr:hover {
    background: var(--bg-hover);
}

#container-table tr.selected {
    background: var(--bg-success-subtle);
    border-left: 3px solid var(--accent-success);
}

.stack-header-row {
    background: var(--bg-secondary) !important;
    border-left: 4px solid var(--accent-primary);
}

.stack-header-row:hover {
    background: var(--bg-tertiary) !important;
}

.stack-header-row td {
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    border-right: none !important;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    min-width: 300px;
}

.ports-cell {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#table-view .batch-checkbox {
    display: none;
}

#table-view.batch-mode .batch-checkbox {
    display: inline-block;
    position: static;
    width: auto;
    height: auto;
}

/* === Images === */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

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

.image-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

.image-body {
    padding: 0.75rem;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* === Images Table === */
#images-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
}

#images-table th,
#images-table td {
    border-right: 1px solid var(--border-color);
    padding: 0.75rem;
    vertical-align: middle;
    text-align: left;
}

#images-table th:last-child,
#images-table td:last-child {
    border-right: none;
}

#images-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#images-table td {
    border-bottom: 1px solid var(--border-color);
}

#images-table tr:hover {
    background: var(--bg-hover);
}

.images-table-view {
    display: none;
}

.images-table-view.active {
    display: block;
}

.images-grid-view {
    display: block;
}

.images-grid-view.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* === Editors === */
#compose-editor, 
#env-editor, 
#caddy-editor {
    width: 100%;
    height: calc(100vh - 200px);
    font-family: monospace;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.editor-actions, 
.compose-file-selector {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* === Modals === */
.logs-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.close-x {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-x:hover {
    color: var(--accent-error);
}

.logs-content {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.container-details {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.detail-row {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-row strong {
    color: var(--text-primary);
    display: inline-block;
    min-width: 80px;
}

/* === Messages === */
.message {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: none;
}

.message.success { 
    background: var(--accent-success); 
    color: white; 
}

.message.error { 
    background: var(--accent-error); 
    color: white; 
}

/* === Loading === */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input, .url-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus, .url-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

/* === Utility Classes === */
.no-containers {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* === Multi-Host Support === */
.host-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.host-header {
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--accent-primary);
}

.host-header h4 {
    margin: 0;
    color: var(--accent-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .logo {
        max-height: 40px;
        max-width: 120px;
        padding: 2px 4px;
    }
    
    .filter-controls .filter-select {
        display: none;
    }
    
    .stats-grid {
        display: none;
    }
    
    .stats-compact {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        font-size: 0.75rem;
    }
    
    .container-grid {
        grid-template-columns: 1fr;
    }
    
    .tab {
        padding: 0.5rem 0.75rem;
    }
    
    .tab-text {
        display: none;
    }
    
    .tab-icon {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .batch-actions {
        position: sticky;
        top: 10px;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-actions {
        min-width: auto;
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .table-actions .btn-sm {
        width: 100%;
        min-width: auto;
    }
    
    .container-header-right {
        gap: 0.2rem;
    }
    
    .host-badge-small {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
    
    .ports-cell {
        max-width: 80px;
        font-size: 0.75rem;
    }
    
    .container-ports {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }
    
    .logs-modal {
        width: 95%;
        max-width: none;
        margin: 1rem;
    }
    
    .logs-modal .actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logs-modal .actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .image-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-container {
        justify-content: center;
    }
    
    #host-filter {
        min-width: 6rem;
        max-width: 8rem;
    }
    
    /* Hide toggle view button on mobile */
    #toggle-view {
        display: none !important;
    }
    
    /* Make stack headers much smaller on mobile */
    .stack-header {
        padding: 0.4rem !important;
        margin-bottom: 0.4rem !important;
        border-radius: 4px !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .stack-header h3 {
        font-size: 0.85rem !important;
        margin: 0 !important;
    }
    
    .stack-stats {
        flex-direction: column;
        gap: 0.2rem;
        align-items: flex-start;
        font-size: 0.7rem !important;
    }
    
    .stack-stats span {
        padding: 0.1rem 0.25rem !important;
        font-size: 0.65rem !important;
    }
    
    /* Make host headers smaller on mobile */
    .host-header {
        margin: 0.5rem 0 0.3rem 0 !important;
        padding: 0.2rem 0 !important;
    }
    
    .host-header h4 {
        font-size: 0.85rem !important;
        margin: 0 !important;
    }
}

/* === Theme-Specific Adjustments === */
[data-theme="refined-dark"] .host-badge-small,
[data-theme="night-owl"] .host-badge-small,
[data-theme="nord"] .host-badge-small {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="refined-dark"] .container-ports,
[data-theme="night-owl"] .container-ports,
[data-theme="nord"] .container-ports {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light-breeze"] .host-badge {
    background: #2563eb;
}

[data-theme="light-breeze"] .host-badge-small {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

[data-theme="light-breeze"] .container-ports {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* === Fix Container Grid Layout === */
.container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    align-items: start;
}

.container-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 140px;
    height: auto;
}

.container-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.container-card.selected {
    border-color: var(--accent-success);
    background: var(--bg-success-subtle);
    transform: scale(0.98);
}

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    min-height: 2.5rem;
}

.container-header-right {
    display: flex;
    gap: 0.3rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: 60%;
}

.container-name {
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    color: var(--accent-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.container-name:hover {
    color: var(--accent-secondary);
    text-decoration: none;
}

.container-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    justify-content: space-between;
}

.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* === Enhanced Batch Actions === */
.batch-actions {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* === Status & Badges === */
.container-status,
.uptime-badge,
.host-badge-small {
    white-space: nowrap;
    flex-shrink: 0;
}

.container-select {
    z-index: 10;
}

/* === Images Table === */
#images-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
}

#images-table th,
#images-table td {
    border-right: 1px solid var(--border-color);
    padding: 0.75rem;
    vertical-align: middle;
    text-align: left;
}

#images-table th:last-child,
#images-table td:last-child {
    border-right: none;
}

#images-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#images-table td {
    border-bottom: 1px solid var(--border-color);
}

#images-table tr:hover {
    background: var(--bg-hover);
}

.images-table-view {
    display: none;
}

.images-table-view.active {
    display: block;
}

.images-grid-view {
    display: block;
}

.images-grid-view.active {
    display: block;
}
/* === Fix Image View Toggle === */
.view {
    display: none;
}

.view.active {
    display: block;
}

#images-grid-view,
#images-table-view {
    display: none;
}

#images-grid-view.active,
#images-table-view.active {
    display: block !important;
}
/* === HOSTS MANAGEMENT === */
.hosts-management {
    padding: 1rem;
}

.multi-host-overview {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.multi-host-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.multi-host-stat {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.multi-host-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: block;
}

.multi-host-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.hosts-list {
    margin-bottom: 2rem;
}

.host-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.host-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.host-item.connected {
    border-left: 4px solid var(--accent-success);
}

.host-item.disconnected {
    border-left: 4px solid var(--accent-error);
    opacity: 0.7;
}

.host-info {
    flex: 1;
}

.host-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.host-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.host-url {
    font-family: monospace;
    background: var(--bg-tertiary);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

.host-type,
.last-check {
    background: var(--bg-tertiary);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

.host-error {
    color: var(--accent-error);
    font-weight: 500;
}

.current-badge {
    background: var(--accent-success);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.host-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.add-host-form {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.connection-help {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.help-section h5 {
    color: var(--accent-primary);
    margin: 1rem 0 0.5rem 0;
}

.help-section h6 {
    color: var(--text-primary);
    margin: 0.75rem 0 0.25rem 0;
    font-size: 0.9rem;
}

.code-block {
    margin: 1rem 0;
}

.code-block pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-size: 0.85rem;
}

.code-block code {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.security-warning {
    background: var(--bg-warning-subtle);
    border: 1px solid var(--accent-warning);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 1rem 0;
}

.security-warning h6 {
    color: var(--accent-warning);
    margin-top: 0;
}

.security-warning p {
    margin-bottom: 0;
    color: var(--text-primary);
}

/* === INSTANCE SELECTOR === */
.instance-select,
#composr-instance-selector {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.instance-select option,
#composr-instance-selector option,
select option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    padding: 8px !important;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

/* === MULTI-HOST BADGES === */
.host-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.host-badge-small {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.deploy-badge {
    background: var(--accent-info);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

/* === HOST HEADERS === */
.host-header {
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--accent-primary);
}

.host-header h4 {
    margin: 0;
    color: var(--accent-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === DEPLOYMENT CONTROLS === */
.deployment-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.deployment-controls h4 {
    color: var(--accent-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box {
    background: var(--bg-warning-subtle);
    border: 1px solid var(--accent-warning);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 0.5rem 0;
}

.warning-box h5 {
    color: var(--accent-warning);
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.warning-box p {
    margin: 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.warning-box ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.warning-box li {
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.warning-box code {
    background: var(--bg-tertiary);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-family: monospace;
    font-size: 0.8rem;
}

.warning-box label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.warning-box input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* === DEPLOYMENT ACTIONS === */
.deploy-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.deploy-actions .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.deploy-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.deploy-actions .btn-success {
    background: var(--accent-success);
    color: white;
}

.deploy-actions .btn-warning {
    background: var(--accent-warning);
    color: white;
}

.deploy-actions .btn-error {
    background: var(--accent-error);
    color: white;
}

.deploy-actions .btn-primary {
    background: var(--accent-primary);
    color: white;
}

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

.quick-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.quick-actions .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* === DEPLOYMENT LOG === */
.deployment-log-modal .modal-content {
    max-height: 70vh;
    overflow-y: auto;
}

.deployment-log-content {
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 1rem 0;
}

.deployment-log-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

/* === DEPLOYMENT PROGRESS === */
.deployment-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-info-subtle);
    border: 1px solid var(--accent-info);
    border-radius: 0.25rem;
    margin: 1rem 0;
}

.deployment-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent-info);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.deployment-success {
    background: var(--bg-success-subtle);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
}

.deployment-error {
    background: var(--bg-error-subtle);
    border: 1px solid var(--accent-error);
    color: var(--accent-error);
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
}

/* === COMPOSE PREVIEW === */
.compose-summary {
    padding: 1rem 0;
}

.compose-summary h4 {
    color: var(--accent-primary);
    margin: 0 0 1rem 0;
}

.compose-summary h5 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
    font-size: 0.9rem;
}

.summary-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.stat-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.compose-summary ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.compose-summary li {
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

/* === PROJECT CREATION === */
.deployment-options {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 1rem;
    margin: 1rem 0;
}

.deployment-options h4 {
    color: var(--accent-primary);
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.deployment-note {
    background: var(--bg-info-subtle);
    border: 1px solid var(--accent-info);
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 1rem 0;
}

.deployment-note p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.host-deployment-info {
    background: var(--bg-secondary);
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.host-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.host-status-indicator.connected {
    color: var(--accent-success);
}

.host-status-indicator.disconnected {
    color: var(--accent-error);
}

/* === MULTI-HOST PANEL === */
.multi-host-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.multi-host-header {
    background: var(--bg-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.5rem 0.5rem 0 0;
}

.multi-host-header h4 {
    margin: 0;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.multi-host-content {
    padding: 1rem;
}

.host-deployment-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.host-deployment-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.host-deployment-option.selected {
    border-color: var(--accent-primary);
    background: var(--bg-primary-subtle);
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    .multi-host-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .host-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .host-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
    
    .deploy-actions {
        flex-direction: column;
    }
    
    .deploy-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn-sm {
        width: 100%;
        text-align: center;
    }
    
    .summary-stats {
        flex-direction: column;
    }
    
    .stat-badge {
        text-align: center;
    }
    
    .host-deployment-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .host-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* === THEME ADJUSTMENTS === */
[data-theme="refined-dark"] .deployment-section,
[data-theme="night-owl"] .deployment-section,
[data-theme="nord"] .deployment-section {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="refined-dark"] .warning-box,
[data-theme="night-owl"] .warning-box,
[data-theme="nord"] .warning-box {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

[data-theme="refined-dark"] .deployment-log-content,
[data-theme="night-owl"] .deployment-log-content,
[data-theme="nord"] .deployment-log-content {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="refined-dark"] .host-badge-small,
[data-theme="night-owl"] .host-badge-small,
[data-theme="nord"] .host-badge-small {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light-breeze"] .host-badge {
    background: #2563eb;
}

[data-theme="light-breeze"] .host-badge-small {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}
/* === UNIFIED TABLE STYLES - REPLACE EXISTING TABLE RULES === */

/* Force table layout and column widths */
#container-table {
    table-layout: auto !important;
    width: 100% !important;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
}

/* Force specific column widths */
#container-table th:nth-child(1), /* Checkbox */
#container-table td:nth-child(1) {
    width: 30px !important;
    max-width: 30px !important;
    text-align: center !important;
}

#container-table th:nth-child(2), /* Name */
#container-table td:nth-child(2) {
    width: 25% !important;
    min-width: 180px !important;
}

#container-table th:nth-child(3), /* Stack */
#container-table td:nth-child(3) {
    width: 12% !important;
    min-width: 100px !important;
}

#container-table th:nth-child(4), /* Status */
#container-table td:nth-child(4) {
    width: 90px !important;
    max-width: 90px !important;
    text-align: center !important;
}

#container-table th:nth-child(5), /* Uptime */
#container-table td:nth-child(5) {
    width: 80px !important;
    max-width: 80px !important;
    text-align: center !important;
}

#container-table th:nth-child(6), /* Ports */
#container-table td:nth-child(6) {
    width: 20% !important;
    min-width: 120px !important;
}

#container-table th:nth-child(7), /* Host */
#container-table td:nth-child(7) {
    width: 90px !important;
    max-width: 90px !important;
    text-align: center !important;
}

#container-table th:nth-child(8), /* Actions */
#container-table td:nth-child(8) {
    width: 320px !important;
    max-width: 320px !important;
    text-align: center !important;
}

/* Table cell styling */
#container-table th,
#container-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
}


#container-table th:last-child,
#container-table td:last-child {
    border-right: none;
}

/* Table header styling */
#container-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#container-table th[onclick] {
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    padding-right: 1.5rem;
}

#container-table th[onclick]:hover {
    background: var(--bg-hover);
}

#container-table th[onclick]::after {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    content: ' ↕';
    font-size: 0.8em;
    opacity: 0.5;
}

#container-table th.sorted-asc::after {
    content: ' ↑';
    color: var(--accent-primary);
    opacity: 1;
}

#container-table th.sorted-desc::after {
    content: ' ↓';
    color: var(--accent-primary);
    opacity: 1;
}

/* Table row styling */
#container-table td {
    border-bottom: 1px solid var(--border-color);
}

#container-table tr:hover {
    background: var(--bg-hover);
}

#container-table tr.selected {
    background: var(--bg-success-subtle);
    border-left: 3px solid var(--accent-success);
}

/* Stack header rows */
.stack-header-row {
    background: var(--bg-secondary) !important;
    border-left: 4px solid var(--accent-primary);
}

.stack-header-row:hover {
    background: var(--bg-tertiary) !important;
}

.stack-header-row td {
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    border-right: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: initial !important;
}

/* Table actions styling */
.table-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    white-space: nowrap;
    min-width: 300px;
}

.table-actions .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    min-width: 50px;
    white-space: nowrap;
}

/* Container name styling */
.container-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    color: var(--accent-primary);
}

.container-name:hover {
    color: var(--accent-secondary);
    text-decoration: none;
}

/* Ports cell styling */
.ports-cell {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status and badge styling */
.container-status {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
    display: inline-block;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running { 
    background: var(--bg-success-subtle);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.status-stopped { 
    background: var(--bg-error-subtle);
    color: var(--accent-error);
    border: 1px solid var(--accent-error);
}

.uptime-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

.host-badge-small {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    white-space: nowrap;
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

/* Batch mode styling */
#table-view .batch-checkbox {
    display: none;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

#table-view.batch-mode .batch-checkbox {
    display: inline-block;
    position: static;
    width: auto;
    height: auto;
}

/* Mobile table adjustments */
@media (max-width: 1200px) {
    #container-table th:nth-child(2), /* Name */
    #container-table td:nth-child(2) {
        width: 20% !important;
        min-width: 150px !important;
    }
    
    #container-table th:nth-child(8), /* Actions */
    #container-table td:nth-child(8) {
        width: 280px !important;
        max-width: 280px !important;
    }
}

@media (max-width: 768px) {
    #container-table th,
    #container-table td {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.85rem;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.1rem;
        min-width: auto;
    }
    
    .table-actions .btn-sm {
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
        min-width: 40px;
        width: 100%;
    }
    
    .container-name {
        font-size: 0.85rem;
    }
    
    .ports-cell {
        max-width: 80px;
        font-size: 0.75rem;
    }
}
/* Hide everything except theme selector on desktop in filter menu */
@media (min-width: 769px) {
    .filter-menu > *:not(#theme-selector-mobile) {
        display: none !important;
    }
}

/* Keep editor actions on one line */
.editor-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    
}

.editor-actions .form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    white-space: nowrap;
}
.container-card {
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.container-actions {
    margin-top: auto;
}

.health-healthy { color: #22c55e; }
.health-warning { color: #f59e0b; }
.health-error { color: #ef4444; }