:root {
    --primary-color: #4A3320;
    --secondary-color: #8B5E34;
    --accent-color: #27AE60;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --border-radius: 8px;
    --sidebar-width: 240px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

button, input, select, textarea {
    font-family: inherit;
}

/* App layout with sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 12px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sidebar-footer span {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

.btn-logout {
    display: block;
    width: calc(100% - 24px);
    margin: 0 12px 16px;
    padding: 12px 16px;
    background-color: #C0392B;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-logout:hover {
    background-color: #A93226;
}

.btn-logout:active {
    transform: scale(0.98);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    margin: 0 0 4px 0;
    color: #fff;
}

.sidebar-brand p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.7;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
}

.sidebar-link {
    display: block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-link.active {
    background-color: var(--secondary-color);
    color: #fff;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    max-width: calc(100vw - var(--sidebar-width));
}

/* Views */
.view {
    animation: fadeIn 0.2s ease;
}

.view-hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    color: var(--primary-color);
    margin: 0 0 6px 0;
    font-size: 1.6rem;
}

.page-header p {
    margin: 0;
    color: #666;
}

.text-muted {
    color: #888;
    font-size: 0.9rem;
}

/* Grid layout (quote view) */
.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

input,
select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.dynamic-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e8e2d9;
    background-color: #fcfcfc;
    border-left: 4px solid var(--secondary-color);
    padding: 15px;
    margin-bottom: 15px;
}

.ingreso-lineas-help {
    margin-bottom: 12px;
    font-size: 0.92rem;
}

.ingreso-lineas-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
}

.ingreso-linea-card {
    border: 1px solid #d9cfc3;
    box-shadow: none;
    background: #fbf8f4;
}

.ingreso-linea-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ingreso-linea-title {
    margin: 0;
    font-size: 1rem;
    color: #4A3320;
}

.ingreso-lineas-actions {
    margin-bottom: 16px;
}

.ingreso-flete-group {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed #d9cfc3;
}

.btn-primary,
.btn-secondary {
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #312115;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
    margin-top: 10px;
}

/* Result panel */
.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #ccc;
}

.return-box {
    margin-top: 20px;
    background-color: #eafff0;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--accent-color);
}

.profit-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 10px 0 0 0;
}

.provider-rate {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 4px 0 0 0;
}

.service-error {
    font-size: 0.85rem;
    font-weight: 600;
    color: #E74C3C;
    margin: 4px 0 0 0;
}

.summary-sale-price {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #ccc;
}

.summary-sale-price input {
    width: 100%;
}

/* Tables */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.btn-inline {
    width: auto;
    white-space: nowrap;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #fafafa;
    color: var(--secondary-color);
    font-weight: 600;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-table {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-action {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.btn-table:hover {
    background: #f5f5f5;
}

.btn-delete {
    border-color: #E74C3C;
    color: #E74C3C;
}

.btn-delete:hover {
    background-color: #DC2626 !important;
    color: #FFFFFF !important;
    border-color: #DC2626 !important;
}

.btn-edit:hover {
    background-color: #4A3320;
    color: #FFFFFF;
    border-color: #4A3320;
}

.btn-view:hover {
    background-color: #374151;
    color: #FFFFFF;
    border-color: #374151;
}

.btn-inactive:hover {
    background-color: #F59E0B;
    color: #FFFFFF;
    border-color: #F59E0B;
}

.btn-table.btn-danger {
    border-color: #E74C3C;
    color: #E74C3C;
}

.text-center {
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: #eafff0;
    color: #27AE60;
}

.badge-inactive {
    background: #fdecea;
    color: #E74C3C;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 28px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn-secondary {
    margin-top: 0;
    width: auto;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: #faf6f2;
}

.row-selected {
    background-color: #f3ebe3;
}

.date-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.date-filter .form-group {
    margin-bottom: 0;
    min-width: 140px;
}

.date-filter .btn-secondary {
    margin-top: 0;
    width: auto;
}

.text-success {
    color: #27AE60;
    font-weight: 600;
}

.text-danger {
    color: #E74C3C;
    font-weight: 600;
}

.modal-content-wide {
    max-width: 640px;
}

.quote-detail-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
}

.detail-subtitle {
    color: var(--secondary-color);
    font-weight: 600;
    margin: 0 0 12px 0;
}

.quote-coffee-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding: 10px 12px;
    background-color: #F9F5F0;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

.detail-divider {
    border: none;
    border-top: 2px solid #eee;
    margin: 12px 0;
}

.quote-detail-bags-wrapper {
    margin-top: 8px;
}

.quote-detail-bags-table th,
.quote-detail-bags-table td {
    font-size: 0.92rem;
    vertical-align: middle;
}

.quote-detail-bags-table th {
    background-color: #F9F5F0;
    color: var(--primary-color);
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #312115 100%);
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 16px;
}

.login-brand h1 {
    color: var(--primary-color);
    margin: 0 0 6px 0;
    font-size: 1.5rem;
}

.login-brand p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.login-form .btn-primary {
    margin-top: 8px;
}

.login-error-hidden {
    display: none;
}

.login-form .service-error {
    margin-bottom: 8px;
}

/* Quote form actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
    width: auto;
    margin-top: 0;
}

.summary-divider {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 16px 0;
}

.summary-return-input {
    margin-bottom: 8px;
}

.summary-return-input input {
    width: 100%;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-brand h1,
    .sidebar-brand p,
    .sidebar-link {
        font-size: 0;
        padding: 12px;
        text-align: center;
    }

    .sidebar-link {
        font-size: 0;
    }

    .sidebar-link::first-letter {
        font-size: 1rem;
    }

    .main-content {
        margin-left: 60px;
        max-width: calc(100vw - 60px);
        padding: 16px;
    }

    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Varieties module tabs */
.tabs-navigation {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 1rem;
}

.btn-tab {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background-color: #F3F4F6;
    color: #4B5563;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-tab.active {
    background-color: #4A3320;
    color: #FFFFFF;
}

.section-divider {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 2rem 0;
}

.section-header {
    margin-bottom: 1.5rem;
    align-items: center;
}

.section-header .btn-primary {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.bag-prices-container {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #ccc;
}

.bag-prices-title {
    font-size: 0.95rem;
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.bag-prices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bag-price-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}

.bag-price-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.bag-price-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: #efe8e0;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-family: inherit;
    color: #374151;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.4) sepia(1) saturate(3) hue-rotate(345deg);
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15em;
    height: 1.15em;
    border: 2px solid #9CA3AF;
    border-radius: 4px;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #4A3320;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked {
    border-color: #4A3320;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.checkbox-inline,
.radio-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.checkbox-inline input,
.radio-inline input {
    margin: 0;
}

input[type="radio"] {
    width: 1.25em;
    height: 1.25em;
    accent-color: #4A3320;
    cursor: pointer;
}

/* Personalización de Flatpickr */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: #F97316;
    border-color: #F97316;
    border-radius: 50%;
}

/* Resumen Precios — acordeones */
.price-summary-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-accordion-item {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FFFFFF;
    overflow: hidden;
}

.price-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: #F9FAFB;
    color: #1F2937;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.price-accordion-header:hover {
    background: #F3F4F6;
}

.price-accordion-header.is-open {
    background: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
}

.price-accordion-header-level-1 {
    font-weight: 600;
}

.price-accordion-header-level-2 {
    font-weight: 500;
    background: #FFFFFF;
}

.price-accordion-meta {
    margin-left: auto;
    font-size: 0.85rem;
    color: #6B7280;
    font-weight: 400;
}

.price-accordion-chevron {
    color: #9CA3AF;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.price-accordion-body {
    padding: 12px 16px 16px;
}

.price-accordion-body-level-1 {
    background: #FAFAFA;
}

.price-accordion-body-level-2 {
    background: #FFFFFF;
    padding-top: 8px;
}

.price-accordion-level-2 {
    margin-bottom: 10px;
    border: 1px solid #ECECEC;
}

.swal-mayorista-form {
    text-align: left;
}

.swal-mayorista-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #4A3320;
}

.swal-mayorista-preview {
    margin-top: 12px;
    font-weight: 600;
    color: #4A3320;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.production-workspace {
    margin-top: 16px;
}

.production-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #E5E7EB;
}

.production-section h4 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
}

.production-metric {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 8px 0 0;
}

.production-balance {
    margin-top: 12px;
    font-weight: 700;
    font-size: 1rem;
}

.production-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.production-quote-row {
    cursor: pointer;
}

.production-quote-row:hover {
    background: #F9FAFB;
}

.production-quote-row.is-active {
    background: #FEF3C7;
}

.production-workspace-panel td {
    padding: 0;
    border: none;
    background: #FAFAFA;
}

.production-workspace-panel .production-workspace {
    margin: 0;
    border-radius: 0 0 8px 8px;
    border-top: 2px solid var(--primary-color);
}

.production-quotes-table .production-quote-row td {
    vertical-align: middle;
}

.production-counters-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.production-counter {
    margin: 0;
    font-size: 1rem;
}

.btn-production-action {
    min-height: 40px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
}

input.input-error {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.btn-finalizar-produccion {
    background: #1E293B;
    color: #FFFFFF;
    border: 1px solid #0F172A;
}

.btn-finalizar-produccion:hover:not(:disabled) {
    background: #0F172A;
}

.btn-finalizar-produccion:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inventory-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.inventory-saldos-grid {
    grid-template-columns: 1fr 1fr;
}

.inventory-table-card-wide {
    grid-column: 1 / -1;
}

.inventory-ajuste-card {
    max-width: 640px;
}

.inventory-ajuste-form .form-actions {
    margin-top: 12px;
}

.inventory-table-card h3 {
    margin: 0 0 16px 0;
    color: var(--primary-color);
}

.price-summary-quote-row {
    cursor: pointer;
}

.price-summary-quote-row:hover {
    background: #F9FAFB;
}

.price-summary-quote-row.is-active {
    background: #FEF3C7;
}

.price-summary-detail-panel td {
    padding: 0;
    border: none;
    background: transparent;
    vertical-align: top;
}

.price-summary-quotes-table {
    font-size: 0.9rem;
}

.price-summary-quotes-table thead th {
    padding: 12px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #FAFAFA;
}

.price-summary-quotes-table .price-summary-quote-row td {
    padding: 12px 14px;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Nivel 4 — panel de detalle financiero */
.price-summary-level4-panel {
    margin: 8px 0 16px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.price-summary-level4-wrapper {
    overflow-x: auto;
}

.price-summary-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.price-summary-detail-table th,
.price-summary-detail-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1F2937;
}

.price-summary-detail-table th {
    background-color: #FAFAFA;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.price-summary-detail-table tbody tr:hover {
    background: #F9FAFB;
}

.price-summary-detail-table .price-summary-col-currency {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.price-summary-detail-table .price-summary-col-number {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.price-summary-detail-table .price-summary-col-action {
    text-align: left;
    white-space: nowrap;
}

.price-summary-detail-table .roi-percent-cell {
    vertical-align: middle;
}

.price-summary-action-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price-summary-detail-table .price-summary-cell-value {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 48px;
}

.price-summary-detail-table .price-summary-action-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.price-summary-add-gramaje-row {
    margin-top: 12px;
    text-align: right;
}

.price-summary-liquidado-badge {
    margin-left: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.price-summary-liquidado-note {
    margin-top: 12px;
    font-size: 0.9rem;
}

.price-summary-quote-row.is-liquidado td {
    background: #f3fbf6;
}

.production-metric-spaced {
    margin-bottom: 1.5rem;
}

.production-guardar-verde-highlight {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #047857;
    font-weight: 700;
    font-size: 1.05rem;
}

.production-guardar-verde-highlight strong {
    color: #047857;
    font-weight: 700;
}

.production-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-extra {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #E0E7FF;
    color: #3730A3;
    font-size: 0.75rem;
    font-weight: 600;
}

.prod-empaque-qty {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
}

.inventory-lot-row {
    cursor: pointer;
}

.inventory-lot-row:hover {
    background: #F9FAFB;
}

.inventory-lot-row.is-active {
    background: #FEF3C7;
}

.inventory-lot-detail-panel td {
    padding: 0;
    border: none;
    background: transparent;
    vertical-align: top;
}

.inventory-level2-panel {
    margin: 8px 0 16px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.inventory-lots-table th,
.inventory-lots-table td,
.inventory-detail-table th,
.inventory-detail-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
}

.inventory-detail-table th {
    color: var(--primary-color);
    font-weight: 600;
    background: #FAFAFA;
}

/* POS / Punto de Venta */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.pos-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pos-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: var(--border-radius);
}

.pos-canal-select {
    min-width: 140px;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: var(--border-radius);
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.pos-product-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
    padding: 14px;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.pos-product-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.pos-card-builder {
    border-color: var(--accent-color);
    background: #F0FDF4;
}

.pos-card-tipo {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    font-weight: 600;
}

.pos-product-card code {
    font-size: 0.75rem;
    color: #6B7280;
}

.pos-card-price {
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 4px;
}

.pos-card-stock {
    font-size: 0.8rem;
    color: #6B7280;
}

.pos-cart-panel {
    position: sticky;
    top: 16px;
}

.pos-cart-panel h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.pos-cart-items {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 12px;
}

.pos-cart-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}

.pos-cart-line-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9rem;
}

.pos-cart-line-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.pos-cart-totals {
    margin-bottom: 12px;
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.pos-total-final {
    font-size: 1.15rem;
    color: var(--primary-color);
}

.pos-checkout-btn {
    width: 100%;
    margin-bottom: 8px;
}

.pos-clear-btn {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: #B91C1C;
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    text-decoration: underline;
}

.pos-caja-modal-content {
    max-width: 640px;
}

.pos-caja-box-price,
.pos-caja-total-row,
.pos-caja-comp-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.pos-caja-comp-line {
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
}

.pos-caja-total-row {
    font-size: 1.1rem;
    color: var(--primary-color);
    border-top: 1px solid #E5E7EB;
    padding-top: 12px;
}

.pos-caja-add-wrap button {
    width: 100%;
}

@media (max-width: 960px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }

    .pos-cart-panel {
        position: static;
    }
}

.prod-ingreso-breakdown-card {
    background: #FAFAF8;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius);
    padding: 12px 14px;
    margin-bottom: 12px;
}

.prod-ingreso-breakdown-list {
    margin: 8px 0;
    padding-left: 18px;
}

.prod-tostion-lote-card {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #E5E7EB;
    border-radius: var(--border-radius);
    background: #fff;
}

.prod-tostion-lote-form {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #D1D5DB;
}
