:root {
    --cr-primary: #f39c12;    /* Naranja Industrial */
    --cr-dark: #2d3436;       /* Gris Carbón */
    --cr-dark-accent: #1e272e;
    --cr-bg: #f4f7f6;
    --cr-text: #2d3436;
    --cr-white: #ffffff;
    --cr-border: #dcdde1;
}

.cr-wrapper {
    background: var(--cr-bg);
    padding: 20px;
    border-radius: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--cr-text);
    max-width: 950px;
    margin: 20px auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Header Estilo Taller */
.cr-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 5px solid var(--cr-primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
}
.cr-main-title { margin: 0; font-size: 24px; font-weight: 900; color: var(--cr-dark); letter-spacing: -1px; }
.cr-tag-pro { background: var(--cr-primary); color: var(--cr-dark); padding: 3px 8px; font-size: 10px; font-weight: 800; border-radius: 4px; }
.cr-reset-link { background: none; border: none; color: #95a5a6; cursor: pointer; font-size: 11px; font-weight: 700; }
.cr-reset-link:hover { color: #e74c3c; }

/* Tarjetas */
.cr-card {
    background: var(--cr-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--cr-border);
}
.cr-card-dark { background: var(--cr-dark); color: #ecf0f1; border: none; }
.cr-card-label { font-size: 13px; font-weight: 900; text-transform: uppercase; margin-bottom: 15px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 5px; }
.cr-card-dark .cr-card-label { color: var(--cr-primary); border-bottom-color: rgba(255,255,255,0.1); }

/* Grid Sistema */
.cr-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
.cr-row-flex { display: flex; flex-wrap: wrap; gap: 15px; }
.flex-1 { flex: 1; min-width: 200px; }
.flex-2 { flex: 2; min-width: 280px; }

.cr-group-input { display: flex; flex-direction: column; gap: 6px; }
.cr-group-input label { font-size: 11px; font-weight: 800; color: #7f8c8d; }
.cr-card-dark label { color: #bdc3c7; }

.cr-group-input input, .cr-group-input textarea {
    padding: 12px;
    border: 2px solid var(--cr-border);
    border-radius: 5px;
    font-size: 16px;
    background: #fff;
    color: var(--cr-dark);
}
.cr-card-dark input { background: rgba(255,255,255,0.05); border-color: #444; color: #fff; }
.cr-group-input input:focus { border-color: var(--cr-primary); outline: none; }

/* Buscador Memoria */
.cr-search-zone { display: flex; gap: 10px; margin-bottom: 20px; }
.cr-search-inner { position: relative; flex: 1; }
.cr-search-icon { position: absolute; left: 12px; top: 14px; color: #95a5a6; z-index: 2; }
#cr-search-input { width: 100%; padding: 14px 14px 14px 40px; border: 3px solid var(--cr-dark); border-radius: 6px; font-size: 16px; font-weight: 700; box-sizing: border-box; }

.cr-dropdown-memoria {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 2px solid var(--cr-dark);
    z-index: 1000; display: none; max-height: 250px; overflow-y: auto;
    border-radius: 0 0 6px 6px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.cr-dropdown-memoria.active { display: block; }
.cr-history-item { padding: 12px; border-bottom: 1px solid #f1f2f6; cursor: pointer; display: flex; justify-content: space-between; font-weight: 600; }
.cr-history-item:hover { background: var(--cr-primary); color: var(--cr-dark); }

/* Tabla Pro */
.cr-table-mobile-wrap { overflow-x: auto; margin-bottom: 20px; border: 1px solid var(--cr-border); border-radius: 6px; }
.cr-table-pro { width: 100%; border-collapse: collapse; background: #fff; }
.cr-table-pro th { background: #f8f9fa; padding: 12px; font-size: 11px; font-weight: 900; text-align: left; border-bottom: 2px solid var(--cr-border); }
.cr-table-pro td { padding: 10px; border-bottom: 1px solid #f1f2f6; vertical-align: middle; }

.cr-inp-table { border: 1px solid transparent; background: transparent; padding: 8px; width: 100%; font-size: 15px; font-weight: 600; }
.cr-inp-table:focus { border-bottom: 2px solid var(--cr-primary); background: #fffbe6; outline: none; }

/* Footer Totales */
.cr-footer-layout { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 25px; padding-top: 20px; border-top: 2px dashed var(--cr-border); }
@media (min-width: 768px) { .cr-footer-layout { grid-template-columns: 1.5fr 1fr; } }

.cr-totals-dark { background: var(--cr-dark); color: #fff; padding: 25px; border-radius: 8px; display: flex; flex-direction: column; gap: 15px; }
.cr-total-line { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.cr-adjust-row input { width: 90px; background: rgba(255,255,255,0.1); border: 1px solid #555; color: var(--cr-primary); text-align: right; padding: 5px; font-weight: 900; border-radius: 4px; }
.cr-total-grande { border-top: 1px solid #444; padding-top: 15px; display: flex; justify-content: space-between; font-size: 26px; font-weight: 900; color: var(--cr-primary); }

/* Acciones Finales */
.cr-main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 30px; }
.cr-btn-big { border: none; padding: 18px; border-radius: 10px; font-size: 16px; font-weight: 900; cursor: pointer; transition: transform 0.1s; display: flex; align-items: center; justify-content: center; gap: 12px; }
.cr-btn-big:active { transform: scale(0.97); }
.cr-btn-wa { background: #27ae60; color: #fff; }
.cr-btn-pdf { background: var(--cr-dark); color: var(--cr-primary); border: 2px solid var(--cr-primary); }
.cr-btn-add { background: var(--cr-primary); color: var(--cr-dark); border: none; padding: 0 25px; border-radius: 6px; font-weight: 900; cursor: pointer; }

/* Estilos Mobile */
@media (max-width: 768px) {
    .cr-table-pro thead { display: none; }
    .cr-table-pro tr { display: block; border-bottom: 3px solid var(--cr-border); padding: 15px 10px; position: relative; }
    .cr-table-pro td { display: block; border: none; padding: 5px 0; text-align: left; }
    .cr-table-pro td:nth-child(1) { font-weight: 900; font-size: 18px; padding-right: 40px; }
    .cr-table-pro td:nth-child(2), .cr-table-pro td:nth-child(3) { display: inline-block; width: 45%; border-top: 1px solid #eee; padding-top: 10px; }
    .cr-table-pro td:nth-child(4) { text-align: right; font-weight: 900; font-size: 20px; color: var(--cr-dark); margin-top: 10px; }
    .cr-main-actions { grid-template-columns: 1fr; }
    .cr-btn-del { position: absolute; top: 15px; right: 10px; font-size: 24px; color: #e74c3c; background: none; border: none; cursor: pointer; }
}

.cr-empty-info { text-align: center; padding: 40px; color: #bdc3c7; font-style: italic; font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }