/* Grid y alineación para panel admin */
.admin-panel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
    align-items: flex-start;
    margin: 2.5rem auto 0 auto;
    width: 100%;
    max-width: 1200px;
}

.admin-panel-section {
    flex: 1 1 340px;
    max-width: 400px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.admin-form label {
    width: 100%;
}

.admin-form button {
    align-self: center;
}

.admin-fields-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2.2rem;
    justify-content: center;
    width: 100%;
}

.admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: 1.2em;
    font-weight: 700;
    width: 100%;
    justify-content: center;
    font-size: 1.15rem;
    padding: 1.2rem 1rem;
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.08), rgba(209, 79, 46, 0.03));
    border: 2px dashed rgba(209, 79, 46, 0.25);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.admin-checkbox-label:hover {
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.12), rgba(209, 79, 46, 0.06));
    border-color: rgba(209, 79, 46, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(209, 79, 46, 0.15);
}

.admin-checkbox-label input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 70px;
    height: 36px;
    background: linear-gradient(135deg, #e0e0e0, #d0d0d0);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
    order: -1;
}

.admin-checkbox-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    border-radius: 50%;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.admin-checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2), 0 2px 12px rgba(209, 79, 46, 0.4), 0 0 20px rgba(209, 79, 46, 0.2);
    border-color: var(--accent-dark);
}

.admin-checkbox-label input[type="checkbox"]:checked::before {
    transform: translateX(34px);
    background: linear-gradient(135deg, #ffffff, #fff9f5);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2), 0 0 12px rgba(255, 255, 255, 0.3);
}

.admin-checkbox-label input[type="checkbox"]:hover {
    transform: scale(1.05);
}

.admin-checkbox-label input[type="checkbox"]:active::before {
    width: 32px;
}

.admin-checkbox-label input[type="checkbox"]:checked:active::before {
    transform: translateX(30px);
}

.admin-status {
    font-size: 0.95em;
    color: #2ecc40;
    display: none;
    margin-top: 0.2em;
}

/* Toggle dark mode button */
#toggle-darkmode {
    position: static;
    background: #232323;
    color: #ffd166;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.13);
    transition: background 0.18s, color 0.18s;
    flex: 0 0 auto;
}

#toggle-darkmode:hover {
    background: #ffd166;
    color: #232323;
}

body.darkmode {
    --bg: #181818;
    --panel: #232323;
    --ink: #f5f5f5;
    --accent: #ff7a3d;
    --accent-dark: #d14f2e;
    --muted: #bcbcbc;
    --danger: #ff4d4d;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    --ring: 0 0 0 3px rgba(255, 200, 70, 0.13);
    background: #181818 !important;
    color: var(--ink) !important;
}

body.darkmode .panel,
body.darkmode .stat-card,
body.darkmode .device-bulk-form,
body.darkmode .upload-field-group,
body.darkmode .modal-card {
    background: #232323 !important;
    color: #f5f5f5 !important;
    border-color: #292929 !important;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

body.darkmode .site-header,
body.darkmode .site-footer {
    background: #181818 !important;
    color: #f5f5f5 !important;
    border-color: #232323 !important;
}

body.darkmode .footer-link,
body.darkmode .ignace-link {
    color: #ffd166 !important;
}

body.darkmode .footer-link:hover,
body.darkmode .ignace-link:hover {
    color: #fff !important;
}

body.darkmode input,
body.darkmode select,
body.darkmode textarea {
    background: #232323 !important;
    color: #f5f5f5 !important;
    border-color: #444 !important;
}

body.darkmode .support-popup {
    background: #232323 !important;
    color: #ffd166 !important;
}

body.darkmode .support-fab {
    background: linear-gradient(135deg, #25D366 60%, #128C7E 100%) !important;
}

body.darkmode .support-fab:hover {
    background: linear-gradient(135deg, #128C7E 60%, #25D366 100%) !important;
}

body.darkmode .support-title {
    color: #25D366 !important;
}

body.darkmode .support-contact-btn {
    background: #25D366 !important;
    color: #181818 !important;
}

body.darkmode .support-contact-btn:hover {
    background: #fff !important;
    color: #25D366 !important;
}

/* Centrado y alineación para formulario de subir imágenes */
.upload-form-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    width: 100%;
}

.upload-fields-wrap {
    display: flex;
    flex-direction: row;
    gap: 2.2rem;
    justify-content: center;
    width: 100%;
}

.upload-field-group {
    min-width: 240px;
    max-width: 320px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.upload-field-group label {
    text-align: center;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.upload-field-group input[type="number"] {
    text-align: center;
}

.admin-panel-section input[type="file"] {
    width: 100%;
    max-width: 100%;
}

/* Campo de contraseña SSH estilizado */
.ssh-password-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ssh-password-field label {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--muted);
}

.ssh-password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.06), rgba(209, 79, 46, 0.02));
    border: 2px solid rgba(209, 79, 46, 0.25);
    border-radius: 14px;
    padding: 0.65rem 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(209, 79, 46, 0.08);
}

.ssh-password-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(209, 79, 46, 0.15);
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.1), rgba(209, 79, 46, 0.04));
    transform: translateY(-2px);
}

.ssh-lock-icon {
    font-size: 1.3rem;
    margin-right: 0.6rem;
    filter: grayscale(0.3);
    user-select: none;
}

.ssh-password-input-wrapper input[type="password"],
.ssh-password-input-wrapper input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.2rem;
    color: var(--text);
}

.ssh-password-input-wrapper input::placeholder {
    color: var(--muted);
    opacity: 0.6;
    font-weight: 500;
}

.toggle-password-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-left: 0.3rem;
}

.toggle-password-btn:hover {
    background: rgba(209, 79, 46, 0.15);
    transform: scale(1.1);
}

.toggle-password-btn:active {
    transform: scale(0.95);
}

.eye-icon {
    font-size: 1.3rem;
    user-select: none;
}

/* Dark mode para campo SSH */
body.darkmode .ssh-password-field label {
    color: #e0e0e0;
}

body.darkmode .ssh-password-input-wrapper {
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.12), rgba(209, 79, 46, 0.06));
    border-color: rgba(209, 79, 46, 0.35);
    box-shadow: 0 2px 8px rgba(209, 79, 46, 0.15);
}

body.darkmode .ssh-password-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(209, 79, 46, 0.25);
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.18), rgba(209, 79, 46, 0.08));
}

body.darkmode .ssh-password-input-wrapper input {
    color: #f5f5f5;
}

body.darkmode .toggle-password-btn:hover {
    background: rgba(209, 79, 46, 0.25);
}


.upload-btn-centered {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1.2rem;
}

/* Personalización de inputs de tipo file */
.custom-file-input {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-file-input input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    border: 2px dashed var(--accent);
    background: linear-gradient(135deg, rgba(255, 122, 61, 0.08), rgba(209, 79, 46, 0.06));
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.custom-file-label:hover {
    background: linear-gradient(135deg, rgba(255, 122, 61, 0.15), rgba(209, 79, 46, 0.12));
    border-color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(209, 79, 46, 0.18);
}

.custom-file-label:active {
    transform: translateY(0);
}

.custom-file-label::before {
    content: '📁';
    font-size: 1.2rem;
}

.custom-file-name {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    color: var(--muted);
    text-align: left;
    font-style: italic;
    min-height: 1.2rem;
    word-break: break-all;
}

.custom-file-input.has-file .custom-file-label {
    border-style: solid;
    background: linear-gradient(135deg, rgba(46, 204, 64, 0.08), rgba(46, 204, 64, 0.06));
    border-color: #2ecc40;
    color: #2ecc40;
}

.custom-file-input.has-file .custom-file-label::before {
    content: '✓';
}

.custom-file-input.has-file .custom-file-name {
    color: #2ecc40;
    font-weight: 600;
}

body.darkmode .custom-file-label {
    background: linear-gradient(135deg, rgba(255, 122, 61, 0.12), rgba(209, 79, 46, 0.08));
    border-color: rgba(255, 122, 61, 0.6);
    color: #ff9966;
}

body.darkmode .custom-file-label:hover {
    background: linear-gradient(135deg, rgba(255, 122, 61, 0.2), rgba(209, 79, 46, 0.15));
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(255, 122, 61, 0.25);
}

body.darkmode .custom-file-name {
    color: rgba(255, 255, 255, 0.6);
}

body.darkmode .custom-file-input.has-file .custom-file-label {
    background: linear-gradient(135deg, rgba(46, 204, 64, 0.15), rgba(46, 204, 64, 0.1));
    border-color: #2ecc40;
    color: #3ef051;
}

body.darkmode .custom-file-input.has-file .custom-file-name {
    color: #3ef051;
}

/* Dark mode para admin checkbox toggle */
body.darkmode .admin-checkbox-label {
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.15), rgba(209, 79, 46, 0.08));
    border-color: rgba(209, 79, 46, 0.35);
    color: #f5f5f5;
}

body.darkmode .admin-checkbox-label:hover {
    background: linear-gradient(135deg, rgba(209, 79, 46, 0.22), rgba(209, 79, 46, 0.12));
    border-color: rgba(209, 79, 46, 0.5);
    box-shadow: 0 4px 12px rgba(209, 79, 46, 0.25);
}

body.darkmode .admin-checkbox-label input[type="checkbox"] {
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border-color: rgba(255, 255, 255, 0.15);
}

body.darkmode .admin-checkbox-label input[type="checkbox"]::before {
    background: linear-gradient(135deg, #e0e0e0, #c0c0c0);
}

body.darkmode .admin-checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #ff6b3d, #d14f2e);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 2px 15px rgba(209, 79, 46, 0.5), 0 0 25px rgba(255, 107, 61, 0.3);
}

/* Semáforo de estado general */
.semaforo-dot {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    border-radius: 50%;
    margin-right: 0.1em;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.12);
    border: 2.5px solid #fff;
}

.semaforo-ok {
    background: #2ecc40;
    border-color: #2ecc40;
}

.semaforo-warn {
    background: #ffd700;
    border-color: #ffd700;
}

.semaforo-down {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* Botón flotante de soporte técnico */
#support-float-btn {
    position: fixed;
    right: 2.2rem;
    bottom: 2.2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.support-fab {
    background: linear-gradient(135deg, #d14f2e 60%, #a33b21 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 18px rgba(209, 79, 46, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.18s, background 0.18s;
    outline: none;
}

.support-fab:hover {
    box-shadow: 0 8px 28px rgba(209, 79, 46, 0.28);
    background: linear-gradient(135deg, #a33b21 60%, #d14f2e 100%);
}

.support-popup {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    background: #181818;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(30, 20, 10, 0.18);
    padding: 1.1rem 1.5rem 1.2rem 1.5rem;
    margin-bottom: 0.7rem;
    min-width: 220px;
    max-width: 320px;
    font-size: 1rem;
    animation: fadein-footer 0.7s;
}

.support-title {
    font-weight: 700;
    font-size: 1.08rem;
    margin-bottom: 0.7rem;
    color: #ffd166;
}

.support-contact-btn {
    background: #ffd166;
    color: #1b1a19;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.3rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    margin-top: 0.2rem;
}

.support-contact-btn:hover {
    background: #fff;
    color: #d14f2e;
}

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap");

:root {
    --bg: #f1efe7;
    --panel: #ffffff;
    --ink: #1b1a19;
    --accent: #d14f2e;
    --accent-dark: #a33b21;
    --muted: #6b6b6b;
    --danger: #b00020;
    --shadow: 0 18px 40px rgba(30, 20, 10, 0.12);
    --ring: 0 0 0 3px rgba(209, 79, 46, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 238, 220, 0.85), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(255, 210, 190, 0.5), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(220, 230, 255, 0.45), transparent 40%),
        linear-gradient(180deg, #fdf8f2 0%, #f1efe7 55%, #e8e2d8 100%);
    color: var(--ink);
}

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

.site-header {
    padding: 2.4rem 0 1.6rem;
}

.header-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1.6rem;
}

.header-side {
    display: flex;
    align-items: stretch;
    gap: 1rem;
}
.site-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    letter-spacing: -0.02em;
}

.lead {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-weight: 600;
}

.header-note {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.panel-grid {
    display: grid;
    gap: 3.2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel {
    background: var(--panel);
    border-radius: 18px;
    padding: 2.2rem 1.6rem 2.2rem 1.6rem;
    box-shadow: var(--shadow);
    animation: rise 0.35s ease both;
    margin-bottom: 3.2rem;
    margin-top: 1.2rem;
}

.panel h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.panel:has(.bulk-send-form) h2 {
    text-align: center;
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.6rem;
    align-items: center;
}

.stat-grid {
    display: grid;
    gap: 0.9rem;
}

.eyebrow {
    letter-spacing: 0.22em;
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
    text-transform: uppercase;
}

.select-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.08rem;
    margin: 0.5rem auto 0.7rem auto;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.48em 1.2em 0.48em 1em;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(209, 79, 46, 0.08);
    transition: background 0.18s, box-shadow 0.18s;
}

.select-all-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 18px rgba(209, 79, 46, 0.13);
}

.select-all-deploy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.4em 1em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(209, 79, 46, 0.1);
    transition: all 0.2s ease;
    width: 100%;
}

.select-all-deploy-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 3px 12px rgba(209, 79, 46, 0.15);
    transform: translateY(-1px);
}

.select-all-deploy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(209, 79, 46, 0.2);
}

body.darkmode .select-all-deploy-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 2px 8px rgba(209, 79, 46, 0.2);
}

body.darkmode .select-all-deploy-btn:hover {
    box-shadow: 0 3px 15px rgba(209, 79, 46, 0.3);
}

.select-all-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    width: 1.35em;
    height: 1.35em;
    margin-right: 0.18em;
    border: 2.2px solid var(--accent);
    position: relative;
}

.select-all-checkbox-wrap input[type="checkbox"] {
    appearance: none;
    width: 100%;
    height: 100%;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
}

.select-all-checkbox-wrap input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 0.32em;
    top: 0.08em;
    width: 0.35em;
    height: 0.7em;
    border: solid #d14f2e;
    border-width: 0 0.18em 0.18em 0;
    transform: rotate(45deg);
    pointer-events: none;
    box-sizing: border-box;
}

.select-all-checkbox-wrap input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.header-card {
    background: linear-gradient(135deg, #fff4ec, #ffffff 55%);
    padding: 1.2rem 1.4rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.session-card {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: linear-gradient(160deg, rgba(16, 24, 40, 0.96), rgba(33, 45, 64, 0.92));
    color: #f8fafc;
    padding: 1.2rem 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.session-user {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.session-role {
    margin: 0;
    color: rgba(248, 250, 252, 0.72);
    font-size: 0.92rem;
}

.session-logout-form {
    margin-top: auto;
}

.session-logout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.status-online {
    border: 1px solid rgba(46, 204, 64, 0.28);
}

.status-maintenance {
    border: 1px solid rgba(255, 190, 70, 0.35);
}

.header-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.header-value {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.8rem;
    margin: 0.2rem 0 0.3rem;
}

.status-dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    display: inline-block;
    background: #2ecc40;
    box-shadow: 0 0 0 0 rgba(46, 204, 64, 0.55);
    animation: statusPulse 1.8s ease-out infinite;
}

.status-maintenance .status-dot {
    background: #ffbf47;
    box-shadow: 0 0 0 0 rgba(255, 191, 71, 0.55);
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 64, 0.55);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(46, 204, 64, 0);
    }
}

.status-maintenance .status-dot {
    animation-name: statusPulseWarn;
}

@keyframes statusPulseWarn {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 191, 71, 0.55);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(255, 191, 71, 0);
    }
}

body.darkmode .header-card {
    background: linear-gradient(160deg, #202327, #171a1f 70%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
}

body.darkmode .session-card {
    background: linear-gradient(160deg, #131722, #0c1018 72%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
body.darkmode .status-online {
    border-color: rgba(46, 204, 113, 0.35) !important;
}

body.darkmode .status-maintenance {
    border-color: rgba(255, 191, 71, 0.45) !important;
}

body.darkmode .header-label {
    color: #b8c0cc !important;
}

body.darkmode .header-value {
    color: #f4f7fb !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
}

body.darkmode .header-note {
    color: #c8d0dc !important;
}

.header-card.status-changing {
    animation: statusCardSwap 0.55s ease;
}

@keyframes statusCardSwap {
    0% {
        transform: translateY(0) scale(1);
        filter: saturate(1);
    }

    50% {
        transform: translateY(-1px) scale(1.015);
        filter: saturate(1.18);
    }

    100% {
        transform: translateY(0) scale(1);
        filter: saturate(1);
    }
}

.site-footer {
    margin-top: 60px;
    padding: 28px 0;
    background: linear-gradient(180deg, #111, #0b0b0b);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
    max-width: 1200px;
    margin: auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-text {
    font-size: 0.98rem;
    letter-spacing: 0.5px;
    color: #c9a27e;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    margin: 0;
    text-align: center;
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
    }
}

.footer-text:hover {
    opacity: 1;
}

.stat-card {
    background: #fff7f1;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(209, 79, 46, 0.15);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.panel-grid {
    display: grid;
    gap: 3.2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

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

label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #d6d0c7;
    font-size: 0.95rem;
    background: #fffcf9;
}

select {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #d6d0c7;
    font-size: 0.95rem;
    background: #fffcf9;
}

input:focus {
    outline: none;
    box-shadow: var(--ring);
    border-color: rgba(209, 79, 46, 0.6);
}

button {
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 18px rgba(209, 79, 46, 0.25);
}

button.danger {
    background: var(--danger);
}

.notice {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    margin: 1rem 0;
}

.notice.success {
    background: #e8f5e9;
    color: #1b5e20;
}

.notice.error {
    background: #ffebee;
    color: #b71c1c;
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.login-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 1.4rem;
    align-items: stretch;
}

.login-brand-panel,
.login-form-panel {
    border-radius: 26px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-brand-panel {
    position: relative;
    padding: 2.2rem;
    background:
        radial-gradient(circle at top right, rgba(255, 183, 138, 0.55), transparent 34%),
        linear-gradient(145deg, #22150f 0%, #4a261a 52%, #8b4126 100%);
    color: #fff5ef;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    inset: auto -80px -100px auto;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
}

.login-brand-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.65rem;
    backdrop-filter: blur(8px);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-brand-panel .eyebrow {
    color: rgba(255, 245, 239, 0.72);
}

.login-brand-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 3.5vw, 3.35rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    max-width: 11ch;
}

.login-intro {
    margin: 1rem 0 0;
    max-width: 52ch;
    color: rgba(255, 245, 239, 0.82);
    font-size: 1.02rem;
    line-height: 1.65;
}

.login-feature-list {
    display: grid;
    gap: 0.95rem;
    margin-top: 2rem;
}

.login-feature-card {
    display: grid;
    gap: 0.28rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}

.login-feature-card strong {
    font-size: 1rem;
}

.login-feature-card span {
    color: rgba(255, 245, 239, 0.74);
    line-height: 1.5;
}

.login-footer-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 245, 239, 0.68);
    font-size: 0.92rem;
}

.login-form-panel {
    padding: 2.2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.96));
    backdrop-filter: blur(14px);
}

.login-form-label {
    margin: 0;
    color: var(--accent);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
}

.login-form-panel h2 {
    margin: 0.45rem 0 0;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    letter-spacing: -0.03em;
}

.login-form-copy {
    margin: 0.7rem 0 1.6rem;
    color: var(--muted);
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-form label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
}

.login-password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    align-items: center;
}

.login-password-row input {
    min-width: 0;
}

.login-password-toggle {
    padding-inline: 1rem;
    background: #172030;
    white-space: nowrap;
}

.login-submit-btn {
    width: 100%;
    justify-content: center;
    padding-block: 0.9rem;
    font-size: 1rem;
}

.login-meta {
    display: grid;
    gap: 0.55rem;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: 0.92rem;
}

body.darkmode .login-form-panel {
    background: linear-gradient(180deg, rgba(19, 22, 30, 0.94), rgba(10, 12, 18, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.darkmode .login-form-label {
    color: #ff9b70;
}

body.darkmode .login-form-copy,
body.darkmode .login-meta {
    color: #a5adbb;
}

body.darkmode .notice.success {
    background: rgba(46, 204, 64, 0.16);
    color: #7ef18a;
}

body.darkmode .notice.error {
    background: rgba(255, 77, 77, 0.15);
    color: #ff9f9f;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid #efe8de;
    text-align: left;
    vertical-align: top;
}

.preview {
    width: 220px;
    max-width: 100%;
    border-radius: 12px;
    background: #1c1c1c;
}

.hero-compact {
    grid-template-columns: 1.25fr auto;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.ghost-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.8rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(209, 79, 46, 0.22);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ghost-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 18px rgba(209, 79, 46, 0.12);
    border-color: rgba(209, 79, 46, 0.45);
}

.inventory-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.inventory-stat-card {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 245, 238, 0.95), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(209, 79, 46, 0.14);
}

.inventory-stat-warn {
    border-color: rgba(255, 191, 71, 0.34);
}

.inventory-stat-label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.inventory-stat-value {
    font-size: 1.85rem;
    letter-spacing: -0.03em;
}

.inventory-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.inventory-search-wrap {
    display: grid;
    gap: 0.45rem;
    min-width: min(100%, 420px);
    flex: 1 1 320px;
    font-weight: 700;
}

.inventory-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.inventory-table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff7f1;
}

.inventory-ip-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    background: rgba(16, 24, 40, 0.06);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.88rem;
}

.inventory-ip-chip-local {
    background: rgba(46, 204, 64, 0.12);
}

.inventory-ip-muted {
    color: var(--muted);
    font-style: italic;
}

body.darkmode .ghost-link-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.12);
}

body.darkmode .inventory-stat-card {
    background: linear-gradient(180deg, rgba(26, 29, 35, 0.96), rgba(18, 20, 26, 0.95));
    border-color: rgba(255, 255, 255, 0.08);
}

body.darkmode .inventory-table-wrap {
    border-color: rgba(255, 255, 255, 0.08);
}

body.darkmode .inventory-table thead th {
    background: #151a22;
}

body.darkmode .inventory-ip-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f5;
}

body.darkmode .inventory-ip-chip-local {
    background: rgba(46, 204, 64, 0.2);
}

body.darkmode .inventory-ip-muted {
    color: #a9b1bb;
}
/* Estilos para vista previa mejorada */
.preview-info {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
}

.filename-preview {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    word-break: break-word;
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: rgba(209, 79, 46, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(209, 79, 46, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(209, 79, 46, 0.2);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(209, 79, 46, 0.3);
    background: linear-gradient(135deg, #ff6b3d, var(--accent));
}

.btn-preview:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(209, 79, 46, 0.25);
}

.video-preview-container {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

/* Estilos para el modal de video */
.modal-video::-webkit-scrollbar {
    width: 10px;
}

.modal-video::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.modal-video::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
}

.modal-video::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

body.darkmode .modal-video::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark mode para preview info */
body.darkmode .filename-preview {
    background: rgba(209, 79, 46, 0.15);
    border-color: rgba(209, 79, 46, 0.3);
    color: #f5f5f5;
}

body.darkmode .btn-preview {
    box-shadow: 0 2px 10px rgba(209, 79, 46, 0.3);
}

body.darkmode .btn-preview:hover {
    box-shadow: 0 4px 18px rgba(209, 79, 46, 0.4);
}

.deploy {
    display: grid;
    gap: 0.4rem;
}

.deploy-device-list {
    display: grid;
    gap: 0.5rem;
}

.deploy-device-option {
    display: grid;
    grid-template-columns: 1.1rem 1fr;
    align-items: center;
    justify-items: start;
    gap: 0.6rem;
    width: 100%;
    font-weight: 600;
    text-align: left;
}

.deploy-device-option input[type="checkbox"] {
    margin: 0;
    justify-self: start;
}

.deploy-device-option span {
    justify-self: start;
}

.deploy-device-list {
    max-height: 140px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.deploy-device-list::-webkit-scrollbar {
    width: 8px;
}

.deploy-device-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.deploy-device-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.deploy-device-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

body.darkmode .deploy-device-list {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

body.darkmode .deploy-device-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.darkmode .deploy-device-list::-webkit-scrollbar-thumb {
    background: rgba(209, 79, 46, 0.7);
}

body.darkmode .deploy-device-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {

    .header-grid,
    .hero {
        grid-template-columns: 1fr;
    }

                .header-side,
                .login-shell {
                    grid-template-columns: 1fr;
                    flex-direction: column;
                }
        
                .login-brand-panel,
                .login-form-panel {
                    padding: 1.4rem;
                }
        
                .login-brand-panel h1 {
                    max-width: none;
                }
        
                .login-footer-line,
                .login-brand-top,
                .login-password-row {
                    grid-template-columns: 1fr;
                    display: grid;
                }
    .panel {
        padding: 1.1rem;
    }

        .inventory-toolbar,
        .inventory-toolbar-actions,
        .hero-actions {
            align-items: stretch;
            justify-content: stretch;
        }
    
        .ghost-link-btn {
            width: 100%;
        }
    .preview-info {
        flex-direction: column;
        gap: 0.6rem;
    }

    .filename-preview {
        text-align: center;
        white-space: normal;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    z-index: 9999;
    padding: 5vh 1rem;
}

.modal-card {
    width: min(760px, 96vw);
    margin: 0 auto;
    background: linear-gradient(180deg, #121212, #0f0f0f);
    color: #f7f7f7;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.35);
    padding: 1rem;
}

.modal-large {
    width: min(980px, 96vw);
}

.modal-video {
    width: min(720px, 85vw);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-head h3 {
    margin: 0;
}

.modal-close {
    border-radius: 8px;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
}

.modal-actions {
    margin-top: 0.9rem;
}

.warn-text {
    margin: 0.5rem 0 0.9rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: rgba(255, 200, 70, 0.15);
    color: #ffd166;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.info-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    display: grid;
    gap: 0.25rem;
}

.info-k {
    font-size: 0.8rem;
    color: #bcbcbc;
}

.info-v {
    font-size: 0.96rem;
    font-weight: 600;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
}

.badge-ok {
    background: rgba(45, 178, 101, 0.22);
    color: #7ef0ae;
}

.badge-warn {
    background: rgba(255, 200, 70, 0.2);
    color: #ffd166;
}

.files-meta {
    margin: 0.6rem 0 0.8rem;
    color: #dadada;
    font-size: 0.9rem;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
}

.files-table th,
.files-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.6rem 0.55rem;
}

.files-table thead {
    background: rgba(255, 255, 255, 0.06);
}

.files-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin: 0.8rem 0 1rem;
}

.files-toolbar .custom-file-input {
    flex: 1;
    min-width: 220px;
}

.files-toolbar input[type="file"] {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.files-actions-col {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.mini-btn {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1;
}

.mini-btn.danger {
    background: #b00020;
}

.mini-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.device-select-wrap {
    display: grid;
    gap: 0.55rem;
}

.bulk-send-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
    text-align: center;
}

.bulk-send-form h2 {
    text-align: center;
    width: 100%;
}

.bulk-send-form .devices-table {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.bulk-preview-col {
    display: flex;
    align-items: end;
}

.bulk-preview-col .preview {
    width: 180px;
}

.bulk-submit {
    white-space: nowrap;
}

.bulk-header-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    justify-content: center;
}

.bulk-header-row .bulk-file-col {
    flex: 1 1 260px;
}

.bulk-header-row .bulk-preview-col {
    flex: 0 0 200px;
    justify-content: flex-end;
}

.select-all-line {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 1.08rem;
    margin: 0.5rem 0 0.7rem 0;
}

.select-all-line input[type="checkbox"] {
    appearance: none;
    width: 1.35em;
    height: 1.35em;
    border: 2.2px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    display: inline-block;
    position: relative;
    transition: border-color 0.18s, box-shadow 0.18s;
    cursor: pointer;
    margin-right: 0.18em;
    vertical-align: middle;
}

.select-all-line input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent-dark);
}

.select-all-line input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 0.32em;
    top: 0.08em;
    width: 0.35em;
    height: 0.7em;
    border: solid #fff;
    border-width: 0 0.18em 0.18em 0;
    transform: rotate(45deg);
    pointer-events: none;
    box-sizing: border-box;
}

.select-all-line input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.mini-label {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 600;
}

.bulk-send-form .mini-label {
    text-align: center;
    width: 100%;
}

.device-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem;
    background: #fff7f1;
    border-radius: 10px;
    padding: 0.7rem;
}

.device-check-grid label {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
    background: #fff;
    border: 1px solid #f0e3d7;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
}

.device-controls-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.9rem;
    margin: 0 0 1rem;
}

.device-bulk-form {
    background: #fff7f1;
    border-radius: 12px;
    padding: 0.8rem;
    display: grid;
    gap: 0.6rem;
}

.device-row-controls {
    display: grid;
    gap: 0.3rem;
    min-width: 160px;
}

.action-btn {
    width: 100%;
    padding: 0.42rem 0.8rem;
    line-height: 1;
    font-size: 0.86rem;
}

.action-select {
    width: 100%;
    padding: 0.42rem 0.8rem;
    font-size: 0.86rem;
    line-height: 1;
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
    border: 1px solid #d6d0c7;
    background: #fffcf9;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-select:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(209, 79, 46, 0.15);
}

.delete-form {
    margin-top: 0.5rem;
}

.devices-table td {
    vertical-align: top;
}

.device-edit-popover {
    position: relative;
}

.device-edit-popover summary {
    cursor: pointer;
    font-weight: 700;
    color: #2a2a2a;
    list-style: none;
    font-size: 0.92rem;
}

.devices-table th,
.devices-table td {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.device-edit-popover summary::-webkit-details-marker {
    display: none;
}

.device-edit-popover[open]>form {
    position: absolute;
    right: 0;
    top: 1.8rem;
    width: min(430px, 78vw);
    z-index: 40;
    background: #fff;
    border: 1px solid #eaded0;
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(35, 24, 12, 0.18);
    padding: 0.85rem;
}

.device-edit-popover[open]>form .grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.history-filters {
    margin-bottom: 0.8rem;
}

.history-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.dup-wrap {
    margin: 0.5rem 0 0.95rem;
    padding: 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 0.6rem;
}

.dup-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.4rem;
    max-height: 160px;
    overflow: auto;
}

.dup-wrap select {
    width: 100%;
    margin-top: 0.35rem;
}

@media (max-width: 980px) {
    .bulk-send-form {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 720px) {
    .bulk-send-form {
        grid-template-columns: 1fr;
    }

    .bulk-preview-col .preview {
        width: 100%;
    }

    .device-row-controls {
        min-width: 0;
    }
}

@media (max-width: 920px) {
    .devices-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .devices-table thead {
        display: none;
    }

    .devices-table tbody,
    .devices-table tr,
    .devices-table td {
        display: block;
        width: 100%;
    }

    .devices-table tr {
        background: #fff;
        border: 1px solid #efe3d6;
        border-radius: 14px;
        box-shadow: 0 8px 16px rgba(35, 24, 12, 0.08);
        padding: 0.55rem 0.75rem;
        margin-bottom: 0.9rem;
    }

    .devices-table td {
        border-bottom: 1px dashed #f1e6db;
        padding: 0.55rem 0;
    }

    .devices-table td:last-child {
        border-bottom: none;
    }

    .devices-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.78rem;
        letter-spacing: 0.02em;
        color: #766b63;
        margin-bottom: 0.28rem;
        font-weight: 700;
    }

    .device-edit-popover[open]>form {
        position: static;
        width: 100%;
        margin-top: 0.55rem;
        box-shadow: none;
        border: 1px solid #efe3d6;
    }
}

.device-col-select {
    width: 1%;
    white-space: nowrap;
}

.device-mass-checkbox {
    transform: translateY(1px);
}

.device-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.2rem;
    margin-bottom: 0.2rem;
    padding: 1.1rem 1.5rem 1.1rem 1.5rem;
    border-top: 1px solid #efe3d6;
    background: #fff7f1;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
}

.device-bulk-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Mejoras visuales para el formulario de subida de imágenes */
.upload-form-custom {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem 2.2rem;
    align-items: end;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: #fff7f1;
    border-radius: 10px;
    padding: 1.1rem 1.2rem 0.9rem 1.2rem;
    box-shadow: 0 2px 10px rgba(209, 79, 46, 0.06);
    border: 1px solid #f0e3d7;
    overflow: hidden;
}

.upload-form-custom label {
    font-weight: 700;
    color: #1b1a19;
    font-size: 1.01rem;
    margin-bottom: 0.1rem;
}

.upload-form-custom input {
    background: #fff;
    border: 1.5px solid #e6d7c7;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.98rem;
    color: #1b1a19;
    margin-top: 0.1rem;
    width: 100%;
    box-sizing: border-box;
}

.upload-btn-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Animación sutil para el footer y estilos de links */
.animated-footer {
    animation: fadein-footer 1.2s cubic-bezier(0.4, 0.2, 0.2, 1) 0.2s both;
    opacity: 0.92;
    transition: opacity 0.25s;
}

.animated-footer:hover {
    opacity: 1;
}


.footer-link,
.ignace-link {
    color: #1b1a19;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: color 0.18s, box-shadow 0.18s;
    border-radius: 4px;
    padding: 0 2px;
}

.footer-link,
.ignace-link {
    color: #fff7f1;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: color 0.18s;
}


.footer-link:hover,
.ignace-link:hover {
    color: #fff;
    text-decoration: underline;
    box-shadow: 0 0 0 2px #fff, 0 2px 8px 0 rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.08);
}

@keyframes fadein-footer {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 0.92;
        transform: translateY(0);
    }
}

/* Estilos adicionales para sección de programación */

.schedule-info-box {
    background: rgba(139, 92, 246, 0.08);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.2rem;
    margin: 1rem 0 1.5rem 0;
    border-radius: 8px;
}

.schedule-info-box p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--text);
}

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

.schedule-info-box li {
    margin: 0.4rem 0;
    line-height: 1.5;
    color: var(--text);
}

.schedule-info-box code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.field-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Dark mode para info box */
body.darkmode .schedule-info-box {
    background: rgba(139, 92, 246, 0.12);
}

body.darkmode .schedule-info-box code {
    background: rgba(255, 255, 255, 0.1);
}

body.darkmode .field-hint {
    color: #999;
}

/* ===== Días de la semana - Programación ===== */
.days-section {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

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

.days-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.days-toggle-btns {
    display: flex;
    gap: 0.4rem;
}

.btn-toggle-days {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 122, 61, 0.4);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-days:hover {
    background: var(--accent);
    color: #fff;
}

.days-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.day-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    user-select: none;
    background: rgba(255, 255, 255, 0.04);
}

.day-checkbox:hover {
    border-color: var(--accent);
    background: rgba(255, 122, 61, 0.1);
}

.day-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.day-checkbox input[type="checkbox"]:checked+span {
    color: var(--accent);
    font-weight: 600;
}

/* ===== Input hora 24h ===== */
.time-input-24h {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}
.log-console {
    background: #121212;
    color: #d9fdd3;
    border: 1px solid #2f2f2f;
    border-radius: 10px;
    padding: 0.9rem;
    margin: 0.6rem 0 0;
    font-size: 0.84rem;
    line-height: 1.35;
    max-height: 50vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== Responsive and contrast fixes ===== */
body {
    --text: var(--ink);
    --line: #efe3d6;
    --surface-soft: #fff7f1;
}

body.darkmode {
    --text: var(--ink);
    --line: rgba(255, 255, 255, 0.08);
    --surface-soft: #1b1d21;
}

.panel,
.panel h2,
.panel p,
.panel li,
.panel label,
.mini-label,
.field-hint,
.devices-table,
.devices-table th,
.devices-table td,
.schedules-table,
.schedules-table th,
.schedules-table td,
.inventory-table,
.inventory-table th,
.inventory-table td {
    color: var(--text);
}

.devices-table th,
.schedules-table th,
.inventory-table th {
    color: #695f57;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.devices-table tbody tr,
.schedules-table tbody tr {
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.devices-table tbody tr:hover,
.schedules-table tbody tr:hover {
    background: rgba(255, 247, 241, 0.78);
}

.device-bulk-actions,
.device-bulk-form,
.device-check-grid,
.upload-form-custom,
.schedule-info-box {
    background: var(--surface-soft);
    color: var(--text);
}

.action-btn,
.device-row-controls button,
.device-bulk-buttons button,
.bulk-submit,
.ghost-link-btn {
    min-height: 42px;
}

.files-toolbar button,
.inventory-toolbar-actions button,
.days-toggle-btns button {
    min-height: 40px;
}

body.darkmode .devices-table tbody tr:hover,
body.darkmode .schedules-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

body.darkmode .device-bulk-actions,
body.darkmode .device-bulk-form,
body.darkmode .device-check-grid,
body.darkmode .upload-form-custom,
body.darkmode .schedule-info-box {
    background: var(--surface-soft);
}

body.darkmode .devices-table th,
body.darkmode .schedules-table th,
body.darkmode .inventory-table th,
body.darkmode .devices-table td::before,
body.darkmode .schedules-table td::before {
    color: #c2c9d2;
}

body.darkmode .files-toolbar input[type="file"] {
    background: rgba(255, 255, 255, 0.06);
    color: #f5f5f5;
}

/* Owner Selection Chips */
.owner-filter-wrapper {
    margin: 0.6rem 0 0.8rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    width: 100%;
}

.owner-chips-flex {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
    width: 100%;
}

.owner-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.owner-chip.inactive {
    background: rgba(255, 255, 255, 0.04);
    color: #a0a8b5;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.owner-chip.inactive:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.owner-chip.active {
    background: var(--accent);
    color: #fff;
    border: 1.5px solid var(--accent);
    box-shadow: 0 3px 10px rgba(209, 79, 46, 0.2);
}

.owner-chip.active:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 14px rgba(209, 79, 46, 0.35);
    transform: translateY(-1px);
}

.owner-chip-count {
    font-size: 0.72rem;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.05rem 0.35rem;
    border-radius: 6px;
    font-weight: 700;
}

.owner-chip.inactive .owner-chip-count {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a8b5;
}

.owner-chip.active .owner-chip-count {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

@media (max-width: 920px) {
    .container {
        padding: 0 1rem;
    }

    .devices-table,
    .schedules-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .devices-table thead,
    .schedules-table thead {
        display: none;
    }

    .devices-table tbody,
    .devices-table tr,
    .devices-table td,
    .schedules-table tbody,
    .schedules-table tr,
    .schedules-table td {
        display: block;
        width: 100%;
    }

    .devices-table tr,
    .schedules-table tr {
        background: #ffffff;
        color: var(--text);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 10px 18px rgba(35, 24, 12, 0.08);
        padding: 0.75rem 0.9rem;
        margin-bottom: 0.9rem;
    }

    body.darkmode .devices-table tr,
    body.darkmode .schedules-table tr {
        background: #23262d;
        border-color: var(--line);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
    }

    .devices-table td,
    .schedules-table td {
        border-bottom: 1px dashed var(--line);
        padding: 0.62rem 0;
        color: var(--text);
    }

    .devices-table td:last-child,
    .schedules-table td:last-child {
        border-bottom: none;
    }

    .devices-table td::before,
    .schedules-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.32rem;
        font-size: 0.77rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        color: #766b63;
    }

    .device-row-controls,
    .device-row-controls form,
    .device-bulk-buttons,
    .device-bulk-buttons button,
    .files-toolbar,
    .files-toolbar button,
    .inventory-toolbar-actions,
    .inventory-toolbar-actions button,
    .bulk-header-row,
    .days-header,
    .schedule-actions {
        width: 100%;
    }

    .admin-panel-grid,
    .admin-fields-row,
    .bulk-header-row,
    .files-toolbar,
    .inventory-toolbar,
    .inventory-toolbar-actions,
    .device-bulk-actions,
    .device-bulk-buttons,
    .days-header,
    .schedule-actions,
    .footer-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-panel-section {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .header-side,
    .session-card,
    .header-card,
    .bulk-preview-col,
    .bulk-preview-col .preview,
    .inventory-search-wrap,
    .ghost-link-btn,
    .action-btn,
    .device-row-controls button,
    .device-bulk-buttons button,
    .files-toolbar button,
    .inventory-toolbar-actions button,
    .days-toggle-btns button {
        width: 100%;
    }

    .site-header {
        padding: 1.5rem 0 1rem;
    }

    .panel {
        padding: 1.15rem 1rem;
        margin-bottom: 1.4rem;
    }

    .device-bulk-actions {
        padding: 1rem;
        border-radius: 14px;
    }

    .days-toggle-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }
}

@media (max-width: 640px) {
    .site-header h1 {
        font-size: 1.8rem;
    }

    .header-value {
        font-size: 1.35rem;
    }

    .bulk-header-row .bulk-preview-col {
        flex: 1 1 auto;
        justify-content: stretch;
    }

    .days-checkboxes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Glassmorphic floating modal popup for Demo request */
.demo-popup {
    position: fixed;
    bottom: 2.2rem;
    left: 2.2rem;
    z-index: 10000;
    max-width: 420px;
    width: calc(100% - 4.4rem);
    background: rgba(24, 20, 18, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(209, 79, 46, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(209, 79, 46, 0.15);
    border-radius: 16px;
    padding: 1.25rem;
    animation: slidein-popup 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes slidein-popup {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.demo-popup-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.demo-popup-icon {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(209, 79, 46, 0.15);
    color: #ff7a3d;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(209, 79, 46, 0.25);
    box-shadow: 0 0 10px rgba(209, 79, 46, 0.1);
}

.demo-popup-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    padding-right: 25px;
}

.demo-popup-text strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.demo-popup-text span {
    font-size: 0.9rem;
    color: #a5adbb;
    line-height: 1.4;
}

.demo-popup-btn {
    background: linear-gradient(135deg, #d14f2e 60%, #a33b21 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 1.1rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(209, 79, 46, 0.3);
    text-align: center;
    white-space: nowrap;
}

.demo-popup-btn:hover {
    background: linear-gradient(135deg, #ff7a3d 60%, #d14f2e 100%);
    box-shadow: 0 6px 18px rgba(209, 79, 46, 0.45);
    transform: translateY(-1px);
    text-decoration: none !important;
}

.demo-popup-btn:active {
    transform: translateY(0);
}

.demo-popup-close {
    position: absolute;
    top: -5px;
    right: -5px;
    background: transparent;
    border: none;
    color: #6b6b6b;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
}

.demo-popup-close:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.05);
}

@media (max-width: 640px) {
    .demo-popup {
        bottom: 1.2rem;
        left: 1.2rem;
        width: calc(100% - 2.4rem);
        max-width: 100%;
        padding: 1rem;
    }
    .demo-popup-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    .demo-popup-icon {
        display: none;
    }
    .demo-popup-text {
        padding-right: 15px;
        text-align: center;
    }
    .demo-popup-btn {
        width: 100%;
    }
    .demo-popup-close {
        top: -10px;
        right: -5px;
    }
}