/* --- RESET Y GENERAL --- */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #e9ebee; margin: 0; padding: 20px; display: flex; gap: 20px; height: 100vh; box-sizing: border-box; }

/* --- BLOQUEO --- */
#login-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:#111; z-index:9999; display:flex; flex-direction:column; justify-content:center; align-items:center; color:white; }
.login-box { text-align: center; }
.login-box input { padding:10px; font-size:18px; text-align:center; border-radius:5px; border:none; margin-bottom:15px; width: 200px; }
.login-box button { padding:10px 25px; background:#ff9900; border:none; font-weight:bold; cursor:pointer; border-radius:5px; font-size: 16px; width: 100%; }
.login-box button:hover { background:#e68a00; }
#error-msg { color:#ff5555; display:none; margin-top:10px; font-weight:bold; }

/* --- PANEL --- */
.controls { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 380px; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.brand-header { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid #1f75fe; padding-bottom: 10px; margin-bottom: 5px; }
.brand-header h2 { margin: 0; color: #333; font-size: 1.4rem; }
.brand-header small { color: #1f75fe; font-weight: bold; }

.ai-zone { background: #222; color: white; padding: 10px; border-radius: 6px; margin-bottom: 10px; border: 1px solid #444; }
.ai-title { font-size: 11px; font-weight: bold; color: #ff9900; text-transform: uppercase; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.ai-input { width: 100%; height: 50px; background: #333; border: 1px solid #555; color: #fff; font-size: 11px; padding: 5px; box-sizing: border-box; resize: none; border-radius: 4px; }
.ai-row { display: flex; gap: 5px; margin-top: 5px; }
.btn-ai { background: #ff9900; color: black; border: none; padding: 8px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 11px; flex-grow: 1; transition: 0.2s; }
.btn-ai:hover { background: #e68a00; }
.btn-ai:disabled { background: #555; color: #888; cursor: wait; }

.section-title { font-size: 10px; font-weight: 800; color: #1f75fe; text-transform: uppercase; margin-top: 10px; letter-spacing: 1px; }
.input-group input, .input-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 13px; transition: 0.2s; }
.input-group input:focus { border-color: #1f75fe; outline: none; background: #f0f7ff; }
input[type="file"] { background: #f1f1f1; padding: 8px; font-size: 11px; cursor: pointer; }

#compat-alert { display: none; padding: 10px; border-radius: 6px; font-size: 12px; font-weight: bold; margin-bottom: 10px; text-align: center; }
.compat-error { background-color: #ffebee; color: #c62828; border: 1px solid #c62828; }
.compat-ok { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #2e7d32; }

.preset-buttons { display: flex; gap: 5px; margin-bottom: 5px; }
.btn-preset { flex: 1; padding: 6px; font-size: 10px; background: #f1f1f1; border: 1px solid #ccc; cursor: pointer; border-radius: 4px; transition: 0.2s; font-weight: bold; color: #555; }
.btn-preset:hover { background: #1f75fe; color: white; border-color: #1f75fe; }
.input-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.input-grid input { text-align: center; padding: 4px; font-size: 10px; }

.checkbox-group { display: flex; align-items: center; justify-content: space-between; background: #f8f9fa; padding: 8px; border-radius: 4px; border: 1px solid #eee; }
.checkbox-group label { margin: 0; font-size: 12px; font-weight: 600; cursor: pointer; }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; font-size: 11px; }

.price-input { font-size: 18px !important; font-weight: bold; color: #1f75fe; padding: 10px !important; text-align: center; }
.btn-download { background-color: #1f75fe; color: white; border: none; padding: 15px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: bold; margin-top: 15px; transition: background 0.3s; box-shadow: 0 4px 6px rgba(31, 117, 254, 0.2); }
.btn-download:hover { background-color: #1558c0; transform: translateY(-1px); }
.btn-wsp { background-color: #25D366; color: white; border: none; padding: 15px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: bold; margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.3s; }
.btn-wsp:hover { background-color: #128C7E; }

/* --- PREVIEW --- */
.preview-container { flex-grow: 1; background: #cfd8dc; border-radius: 8px; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 40px; }
#cotizacion { background: white; width: 1100px; padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); position: relative; box-sizing: border-box; }

.header-container { display: flex; gap: 20px; margin-bottom: 25px; align-items: stretch; }
.logo-area { width: 180px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.logo-area img { max-width: 100%; max-height: 160px; object-fit: contain; }

.table-area { flex-grow: 1; }
table { width: 100%; border-collapse: collapse; border: 2px solid #2e75b6; font-size: 14px; }
th { background-color: #2e75b6; color: white; padding: 10px; text-align: left; border: 1px solid #2e75b6; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
td { padding: 8px 12px; border: 1px solid #ccc; color: #333; font-weight: 500; }
td[contenteditable="true"]:hover { background-color: #fffde7; cursor: text; border: 1px dashed #fbc02d; }
td[contenteditable="true"]:focus { background-color: #fff9c4; outline: none; border: 1px solid #fbc02d; }
.col-componente { width: 22%; font-weight: 700; background-color: #f4f8ff; color: #2e75b6; }

.case-preview-area { width: 260px; flex-shrink: 0; border: 2px solid #2e75b6; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; min-height: 220px; }
.case-header { background-color: #2e75b6; color: white; width: 100%; text-align: center; padding: 6px; font-weight: bold; font-size: 11px; position: absolute; top: 0; left: 0; }
#case-result-img { max-width: 90%; max-height: 200px; object-fit: contain; margin-top: 25px; display: none; }
#case-placeholder { color: #ccc; font-weight: bold; font-size: 16px; margin-top: 20px; }

.price-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 25px; }
.price-bar { padding: 10px 20px; color: white; font-weight: bold; border-radius: 6px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.bar-red { background: linear-gradient(90deg, #d32f2f, #b71c1c); }
.bar-blue { background: linear-gradient(90deg, #1976d2, #0d47a1); }
.bar-gold { background: linear-gradient(90deg, #fbc02d, #f57f17); }

.extra-info-container { display: flex; gap: 20px; margin-top: 0; width: 100%; }
.gaming-box, .work-box { border-radius: 8px; overflow: hidden; border: 2px solid; background: white; }
.gaming-box { flex: 6; border-color: #333; }
.gaming-box .box-header { background: #333; color: white; padding: 8px; text-align: center; font-weight: bold; font-size: 13px; text-transform: uppercase; }
.fps-grid { display: flex; justify-content: space-between; padding: 10px; gap: 8px; }
.fps-item { position: relative; flex: 1; height: 90px; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background-color: #333; background-size: cover; background-position: center; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.fps-item::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8)); z-index: 1; }
.fps-item span { position: relative; z-index: 2; text-shadow: 0 2px 4px rgba(0,0,0,0.9); }
.game-name { display: block; font-size: 11px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.fps-val { display: block; font-size: 22px; font-weight: 900; color: #fff; line-height: 1; }
.fps-sub { font-size: 9px; color: #ddd; font-weight: 600; }

.bg-fortnite { background-image: url('img/fortnite.jpg'); }
.bg-valorant { background-image: url('img/valorant.jpg'); }
.bg-gta { background-image: url('img/gta.jpg'); }
.bg-warzone { background-image: url('img/warzone.jpg'); }
.bg-cs2 { background-image: url('img/cs2.jpg'); }

.work-box { flex: 4; border-color: #2e7d32; }
.work-box .box-header { background: #2e7d32; color: white; padding: 8px; text-align: center; font-weight: bold; font-size: 13px; text-transform: uppercase; }
.work-grid { padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.work-card { position: relative; height: 40px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; background-color: #2e7d32; background-size: cover; background-position: center; border: 1px solid #ccc; }
.work-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.4)); z-index: 1; }
.work-card span { position: relative; z-index: 2; }
.work-name { color: white; font-weight: bold; font-size: 12px; text-shadow: 0 1px 3px black; }
.work-status { font-size: 16px; }

.bg-stream { background-image: url('img/streaming.jpg'); }
.bg-video { background-image: url('img/video.jpg'); }
.bg-3d { background-image: url('img/render.jpg'); }
.bg-design { background-image: url('img/design.jpg'); }
.bg-office { background-image: url('img/office.jpg'); }

.status-ok::after { content: '✅'; }
.status-fail::after { content: '❌'; filter: grayscale(1); }
.is-disabled::before { background: rgba(0,0,0,0.85) !important; }
.is-disabled .work-name { color: #888; }

.footer-terms { text-align: center; font-size: 11px; margin-top: 30px; line-height: 1.5; color: #555; border-top: 1px solid #eee; padding-top: 15px; }
.highlight-green { color: #2e7d32; font-weight: bold; }
.highlight-red { color: #c62828; font-weight: bold; }