/* suite/css/styles.css - Estilos Globales de la Suite Despieces */

:root {
    --bg: #090d16;
    --surface: #121826;
    --surface-hover: #1a2236;
    --border: #222f49;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --cyan: #00d2ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 0.75rem 0.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Pantallas Principales */
.screen-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================================
   PANTALLA 1: DASHBOARD DE PROYECTOS
   ========================================= */
.dashboard-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.2rem 0;
    flex-wrap: wrap;
}

.search-wrapper {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}

.search-wrapper input:focus {
    border-color: var(--primary);
}

.dashboard-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
    margin-top: 0.2rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.85rem;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
}

.project-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.project-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    word-break: break-word;
}

.project-card-dates {
    font-size: 0.73rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.3rem;
}

.project-card-client {
    font-size: 0.8rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.project-card-progress {
    background: #090d16;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.75rem;
}

.project-card-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.project-card-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 999px;
    transition: width 0.3s;
}

.project-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.75rem;
}

.btn-open-project {
    flex: 1;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.btn-open-project:hover {
    background: var(--primary-hover);
}

.btn-delete-project {
    background: transparent;
    border: 1px solid var(--border);
    color: #f87171;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-delete-project:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.empty-dashboard {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.empty-dashboard-icon {
    font-size: 2.8rem;
    opacity: 0.6;
}

/* =========================================
   PANTALLA 2: ESPACIO DE TRABAJO (WORKSPACE)
   ========================================= */
.workspace-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ws-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.btn-back-dashboard {
    background: #090d16;
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.btn-back-dashboard:hover {
    border-color: var(--primary);
    color: #60a5fa;
}

.ws-project-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ws-icon {
    font-size: 1.25rem;
}

.ws-title-group h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.ws-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ws-nav-tabs {
    display: flex;
    background: #090d16;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.ws-nav-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ws-nav-tab:hover {
    color: #fff;
}

.ws-nav-tab.active {
    background: #1e293b;
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.excel-banner-context {
    background: #090d16;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.excel-banner-icon {
    font-size: 1.5rem;
}

/* Tarjeta Paso Siguiente */
.ws-step-actions-card {
    background: linear-gradient(135deg, #121826 0%, #1a253d 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    margin-top: 0.5rem;
}

.ws-step-actions-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-badge {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

.ws-step-actions-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-step-action {
    flex: 1;
    min-width: 240px;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.btn-step-action-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: 1px solid #60a5fa;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-step-action-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

.btn-step-action-secondary {
    background: #090d16;
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-step-action-secondary:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    transform: translateY(-2px);
}

/* Selector de Proveedor / Centro de Optimización */
.provider-selector-card {
    background: #090d16;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.provider-pills {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.provider-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.provider-pill:hover:not(.disabled) {
    border-color: var(--primary);
    color: #fff;
}

.provider-pill.active {
    background: #1e293b;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.provider-pill.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #0c121e;
    border-style: dashed;
}

/* Botones Comunes */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-pwa-install {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #60a5fa;
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s;
}

.btn-pwa-install:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.45);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-ghost:hover {
    color: #fff;
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Badges */
.badge-tag {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge-mat {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.72rem;
}

.badge-mueble {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.72rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-done {
    color: #34d399;
    font-weight: 700;
    font-size: 0.72rem;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.badge-partial {
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.72rem;
    background: rgba(59, 130, 246, 0.15);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.badge-pending {
    color: #94a3b8;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.badge-issue {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.72rem;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    font-size: 0.85rem;
}

/* =========================================
   MÓDULO 1: PROYECTO
   ========================================= */
.project-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.project-name-wrapper label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.project-name-wrapper input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
}

.project-name-wrapper input:focus {
    border-color: var(--primary);
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
}

.dropzone h3 {
    font-size: 1rem;
    font-weight: 700;
}

.dropzone p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Muebles Lista */
.muebles-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mueble-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mueble-card.has-decimal-error {
    border: 1.5px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.22);
}

.mueble-card-decimal-alert {
    background: rgba(127, 29, 29, 0.4);
    border: 1px solid rgba(239, 68, 68, 0.6);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.45rem;
}

.mueble-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mueble-card-icon {
    font-size: 1.5rem;
}

/* Metadata Form */
.meta-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.input-group label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.input-group input {
    width: 100%;
    background: #090d16;
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
}

/* =========================================
   MÓDULO 2: CONVERSOR EXCEL
   ========================================= */
.excel-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mueble-select-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mueble-select-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.alert-box {
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
}

.alert-ok {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-warn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.btn-download-excel {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 0.9rem 1.25rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-download-excel:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-download-excel:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* =========================================
   MÓDULO 3: ARMADO Y CONTROL DE PIEZAS
   ========================================= */
.finder-box {
    background: linear-gradient(180deg, #162032 0%, var(--surface) 100%);
    border: 1px solid #2b3d5c;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.finder-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #93c5fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inputs-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dim-input-wrapper {
    flex: 1;
    position: relative;
}

.dim-input-label {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dim-input {
    width: 100%;
    background: #090d16;
    border: 2px solid #2b3d5c;
    color: #fff;
    padding: 1.15rem 0.65rem 0.35rem 0.65rem;
    border-radius: 10px;
    font-size: 1.45rem;
    font-weight: 800;
    outline: none;
    text-align: center;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.dim-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.input-mult {
    font-size: 1.4rem;
    color: #64748b;
    font-weight: 800;
    user-select: none;
}

.btn-clear-search {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 44px;
    height: 48px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-clear-search:hover {
    color: #fff;
    background: var(--surface-hover);
}

/* Guía visual de cantos */
.finder-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: #94a3b8;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.leg-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.leg-line {
    display: inline-block;
    height: 3px;
    width: 18px;
    border-radius: 2px;
}

.leg-line.delg {
    background: #10b981;
}

.leg-line.grue {
    background: #ef4444;
    height: 5px;
}

/* Match Result Banner */
.match-banner {
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    background: rgba(30, 58, 138, 0.25);
    border: 1px solid #3b82f6;
    border-radius: 12px;
    padding: 0.75rem;
}

.match-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    transition: all 0.2s;
}

.match-item.is-ready {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.06);
}

.match-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 280px;
}

.piece-canvas-card {
    background: #090d16;
    border-radius: 8px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
    max-width: 380px;
}

.piece-canvas-mini {
    padding: 3px;
    border-radius: 6px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-info {
    flex: 1;
}

.match-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.match-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.badge-edge {
    background: #162032;
    color: #cbd5e1;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
}

.badge-edge.is-thick {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
    font-weight: 700;
}

.badge-edge.is-thin {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.45);
    font-weight: 700;
}

.match-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
    justify-content: center;
}

.match-actions-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    justify-content: flex-end;
}

/* Cápsula Stepper (Opción 1) */
.capsule-stepper {
    display: inline-flex;
    align-items: center;
    background: #090d16;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    padding: 0.15rem 0.35rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    user-select: none;
    transition: all 0.2s;
}

.capsule-stepper.is-complete {
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.capsule-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, transform 0.1s, color 0.15s;
}

.capsule-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    color: #38bdf8;
}

.capsule-btn:active:not(:disabled) {
    transform: scale(0.88);
}

.capsule-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.capsule-val-container {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-width: 54px;
    padding: 0 0.4rem;
    cursor: pointer;
}

.capsule-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--cyan);
    letter-spacing: -0.5px;
    line-height: 1;
}

.capsule-stepper.is-complete .capsule-val {
    color: #34d399;
}

.capsule-total {
    font-size: 0.82rem;
    font-weight: 700;
    color: #94a3b8;
    margin-left: 2px;
}

.btn-batch-all {
    background: #10b981;
    color: #022c22;
    border: none;
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-batch-all:hover {
    background: #059669;
    color: #fff;
}

.btn-batch-all:active {
    transform: scale(0.96);
}

.btn-match-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-match-warn:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* Progress & KPI Chips */
.progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #090d16;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.kpi-chip {
    background: #0b101c;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.kpi-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    background: #111827;
}

.kpi-chip:active {
    transform: scale(0.96);
}

.kpi-chip.chip-ok.active {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.14);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.kpi-chip.chip-pend.active {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.14);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.35);
}

.kpi-chip.chip-warn.active {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.kpi-chip.chip-miss.active {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.14);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.kpi-chip-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-chip-val {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

.chip-ok .kpi-chip-val { color: var(--success); }
.chip-pend .kpi-chip-val { color: var(--text-muted); }
.chip-warn .kpi-chip-val { color: var(--warning); }
.chip-miss .kpi-chip-val { color: var(--danger); }

/* Barra de control de lista */
.list-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    background: #0b101c;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    flex-wrap: wrap;
}

.filter-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-tab.active {
    background: #1e293b;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.view-switcher {
    display: inline-flex;
    background: #0b101c;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.view-btn.active {
    background: #1e293b;
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.mueble-filter-wrapper select {
    background: #0b101c;
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
}

/* Grid de Tarjetas (Estrictamente 2 columnas) */
.pieces-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .pieces-grid {
        grid-template-columns: 1fr;
    }
}

.piece-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: all 0.2s;
}

.piece-card.is-done {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.03);
}

.piece-card.is-warn {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.04);
}

.piece-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.4rem;
}

.piece-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.btn-card-warn {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.piece-card-visual {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0;
}

.piece-card-dims {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4rem 0.6rem;
    background: #090d16;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.piece-card-edges {
    font-size: 0.72rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.piece-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tally-stepper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-step {
    width: 28px;
    height: 28px;
    background: #090d16;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-step:active {
    transform: scale(0.92);
}

.btn-step-reset {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    font-size: 0.8rem;
    margin-left: 0.2rem;
    transition: all 0.15s;
}

.btn-step-reset:hover {
    background: #ef4444;
    color: #fff;
}

.btn-card-check {
    background: #1e293b;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-card-check.is-done {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: #34d399;
}

/* Tabla Compacta */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.table-responsive {
    overflow-x: auto;
    max-height: 520px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
    min-width: 700px;
}

th {
    background: #0b101c;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

tr.row-done td strong {
    color: #34d399;
}

tr.row-warn td {
    background: rgba(245, 158, 11, 0.06);
}

.btn-row-action {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: -1.25rem;
    background: var(--surface);
    z-index: 20;
    padding: 0.5rem 0;
    margin-top: -0.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.tag-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.tag-btn {
    background: #090d16;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}

.tag-btn.selected {
    background: var(--warning);
    color: #000;
    border-color: var(--warning);
    font-weight: 700;
}

.report-box {
    background: #090d16;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    font-family: monospace;
    font-size: 0.78rem;
    white-space: pre-wrap;
    max-height: 260px;
    overflow-y: auto;
    line-height: 1.4;
    color: #e2e8f0;
}

.btn-whatsapp {
    background: #25d366;
    color: #000;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Historial de Proyectos */
.project-history-item {
    background: #090d16;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-history-item.is-active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    border: 1px solid #3b82f6;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================
   MECANIZADOS Y CORTES ESPECIALES
   ========================================= */
.modal-content-lg {
    max-width: 840px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

.modal-content-lg.modal-mecanizados-layout {
    max-width: 980px !important;
    width: 96% !important;
    height: 90vh !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.25rem 1.4rem 1rem 1.4rem !important;
    overflow: hidden !important;
    gap: 0 !important;
    box-sizing: border-box !important;
}

.mecanizados-header-fixed {
    flex-shrink: 0;
    margin-bottom: 0.4rem;
}

.mecanizados-scroll-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 140px;
    padding-right: 0.35rem;
    margin: 0.35rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mecanizados-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    align-items: start;
}

@media (max-width: 768px) {
    .mecanizados-cards-grid {
        grid-template-columns: 1fr;
    }
}

.mecanizados-match-card.is-complete-card {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.04);
}

.mecanizados-footer-fixed {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
    background: var(--surface);
    margin-top: auto;
}

.mecanizados-summary-scroll {
    max-height: 110px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 0.2rem;
}

.btn-mecanizados {
    background: #1e293b;
    border: 1px solid #f59e0b;
    color: #fef08a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-mecanizados:hover {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-ranura-tag {
    background: #451a03 !important;
    color: #fde68a !important;
    border: 1px solid #b45309 !important;
}

.badge-corte-tag {
    background: #3b0764 !important;
    color: #f5d0fe !important;
    border: 1px solid #a855f7 !important;
}

.mecanizados-match-card {
    background: #090d16;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.95rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: border-color 0.2s;
}

.mecanizados-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.55rem;
}

.mecanizados-visual-center {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.3rem 0;
    background: transparent;
}

.mecanizados-match-card.has-mecanizado {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.03);
}

.side-selector-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.side-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.side-btn:hover {
    background: #374151;
    color: #fff;
}

.side-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #000;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.mecanizados-dim-inputs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.mecanizados-dim-input {
    width: 48px;
    background: #090d16;
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.25rem 0.35rem;
    border-radius: 5px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.mecanizados-corte-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mecanizados-corte-input {
    background: #090d16;
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    min-width: 200px;
    outline: none;
}

.mecanizados-corte-input:focus {
    border-color: #a855f7;
}

/* =========================================
   PREVISUALIZACIÓN OFICIAL MARTIN
   ========================================= */
.excel-preview-wrapper {
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
}

.excel-preview-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.excel-preview-scroll {
    max-height: 380px;
    overflow: auto;
}

.excel-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    text-align: center;
    white-space: nowrap;
}

.excel-preview-table th {
    background: #090d16;
    color: #94a3b8;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.55rem 0.6rem;
    border-bottom: 2px solid var(--border);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.excel-preview-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.excel-preview-table tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

.excel-preview-table tr.row-warn td {
    color: #f87171;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.08);
}

.excel-preview-table .cell-highlight {
    color: #fef08a;
    font-weight: 800;
}

.excel-preview-table .cell-correlativo {
    color: #93c5fd;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.4);
}

/* Micro-interacción Botón [ R ] en SVG 4 Lados */
.svg-r-btn {
    cursor: pointer;
    user-select: none;
}

.svg-r-btn rect {
    transition: opacity 0.12s ease, filter 0.12s ease;
}

.svg-r-btn:hover rect {
    filter: brightness(1.25);
}

.svg-r-btn:active rect {
    opacity: 0.7;
}

