:root {
    --bg: #050505;
    --card-bg: #0f0f0f;
    --red-main: #ff3e3e;
    --red-dim: #4a0000;
    --text: #e0e0e0;
    --border-color: #222;
}

body { margin: 0; font-family: 'Segoe UI', sans-serif; background-color: var(--bg); color: var(--text); }
.main-layout { padding: 40px; max-width: 1300px; margin: 0 auto; }

.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.glitch-text { font-size: 1.8rem; font-weight: 900; color: var(--red-main); letter-spacing: 2px; line-height: 1; }

.stats-bar { font-size: 0.7rem; color: #666; font-weight: bold; margin-top: 5px; letter-spacing: 1px; }
#count-pending {
	color: var(--red-main); 
	font-size: 20px;
	}
#count-done {
	color: #2ecc71; 
	font-size: 20px;
	}
	

.header-actions { display: flex; align-items: center; gap: 20px; }
.add-team-box { display: flex; gap: 10px; }
#team-input { background: #1a1a1a; border: 1px solid var(--border-color); padding: 12px 15px; color: white; border-radius: 4px; outline: none; }
.btn-add-inline { background: var(--red-main); color: white; border: none; padding: 0 20px; border-radius: 4px; font-weight: bold; cursor: pointer; }

.btn-clean { background: #111; color: #555; border: 1px solid #333; padding: 10px 15px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-clean:hover { color: var(--red-main); border-color: var(--red-main); }

.table-frame { background: var(--card-bg); border: 1px solid var(--border-color); overflow-x: auto; margin-bottom: 40px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 15px; text-align: left; background: #000; color: var(--red-main); font-size: 0.75rem; border-bottom: 2px solid var(--red-dim); }
td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); }

.edit-name { background: transparent; border: none; color: white; font-weight: bold; font-family: inherit; width: 150px; outline: none; }
.progress-container { width: 80px; height: 8px; background: #1a1a1a; border-radius: 10px; border: 1px solid #222; overflow: hidden; }
.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--red-main);
    border-radius: 10px;
    transition: background 0.4s ease;
}


.cb-red input { display: none; }
.cb-red span { display: inline-block; width: 20px; height: 20px; background: #1a1a1a; border: 1px solid var(--border-color); border-radius: 4px; position: relative; cursor: pointer; }
.cb-red input:checked + span::after { content: "✓"; position: absolute; color: var(--red-main); left: 4px; top: 0; }

.finish-btn { background: transparent; border: 1px solid #333; color: #444; padding: 5px 10px; cursor: not-allowed; font-size: 0.7rem; border-radius: 4px; opacity: 0.5; font-weight: bold; }
.finish-btn.ready-to-finish { border-color: #ccc; color: #eee; cursor: pointer; opacity: 1; }

.delete-row-btn { background: transparent; border: 1px solid var(--red-main); color: var(--red-main); padding: 5px 10px; cursor: pointer; font-size: 0.7rem; border-radius: 4px; font-weight: bold; }
.delete-row-btn:hover { background: var(--red-main); color: white; }

.row-finished td:nth-child(-n+8) { opacity: 0.3; filter: grayscale(1); }
.row-finished td:nth-child(9) { opacity: 1 !important; filter: none !important; }
.row-finished .finish-btn { opacity: 1 !important; filter: grayscale(0) !important; color: var(--red-main); border-color: var(--red-main); cursor: pointer; }

.summary-box { background: #000; border: 1px solid var(--border-color); padding: 15px; margin-top: 10px; min-height: 50px; }
.summary-item { margin-bottom: 10px; font-family: 'Consolas', monospace; display: flex; align-items: center; }
.summary-name { color: var(--red-main); font-weight: bold; min-width: 100px; }
.summary-note-input { background: transparent; border: none; border-bottom: 1px dashed #333; color: #ccc; flex-grow: 1; outline: none; padding-left: 10px; font-family: inherit; }

.notes-header-flex { display: flex; justify-content: space-between; align-items: center; }
.btn-date { background: transparent; border: 1px solid #444; color: #888; font-size: 0.6rem; padding: 4px 8px; cursor: pointer; border-radius: 3px; }
.btn-date:hover { border-color: var(--red-main); color: var(--red-main); }

#global-notes { width: 100%; height: 100px; background: #000; color: #ccc; border: 1px solid #222; border-left: 4px solid var(--red-main); padding: 15px; box-sizing: border-box; resize: vertical; margin-top: 10px; }
.notes-header { color: var(--red-main); font-size: 0.8rem; font-weight: bold; }

/* CONTENEDOR GRID */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* TARJETA */
.team-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--red-main);
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: 0.2s ease;
}

.team-card:hover {
    border-color: var(--red-main);
    box-shadow: 0 0 12px rgba(255, 62, 62, 0.2);
}

/* CABECERA */
.card-header {
    font-weight: bold;
    color: var(--red-main);
    margin-bottom: 10px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* TEXTAREA */
.card-textarea {
    width: 100%;
    height: 80px;
    background: #000;
    border: 1px solid #222;
    border-left: 3px solid var(--red-main);
    color: #ccc;
    padding: 10px;
    resize: vertical;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    box-sizing: border-box;
    transition: 0.2s;
}

.card-textarea:focus {
    outline: none;
    border-color: var(--red-main);
    box-shadow: 0 0 5px rgba(255, 62, 62, 0.4);
}

/* FOOTER */
.card-footer {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* TEXTO INVENTARIO */
.footer-q {
    font-size: 0.7rem;
    color: #777;
    letter-spacing: 1px;
}

/* SWITCH */
.binary-switch {
    display: flex;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.binary-switch button {
    background: transparent;
    border: none;
    color: #555;
    font-size: 0.7rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: 0.2s;
}

.binary-switch button:hover {
    color: var(--red-main);
}

/* ACTIVO */
.binary-switch button.active {
    background: var(--red-main);
    color: white;
}
.card-textarea::placeholder {
    color: #555;
    font-style: italic;
}
.progress-text {
    font-size: 0.7rem;
    color: #888;
    margin-top: 5px;
    font-family: 'Consolas', monospace;
}
/* =========================
   PROGRESO ANIMADO
========================= */

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--red-main);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: width;
}

/* =========================
   CHECKBOX (RECUPERA ESTILO)
========================= */

.cb-red input {
	position: absolute;
	opacity: 0;
}

.cb-red span {
    width: 18px;
    height: 18px;
    display: inline-block;
    border: 2px solid var(--red-main);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.cb-red input:checked + span {
    background: var(--red-main);
}

.cb-red input:checked + span::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    left: 3px;
    top: -1px;
}

/* =========================
   TARJETAS NOTAS
========================= */

.team-card {
    background: #1e1e1e;
    padding: 10px;
    border-radius: 8px;
}

.card-header {
    font-weight: bold;
    margin-bottom: 5px;
}

.card-textarea {
    width: 100%;
    min-height: 60px;
    background: #111;
    color: white;
    border: none;
    padding: 5px;
}
.inv-row {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.inv-btn {
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    background: #444;
    color: white;
}

.inv-btn:hover {
    background: #666;
}
.filter-box {
    display: flex;
    gap: 5px;
}

.filter-btn {
    padding: 6px 10px;
    border: none;
    background: #333;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 12px;
}

.filter-btn:hover {
    background: #555;
}

.filter-btn.active {
    background: var(--red-main);
}
.global-progress {
    width: 100%;
    height: 10px;
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.global-bar {
    height: 100%;
    width: 0%;
    background: var(--red-main);
    transition: width 0.3s ease, background 0.3s ease;
}

.global-text {
    font-size: 12px;
    margin-top: 4px;
}
.state-in-progress td,


.state-ready td,

.state-done td,


.state-reopened td {
    border-left: none;
}
/* animación pulse al actualizar */
@keyframes progressPulse {
    0% { transform: scaleX(1); filter: brightness(1); }
    50% { transform: scaleX(1.02); filter: brightness(1.4); }
    100% { transform: scaleX(1); filter: brightness(1); }

}

.progress-bar.animate {
    animation: progressPulse 0.4s ease;
}

.progress-bar[style*="width: 100%"] {
    background: #2ecc71;
}
/* =========================
   COMPLETADO: BOUNCE + GLOW
========================= */

@keyframes completeBounce {
    0% {
        transform: scaleX(1);
        box-shadow: 0 0 0 rgba(46, 204, 113, 0);
    }
    30% {
        transform: scaleX(1.08);
        box-shadow: 0 0 12px rgba(46, 204, 113, 0.6);
    }
    60% {
        transform: scaleX(0.98);
        box-shadow: 0 0 18px rgba(46, 204, 113, 0.8);
    }
    100% {
        transform: scaleX(1);
        box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
    }
}

.progress-bar.complete-bounce {
    animation: completeBounce 0.45s ease-out;
}
.progress-bar.complete-bounce {
    animation: completeBounce 0.45s ease-out;
}
.progress-bar.full {
    background: #2ecc71;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease;
}


.hidden {
  display: none;
}

.modal-content {
  background: #0f0f0f;
  border: 1px solid #222;
  border-radius: 10px;
  width: 420px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(0,0,0,0.8);
  animation: scaleIn 0.2s ease;
}

.modal-content h3 {
  margin: 0;
  padding: 15px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--red-main);
  border-bottom: 1px solid #222;
}

#history-list div {
  border-bottom: 1px solid #222;
  padding: 10px 0;
  font-size: 12px;
}
#history-list {
  padding: 10px 15px;
  overflow-y: auto;
  flex: 1;
}

/* ITEMS */
.history-item {
  padding: 10px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 12px;
  transition: 0.2s;
}

.history-item:hover {
  background: rgba(255,255,255,0.03);
}

.history-name {
  color: var(--red-main);
  font-weight: bold;
}

.history-meta {
  color: #777;
  font-size: 11px;
}

/* FOOTER */
.modal-actions {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-top: 1px solid #222;
}

.modal-actions button {
  background: #111;
  border: 1px solid #333;
  color: #aaa;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  transition: 0.2s;
}

.modal-actions button:hover {
  border-color: var(--red-main);
  color: var(--red-main);
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0 }
  to { transform: scale(1); opacity: 1 }
}
.inv-yes {
  color: #2ecc71;
  font-weight: bold;
}

.inv-no {
  color: #ff3e3e;
  font-weight: bold;
}
.filter-btn {
    transition: all 0.2s ease;
}
#search-input {
    background: #111;
    border: 1px solid #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin-left: 10px;
}
#edit-input {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  background: #000;
  border: 1px solid #333;
  color: white;
}
.edit-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 4px;
    padding: 2px 6px;
}

.edit-btn:hover {
    border-color: var(--red-main);
    color: var(--red-main);
}
tr.dragging {
    opacity: 0.5;
    background: #111;
}
.drag-invalid {
    outline: 2px solid red;
    opacity: 0.4;
}
.lock-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    cursor: pointer;
    padding: 3px 6px;
}

.locked-row {
    opacity: 0.6;
}
.export-btn.csv {
    right: 50px;
}
.export-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #111;
    border: 1px solid #333;
    color: #888;
    font-size: 10px;
    padding: 4px 8px;
    cursor: pointer;
}

.export-btn:hover {
    border-color: var(--red-main);
    color: var(--red-main);
}
.modal-actions button:first-child {
    border-color: #2ecc71;
    color: #2ecc71;
}
