/* ========================================
   MODIFICACION UI CON CSS
   ======================================== */

/* Efecto zoom sobre los iconos en compose */

/* Corrige de layout en la pagina compose */
.shadow-box.container > .row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.shadow-box.container > .row > img.cp-icon[data-icono-app="1"] {
    flex: 0 0 auto !important;
    margin-right: 20px !important;
}

.shadow-box.container > .row > .col-7 {
    flex: 1 1 auto !important;
    max-width: unset !important;
}

.shadow-box.container > .row > .col-5 {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    width: auto !important;
    max-width: unset !important;
}

div.mb-3.col-xl-9.col-md-8.col-12 {
    width: auto !important;
    max-width: none !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
}

@media (max-width: 700px) {
    /* Handle: fijo en body, independiente del sidebar (no lo recorta overflow) */
    #mobile-sidebar-handle {
        position: fixed;
        left: 0;
        top: 190px;
        transform: translateY(-50%);
        width: 22px;
        height: 60px;
        background: #142d4f;
        border-radius: 0 10px 10px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0,0,0,0.5);
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
        transition: left 0.3s ease;
    }

    /* Dashboard ocupa todo el ancho en móvil */
    div.mb-3.col-xl-9.col-md-8.col-12 {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
    }

    /* Ocultar iconos de editar y organizar en móvil */
    .header-icons {
        display: none !important;
    }
}

@media (max-width: 700px) {
    #dockme-dashboard {
        margin-left: -25px !important;
    }

    div.mb-3.col-xl-9.col-md-8.col-12 .metric-card{
        max-width: 98% !important;
        min-width: 290px !important;
    }

    header.justify-content-center {
        justify-content: space-between !important;
    }

    /* dm-col2 oculto fuera de pantalla por defecto, desliza con .mobile-open */
    #dm-col2 {
        position: fixed !important;
        left: 0 !important;
        top: 55px !important;
        width: 85vw !important;
        max-width: 350px !important;
        height: calc(100vh - 55px) !important;
        background: #090c0f !important;
        z-index: 999 !important;
        overflow-y: auto !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    #dm-col2.mobile-open {
        transform: translateX(0) !important;
    }

    /* Categorías al 100% en móvil — no se pueden organizar */
    #dockme-blocks-row [data-block-key^="category:"] {
        width: 100% !important;
        min-width: unset !important;
        max-width: unset !important;
    }
}

/* Tamano de fuente en el editor y terminal */
div.xterm-rows {
    font-size: 14px !important;
}

/* Nombre junto al icono principal: Evita que el titulo se estilice con degradado */
.fs-4.title {
    color: inherit;
    font-size: inherit;
}

/* Estilos de botones unificados al final del archivo */

/* Fila superior con el logo y nombre mas estrecha (header) */
.py-3 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Color destacado en azul para la version de la imagen */

/* Caja de los contenedores con fondo mas visible */

/* Head fijo con el menu superior */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #090c0f;
    height: 55px;
}

/* ========================================
   TARJETAS DE RECIENTES Y UPDATES
   ======================================== */
.stack-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.stack-card-horizontal {
    display: flex;
    align-items: center;
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 15px;
    transition: background 0.2s;
    height: 98px;
}

.stack-card-horizontal:hover {
    background-color: #333;
}

.stack-card-horizontal.update {
    border: 1px solid #ab8f39;
    background-color: #342812;
}

/* Hueco del Logo */
.stack-logo-left {
    height: 80px;
    width: 80px;
    margin-right: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Imagen del logo */
.stack-logo-left img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;   /* mantiene proporciones */
    display: block;
}

/* Contenedor de texto */
.stack-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* CLAVE para ellipsis */
}

/* Fila superior (nombre + ignorar) */
.linea1-stack-update {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

/* Nombre del stack */
.stack-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.3em;
    color: #4f84c8;
}

/* Hostname */
.stack-hostname {
    font-size: 1.1em;
    font-weight: bold;
    color: #bbb840;
    margin-top: -2px;
}

/* Changelog */
.stack-docker-image {
    min-height: 1em;
    color: #aa753d;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Estado */
.stack-status {
    font-size: 14px;
    text-align: right;
    color: #ccc;
}

/* Selector de tarjetas de updates */
.stack-selector {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.stack-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4f84c8;
    filter: grayscale(100%) brightness(0.6);
}

.stack-checkbox:checked {
    filter: none;
}

/* Tarjeta seleccionada - borde destacado */
.stack-card-horizontal:has(.stack-checkbox:checked) {
    border-color: #4f84c8;
    border-width: 2px;
}

/* Controles de bulk update en titulo */
.bulk-update-controls {
    display: inline-flex;
    gap: 12px;
    margin-left: 20px;
}
.bulk-update-controls .btn {
    padding: 0px 8px !important;
    font-size: 0.65em !important;
}

/* ========================================
   BULK UPDATE PANEL
   ======================================== */

/* Panel flotante - Desktop */
.bulk-update-panel {
    position: fixed;
    top: 55px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 100px);
    background: #1c2431;
    border: 3px solid #ab8f39;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.bulk-update-panel.success {
    border-color: #1b9548; /* verde éxito */
}
.bulk-update-panel.error {
    border-color: #c23737; /* rojo error/cancelado */
}

.stack-update-icon-wrap {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
}

.stack-update-icon-wrap .stack-icon-normal,
.stack-update-icon-wrap .stack-icon-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.15s;
}

.stack-update-icon-wrap .stack-icon-hover {
    opacity: 0;
}

.stack-update-icon-wrap:hover .stack-icon-normal {
    opacity: 0;
}

.stack-update-icon-wrap:hover .stack-icon-hover {
    opacity: 1;
}

/* Boton comenzar actualizaciones */
.btn-start-updates {
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 2px 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: calc(100% - 50px);
    margin-right: 10px;
}

.btn-start-updates:hover {
    background: #16a34a;
}

.panel-title {
    flex: 1;
    margin: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

/* Header del panel */

.panel-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #e0e0e0;
}

.btn-close-panel {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.btn-close-panel:hover {
    color: #fff;
}

/* Cuerpo del panel */
.panel-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* Fila de cada stack */
.stack-update-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    margin-bottom: 8px;
    background: #252d3a;
    border-radius: 6px;
    border: 1px solid #3a4557;
}

.stack-update-name {
    font-weight: 500;
    color: #4f84c8;
}

.stack-update-status {
    font-size: 0.9em;
    color: #ccc;
}

/* Titulo de grupo de servidor */
.server-group-title {
    font-size: 1.1em;
    font-weight: 800;
    color: #bbb840;
    margin: 20px 0 5px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #3a4557;
}

.server-group-title:first-child {
    margin-top: 0;
}

/* Logo pequeño en cada stack */
.stack-update-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
}

/* Ajustar layout de la fila */

/* Móvil - pantalla completa deslizable */
@media (max-width: 700px) {
    .bulk-update-panel {
        top: 55px;
        right: 0;
        width: 100%;
        height: calc(100vh - 55px);  /* ← ajustar altura tambien */
        max-height: calc(100vh - 55px);
        border-radius: 0;
        transform: translateX(calc(100% - 14px));  /* ← 14px visible */
        transition: transform 0.3s ease;
    }
    
    .bulk-update-panel.open {
        transform: translateX(0);
        z-index: 1000;
    }
    
    body:has(.bulk-update-panel.open) {
        overflow: hidden !important;
    }
}

/* ========================================
   TARJETAS DE MÉTRICAS
   ======================================== */
.metrics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 0px;
    margin-right: -15px; /* compensa el gap para alinear a la derecha */
}

.metric-card {
    background: #1c2431;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    cursor: default;
    transition: all 0.2s;
    min-width: 435px;
    max-width: 435px;
    height: 210px;
    flex: 1;
}

.metric-card.selected {
    border-color: #4f84c8;
    border-width: 3px;
}

.metric-card.disconnected {
    opacity: 0.6;
    border-color: #e74c3c;
}

.metric-card.disconnected:hover {
    border-color: #c0392b;
}

/* Header de la tarjeta */
.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    height: 30px;
}

.metric-content {
    display:grid;
    grid-template-columns:30% 30% 40%;
    row-gap:12px;
    margin-top:6px;
    font-size:0.95em;
    align-items:center;
}

.metric-hostname {
    font-size: 1.1em;
    font-weight: bold;
    color: #4f84c8;
}

.metric-version {
    display: inline-block;
    margin-left: 8px;
    padding: 0px 6px;
    background: #2a3441;
    border: 1px solid #3a4557;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: normal;
    color: #79c0ff;
}

.metric-uptime.disconnected {
    color: #e74c3c;
    font-weight: bold;
}

/* Boton actualizar Dockme en tarjeta de metricas */
.btn-update-dockme {
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 2px 3px;
    font-size: 0.8em;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-update-dockme:hover {
    background: #16a34a;
}
.btn-novedades-dockme {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    background: #2d6a4f;
    color: #fff;
    transition: background 0.2s;
}
.btn-novedades-dockme:hover {
    background: #1b4332;
}
.metric-server-icon-wrap {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
}

.metric-server-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity 0.15s;
}

.metric-server-icon.stack-icon-hover {
    opacity: 0;
}

.metric-server-icon-wrap:hover .stack-icon-normal {
    opacity: 0;
}

.metric-server-icon-wrap:hover .stack-icon-hover {
    opacity: 1;
}

/* Filas de metricas */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
    font-size: 0.95em;
}

.metric-label {
    color: #aaa;
}

.metric-value {
    font-weight: bold;
    min-width: 4ch;
    display: inline-block;
    text-align: right;
}

/* Colores segun threshold */
.metric-value.normal {
    color: #299a60;
}

.metric-value.warning {
    color: #f39c12;
}

.metric-value.danger {
    color: #e74c3c;
}

.metric-value.charging {
    color: #3498db;
}

/* Docker containers */
.metric-docker {
    color: #3498db;
}

.metric-stopped {
    color: #e74c3c;
    font-weight: bold;
}

/* Titulo de seccion */
#metrics-section .section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a3441;
}
#metrics-section .links-cat-box-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Titulos de seccion del dashboard */
.dashboard-section-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px !important;
    padding-top: 10px;
}

/* Grid base común para secciones de Updates y Recientes */
.dashboard-section-grid {
    display: grid;
    gap: 15px;
}

/* Grid de actualizaciones (tarjetas mas anchas) */
.dashboard-grid-updates {
    grid-template-columns: repeat(auto-fit, minmax(min(435px, 100%), 1fr));
    margin-bottom: 15px;
}

/* Grid de recientes (tarjetas mas compactas) */
.dashboard-grid-recientes {
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
}

/* Móvil: tarjetas fluidas que ocupan todo el ancho */
@media (max-width: 700px) {
    .dashboard-grid-updates,
    .dashboard-grid-recientes {
        grid-template-columns: 1fr !important;
    }
    
    .stack-card-horizontal {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 80px !important;
    }
    
    /* Logo mas pequeño */
    .stack-logo-left {
        width: 60px !important;
        height: 60px !important;
        margin-right: 10px !important;
    }
    
    /* Textos mas pequeños */
    .stack-name {
        font-size: 1.2em !important;
    }
    
    .stack-hostname {
        font-size: 0.95em !important;
    }
    
    .stack-docker-image {
        font-size: 0.85em !important;
    }
}

/* ========================================
   EDITOR DE ICONOS DE STACKS
   ======================================== */
/* Icono de editar stacks junto al buscador */
.header-top {
    display: flex;
    align-items: center;
}
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 6px;
}

.edit-icon,
.organize-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: #1c2431;
    border: 1px solid #2a3441;
    cursor: pointer;
    opacity: 0.85;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.edit-icon:hover,
.organize-icon:hover {
    opacity: 1;
    background-color: #2a3441;
    border-color: #4f84c8;
}

.edit-icon.active,
.organize-icon.active {
    background-color: #3a4b6b;
    box-shadow: 0 0 0 2px rgba(111,168,255,0.5);
    opacity: 1;
}

.edit-icon.active:hover,
.organize-icon.active:hover {
    background-color: #445a82;
}

/* Contenedor del editor de iconos */
.icon-preview {
    margin-top: 15px;
    width: 96px;
    height: 96px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px dashed #3a4557;
    border-radius: 8px;
}

.icon-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: #cfd6e4;
}

.editor-input,
.editor-input,
.editor-input {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #3a4557;
    background: #121821;
    color: #fff;
}

.icon-upload-btn {
    cursor: pointer;
}

.icon-error {
    margin-top: 10px;
    color: #ff8a8a;
    font-size: 13px;
}

.icon-success {
    margin-top: 10px;
    color: #8affc1;
    font-size: 13px;
}
.editor-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.stack-editor {
    max-width: 700px;
    margin-top: 48px;
	padding: 20px;
	background-color: #15263f !important;
}

.editor-stack-name {
    font-size: 1.8em;
    font-weight: 600;
    color: #4f84c8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorite-star {
    font-size: 2.5em;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, transform 0.15s;
    user-select: none;
    line-height: 1;
    margin-left: 8px;
    align-self: flex-start;
    margin-top: -20px;
}

.favorite-star.active {
    color: #f0c040;
    -webkit-text-stroke: 0;
}

.editor-hint {
    margin-top: 20px;
    font-size: 13px;
    color: #9aa4b2;
}

.icon-preview img {
    max-width: 96px;
    max-height: 96px;
}

.icon-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-status {
    font-size: 13px;
    min-width: 20px;
    margin-left: 5px;
}

.icon-status.ok {
    color: #22c55e; /* verde */
}

.icon-status.error {
    color: #ef4444; /* rojo */
}

.inline-error {
    margin-left: 6px;
    font-size: 13px;
    color: #ef4444;
}

/* seccion de gestion de agentes Dockge */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;              /* aprox. 1 cm visual */
    margin-bottom: 10px;
}
.manage-btn {
    margin-left: 12px;
    cursor: pointer;
}
/* ========================================
   GESTIÓN DE AGENTES
   ======================================== */

.agents-wrapper {
    margin-top: 20px;
    overflow-x: auto;
}

.agents-table {
    max-width: 800px;
    width: 100%;
    border-collapse: collapse;
    background: #1b2228;
    border-radius: 8px;
    border: 1px solid #4e5865;
    overflow: hidden;
}

.agents-table thead {
    background: #2a3441;
}

.agents-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #e0e0e0;
    border-bottom: 2px solid #3a4557;
}

.agents-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #2a3441;
    color: #cfd6e4;
}

.agents-table tbody tr:last-child td {
    border-bottom: none;
}

.agents-table tbody tr:hover {
    background: #252d3a;
}

.agents-table code,
.detected-server-endpoint code {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #79c0ff;
}

.agents-table .text-center {
    text-align: center;
}

@media (max-width: 700px) {
    .agents-table thead {
        display: none;
    }

    .agents-table tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        padding: 10px;
        gap: 6px;
        border-bottom: 1px solid #2a3441;
    }

    .agents-table td:nth-child(1) {
        grid-row: 1;
        grid-column: 1;
    }

    .agents-table td:nth-child(2) {
        grid-row: 1;
        grid-column: 2;
    }

    .agents-table td:nth-child(3) {
        grid-row: 2;
        grid-column: 1 / -1;
    }

    .agents-table td:nth-child(4) {
        grid-row: 1;
        grid-column: 3;
    }
}

.agent-server-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    cursor: pointer;
    border-radius: 6px;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.agent-server-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.agent-endpoint-small {
    font-size: 0.8em;
    color: #4f84c8;
    margin-top: 2px;
    font-family: monospace;
}
.agent-ui-url-input {
    direction: ltr;
    text-overflow: ellipsis;
}
.agent-ui-url-input:not(:focus) {
    text-overflow: ellipsis;
}

/* Servidores detectados */
.detected-servers {
    margin-top: 40px;
}

.detected-servers-list {
    background: #1c2431;
    border-radius: 8px;
    padding: 15px;
    max-width: 800px;
}

.detected-server-row {
    padding: 20px;
    background: #252d3a;
    border-radius: 6px;
    margin-bottom: 15px;
}

.detected-server-row:last-child {
    margin-bottom: 0;
}

/* Header (hostname + endpoint) */
.detected-server-header {
    margin-bottom: 15px;
}

.detected-server-hostname {
    font-size: 1.1em;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.detected-server-endpoint {
    font-size: 0.9em;
    color: #888;
}

/* Formulario inline */
.detected-server-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    max-width: 100%;
}

.detected-server-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detected-server-form label {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.9em;
}

.detected-server-form input {
    padding: 8px 12px;
    border: 1px solid #3a4557;
    border-radius: 4px;
    background: #1c2431;
    color: #fff;
    font-size: 0.95em;
}

.detected-server-form input:focus {
    outline: none;
    border-color: #4f84c8;
    background: #242d3c;
}

.detected-server-form input::placeholder {
    color: #666;
}

.connect-agent-btn {
    white-space: nowrap;
    align-self: end;
}

/* Mensaje de error */
.detected-server-error {
    margin-top: 12px;
    padding: 10px;
    background: #3a1a1a;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #ff8a8a;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .detected-server-form {
        grid-template-columns: 1fr;
    }
}

/* Alerta simple de servidores detectados */
.detected-alert-simple {
    color: #f39c12;
    font-size: 1em;
    font-weight: 500;
    margin: 10px 0 15px 0;
    padding: 0;
}
/* Alerta temporal de actualizacion */
.updating-alert {
    font-size: 1em;
    font-weight: 500;
    color: #f39c12;
    margin: 15px 0 15px 10px;
    padding: 0;
    display: none;
}
/* Boton eliminar agente */
.btn-delete-agent {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-delete-agent:hover {
    opacity: 1;
    transform: scale(1.2);
}
/* Boton descartar servidor detectado */

.detected-server-info {
    flex: 1;
}

.btn-discard-detected {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px 10px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    color: #e74c3c;
}

.btn-discard-detected:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* ========================================
   BOTONES - NUEVO ESTILO DOCKME
   ======================================== */

/* Reset general de bordes redondeados en todos los botones */
.btn {
    border-radius: 3px !important;
    font-weight: 400 !important;
    letter-spacing: 0.3px !important;
    transition: all 0.15s ease !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

/* Boton primario — VERDE (Start, Deploy, Save, Connect) */
a.btn.btn-primary,
button.btn.btn-primary {
    background-color: #0f3d25 !important;
    background: #0f3d25 !important;
    border: 1px solid #27ae60 !important;
    color: #6dbf8a !important;
}
a.btn.btn-primary:hover,
button.btn.btn-primary:hover {
    background-color: #1a5c38 !important;
    border-color: #2ecc71 !important;
    color: #86efac !important;
}

/* Boton normal + secondary - AZUL (Stop, Restart, Edit, Back, Update, Cancel) */
a.btn.btn-normal,
button.btn.btn-normal,
a.btn.btn-secondary,
button.btn.btn-secondary {
    background-color: #1a3a6b !important;
    border: 1px solid #2563a8 !important;
    color: #7eb8f7 !important;
}
a.btn.btn-normal:hover,
button.btn.btn-normal:hover,
a.btn.btn-secondary:hover,
button.btn.btn-secondary:hover {
    background-color: #2550a0 !important;
    border-color: #5c9adf !important;
    color: #bfdbfe !important;
}

/* Boton danger — ROJO (Delete) */
a.btn.btn-danger,
button.btn.btn-danger {
    background-color: #3d0f0f !important;
    border: 1px solid #c0392b !important;
    color: #fca5a5 !important;
}
a.btn.btn-danger:hover,
button.btn.btn-danger:hover {
    background-color: #5c1a1a !important;
    border-color: #e74c3c !important;
    color: #fecaca !important;
}

/* badge de running y puertos de docker sin bordes redondeados */
.badge {
    border-radius: 5px !important;
}

.profile-pic {
    background-color: #2385d2 !important;
}


/* ========================================
   EFECTO FLIP EN LOS ICONOS DE LOS STACKS AL PASAR EL RATON
   ======================================== */
.stack-logo-left.has-url {
    position: relative;
    cursor: pointer;
    perspective: 600px;
}

.stack-logo-left {
    perspective: 400px;
}

.stack-logo-flip {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.stack-logo-left.has-url:hover .stack-logo-flip {
    transform: rotateY(180deg);
}

.logo-front,
.logo-back {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.logo-front {
    transform: rotateY(0deg);
}

.logo-back {
    transform: rotateY(180deg);
}

.logo-back::after {
    content: '';
    display: block;
    width: 80%;
    height: 80%;
    background-image: url('/system-icons/open-external.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* ========================================
   PANEL DE CONFIGURACIÓN - TABS
   ======================================== */
.config-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a3441;
    padding-bottom: 0;
}

.config-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #888;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95em;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.config-tab:hover {
    color: #ccc;
}

.config-tab.active {
    color: #fff;
    border-bottom-color: #4f84c8;
}

.config-content {
    display: none;
}

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

#config-tab-stacks.active:has(> p:only-child) {
    height: 570px;
}

#config-tab-stacks.active:has(> p:only-child) > p {
    display: table-footer-group;
    color: #7c94b3;
    font-size: 1.2em;
    font-weight: 500;
    opacity: 0.8;
    user-select: none;
    text-align: center;
}

.config-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.config-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8em;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.config-panel-close:hover {
    color: #fff;
}

/* ========================================
   EDITOR DE LINKS
   ======================================== */
.links-category-editor {
    background: #1b2228;
    border: 1px solid #4e5865;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 25px;
}

.links-cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.links-drag-handle {
    color: #555;
    cursor: grab;
    padding: 0 4px;
    user-select: none;
    font-size: 1.1em;
}

.links-drag-handle:active {
    cursor: grabbing;
}

.links-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #121821;
    border: 1px solid #2a3441;
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
}

.links-item-icon-wrap {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.links-item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.links-item-icon-wrap:hover .links-item-icon {
    opacity: 0.7;
    outline: 2px solid #4f84c8;
    border-radius: 4px;
}

/* ========================================
   SECCIÓN LINKS EN DASHBOARD
   ======================================== */
.links-cat-box {
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    padding: 12px;
    overflow: hidden;
    position: relative;
    min-width: 96px;
    max-width: 100%;
    box-sizing: border-box;
    margin-right: -15px;
}

.links-cat-box-title {
    font-size: 1.1em;
    font-weight: 500;
    color: #ccc;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a3441;
    cursor: grab;
    user-select: none;
}

.links-cat-box-title.dashboard-section-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #4f84c8;
}

/* Si el bloque no tiene un ancho específico, que ocupe todo el ancho disponible cuando no hay perfiles*/
#dockme-blocks-row > .links-cat-box:not([style*="width"]) {
    width: 100%;
}

.links-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-right: -15px;
}

.links-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: #121821;
    border: 1px solid #2a3441;
    border-radius: 6px;
    padding: 10px 3px;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 98px;
    height: 98px;
    box-sizing: border-box;
}

.links-item-card:hover {
    border-color: #4f84c8;
}

.links-item-card img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
}

.links-item-card span {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    min-height: 2.6em;
    line-height: 1.3em;
}

/* ── Modo normal: bloques sin fondo ─────────────────────────────────────── */
#dockme-blocks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0;
    align-items: stretch;
}

#dockme-blocks-row > .links-cat-box {
    background: transparent;
    border-color: transparent;
    resize: none;
}

#metrics-box .section-header {
    display: flex;
}

#dockme-blocks-row:not(.organizing) > .links-cat-box .links-cat-box-title {
    cursor: default;
}

/* ── Modo organización: bloques visibles y arrastrables ──────────────────── */
#dockme-blocks-row.organizing > .links-cat-box {
    background: #1c2431;
    border-color: #2a3441;
}

#dockme-blocks-row.organizing > .links-cat-box .section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a3441;
}

#dockme-blocks-row.organizing > .links-cat-box .links-cat-box-title {
    cursor: grab;
}

/* Título en métricas va dentro de section-header, sin borde propio */
#dockme-blocks-row.organizing > #metrics-box .links-cat-box-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#metrics-box .links-cat-box{
    min-width: 300px;
    height: 280px;
}

/* ── Barra de perfiles en modo organizar ─────────────────────────────────── */
#dockme-profile-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    justify-content: flex-end;
}

.profile-bar-name {
    display: flex;
    align-items: center;
}

.profile-bar-name-label {
    font-size: 0.9em;
    color: #ccc;
    font-weight: 500;
    padding: 0 4px;
    margin-right: auto;
}

.profile-bar-input {
    background: #121821;
    border: 1px solid #169c56;
    border-radius: 6px;
    color: #ccc;
    font-size: 0.95em;
    font-weight: 500;
    padding: 4px 10px;
    width: 200px;
}

.profile-bar-input:focus {
    outline: none;
}

.profile-bar-dropdown {
    position: relative;
}

.profile-bar-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    min-width: 200px;
    z-index: 500;
    padding: 4px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.profile-bar-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    gap: 8px;
    font-size: 0.9em;
    color: #ccc;
    cursor: pointer;
    transition: background 0.15s;
}

.profile-bar-dropdown-item:hover {
    background: #2a3441;
}

.profile-bar-dropdown-item.active {
    color: #4f84c8;
    font-weight: 500;
}

.profile-bar-btn-del {
    padding: 1px 6px !important;
    font-size: 0.78em !important;
    opacity: 0.7;
}

.profile-bar-btn-del:hover {
    opacity: 1;
}

/* ── Handle de resize custom (esquina superior derecha) ─────────────────── */
.dockme-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    cursor: ew-resize;
    z-index: 10;
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 5px;
}

.dockme-resize-handle::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-top: 3px solid #4f84c8;
    border-right: 3px solid #4f84c8;
    border-radius: 0 5px 0 0;
    opacity: 0.7;
}

.dockme-resize-handle:hover::after {
    opacity: 1;
}

#dockme-blocks-row.organizing .dockme-resize-handle {
    display: flex;
}

#dockme-sidebar-handle {
    position: absolute;
    top: 50px;
    right: 0;
    height: calc(100% - 50px);
    width: 8px;
    cursor: default;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    background: linear-gradient(to bottom, transparent 40%, #4f84c8 40%, #4f84c8 60%, transparent 60%);
    background-size: 2px 20px;
    background-repeat: repeat-y;
    background-position: center;
}

body.dockme-organizing #dockme-sidebar-handle:hover {
    opacity: 1;
    background-color: rgba(79, 132, 200, 0.3);
}

body.dockme-organizing #dockme-sidebar-handle {
    opacity: 1;
    background-color: rgba(79, 132, 200, 0.15);
    cursor: ew-resize;
}

/* ========================================
   Tab General
   ======================================== */
.general-tab-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.general-section {
    background: #1b2228;
    border-radius: 8px;
    border: 1px solid #4e5865;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.general-section-title {
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7a9cc4;
    margin-bottom: 4px;
}

.general-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.general-label {
    font-size: 0.9em;
    color: #c0cfe0;
}

.general-field-hint {
    font-size: 0.78em;
    color: #6a7f9a;
    min-height: 1em;
    white-space: pre-line;
    line-height: 1.5;
}

.general-time-input {
    max-width: 140px;
    color-scheme: dark;
}

.general-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.general-input-row .editor-input {
    flex: 1;
}

.gen-field-status {
    font-size: 18px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.general-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.general-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.general-toggle-slider {
    position: absolute;
    inset: 0;
    background: #3a4557;
    border-radius: 24px;
    transition: background 0.2s;
}

.general-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.general-toggle input:checked + .general-toggle-slider {
    background: #4f84c8;
}

.general-toggle input:checked + .general-toggle-slider::before {
    transform: translateX(20px);
}

/* Prune section two-column layout */
.general-prune-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.general-prune-left {
    flex: 1;
    min-width: 0;
}

.general-prune-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
/* ── Panel de Logs ─────────────────────────────────────────── */
#dockme-logs-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 400px;
}

#logs-header-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    flex-shrink: 0;
}

.logs-header-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.logs-header-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.logs-action-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logs-action-btn {
    padding: 2px 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#logs-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.logs-stack-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.btn-back-dashboard {
    padding: 3px 3px !important;
}

.logs-stack-name {
    color: #4f84c8;
    font-weight: 600;
    font-size: 1.5em;
    white-space: nowrap;
    text-transform: capitalize;
}

.logs-stack-sep {
    color: #555;
    font-size: 1.0em;
}

.logs-stack-host {
    color: #bbb840;
    font-weight: 600;
    font-size: 1.5em;
    white-space: nowrap;
    opacity: 0.7;
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.logs-controls-sep {
    width: 1px;
    height: 24px;
    background: #2a3441;
    flex-shrink: 0;
}

.logs-filter-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.logs-filter-wrap .profile-bar-input {
    padding-right: 24px;
}

.logs-filter-clear-btn {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.1em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.logs-filter-clear-btn:hover {
    color: #ccc;
}

.logs-autoscroll-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.logs-autoscroll-label {
    font-size: 0.85em;
    color: #aaa;
    white-space: nowrap;
    user-select: none;
}

#logs-area {
    flex: 1;
    overflow-y: auto;
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82em;
    line-height: 1.7;
}

/* Grid: ts fijo en ch (monospace), cn fijo, msg ocupa el resto y sangra al wrap */
.logs-line {
    display: grid;
    grid-template-columns: calc(8ch + 10px) auto 1fr;
    gap: 0;
    word-break: break-word;
}

/* Sin timestamp activo */
body.logs-hide-ts .logs-line {
    grid-template-columns: auto 1fr;
}

body.logs-hide-ts .logs-ts { display: none; }
body.logs-hide-ts .logs-cn { grid-column: 1; display: inline; }
body.logs-hide-ts .logs-msg { grid-column: 2; }

.logs-ts {
    color: #4caf50;
    white-space: nowrap;
    flex-shrink: 0;
    grid-column: 1;
    user-select: text;
}

.logs-cn {
    color: #4caf50;
    white-space: nowrap;
    flex-shrink: 0;
    grid-column: 2;
    user-select: text;
}

/* Ocultar nombre contenedor si hay un solo contenedor Y timestamp visible */
body:not(.logs-hide-ts) .logs-cn.logs-cn-single { display: none; }
body:not(.logs-hide-ts) .logs-line.logs-single-cn {
    grid-template-columns: calc(8ch + 10px) 1fr;
}
body:not(.logs-hide-ts) .logs-line.logs-single-cn .logs-msg { grid-column: 2; }

.logs-msg {
    color: #ccc;
    grid-column: 3;
    word-break: break-word;
    user-select: text;
}

.logs-line:not(:has(.logs-cn)) .logs-msg {
    grid-column: 2;
}

.logs-error-line {
    color: #e57373;
    padding: 2px 0;
    font-style: italic;
}

.logs-highlight {
    background: #7c5c00;
    color: #ffe082;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Footer bar de logs ── */
#logs-footer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-top: 6px;
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    flex-shrink: 0;
}

.logs-footer-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-end;
}

/* ── Botón expandir/contraer ── */
#logs-expand-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #1c2431;
    border: 2px solid #4f84c8;
    color: #4f84c8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

#logs-expand-btn:hover {
    background: #2a3441;
    color: #fff;
    border-color: #6fa8ff;
}

#logs-expand-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

body.dockme-logs-mode #dockme-blocks-row {
    display: none !important;
}

/* ── Tabs de logs/compose ── */
#logs-tabs {
    display: flex;
    gap: 4px;
    margin: 6px 0 0 0;
    flex-shrink: 0;
    position: relative;    
}

.logs-tab {
    background: #0d1117;
    border: 1px solid #2a3441;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: #888;
    padding: 5px 16px;
    font-size: 0.88em;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.logs-tab:hover {
    color: #ccc;
    background: #243040;
}

.logs-tab.active {
    color: #4f84c8;
    background: #1c2431;
    border-color: #2a3441;
    font-weight: 500;
}

/* Compose footer */
#compose-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    margin-top: 6px;
    background: #1c2431;
    border: 1px solid #2a3441;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ── Split panel compose/env ── */
#compose-area {
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

#compose-resize-handle:hover > div {
    background: #344459;
}

/* CodeMirror en el tab compose — ancho completo sin área blanca */
#compose-editor-wrap .CodeMirror,
#env-editor-wrap .CodeMirror {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
}

#compose-editor-wrap .CodeMirror-scroll,

#compose-editor-wrap,
#env-editor-wrap {
    box-sizing: border-box;
}/* ================================================================
   DockMe v2 — app.css
   Estilos propios del frontend v2
================================================================ */

/* ===== FIXES CSS v2 — basado en estilos computados del original ===== */
    body, html { background:#090c0f !important; }

    /* shadow-box */

    /* list-header */
    #dm-col2 .list-header {
        background: rgb(22,27,34);
        border-radius: 10px 10px 0 0;
        padding: 10px;
        height: 64px;
        box-sizing: border-box;
    }

    /* header-top */
    #dm-col2 .header-top {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: 44px;
        padding: 0;
        margin: 0;
    }

    /* search-wrapper */
    #dm-col2 .search-wrapper {
        display: flex;
        flex-direction: row;
        align-items: center;
        height: 44px;
        flex: 1;
        min-width: 0;
    }

    /* search-icon */
    #dm-col2 .search-icon {
        display: block;
        padding: 10px;
        width: 36px;
        height: 44px;
        cursor: pointer;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    #dm-col2 .search-icon svg { width: 16px; height: 16px; }

    /* search-input */
    #dm-col2 .search-input {
        display: block;
        padding: 6px 12px;
        height: 38px;
        background: rgb(7,10,16) !important;
        border: 1px solid rgb(29,38,52) !important;
        border-radius: 800px !important;
        color: rgb(177,184,192) !important;
        font-size: 16px;
        max-width: none !important;
        width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
        outline: none;
    }
    #dm-col2 .search-input:focus { border-color: #4f84c8 !important; }

    /* stack-list */
    #dm-col2 .dm-stack-list {
        display: block;
        overflow: auto;
        padding: 0;
        margin: 0;
    }

    /* items */
    #dm-col2 .dm-item {
        display: flex;
        align-items: center;
        padding: 0 8px;
        height: 52px;
        border-radius: 10px;
        color: rgb(177,184,192);
        overflow: hidden;
        cursor: pointer;
        box-sizing: border-box;
        border-left: 3px solid transparent;
        text-decoration: none;
    }
    #dm-col2 .dm-item:hover { background: rgba(255,255,255,0.05); }

    /* placeholder — width:0 en el original */
    #dm-col2 .placeholder { display: block; width: 0; overflow: hidden; flex-shrink: 0; }

    /* ===== HEADER CSS — basado en estilos computados del original ===== */

    #dm-header {
        display: flex;
        flex-direction: row;
        align-items: normal;
        justify-content: center;
        flex-wrap: wrap;
        padding: 8px 0;
        margin: 0 0 16px;
        height: 55px;
        background: rgb(22,27,34);
        background-color: rgb(22,27,34);
        border-bottom: 1px solid #1c5185 !important;
        color: rgb(177,184,192);
        position: sticky;
        top: 0;
        z-index: 100;
        box-sizing: border-box;
        width: 100%;
    }

    /* logo + título */
    #dm-header .d-flex.align-items-center {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin: 0 auto 0 0;
        padding: 0;
        height: 42px;
        cursor: pointer;
        text-decoration: none;
    }

    /* título */
    #dm-header-title {
        display: block;
        color: rgb(240,246,252);
        font-size: 24px;
        font-weight: 700;
        cursor: pointer;
        text-decoration: none;
        margin: 0;
        padding: 0;
    }

    /* nav */
    #dm-header .nav {
        display: flex;
        flex-direction: row;
        padding: 0;
        margin: 0 25px 0 0;
        height: 42px;
        list-style: none;
    }

    /* nav-item */
    #dm-header .nav-item {
        display: list-item;
        margin: 0 8px 0 0;
        height: 42px;
    }

    /* nav-link — ocultos en el original */
    #dm-header .nav-link {
        display: none;
    }

    /* dropdown profile */
    #dm-header .dropdown-profile-pic {
        display: block;
        position: relative;
        height: 40px;
        cursor: pointer;
    }
    #dm-header .nav-link.dropdown-toggle,
    #dm-header [data-bs-toggle="dropdown"] {
        display: flex !important;
        align-items: center;
        cursor: pointer;
        padding: 8px 4px;
        height: 40px;
    }

    /* profile pic */
    #dm-header .profile-pic {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        background: rgb(35,133,210);
        border-radius: 800px;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        margin: 0 5px 0 0;
        cursor: pointer;
        flex-shrink: 0;
    }

    /* dropdown menu */
    #dm-header .dropdown-menu .svg-inline--fa {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

#dm-header .dropdown-menu {
        background: rgb(13,17,23);
        border: 1px solid rgb(29,38,52);
        border-radius: 16px;
        min-width: 160px;
        padding: 8px 0 0;
        margin: 8px 0 0;
        overflow: hidden;
        color: rgb(177,184,192);
    }
    #dm-header .dropdown-menu .dropdown-item,
    #dm-header .dropdown-menu .dropdown-item-text {
        color: rgb(177,184,192);
        background: transparent;
        padding: 8px 16px;
        font-size: 14px;
    }
    #dm-header .dropdown-menu .dropdown-item:hover { background: rgb(22,27,34); }
    #dm-header .dropdown-menu button.dropdown-item { width: 100%; text-align: left; border: none; cursor: pointer; }
    #dm-header .dropdown-divider { border-color: rgb(29,38,52); margin: 4px 0; }

    /* header icons */
    #dm-header .header-icons {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        margin: 0 6px 0 0;
        height: 42px;
    }

    /* edit/organize icons — heredan de custom.css */
    #dm-header .edit-icon,
    #dm-header .organize-icon {
        width: 42px;
        height: 42px;
    }

    /* icons-li — slot para iconos movidos */
    #dm-icons-li {
        display: flex;
        align-items: center;
        height: 42px;
    }

/* ===== Ajustes items lista v2 ===== */
#dm-col2 .dm-item .dm-circle {
    margin: 3px;
    padding: 8px;
}

#dm-col2 .dm-item .dm-name {
    font-size: 1.15em !important;
}

#dm-col2 .dm-item:hover .dm-name {
    color: #bbbf53;
    font-weight: 500;
}

/* ===== Inputs nuevo stack ===== */
#new-stack-name,
#new-stack-server {
    background: rgb(7,10,16) !important;
    border: 1px solid rgb(29,38,52) !important;
    border-radius: 800px !important;
    color: rgb(177,184,192) !important;
    padding: 6px 12px;
    font-size: 16px;
}
#new-stack-name:focus,
#new-stack-server:focus {
    border-color: #4f84c8 !important;
    outline: none;
}

/* ===== Expandir logs — ocultar columna de stacks ===== */
body.logs-expanded #dm-col2 {
    display: none !important;
}

body.logs-expanded .col-12.col-md-8.col-xl-9.mb-3 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* ===== Layout fijo — scroll solo en contenido ===== */
html, body {
    height: 100%;
    overflow: hidden;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

main > .container-fluid {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

main > .container-fluid > .row {
    flex: 1;
    min-height: 0;
    flex-wrap: nowrap !important;
    overflow: hidden;
    margin: 0;
}

/* Columna stack — fija, sin scroll propio (lo gestiona dm-list-box) */
#dm-col2 {
    overflow: hidden;
    flex-shrink: 0;
    height: 100%;
}

/* Columna contenido — scroll interno */
.col-12.col-md-8.col-xl-9.mb-3 {
    height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* ===== AUTH OVERLAY (login + setup) ===== */
#dm-auth-overlay {
    background: #090c0f;
}

#dm-auth-overlay .form-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
}

#dm-auth-overlay .form {
    display: block;
    padding: 15px;
    margin: auto;
    width: 330px;
    max-width: 330px;
    box-sizing: border-box;
}

.dm-auth-field {
    width: 100%;
}

.dm-auth-input {
    display: block;
    width: 100%;
    padding: 16px 12px 16px 20.8px;
    height: 58px;
    background: rgb(7,10,16) !important;
    border: 1px solid rgb(29,38,52) !important;
    border-radius: 800px !important;
    color: rgb(177,184,192) !important;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
}

.dm-auth-input:focus {
    border-color: #4f84c8 !important;
    color: rgb(240,246,252) !important;
}

.dm-auth-input::placeholder {
    color: rgb(87,92,98);
}

#dm-auth-overlay .form-check-input {
    background-color: rgb(7,10,16);
    border-color: rgb(29,38,52);
}

#dm-auth-overlay .form-check-label {
    color: rgb(177,184,192);
}

#dm-auth-overlay .btn-primary {
    width: 100%;
    margin-top: 8px;
}

/* ===== Formulario conectar agente — fila horizontal ===== */

.detected-server-form .connect-agent-btn {
    flex-shrink: 0;
    white-space: nowrap;
    align-self: flex-end;
}

/* ===== Reglas específicas v2 que sobreescriben custom.css ===== */

/* editmode no oculta dm-col2 */
body.dockme-edit-mode #dm-col2 { display: block !important; }

/* dark mode links */
.dark a:not(.btn), .dark .table, .dark .nav-link { color: #b1b8c0; }

/* stack editor margin */
.stack-editor { margin-top: 0 !important; }

/* dm-col2 en editmode */
body.dockme-edit-mode #dm-col2 { display: block !important; }

/* Eliminar margin-top heredado de Bootstrap en dashboard */
#dockme-dashboard.mt-4 { margin-top: 0 !important; }

/* ===== Flip icon en lista de stacks ===== */
.dm-icon-flip {
    perspective: 300px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

.dm-flip-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
}

.dm-icon-flip:hover .dm-flip-inner {
    transform: rotateY(180deg);
}

.dm-flip-front,
.dm-flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.dm-flip-front img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dm-flip-back {
    transform: rotateY(180deg);
    background: #142d4f;
    background-image: url('/system-icons/open-external.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
}

/* ===== Botón expandir/contraer panel logs ===== */
#logs-expand-btn {
    position: absolute;
    top: 45px;
    left: -12px;
    z-index: 10;
    width: 25px;
    height: 30px;
    border-radius: 6px;
    background: #1c2431;
    border: 2px solid #4f84c8;
    color: #4f84c8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}