:root {
    --term-bg: #0a0f1d;
    --term-panel: #121829;
    --neon-green: #00ff66;
    --neon-blue: #00d9ff;
    --text-white: #ffffff;
    --text-muted: #7f8c8d;
    --poster-red: #c92a2a;
    --poster-paper: #f1e4c3;
}

body {
    background-color: var(--term-bg);
    color: var(--neon-green);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
}

.terminal-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--term-panel);
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
    overflow: hidden;
}

.unified-view {
    max-width: 900px;
    margin: 0 auto;
}

.terminal-header {
    background: #1a233d;
    padding: 15px 20px;
    border-bottom: 2px solid var(--neon-blue);
}

.system-status {
    font-size: 12px;
    color: var(--neon-blue);
    margin-bottom: 5px;
}

.terminal-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text-white);
    letter-spacing: 2px;
}

.terminal-body {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex-wrap: wrap;
}

.form-section, .preview-section {
    flex: 1;
    min-width: 320px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 102, 0.2);
    position: relative;
}

.fully-wide {
    flex: 1;
    width: 100%;
}

h2 {
    font-size: 18px;
    margin-top: 0;
    color: var(--neon-blue);
    border-bottom: 1px solid var(--neon-blue);
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
}

input, textarea {
    width: 100%;
    padding: 10px;
    background: #070a14;
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    color: var(--text-white);
    font-family: inherit;
    box-sizing: border-box;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.5);
}

textarea {
    height: 80px;
    resize: none;
}

.btn-terminal {
    width: 100%;
    padding: 12px;
    background: var(--neon-green);
    color: #000;
    border: none;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 4px 0 #00b347;
    transition: all 0.1s ease;
    margin-bottom: 10px;
}

.btn-terminal:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-terminal.btn-edit-mode {
    background: var(--neon-blue);
    box-shadow: 0 4px 0 #0099b3;
}

.btn-terminal.btn-cancel {
    background: #555;
    color: #fff;
    box-shadow: 0 4px 0 #333;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 650px;
    overflow-y: auto;
}

.record-card {
    background: #172038;
    border: 1px solid var(--neon-blue);
    padding: 15px;
    border-radius: 4px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.record-thumb-box {
    width: 70px;
    height: 85px;
    border: 1px solid var(--neon-green);
    background: #070a14;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.record-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    font-size: 9px;
    color: var(--neon-green);
    font-weight: bold;
    padding: 2px;
}

.record-info {
    flex: 1;
    font-size: 12px;
    color: var(--text-white);
}

.record-info div { margin-bottom: 4px; }

.record-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-action {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    text-align: center;
}

.btn-action.btn-change { border-color: #ffaa00; color: #ffaa00; }
.btn-action.btn-print { border-color: var(--neon-green); color: var(--neon-green); }
.btn-action.btn-delete { border-color: #ff4d4d; color: #ff4d4d; }

/* TECLADO DE PANTALLA PIN PIN */
.pin-screen-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #0a0f1d;
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pin-box {
    background: #121829;
    border: 2px solid var(--neon-blue);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.3);
    width: 280px;
}

.pin-title {
    color: var(--neon-blue);
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

#pin-display {
    width: 100%;
    text-align: center;
    font-size: 24px;
    letter-spacing: 6px;
    background: #070a14;
    border: 1px solid var(--neon-green);
    color: var(--text-white);
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
    border-radius: 4px;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.keypad-grid button {
    background: #172038;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 15px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s;
}

.keypad-grid button:active {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 10px var(--neon-green);
}

/* VENTANA MODAL FLOTANTE */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--term-panel);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    width: 95%;
    max-width: 650px;
    padding: 25px;
    box-shadow: 0 0 25px rgba(0, 255, 102, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    color: #ff4d4d;
    font-size: 30px;
    cursor: pointer;
    font-weight: bold;
}

.modal-layout { display: flex; gap: 20px; margin-top: 20px; color: var(--text-white); }
.modal-photo-box {
    width: 150px; height: 180px;
    border: 2px solid var(--neon-blue);
    background: #070a14;
    display: flex; justify-content: center; align-items: center;
}
.modal-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.modal-fields { flex: 1; font-size: 14px; line-height: 1.6; }
.modal-fields div { margin-bottom: 8px; border-bottom: 1px solid rgba(0, 217, 255, 0.1); padding-bottom: 4px; }
.modal-fields strong { color: var(--neon-blue); }

#capture-area-element {
    background-color: #121829 !important;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

/* CARTEL DE IMPRESIÓN */
.poster-preview {
    display: none;
    background-color: var(--poster-paper);
    width: 500px;
    padding: 35px;
    border: 15px double #3a2d1f;
    color: #1a1105;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.poster-title-red {
    font-family: 'Arial Black', sans-serif;
    font-size: 38px;
    font-weight: 900;
    color: var(--poster-red);
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
    margin: 0;
}

.poster-subheader {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    color: #000;
    margin: 8px 0 20px 0;
    border-bottom: 4px solid #3a2d1f;
    width: 100%;
    text-align: center;
}

.poster-photo-container {
    width: 240px; height: 270px;
    border: 5px solid #3a2d1f;
    background-color: #e3d3a7;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; margin-bottom: 20px;
}

.poster-photo-container img {
    width: 100%; height: 100%; object-fit: cover;
    filter: grayscale(100%) contrast(130%);
}

.poster-photo-placeholder {
    font-size: 18px; font-weight: bold; text-align: center; color: #3a2d1f;
}

.poster-grid { width: 100%; font-size: 14px; line-height: 1.6; border-top: 2px solid #3a2d1f; padding-top: 15px; }
.poster-grid div { margin-bottom: 6px; }
.poster-grid strong { display: inline-block; width: 150px; text-transform: uppercase; }
.poster-antecedentes { margin-top: 15px; border-top: 1px dashed #3a2d1f; padding-top: 10px; font-style: italic; }

@media print {
    .terminal-container, .pin-screen-overlay, .modal-overlay { display: none !important; }
    body { background: white; padding: 0; }
    .poster-preview { display: flex !important; margin: 0 auto; }
}
