/* ============================================
   FabriCalzado - Sistema de Gestion de Fabrica
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --bg: #f1f5f9;
    --bg-white: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .menu-item span,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.6rem;
    color: #60a5fa;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    color: #94a3b8;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.menu-item.active {
    background: rgba(37, 99, 235, 0.2);
    border-left-color: var(--primary);
    color: white;
}

.menu-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    color: #64748b;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Topbar */
.topbar {
    background: var(--bg-white);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}

.user-info i {
    font-size: 1.5rem;
    color: var(--primary);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

/* Sections */
.section {
    display: none;
    padding: 25px;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-blue .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-green .stat-icon { background: var(--success-light); color: var(--success); }
.stat-orange .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-purple .stat-icon { background: var(--purple-light); color: var(--purple); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.card-title i {
    color: var(--primary);
}

.list-container {
    max-height: 250px;
    overflow-y: auto;
}

.empty-msg {
    color: var(--text-light);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-item-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.list-item-sub {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-white);
    cursor: pointer;
    outline: none;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: #f1f5f9; color: var(--secondary); }
.badge-cortador { background: #fef3c7; color: #b45309; }
.badge-guarnicion { background: #dbeafe; color: #1d4ed8; }
.badge-solador { background: #ede9fe; color: #6d28d9; }

/* Asignacion de Fases */
.asignacion-fases {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.fase-card {
    flex: 1;
    min-width: 160px;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    background: var(--bg);
    transition: all 0.3s;
}
.fase-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.fase-cortador { border-color: #f59e0b; background: #fffbeb; }
.fase-guarnicion { border-color: #2563eb; background: #eff6ff; }
.fase-solador { border-color: #7c3aed; background: #f5f3ff; }
.fase-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.fase-cortador .fase-header { color: #b45309; }
.fase-guarnicion .fase-header { color: #1d4ed8; }
.fase-solador .fase-header { color: #6d28d9; }
.fase-card select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
}
.fase-flecha {
    display: flex;
    align-items: center;
    color: var(--secondary);
    font-size: 1.2rem;
}
.fase-pago {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--secondary);
    min-height: 18px;
}
.costo-mano-obra {
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 8px;
    font-weight: 600;
    color: #065f46;
    text-align: center;
    font-size: 0.9rem;
}
.trabajador-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin: 1px;
}
.trabajador-mini.t-cortador { background: #fef3c7; color: #b45309; }
.trabajador-mini.t-guarnicion { background: #dbeafe; color: #1d4ed8; }
.trabajador-mini.t-solador { background: #ede9fe; color: #6d28d9; }
.trabajador-mini .t-icon { font-size: 0.65rem; }

@media (max-width: 600px) {
    .asignacion-fases { flex-direction: column; }
    .fase-flecha { justify-content: center; transform: rotate(90deg); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    background: var(--primary);
}

.progress-fill.low { background: var(--danger); }
.progress-fill.mid { background: var(--warning); }
.progress-fill.high { background: var(--success); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.btn-action.edit { color: var(--primary); }
.btn-action.delete { color: var(--danger); }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-content.modal-sm {
    max-width: 400px;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
    line-height: 1;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--danger);
}

/* Forms */
form {
    padding: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full-width {
    grid-column: span 2;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* Venta Items */
.venta-item-row {
    display: grid;
    grid-template-columns: 2fr 80px 80px 100px 100px 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.venta-item-row select,
.venta-item-row input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
}

.venta-item-row select:focus,
.venta-item-row input:focus {
    border-color: var(--primary);
}

.venta-total {
    text-align: right;
    font-size: 1.2rem;
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: var(--radius);
}

/* Reportes */
.reportes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.reporte-card {
    text-align: center;
    padding: 30px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.reporte-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.reporte-card i {
    color: var(--primary);
    margin-bottom: 15px;
}

.reporte-card h3 {
    margin-bottom: 8px;
}

.reporte-card p {
    color: var(--text-light);
    font-size: 0.85rem;
}

.reporte-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.reporte-table th,
.reporte-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.reporte-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
}

.reporte-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.reporte-summary-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.reporte-summary-item h4 {
    font-size: 1.3rem;
    color: var(--primary);
}

.reporte-summary-item p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e293b;
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Stock indicator */
.stock-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stock-dot.ok { background: var(--success); }
.stock-dot.low { background: var(--warning); }
.stock-dot.critical { background: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .logo span,
    .sidebar .menu-item span,
    .sidebar .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .venta-item-row {
        grid-template-columns: 1fr 1fr;
    }

    .topbar {
        padding: 10px 15px;
    }

    .section {
        padding: 15px;
    }
}

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

/* Producto foto */
.producto-foto-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.foto-preview {
    width: 180px;
    height: 180px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.85rem;
    transition: var(--transition);
    overflow: hidden;
    background: #f8fafc;
}

.foto-preview:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.foto-preview i {
    font-size: 2rem;
}

.foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-preview.has-foto {
    border-style: solid;
    border-color: var(--primary);
}

.producto-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.producto-no-foto {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Tallas Grid (Materiales) */
.tallas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    background: #f8fafc;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.talla-stock-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.talla-stock-row.talla-header {
    grid-column: 1 / -1;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    justify-content: space-between;
    padding: 0 10px 4px;
}

.talla-stock-row label {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 28px;
    color: var(--primary);
}

.talla-stock-row input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
    outline: none;
}

.talla-stock-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.talla-stock-total {
    grid-column: 1 / -1;
    text-align: right;
    padding: 8px 10px 0;
    font-size: 0.95rem;
    color: var(--primary);
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

/* Ficha Tecnica */
.ficha-tecnica-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.ficha-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ficha-titulo i {
    color: var(--primary);
}

.ficha-material-row {
    display: grid;
    grid-template-columns: 2fr 80px 80px 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.ficha-material-row select,
.ficha-material-row input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
}

.ficha-material-row select:focus,
.ficha-material-row input:focus {
    border-color: var(--primary);
}

.ficha-talla-indicator {
    grid-column: 1 / -1;
    background: #ede9fe;
    color: #6d28d9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Materiales Requeridos en Orden */
.materiales-requeridos {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px;
}

.materiales-requeridos h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.materiales-requeridos h4 i {
    color: var(--primary);
}

.mat-req-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.mat-req-item.stock-ok {
    border-left: 3px solid var(--success);
}

.mat-req-item.stock-low {
    border-left: 3px solid var(--danger);
    background: #fff5f5;
}

.mat-req-cantidad {
    font-weight: 600;
}

.mat-req-stock {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Orden Grupos */
.orden-grupo {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

.orden-grupo-titulo {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.orden-grupo-titulo i {
    color: var(--primary);
}

.orden-grupo .form-grid {
    margin-bottom: 0;
}

.suela-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}

.suela-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.suela-stock-item.ok { border-left: 4px solid var(--success); background: #f0fdf4; }
.suela-stock-item.low { border-left: 4px solid var(--danger); background: #fef2f2; animation: pulseRed 1.5s ease-in-out infinite; }

@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.2); }
    50% { box-shadow: 0 0 8px 2px rgba(220,38,38,0.3); }
}

/* Numeracion rows */
.numeracion-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.numeracion-row {
    display: grid;
    grid-template-columns: 120px 100px 40px;
    gap: 8px;
    align-items: center;
}

.numeracion-row select,
.numeracion-row input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
}

.numeracion-row select:focus,
.numeracion-row input:focus {
    border-color: var(--primary);
}

.orden-total-pares {
    font-size: 0.95rem;
    color: var(--primary);
}

.numeracion-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 2px;
}

/* Print */
@media print {
    .sidebar, .topbar, .btn, .filters, .section-header button, .form-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .section {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animations */
@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
