:root {
    --isw-puertas-rev: #27ae60;
    --isw-puertas-rev-light: #e8f8f0;
    --isw-puertas-rev-dark: #1e8449;
}

.isw-sc-rev { background: var(--isw-puertas-rev) !important; color: #fff !important; }
.isw-sh-rev { background: var(--isw-puertas-rev); color: #fff; }

.isw-rev-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,.55); z-index: 100000; display: none;
}
.isw-rev-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw; max-width: 1100px;
    height: 80vh; max-height: 700px;
    background: #fff; z-index: 100001; display: none;
    flex-direction: column; overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 2px solid #27ae60;
}
.isw-rev-modal.active, .isw-rev-overlay.active { display: flex; }
.isw-rev-overlay.active { display: block; }

.isw-rev-header {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px; height: 38px; min-height: 38px;
    background: var(--isw-puertas-rev); color: #fff;
    font-size: 13px; font-weight: 700;
}
.isw-rev-header-ref { font-family: 'JetBrains Mono', monospace; font-size: 13px; opacity: .9; }
.isw-rev-header-client { font-weight: 400; opacity: .8; }
.isw-rev-header-close {
    margin-left: auto; background: none; border: none; color: #fff;
    font-size: 20px; cursor: pointer; padding: 4px 8px;
}

.isw-rev-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: #f8f8f6; border-bottom: 1px solid #ddd;
}
.isw-rev-tbtn {
    padding: 6px 14px; font-size: 12px; font-weight: 600;
    border: none; cursor: pointer; color: #fff; font-family: inherit;
}
.isw-rev-tbtn-close-rev { background: var(--isw-puertas-rev); }
.isw-rev-tbtn-reopen { background: #7f8c8d; }
.isw-rev-tbtn-genpre { background: #3498db; }
.isw-rev-tbtn-print { background: #2c3e50; }
.isw-rev-tbtn:hover { opacity: .85; }

.isw-rev-summary {
    display: flex; gap: 16px; padding: 10px 16px;
    background: var(--isw-puertas-rev-light); border-bottom: 1px solid #c3e6cb;
}
.isw-rev-stat {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
}
.isw-rev-stat-num {
    display: inline-block; min-width: 28px; height: 28px;
    line-height: 28px; text-align: center; color: #fff;
    font-size: 14px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
}
.isw-rev-stat-total .isw-rev-stat-num { background: #2c3e50; }
.isw-rev-stat-done .isw-rev-stat-num { background: var(--isw-puertas-rev); }
.isw-rev-stat-warn .isw-rev-stat-num { background: #e67e22; }
.isw-rev-stat-skip .isw-rev-stat-num { background: #95a5a6; }
.isw-rev-stat-pend .isw-rev-stat-num { background: #e74c3c; }

.isw-rev-body {
    flex: 1; overflow-y: auto; padding: 0;
}

.isw-rev-inst-group {
    margin-bottom: 2px;
}
.isw-rev-inst-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; background: #f0f0ec; border-bottom: 1px solid #ddd;
    font-size: 14px; font-weight: 700; color: #2c3e50; cursor: pointer;
}
.isw-rev-inst-header i { color: #8E44AD; }
.isw-rev-inst-header .isw-rev-inst-count {
    margin-left: auto; font-size: 12px; font-weight: 400; color: #888;
}

.isw-rev-puerta {
    display: grid; grid-template-columns: 240px 1fr 1fr 120px;
    gap: 0; border-bottom: 1px solid #eee; min-height: 48px;
    align-items: stretch;
}
.isw-rev-puerta:hover { background: #fafaf8; }

.isw-rev-puerta-nombre {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; font-size: 13px; font-weight: 600; color: #333;
    border-right: 1px solid #eee;
}
.isw-rev-puerta-informe,
.isw-rev-puerta-correctivas {
    padding: 8px 12px; font-size: 12px; color: #555;
    border-right: 1px solid #eee;
}
.isw-rev-puerta-informe textarea,
.isw-rev-puerta-correctivas textarea {
    width: 100%; min-height: 60px; border: 1px solid #ddd; padding: 6px;
    font-size: 12px; font-family: inherit; resize: vertical;
}
.isw-rev-puerta-acciones {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px; padding: 8px;
}
.isw-rev-puerta-acciones button {
    width: 100%; padding: 4px 8px; font-size: 11px; font-weight: 600;
    border: none; cursor: pointer; font-family: inherit;
}

.isw-rev-badge {
    display: inline-block; padding: 2px 8px; font-size: 10px;
    font-weight: 700; color: #fff; font-family: 'JetBrains Mono', monospace;
}
.isw-rev-badge-pendiente { background: #e74c3c; }
.isw-rev-badge-revisada { background: var(--isw-puertas-rev); }
.isw-rev-badge-no_revisable { background: #95a5a6; }
.isw-rev-badge-incidencia { background: #e67e22; }

.isw-rev-puerta.no-revisable { opacity: .6; background: #f5f5f5; }
.isw-rev-puerta.no-revisable .isw-rev-puerta-informe textarea,
.isw-rev-puerta.no-revisable .isw-rev-puerta-correctivas textarea { background: #eee; }

.isw-rev-motivo-nr {
    display: none; margin-top: 4px;
}
.isw-rev-puerta.no-revisable .isw-rev-motivo-nr { display: block; }
.isw-rev-motivo-nr input {
    width: 100%; padding: 4px 6px; font-size: 11px; border: 1px solid #ccc;
}

.isw-rev-footer-modal {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px; background: #f8f8f6; border-top: 1px solid #ddd;
    font-size: 12px; color: #888;
}

.isw-rev-progress {
    flex: 1; height: 8px; background: #e0e0e0; overflow: hidden;
}
.isw-rev-progress-bar {
    height: 100%; background: var(--isw-puertas-rev); transition: width .3s;
}

.isw-rev-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-bottom: 1px solid #eee; cursor: pointer;
}
.isw-rev-card:hover { background: #fafaf8; }
.isw-rev-card-ref {
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    font-weight: 700; color: var(--isw-puertas-rev);
}
.isw-rev-card-client { font-size: 13px; color: #333; }
.isw-rev-card-meta { font-size: 11px; color: #999; margin-left: auto; }
.isw-rev-card-progress {
    width: 60px; height: 6px; background: #e0e0e0;
}
.isw-rev-card-progress-bar { height: 100%; background: var(--isw-puertas-rev); }

@media (max-width: 900px) {
    .isw-rev-puerta { grid-template-columns: 1fr; }
    .isw-rev-puerta-nombre { border-right: none; border-bottom: 1px solid #eee; }
    .isw-rev-puerta-informe, .isw-rev-puerta-correctivas { border-right: none; }
}
