:root {
    /* The following are official CakePHP colors */
    --color-cakephp-red: #d33c43;
    --color-cakephp-gray: #ffffff;
    --color-cakephp-blue: #2f85ae;
    --color-cakephp-lightblue: #34bdd7;

    /* These are additional colors */
    --color-lightgray: #ffffff;
    --color-white: #fff;

    --color-main-bg: #1e1d2b;;
    --color-links: var(--color-cakephp-blue);
    --color-links-active: #5693c9;
    --color-headings: #898989;

    --color-message-success-bg: #e3fcec;
    --color-message-success-text: #1f9d55;
    --color-message-success-border: #51d88a;

    --color-message-warning-bg: #fffabc;
    --color-message-warning-text: #8d7b00;
    --color-message-warning-border: #d3b800;

    --color-message-error-bg: #fcebea;
    --color-message-error-text: #cc1f1a;
    --color-message-error-border: #ef5753;

    --color-message-info-bg: #eff8ff;
    --color-message-info-text: #2779bd;
    --color-message-info-border: #6cb2eb;
}

.box-form{
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.box-form textarea{
    width: 600px;
    height: 60px;
}

.form-group.duration {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.form-group.duration .radio label {
    display: inline-block;
    margin-right: 15px;
}

.device-item {
    margin-bottom: 5px;
}

.device-search-input {
    width: 100%;
    padding: 0.5em 0.75em;
    margin-bottom: 0.8em;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    font-size: 1rem;
}

#device-list,
#stock-list {
    max-height: 300px; /* Ajusta según el espacio que quieras */
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 0.375rem;
    padding: 0.5em;
    background-color: #fafafa;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 0.3em 0.5em;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}


.device-item:hover {
    background-color: #c5c4c4;
}

.device-item input[type="checkbox"] {
    margin: 0 8px 0 0; /* margen derecho para separar */
    padding: 0;
    vertical-align: middle;
    flex-shrink: 0;
}


.device-label {
    font-size: 15px;
    color: #333;
    word-break: break-all; /* Por si los barcodes son muy largos */
}

.selected-summary {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5em;
    font-size: 14px;
}

.selected-summary th,
.selected-summary td {
    border: 1px solid #ddd;
    padding: 0.5em;
    text-align: left;
}

.selected-summary th {
    background-color: #f4f4f4;
    font-weight: 600;
}

.selected-summary{
    background-color: var(--color-cakephp-gray);
}


.action-print-view {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #333;
    background-color: var(--color-cakephp-gray);
}

.action-print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.action-print-table td {
    border: 1px solid #000;
    padding: 0.4em;
}

.devices-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.devices-table th,
.devices-table td {
    border: 1px solid #000;
    padding: 0.4em;
    text-align: left;
}

.action-print-view td,
.action-print-view tH{
    padding: 0;
}

.action-icon {
    height: 16px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.top-nav-title {
    display: flex;
    align-items: center;
}

.top-nav-title span {
    margin-left: 10px;
    font-weight: bold;
}

.top-nav-title a {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.top-nav-title a img {
    display: block;
    width: auto;
    height: 40px;
    max-height: 40px;
    object-fit: contain;
}

.nav-hamburger {
    display: none;
    border: 0;
    background: transparent;
    color: var(--color-lightgray);
    font-size: 22px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}

select {
    background-color: white;
}

input.print-checkbox.no-print{
    margin-right: 5px;
}

/* Modal */
.modal {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 50mm;
    height: 142px;
    max-width: 500px;
    border-radius: 5px;
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    right: 10px; top: 5px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
/* --------------- Devices State ---------------*/
.state-available{    
    background-color: #a1e9be;
    border-radius: 20px;
    color: #00ab45;
    font-weight: bold;
    margin: 0;
    padding: 2px;
    text-align: center;
    width: 110px;
    font-size: 13px;
}

.state-unavailable{
    background-color: #ffb9b9;
    border-radius: 20px;
    color: #bf4040;
    font-weight: bold;
    text-align: center;
    width: 110px;
    font-size: 13px;
}

.state-disabled{    
    background-color: #d5d5d5;
    border-radius: 20px;
    color: #393939;
    font-weight: bold;
    margin: 0;
    padding: 2px;
    text-align: center;
}

/* --------------- Devices View ---------------*/
.device-content{
    display: flex;
}

.image-container, .info-container-left {
    margin-right: 30px;
}


dl, dt, dd {
    margin: 0;
    padding: 0;
}

dt{
    font-weight: bold;
}

td, th {
    border-bottom: 0.1rem solid #e1e1e1;
    padding: 0.2rem 0.6rem;
}

th.actions {
    width: 170px;
}

th.state {
    width: 130px;
}

input#email,
input#password {
    background-color: var(--color-cakephp-gray);
}


.top-info{
    display: flex;
}

.btn-add{
    width: 1em;
    margin-left: 10px;
    fill: var(--color-main-bg);
    vertical-align: middle;
}

.hover-btn {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.hover-btn:hover{
    transform: scale(1.2);
    filter: brightness(1.2);
    cursor: pointer;
}

input#device-search, 
input#stock-search,
.stock-table{
    background-color: var(--color-cakephp-gray);
}


/* --------------- Labels  ---------------*/
#tagsContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas iguales */
    gap: 10px; /* espacio entre etiquetas */
}

/* Estilo base */
.cell-highlight {
  display: block;              /* ahora ocupa todo el td */
  width: 100%;
  height: 100%;
  padding: 0px 12px;           /* margen interno cómodo */
  background-color: #ebebeb;   /* gris suave */
  border-radius: 6px;          /* bordes redondeados */
  font-weight: bold;
  color: #111827;              /* texto oscuro */
  text-decoration: none;       /* sin subrayado */
  transition: all 0.2s ease;
  text-align: center;          /* centra el número */
  box-sizing: border-box;      /* incluye padding en ancho */
}

/* Efecto hover */
.cell-highlight:hover {
  background-color: #525252;   /* gris oscuro */
  color: #fff;
  transform: scale(1.05);      /* efecto zoom */
}




@media print {
    #tagsContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .top-nav {
        display: none !important;
    }

    .hide-on-print {
        display: none !important;
    }

    input[type="checkbox"] {
        display: none;
    }
}

@media (max-width: 700px) {
    .top-nav {
        align-items: center;
    }

    .nav-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .top-nav-links {
        display: none;
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .top-nav-links.is-open {
        display: flex;
    }

    .top-nav-links a,
    .top-nav-links .nav-theme-toggle {
        margin: 0;
    }

    .top-nav-title a img {
        height: 38px;
        max-height: 38px;
        min-height: 38px;
    }
}
