:root {
    --brand-950: #052e1a;
    --brand-900: #064e3b;
    --brand-800: #065f46;
    --brand-700: #047857;
    --brand-600: #059669;
    --brand-500: #10b981;
    --brand-100: #d1fae5;
    --brand-50: #ecfdf5;
    --ink-900: #10231a;
    --ink-700: #34443b;
    --ink-500: #66756d;
    --line: #dce7df;
    --surface: #ffffff;
    --surface-soft: #f4f8f5;
    --shadow-sm: 0 8px 22px rgba(6, 78, 59, 0.08);
    --shadow-md: 0 14px 32px rgba(6, 78, 59, 0.12);
}

body {
    background: var(--surface-soft);
    color: var(--ink-900);
}

.content {
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 32rem),
        linear-gradient(180deg, #f7fbf8 0%, #eef6f0 100%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ink-900);
}

.card,
.dashboard-section,
.report-section,
.minorista-card,
.filtros-card,
.productos-card,
.section-card,
.filtros-reportes {
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm) !important;
    background: var(--surface) !important;
}

.card-header,
.dashboard-section-header,
.report-section-header,
.productos-card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f3faf5 100%) !important;
    border-bottom: 1px solid var(--line) !important;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary,
.btn-success {
    background: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-success:hover {
    background: var(--brand-800) !important;
    border-color: var(--brand-800) !important;
}

.btn-outline-primary {
    color: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
}

.btn-outline-primary:hover {
    background: var(--brand-700) !important;
    color: #fff !important;
}

.btn-info {
    background: #0ea5a4 !important;
    border-color: #0ea5a4 !important;
    color: #fff !important;
}

.btn-dark {
    background: var(--ink-900) !important;
    border-color: var(--ink-900) !important;
}

.form-control,
.form-select {
    border-color: #cbd9d0;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.18);
}

.table {
    --bs-table-hover-bg: #f0faf3;
}

.table thead th,
.table-dark th,
.table-dark td {
    background: var(--brand-900) !important;
    border-color: var(--brand-900) !important;
    color: #fff !important;
}

.badge.bg-primary,
.badge.bg-success,
.badge-estado-activa,
.stock-ok,
.margen-ok,
.estado-ok {
    background: var(--brand-700) !important;
    color: #fff !important;
}

.alert-success {
    background: var(--brand-50);
    border-color: #a7f3d0;
    color: var(--brand-900);
}

.page-kicker,
.dashboard-subtitle,
.venta-subtitle,
.reportes-subtitle,
.metric-label,
.resumen-label,
.report-label {
    color: var(--ink-500) !important;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--brand-700);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(236, 253, 245, 0.96) 0%, rgba(255, 255, 255, 0.96) 70%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.13), transparent 18rem);
    box-shadow: var(--shadow-sm);
}

.page-header h1,
.page-header h2 {
    margin: 0 0 4px;
    font-size: 2rem;
    font-weight: 750;
    color: var(--brand-900);
}

.page-header p {
    margin: 0;
    color: var(--ink-500);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.filter-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 18px;
}

.data-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-card > .card-body,
.data-card.form-shell > .card-body {
    padding: 22px !important;
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f3faf5 100%);
}

.data-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 750;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.table-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.muted-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--brand-50);
    color: var(--brand-900);
    border: 1px solid #a7f3d0;
    font-weight: 700;
    font-size: 0.85rem;
}

.summary-panel {
    position: sticky;
    top: 18px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    background: var(--brand-50);
    border: 1px solid #a7f3d0;
    padding: 14px;
}

.summary-total strong {
    color: var(--brand-900);
    font-size: 1.25rem;
}

.icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.form-shell {
    max-width: 820px;
}

.form-shell .form-label {
    margin-bottom: 6px;
    color: var(--ink-700);
    font-weight: 650;
}

.form-shell .form-control,
.form-shell .form-select {
    min-height: 42px;
    background-color: #fff;
}

.form-shell .mb-3 {
    margin-bottom: 18px !important;
}

.form-shell .row.g-3 {
    --bs-gutter-y: 18px;
}

.form-section-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--ink-900);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.info-stack {
    display: grid;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row span {
    color: var(--ink-500);
}

.total-highlight {
    border-radius: 12px;
    background: var(--brand-900);
    color: #fff;
    padding: 16px;
}

.total-highlight span {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
}

.total-highlight strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1.1;
    margin-top: 4px;
}

.repeater-row {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbf9;
    padding: 14px;
}

.repeater-row + .repeater-row {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        padding: 16px;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .data-card > .card-body {
        padding: 16px !important;
    }

    .form-actions .btn {
        flex: 1 1 auto;
    }
}
