/* ==========================================================================
   PCA - Programa de Cálculo de Aberturas / Aluminio - Hoja de Estilos de Nivel Superior
   Paleta: Dark Slate / Industrial Blueprint / Argentinian Aluminium Design System
   ========================================================================== */

:root {
    --bg-base: #090d16;
    --bg-surface: #0f172a;
    --bg-card: #141e33;
    --bg-card-hover: #1b2742;
    --bg-input: #0b1324;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.15);

    --accent: #6366f1;
    --accent-hover: #4f46e5;

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --info: #06b6d4;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

.font-mono {
    font-family: var(--font-mono);
}

/* ================= HEADER & BRAND ================= */
.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem 0.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.6rem;
    box-shadow: var(--shadow-sm);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-title .highlight {
    color: var(--primary);
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

.brand-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.badge-country {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.badge-tech {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

.badge-status {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

/* ================= MAIN NAVIGATION ================= */
.main-nav {
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ================= MAIN CONTENT & TABS ================= */
.app-main {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1680px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================= CARDS & CONTAINERS ================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.workspace-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
}

/* ================= CONFIG PANEL (LEFT) ================= */
.config-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.panel-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.step-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group label .unit {
    color: var(--primary);
    font-weight: 600;
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.dimensions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.options-group {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-label input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ================= BOTONES ================= */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
}

.btn-accent {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-ghost.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* ================= RESUMEN INMEDIATO ================= */
.summary-card {
    background: rgba(11, 19, 36, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
}

.summary-card h3 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.metric-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
}

.metric-title {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: #38bdf8;
    margin-top: 0.2rem;
}

/* ================= VISOR CAD 2D ================= */
.canvas-and-tables {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cad-viewer-card {
    display: flex;
    flex-direction: column;
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.65rem;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cad-scale-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cad-badge {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: #38bdf8;
}

.cad-viewport-container {
    background: #060a12;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease;
}

.cad-viewport-container.show-grid {
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
}

#cad-svg-canvas {
    width: 100%;
    height: 100%;
}

/* ================= TABLAS TÉCNICAS ================= */
.results-card {
    padding: 1.25rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.65rem;
}

.subtabs-nav {
    display: flex;
    gap: 0.5rem;
}

.subtab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.subtab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.subtab-btn.active {
    color: white;
    background: var(--primary);
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

.table-responsive {
    overflow-x: auto;
}

.tech-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tech-table th {
    background: rgba(11, 19, 36, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tech-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.tech-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tech-table .mono {
    font-family: var(--font-mono);
}

.tech-table .corte-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ================= OPTIMIZADOR 1D ================= */
.opt-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.opt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.opt-settings-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.opt-param {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.opt-param label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-control-sm {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    width: 80px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.m-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.m-val {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0.3rem 0;
}

.m-val.highlight { color: #60a5fa; }
.m-val.success { color: #34d399; }
.m-val.info { color: #38bdf8; }
.m-val.warning { color: #fbbf24; }

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

/* ================= VISUALIZADOR DE BARRAS 1D ================= */
.bars-visualization-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bars-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.legend {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-dot.color-piece { background: #3b82f6; }
.legend-dot.color-retazo { background: #10b981; }
.legend-dot.color-scrap { background: #ef4444; }

.bars-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bar-row {
    background: rgba(11, 19, 36, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

.bar-title {
    font-weight: 600;
    color: var(--text-primary);
}

.bar-efficiency {
    font-family: var(--font-mono);
    color: #34d399;
    font-weight: 700;
}

.bar-track {
    height: 42px;
    background: #060a12;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.bar-svg-track {
    width: 100%;
    height: 100%;
    display: block;
    user-select: none;
}

.svg-bar-piece-group {
    cursor: pointer;
    transition: filter 0.15s ease;
}

.svg-bar-piece-group:hover polygon {
    filter: brightness(1.22);
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
}

.cut-pill .badge-cut-45 {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
}

.cut-pill .badge-cut-90 {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-weight: 600;
    margin-left: 4px;
}

.bar-segment {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    border-right: 1px solid rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    transition: filter 0.2s;
}

.bar-segment:hover {
    filter: brightness(1.2);
    z-index: 10;
}

.bar-segment.segment-cut {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.bar-segment.segment-retazo {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ecfdf5;
}

.bar-segment.segment-scrap {
    background: repeating-linear-gradient(
        45deg,
        #b91c1c,
        #b91c1c 8px,
        #dc2626 8px,
        #dc2626 16px
    );
    color: #fee2e2;
}

.bar-cuts-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.75rem;
}

.cut-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* ================= CATÁLOGO GENERAL ================= */
.catalog-filters-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    width: 360px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
}

.search-box input:focus {
    outline: none;
}

.filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pill-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.pill-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ================= PLANILLA DE TALLER (PRINTABLE) ================= */
.taller-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sheet-paper {
    background: white;
    color: #0f172a;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    font-size: 0.85rem;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 1rem;
}

.sheet-logo h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.sheet-logo p {
    font-size: 0.85rem;
    color: #475569;
}

.sheet-meta {
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: right;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 0.35rem 0.6rem;
    border-left: 4px solid #2563eb;
    margin-bottom: 0.75rem;
}

.sheet-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.85rem;
    border-radius: 4px;
}

.sheet-details-grid strong {
    color: #1e293b;
}

.sheet-paper .tech-table {
    border: 1px solid #cbd5e1;
}

.sheet-paper .tech-table th {
    background: #e2e8f0;
    color: #1e293b;
    border-bottom: 1px solid #94a3b8;
}

.sheet-paper .tech-table td {
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
}

.sheet-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
    padding-top: 1rem;
}

.sig-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;

    /* Ajustes específicos para tarjetas de barras en impresión */
    .sheet-bar-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border: 1.5px solid #334155 !important;
        box-shadow: none !important;
        margin-bottom: 1.3rem !important;
    }
    .sheet-profile-header {
        background: #0f172a !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .sheet-bar-table th {
        background: #e2e8f0 !important;
        color: #0f172a !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .sheet-bar-graphic-box {
        background: #f8fafc !important;
        border: 1px solid #94a3b8 !important;
    }
    .sheet-check-box {
        border: 1.5px solid #0f172a !important;
    }

}

.sig-line {
    width: 100%;
    border-top: 1px solid #0f172a;
}

.sig-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

/* ================= ESQUEMAS GRÁFICOS DE CORTE EN PLANILLA DE TALLER ================= */
.sheet-bar-print-row {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.5rem;
}

.sheet-bar-print-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.sheet-bar-print-track {
    display: flex;
    height: 24px;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.sheet-bar-print-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    box-sizing: border-box;
}

.sheet-bar-print-trim {
    background: #94a3b8;
}

.sheet-bar-print-retazo {
    background: #059669;
}

.sheet-bar-print-scrap {
    background: #cbd5e1;
    color: #475569;
}

.sheet-glass-print-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.sheet-glass-print-card {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.sheet-glass-print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e2e8f0;
}

.sheet-glass-svg-box {
    width: 100%;
    display: flex;
    justify-content: center;
}


/* ================= HOJA DE RUTA DE CORTE POR BARRAS (PLANILLA DE TALLER) ================= */
.sheet-profile-block {
    margin-bottom: 1.5rem;
    page-break-inside: auto;
}

.sheet-profile-header {
    background: #0f172a;
    color: #ffffff;
    padding: 0.55rem 0.9rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-left: 4px solid #38bdf8;
}

.sheet-profile-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #93c5fd;
    font-size: 0.75rem;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-weight: 600;
}

.sheet-bar-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.85rem;
    margin-bottom: 1.25rem;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sheet-bar-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sheet-bar-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.sheet-bar-badge-alert {
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #facc15;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sheet-bar-meta-right {
    display: flex;
    gap: 0.85rem;
    font-size: 0.78rem;
    color: #475569;
    flex-wrap: wrap;
    align-items: center;
}

.sheet-bar-meta-right strong {
    color: #0f172a;
}

.sheet-bar-table {
    margin-bottom: 0.75rem !important;
    width: 100%;
}

.sheet-bar-table th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.6rem !important;
}

.sheet-bar-table td {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.82rem !important;
    vertical-align: middle;
}

.sheet-bar-graphic-box {
    margin-top: 0.65rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.35rem 0.4rem;
}

.sheet-check-box {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 1.5px solid #475569;
    border-radius: 3px;
    background: #ffffff;
    box-sizing: border-box;
}

.sheet-check-group {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.badge-angle-45 {
    background: #0284c7;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    letter-spacing: 0.02em;
}

/* ================= PRINT MEDIA ================= */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .no-print, .app-header, .app-footer, .main-nav {
        display: none !important;
    }
    .app-main {
        padding: 0 !important;
        max-width: 100% !important;
    }
    .sheet-paper {
        box-shadow: none !important;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .sheet-section {
        page-break-inside: auto;
    }
    .sheet-bar-print-row {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 0.5rem;
    }
    .sheet-section-vidrios-graficos {
        page-break-before: always !important;
        break-before: page !important;
    }
    .sheet-glass-print-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }
    .sheet-glass-print-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        width: 100% !important;
        margin-bottom: 1.8rem !important;
        border: 1.5px solid #475569 !important;
        box-shadow: none !important;
    }
    .sheet-glass-svg-box svg {
        max-height: 360px !important;
        width: 100% !important;
    }
    .sheet-signatures {
        page-break-inside: avoid;
    }
}

/* ================= FOOTER ================= */
.app-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

/* ================= WIDGET VIENTO IRAM 11507-1 ================= */
.viento-card {
    background: rgba(11, 19, 36, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.viento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viento-header h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.viento-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.viento-badge.cumple {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.viento-badge.falla {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.viento-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.viento-results {
    font-size: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    line-height: 1.4;
}

.action-buttons-row {
    display: flex;
    gap: 0.6rem;
}

/* ================= PESTAÑA PROYECTO DE OBRA ================= */
.obra-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.obra-header-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.obra-info-inputs {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 1rem;
}

.obra-actions-bar {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    flex-wrap: wrap;
}

.obra-table-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ================= PLANCHAS DE VIDRIO 2D ================= */
.opt-view-section {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.opt-view-section.active {
    display: flex;
}

.planchas-vidrio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.5rem;
}

.plancha-2d-card {
    background: rgba(11, 19, 36, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.plancha-2d-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

.plancha-svg-container {
    background: #040811;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.plancha-svg-container svg {
    width: 100%;
    height: 100%;
}

/* ================= SELECT & DROPDOWNS MEJORADOS (LINUX / WEB COMPAT) ================= */
select.form-control, select.form-control-sm {
    cursor: pointer;
    background-color: var(--bg-input);
    color: var(--text-primary);
    min-height: 42px;
    line-height: 1.4;
    padding: 0.65rem 2.2rem 0.65rem 0.85rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

select.form-control:focus, select.form-control-sm:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

select.form-control option, select.form-control optgroup {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 8px 12px;
    font-size: 0.88rem;
    white-space: normal;
}

select.form-control optgroup {
    font-weight: 700;
    color: #38bdf8;
    background-color: #090d16;
    padding-top: 6px;
    padding-bottom: 4px;
}

/* ================= BARRA DE GESTIÓN DE PROYECTO ================= */
.obra-project-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.toolbar-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}
.btn-success:hover {
    background: linear-gradient(135deg, #047857, #059669);
}

.btn-info {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: white;
}
.btn-info:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7);
}

/* ================= MODAL DE PROYECTOS ================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.proyectos-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.proyecto-item-card {
    background: rgba(11, 19, 36, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.proyecto-item-card:hover {
    border-color: var(--primary);
    background: rgba(11, 19, 36, 1);
}

.proj-info-col h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.proj-info-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
}

.proj-actions-col {
    display: flex;
    gap: 0.5rem;
}

/* ================= BARRA GLOBAL DE PROYECTO ================= */
.global-project-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    margin-bottom: 0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-current-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.proj-badge-icon {
    font-size: 1.35rem;
    background: rgba(30, 41, 59, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.proj-badge-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.proj-badge-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.proj-badge-input {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    min-width: 280px;
    transition: all 0.2s ease;
}

.proj-badge-input:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(30, 41, 59, 0.7);
}

.proj-badge-input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.proj-aberturas-count {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.proj-aberturas-count:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #60a5fa;
    color: #93c5fd;
    transform: translateY(-1px);
}

.global-project-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-mini {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.2rem;
}

.toolbar-divider {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s, transform 0.3s;
}

.toast-success {
    background: linear-gradient(135deg, #065f46, #059669);
    border: 1px solid #10b981;
}

.toast-warning {
    background: linear-gradient(135deg, #92400e, #d97706);
    border: 1px solid #f59e0b;
}

.toast-info {
    background: linear-gradient(135deg, #075985, #0284c7);
    border: 1px solid #38bdf8;
}

.toast-danger {
    background: linear-gradient(135deg, #991b1b, #dc2626);
    border: 1px solid #ef4444;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================= CUSTOM SELECT VIDRIO (INMUNE A BUGS DE GTK/LINUX) ================= */
.custom-select-container {
    position: relative;
    user-select: none;
}
.custom-select-container.open {
    z-index: 100;
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(30, 41, 59, 0.6);
}

.custom-select-trigger:focus,
.custom-select-container.open .custom-select-trigger {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
    background: var(--bg-surface);
}

.cs-selected-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

.cs-selected-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-selected-price {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    flex-shrink: 0;
}

.cs-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 0.5rem;
}

.custom-select-container.open .cs-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Menú flotante */
.custom-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0b1324;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.75), 0 8px 16px -6px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: 380px;
    overflow: hidden;
    flex-direction: column;
}

.custom-select-container.open .custom-select-dropdown {
    display: flex;
    animation: csFadeIn 0.15s ease-out;
}

@keyframes csFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buscador interno */
.cs-search-box {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cs-search-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cs-search-input {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #f8fafc;
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
    width: 100%;
    outline: none;
}

.cs-search-input:focus {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.95);
}

.cs-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
}
.cs-clear-btn:hover { color: #f87171; }

/* Lista de opciones con scroll */
.cs-options-list {
    overflow-y: auto;
    max-height: 320px;
    padding: 0.35rem 0;
}

.cs-options-list::-webkit-scrollbar {
    width: 7px;
}
.cs-options-list::-webkit-scrollbar-track {
    background: rgba(11, 19, 36, 0.6);
}
.cs-options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.cs-options-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Grupo de categoría */
.cs-group-header {
    padding: 0.45rem 0.85rem 0.25rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #38bdf8;
    background: rgba(14, 165, 233, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.25rem;
}
.cs-group-header:first-child {
    border-top: none;
    margin-top: 0;
}

/* Opción individual */
.cs-option {
    padding: 0.55rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 2px solid transparent;
}

.cs-option:hover {
    background: rgba(59, 130, 246, 0.18);
    border-left-color: var(--primary);
}

.cs-option.selected {
    background: rgba(59, 130, 246, 0.25);
    border-left-color: #60a5fa;
}

.cs-option-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.cs-option-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.cs-option.selected .cs-option-name {
    color: #93c5fd;
    font-weight: 600;
}

.cs-option-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cs-option-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cs-option-price {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.cs-option-check {
    color: #60a5fa;
    font-weight: bold;
    font-size: 0.85rem;
    opacity: 0;
}

.cs-option.selected .cs-option-check {
    opacity: 1;
}

.cs-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ================= PESTAÑA AJUSTES & CONFIGURACIÓN DE TALLER ================= */
.ajustes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

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

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

.ajuste-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ajuste-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.85rem;
}

.ajuste-icon {
    font-size: 1.6rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.55rem;
}

.ajuste-card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ajuste-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: block;
}


.designer-actions-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.35rem;
    width: 100%;
}

.designer-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 100%;
}


/* ================= SELECTOR DE ALCANCE EN OPTIMIZADORES ================= */
.opt-scope-selector {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.opt-scope-selector label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.scope-toggle-group {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}

.scope-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.scope-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.scope-toggle-btn.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Input de cantidad en tabla de obra */
.table-cant-input {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #38bdf8;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    width: 65px;
    padding: 0.2rem 0.4rem;
    text-align: center;
    transition: border-color 0.2s;
}
.table-cant-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* ================= ESTILOS MODAL IMPORTADOR PDF / TEXTO ================= */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}
.table-compact th, .table-compact td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
}
.table-compact tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.input-preview-edit {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    width: 100%;
}
.input-preview-edit:focus {
    border-color: var(--primary);
    outline: none;
}
#dropzone-pdf.dragover {
    border-color: var(--primary) !important;
    background: rgba(59, 130, 246, 0.1) !important;
}
