:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-top: #0f172a;
    --sidebar-bottom: #020617;
    --sidebar-text: #cbd5e1;
    --sidebar-active: rgba(255,255,255,0.12);
    --ok-bg: #ecfdf3;
    --ok-text: #027a48;
    --err-bg: #fef3f2;
    --err-text: #b42318;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,sans-serif; background:var(--bg); color:var(--text); }
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }
.app-shell { display:flex; min-height:100vh; }
.sidebar { width:270px; background:linear-gradient(180deg,var(--sidebar-top),var(--sidebar-bottom)); color:var(--sidebar-text); padding:28px 18px; position:fixed; inset:0 auto 0 0; overflow-y:auto; border-right:1px solid rgba(255,255,255,0.06); }
.sidebar-brand { margin-bottom:30px; }
.sidebar-brand img { width:200px; max-width:100%; display:block; margin-bottom:12px; }
.sidebar-brand-subtitle { font-size:12px; line-height:1.4; opacity:.72; letter-spacing:.02em; }
.sidebar-nav { display:flex; flex-direction:column; gap:6px; }
.sidebar-nav a { display:block; padding:12px 14px; border-radius:12px; color:var(--sidebar-text); font-weight:600; transition:all .18s ease; }
.sidebar-nav a:hover, .sidebar-nav a.active { background:var(--sidebar-active); color:#fff; text-decoration:none; }
.content { flex:1; margin-left:270px; min-width:0; }
.topbar { background:rgba(255,255,255,.92); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); padding:18px 30px; display:flex; justify-content:space-between; align-items:center; position:sticky; top:0; z-index:20; }
.topbar-user { font-size:14px; color:var(--muted); font-weight:600; }
.content-body { padding:34px; }
.page-header { margin-bottom:24px; }
.page-title { margin:0 0 8px; font-size:32px; line-height:1.15; font-weight:800; letter-spacing:-0.02em; }
.page-subtitle { margin:0; color:var(--muted); font-size:15px; }
.dashboard-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:24px; }
.dashboard-grid > .card { grid-column:span 12; }
@media (min-width:1024px){ .dashboard-grid.two-col > .card { grid-column:span 6; } }
.card { background:var(--surface); border:1px solid rgba(15,23,42,.04); border-radius:var(--radius); box-shadow:var(--shadow); padding:28px; margin-bottom:24px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
@media (max-width:1000px){ .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){ .metric-grid { grid-template-columns:1fr; } }
.metric { background:var(--surface-soft); border:1px solid var(--line); border-radius:14px; padding:18px; }
.metric-label { color:var(--muted); font-size:13px; margin-bottom:8px; font-weight:600; }
.metric-value { font-size:24px; font-weight:800; color:var(--text); }
label { display:block; font-size:14px; font-weight:700; margin-bottom:8px; color:var(--text); }
input[type="text"], input[type="password"], input[type="file"], select, textarea { width:100%; border:1px solid #cbd5e1; background:white; border-radius:12px; padding:12px 14px; font-size:14px; color:var(--text); outline:none; transition:border-color .15s ease, box-shadow .15s ease; margin-bottom:16px; }
input:focus, select:focus, textarea:focus { border-color:#93c5fd; box-shadow:0 0 0 4px rgba(37,99,235,.12); }
button, .button { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--primary); color:white; border:none; border-radius:12px; padding:11px 18px; font-size:14px; font-weight:700; cursor:pointer; transition:background .16s ease, transform .12s ease; text-decoration:none; }
button:hover, .button:hover { background:var(--primary-hover); text-decoration:none; }
.button-secondary { background:white; color:var(--text); border:1px solid var(--line); }
.button-secondary:hover { background:#f8fafc; }
.inline-actions { display:flex; gap:10px; flex-wrap:wrap; }
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:white; }
table { width:100%; border-collapse:collapse; min-width:760px; }
thead th { text-align:left; background:#f8fafc; color:#334155; font-size:13px; font-weight:800; letter-spacing:.01em; text-transform:none; padding:14px 16px; border-bottom:1px solid var(--line); }
tbody td { padding:14px 16px; border-bottom:1px solid #eef2f7; font-size:14px; vertical-align:top; }
tbody tr:hover { background:#fafcff; }
pre.codeblock { background:#0f172a; color:#e2e8f0; padding:18px; border-radius:14px; overflow-x:auto; white-space:pre-wrap; }
.alert { border-radius:14px; padding:14px 16px; margin-bottom:20px; font-weight:600; }
.alert.success { background:var(--ok-bg); color:var(--ok-text); }
.alert.error { background:var(--err-bg); color:var(--err-text); }
.search-form { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:end; }
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at top, #eff6ff, #f4f7fb 38%, #eef2ff 100%); padding:24px; }
.login-card { width:100%; max-width:460px; background:rgba(255,255,255,.96); border:1px solid rgba(15,23,42,.05); box-shadow:0 20px 50px rgba(15,23,42,.12); border-radius:24px; padding:34px; }
.login-logo { width:230px; display:block; margin:0 auto 18px; }
@media (max-width:900px){ .sidebar{ position:static; width:100%; height:auto; } .content{ margin-left:0; } .app-shell{ flex-direction:column; } .content-body{ padding:22px; } .topbar{ padding:16px 22px; } .page-title{ font-size:28px; } }

/* Admin users compact actions */
.users-table {
    min-width: 980px;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
    width: 520px;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-action-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, 150px) auto;
    gap: 8px;
    align-items: center;
}

.user-password-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.user-actions form {
    margin: 0;
}

.user-actions input,
.user-actions select {
    margin-bottom: 0;
    padding: 9px 11px;
    border-radius: 10px;
}

.user-actions button {
    padding: 9px 13px;
    border-radius: 10px;
    white-space: nowrap;
}

.button-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.button-danger:hover {
    background: #fecaca;
}

@media (max-width: 1100px) {
    .user-action-row,
    .user-password-row {
        grid-template-columns: 1fr;
    }
}

.user-reset-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
}

.user-delete-form {
    display: flex;
}

/* Admin users compact override */
.users-table td {
    vertical-align: middle;
}

.users-table td:nth-child(6) {
    width: 460px;
}

.users-table .user-actions {
    max-width: 460px;
}

.users-table .user-action-row {
    display: grid;
    grid-template-columns: 170px 120px 130px;
    gap: 8px;
    align-items: center;
}

.users-table .user-password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.users-table .user-reset-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 150px;
    gap: 8px;
    align-items: center;
}

.users-table .user-delete-form {
    display: flex;
    justify-content: flex-start;
}

.users-table .user-actions select,
.users-table .user-actions input[type="password"] {
    height: 38px;
    min-height: 38px;
    padding: 7px 10px;
    margin: 0;
    font-size: 13px;
}

.users-table .user-actions button {
    height: 38px;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 13px;
    margin: 0;
}

.users-table tbody td {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Admin users final compact layout */
.users-table .user-action-row,
.users-table .user-password-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.users-table .user-action-row select {
    width: 160px;
    flex: 0 0 160px;
}

.users-table .user-action-row select[name="is_active"] {
    width: 115px;
    flex-basis: 115px;
}

.users-table .user-reset-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
}

.users-table .user-reset-form input[type="password"] {
    width: 220px;
    flex: 0 0 220px;
}

.users-table .user-delete-form {
    flex: 0 0 auto;
}

.users-table .user-actions button {
    min-width: auto;
}

.users-table .user-actions .button-secondary,
.users-table .user-actions .button-danger {
    padding-left: 12px;
    padding-right: 12px;
}

/* Admin users create form compact layout */
.users-create-card {
    padding: 22px 24px;
}

.users-create-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.users-create-header h3 {
    margin: 0 0 6px;
}

.users-create-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(150px, 180px) auto;
    gap: 12px;
    align-items: end;
}

.users-create-form .form-field {
    min-width: 0;
}

.users-create-form label {
    margin-bottom: 6px;
    font-size: 13px;
}

.users-create-form input,
.users-create-form select {
    height: 40px;
    min-height: 40px;
    margin-bottom: 0;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 13px;
}

.users-create-form button {
    height: 40px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .users-create-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .users-create-form {
        grid-template-columns: 1fr;
    }
}
/* Stock search helper */
.stock-search-card {
    padding-bottom: 20px;
}

.search-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}
/* Stock results table */
.stock-results-table {
    min-width: 980px;
}

.stock-results-table .sku-cell {
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.stock-results-table .stock-number-col,
.stock-results-table .stock-number-cell {
    text-align: right;
}

.stock-badge-ok {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-block;
    min-width: 42px;
    text-align: center;
    font-weight: 800;
}

.stock-badge-pipeline {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-block;
    min-width: 42px;
    text-align: center;
    font-weight: 800;
}

.stock-zero {
    color: var(--muted);
    font-weight: 600;
}

.pending-tarifa {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-block;
    font-weight: 800;
}
.stock-badge-danger {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-block;
    min-width: 42px;
    text-align: center;
    font-weight: 800;
}
/* Upload history badges */
.number-cell {
    text-align: right;
    font-weight: 700;
}

.status-badge,
.rejected-badge {
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-block;
    min-width: 74px;
    text-align: center;
    font-weight: 800;
    font-size: 12px;
}

.status-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #bbf7d0;
}

.status-error,
.rejected-badge {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecaca;
}

.status-duplicate {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.status-pending {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
/* Tarifa history alignment */
.tarifa-history-table {
    min-width: 960px;
}

.tarifa-history-table .status-col,
.tarifa-history-table .status-cell {
    text-align: center;
}

.tarifa-history-table .number-col,
.tarifa-history-table .number-cell {
    text-align: right;
    padding-right: 22px;
}

.tarifa-history-table .status-badge {
    min-width: 78px;
}
/* Reload requests tables */
.reloads-table {
    min-width: 920px;
}

.reloads-table .status-col,
.reloads-table .status-cell {
    text-align: center;
}

.reloads-table .status-badge {
    min-width: 86px;
}

.reloads-table .inline-actions {
    justify-content: flex-start;
    align-items: center;
}
/* Pending tarifa products */
.pending-tarifa-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.pending-tarifa-actions h3 {
    margin: 0 0 6px;
}

.pending-tarifa-table {
    min-width: 1080px;
}

.pending-tarifa-table .sku-cell {
    font-weight: 800;
    white-space: nowrap;
}

.pending-tarifa-table .number-col,
.pending-tarifa-table .number-cell {
    text-align: right;
}

.total-units-badge {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-block;
    min-width: 52px;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 900px) {
    .pending-tarifa-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* Tarifa quality report */
.quality-grid {
    align-items: stretch;
}

.quality-card h3 {
    margin-top: 0;
}

.quality-metrics {
    display: grid;
    gap: 10px;
}

.quality-metrics div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

.quality-metrics div:last-child {
    border-bottom: 0;
}

.quality-metrics span {
    color: var(--muted);
    font-size: 13px;
}

.quality-metrics strong {
    font-size: 18px;
    color: var(--text);
}

.quality-ok {
    color: #027a48 !important;
}

.quality-danger {
    color: #b42318 !important;
}

.quality-header-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.quality-header-row h3 {
    margin: 0 0 6px;
}

@media (max-width: 900px) {
    .quality-header-row {
        flex-direction: column;
    }
}

/* Ventas Depau - informe de reposición */
.section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-title-row h3 {
    margin-bottom: 6px;
}

.section-title-row p {
    margin: 0;
    color: #5f6f89;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1120px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f9fc;
    color: #1f2a44;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #dfe6ef;
}

.data-table th,
.data-table td {
    padding: 13px 14px;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

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

.replenishment-table-wrapper {
    max-height: 620px;
    overflow: auto;
}

.replenishment-table .sku-cell {
    white-space: nowrap;
    color: #101828;
}

.replenishment-table .description-cell {
    max-width: 420px;
    line-height: 1.35;
    color: #263247;
}

.strong-number {
    font-weight: 800;
    color: #101828;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge-danger {
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffd1cc;
}

.status-badge-warning {
    color: #9a6700;
    background: #fff8db;
    border: 1px solid #f5df89;
}

.status-badge-ok {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.status-badge-muted {
    color: #475467;
    background: #f2f4f7;
    border: 1px solid #d0d5dd;
}

.coverage-danger,
.coverage-warning,
.coverage-ok,
.coverage-muted {
    display: inline-block;
    min-width: 42px;
    padding: 4px 7px;
    border-radius: 8px;
    font-weight: 800;
    text-align: center;
}

.coverage-danger {
    color: #b42318;
    background: #fff1f0;
}

.coverage-warning {
    color: #9a6700;
    background: #fff8db;
}

.coverage-ok {
    color: #067647;
    background: #ecfdf3;
}

.coverage-muted {
    color: #667085;
    background: #f2f4f7;
}

/* Ajuste visual final Ventas Depau */
.replenishment-table-wrapper {
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.replenishment-table thead th {
    position: static !important;
}

.replenishment-table td .status-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.replenishment-table td .status-badge-danger {
    color: #b42318 !important;
    background: #fff1f0 !important;
    border: 1px solid #ffd1cc !important;
}

.replenishment-table td .status-badge-warning {
    color: #9a6700 !important;
    background: #fff8db !important;
    border: 1px solid #f5df89 !important;
}

.replenishment-table td .status-badge-ok {
    color: #067647 !important;
    background: #ecfdf3 !important;
    border: 1px solid #abefc6 !important;
}

.replenishment-table td .status-badge-muted {
    color: #475467 !important;
    background: #f2f4f7 !important;
    border: 1px solid #d0d5dd !important;
}

.replenishment-table .description-cell {
    max-width: 520px;
}

.replenishment-table tbody td {
    font-size: 13px;
}

.replenishment-table .sku-cell {
    font-weight: 800;
}


/* Ventas Depau - resumen reposición */
.replenishment-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
}

.replenishment-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    background: #ffffff;
}

.replenishment-summary-item strong {
    font-size: 15px;
    color: #101828;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 800;
}

.stock-pill-ok {
    color: #067647;
    background: #ecfdf3;
}

.stock-pill-empty {
    color: #667085;
    background: #f2f4f7;
}


/* Ajuste compacto resumen reposición Depau */
.replenishment-summary {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px 14px !important;
    margin: 14px 0 18px !important;
}

.replenishment-summary .replenishment-summary-item {
    width: auto !important;
    min-width: auto !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.replenishment-summary .replenishment-summary-item strong {
    display: inline-block !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    min-width: 18px !important;
}


/* Ventas Depau - KPIs comerciales compactos */
.depau-kpi-section {
    padding: 20px 24px;
    margin-bottom: 22px;
}

.depau-kpi-section .section-title-row {
    margin-bottom: 14px;
}

.depau-kpi-section .section-title-row h3 {
    margin-bottom: 4px;
}

.depau-kpi-section .section-title-row p {
    margin: 0;
    color: #5f6f89;
    font-size: 14px;
}

.depau-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.depau-kpi-card {
    background: #f8fafc;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 14px 16px;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.depau-kpi-card-highlight {
    background: #fbf8ff;
    border-color: #e7ddff;
}

.depau-kpi-label {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    color: #5f6f89;
    margin-bottom: 10px;
}

.depau-kpi-value {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    color: #162033;
}

.depau-kpi-positive {
    color: #0f9f5f;
}

.depau-kpi-negative {
    color: #d92d20;
}

@media (max-width: 1200px) {
    .depau-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .depau-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .depau-kpi-grid {
        grid-template-columns: 1fr;
    }

    .depau-kpi-value {
        font-size: 24px;
    }
}


/* Ventas Depau - enlaces SKU */
.sku-link {
    color: #162033;
    text-decoration: none;
}

.sku-link:hover {
    color: #2563eb;
    text-decoration: underline;
}


/* Ventas Depau - acción recomendada */
.replenishment-table .action-cell {
    max-width: 260px;
    color: #344054;
    font-weight: 600;
    line-height: 1.35;
}


/* Ventas Depau - selector estado */
.filter-form select {
    width: 100%;
    height: 38px;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    padding: 0 10px;
    background: #ffffff;
    color: #162033;
    font-weight: 600;
}


/* Ventas Depau - filtros rápidos por estado */
.status-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 14px 0 18px;
}

.status-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e5eaf2;
    border-radius: 999px;
    background: #ffffff;
    text-decoration: none;
    color: #162033;
}

.status-filter-pill strong {
    font-size: 16px;
}

.status-filter-pill:hover,
.status-filter-pill.active {
    border-color: #1697f6;
    background: #f0f8ff;
}

.status-filter-clear {
    font-size: 13px;
    font-weight: 700;
    color: #1697f6;
    text-decoration: none;
}

.status-filter-clear:hover {
    text-decoration: underline;
}


/* Stock - buscador alineado */
.stock-search-card .search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.stock-search-card .search-form input[type="text"] {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
}

.stock-search-card .search-form button {
    height: 42px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 700px) {
    .stock-search-card .search-form {
        grid-template-columns: 1fr;
    }

    .stock-search-card .search-form button {
        width: 100%;
    }
}


/* Stock - fix definitivo buscador */
.card.stock-search-card form.search-form {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.card.stock-search-card form.search-form input[type="text"] {
    flex: 1 1 auto !important;
    height: 44px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.card.stock-search-card form.search-form button {
    flex: 0 0 auto !important;
    height: 44px !important;
    min-height: 44px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

@media (max-width: 700px) {
    .card.stock-search-card form.search-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .card.stock-search-card form.search-form button {
        width: 100% !important;
    }
}


/* Sidebar - grupo Depau */
.sidebar-nav-group {
    margin: 6px 0;
    padding: 8px;
    border-radius: 14px;
}

.sidebar-nav-group.active {
    background: rgba(22, 151, 246, 0.08);
}

.sidebar-nav-group-title {
    padding: 8px 10px 7px;
    color: #5f6f89;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-subnav a {
    display: block;
    padding: 9px 12px 9px 22px;
    border-radius: 10px;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-subnav a:hover {
    background: #f0f8ff;
    color: #1697f6;
}

.sidebar-subnav a.active {
    background: #1697f6;
    color: #ffffff;
}


/* Sidebar Depau - contraste en menú oscuro */
.sidebar-nav-group-title {
    color: #8ea4c2;
}

.sidebar-subnav a {
    color: #d8e1ef;
}

.sidebar-subnav a:hover {
    background: rgba(22, 151, 246, 0.14);
    color: #ffffff;
}

.sidebar-subnav a.active {
    background: #1697f6;
    color: #ffffff;
}

.sidebar-nav-group.active {
    background: rgba(22, 151, 246, 0.10);
}


/* Sidebar Depau - acabado visual */
.sidebar-nav-group {
    margin-top: 14px;
    margin-bottom: 12px;
    padding: 4px 0 4px 10px;
    border-left: 3px solid transparent;
}

.sidebar-nav-group.active {
    border-left-color: #1697f6;
    background: transparent;
}

.sidebar-nav-group-title {
    padding: 6px 10px 8px;
}

.sidebar-subnav a {
    padding: 9px 12px 9px 14px;
}


/* Sidebar - desplegable Depau */
.sidebar-dropdown {
    margin: 0;
}

.sidebar-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-radius: 12px;
    color: #e6edf7;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.sidebar-dropdown summary::-webkit-details-marker {
    display: none;
}

.sidebar-dropdown summary::after {
    content: "▾";
    font-size: 12px;
    color: #8ea4c2;
    transform: rotate(-90deg);
    transition: transform 0.18s ease;
}

.sidebar-dropdown[open] summary::after {
    transform: rotate(0deg);
}

.sidebar-dropdown summary:hover,
.sidebar-dropdown.active summary {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-dropdown .sidebar-subnav {
    margin: 6px 0 8px 12px;
    padding-left: 10px;
    border-left: 3px solid #1697f6;
}

.sidebar-dropdown .sidebar-subnav a {
    padding: 9px 12px;
    border-radius: 10px;
    color: #d8e1ef;
    font-size: 14px;
    font-weight: 700;
}

.sidebar-dropdown .sidebar-subnav a.active {
    background: #1697f6;
    color: #ffffff;
}

/* Logo lateral clicable y subtítulo centrado */
.sidebar-brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none !important;
    color: inherit;
    text-align: center;
}

.sidebar-brand-link:hover,
.sidebar-brand-link:focus,
.sidebar-brand-link:active,
.sidebar-brand-link * {
    text-decoration: none !important;
}

.sidebar-brand-subtitle {
    text-align: center;
    width: 100%;
    line-height: 1.25;
}

/* Fix definitivo logo lateral */
.sidebar .sidebar-brand,
.sidebar .sidebar-brand-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.sidebar .sidebar-brand-link:link,
.sidebar .sidebar-brand-link:visited,
.sidebar .sidebar-brand-link:hover,
.sidebar .sidebar-brand-link:focus,
.sidebar .sidebar-brand-link:active {
    color: #ffffff !important;
    text-decoration: none !important;
}

.sidebar .sidebar-brand-link img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.sidebar .sidebar-brand-subtitle,
.sidebar .sidebar-brand-link .sidebar-brand-subtitle,
.sidebar .sidebar-brand-link:hover .sidebar-brand-subtitle,
.sidebar .sidebar-brand-link:focus .sidebar-brand-subtitle,
.sidebar .sidebar-brand-link:active .sidebar-brand-subtitle {
    display: block !important;
    width: 100% !important;
    margin-top: 6px !important;
    text-align: center !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.sidebar .sidebar-brand-link *,
.sidebar .sidebar-brand-link:hover *,
.sidebar .sidebar-brand-link:focus *,
.sidebar .sidebar-brand-link:active * {
    color: inherit !important;
    text-decoration: none !important;
}

/* Logo clicable solo en imagen + subtítulo blanco */
.sidebar .sidebar-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
}

.sidebar .sidebar-logo-link,
.sidebar .sidebar-logo-link:link,
.sidebar .sidebar-logo-link:visited,
.sidebar .sidebar-logo-link:hover,
.sidebar .sidebar-logo-link:focus,
.sidebar .sidebar-logo-link:active {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-decoration: none !important;
    color: inherit !important;
}

.sidebar .sidebar-logo-link img {
    display: block !important;
    margin: 0 auto !important;
}

.sidebar .sidebar-brand-subtitle {
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
    text-align: center !important;
    color: #ffffff !important;
    text-decoration: none !important;
    pointer-events: none !important;
}

/* Subtítulo Vention España blanco puro y negrita */
.sidebar .sidebar-brand .sidebar-brand-subtitle {
    color: #fff !important;
    font-weight: 800 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Login Vention España */
.login-card {
    text-align: center;
}

.login-card .login-logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-card h1 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.login-card form {
    text-align: left;
}

.login-card form button[type="submit"] {
    display: block;
    margin: 18px auto 0 auto;
    min-width: 120px;
}

/* Login título en una sola línea */
.login-card h1 {
    font-size: 30px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
}


/* Ayuda contextual dinámica */
.contextual-help {
    margin: 0 0 1rem 0;
    padding: 0.85rem 1rem;
    border-left: 4px solid #4f7cff;
    background: rgba(79, 124, 255, 0.06);
}

.contextual-help summary {
    cursor: pointer;
    font-weight: 700;
    line-height: 1.3;
}

.contextual-help-content {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.75rem;
}

.contextual-help-item h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.98rem;
}

.contextual-help-item p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
}

@media (max-width: 768px) {
    .contextual-help {
        padding: 0.75rem;
        margin-bottom: 0.85rem;
    }

    .contextual-help-item p {
        font-size: 0.9rem;
    }
}

/* fase272-fix8-product-card-style */
.card .card-title,
.card-title {
    color: #0052ff;
    font-weight: 700;
    line-height: 1.2;
}

.product-photo-card {
    align-self: start;
}

.product-photo-card .card-title {
    color: #0052ff;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
}

.product-description-field {
    align-items: flex-start;
}

.product-description-field > strong {
    color: inherit;
    font-weight: 700;
}

.product-description-value {
    display: block;
    white-space: normal;
    line-height: 1.45;
}

.product-description-value [data-product-desc-es="1"],
.product-description-value [data-product-desc-en="1"] {
    display: block;
}

.product-photo-img {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}
/* /fase272-fix8-product-card-style */

/* fase272-fix9-product-desc-admin-split */
.card .card-title,
.card-title {
    color: #0052ff;
    font-weight: 700;
    line-height: 1.2;
}

.product-description-field {
    align-items: flex-start;
}

.product-description-field > strong {
    min-width: 150px;
    color: inherit;
    font-weight: 700;
}

.product-description-value {
    display: block;
    white-space: normal;
    line-height: 1.45;
}

.product-description-field-admin-es,
.product-description-field-admin-en {
    align-items: flex-start;
}

.product-photo-card .card-title {
    color: #0052ff;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
}

.product-photo-img {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}
/* /fase272-fix9-product-desc-admin-split */

/* fase272-fix10-product-table-desc-style */
.card .card-title,
.card-title,
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6 {
    color: #0052ff;
    font-weight: 700;
    line-height: 1.2;
}

.product-description-row th {
    color: inherit;
    font-weight: 700;
    vertical-align: top;
}

.product-description-row td {
    white-space: normal;
    line-height: 1.45;
    vertical-align: top;
}

.product-description-row [data-product-desc-es="1"],
.product-description-row [data-product-desc-en="1"] {
    display: block;
}

.product-photo-card .card-title,
.product-photo-card h1,
.product-photo-card h2,
.product-photo-card h3 {
    color: #0052ff;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
}

.product-photo-img {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}
/* /fase272-fix10-product-table-desc-style */

/* fase272-fix11-photo-title-size */
.card-title,
.card .card-title,
.product-photo-card .card-title {
    color: #0052ff;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.25;
}

.product-photo-card .card-title {
    margin-top: 0;
    margin-bottom: 14px;
}
/* /fase272-fix11-photo-title-size */

/* FASE 411 - informe ventas Depau admin */
.depau-report-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.depau-report-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
    padding: 26px;
    border-radius: 28px;
    background: linear-gradient(135deg, #0f2f6e, #1b67ff 58%, #37b6ff);
    color: #fff;
    box-shadow: 0 20px 60px rgba(15, 47, 110, 0.25);
}

.depau-report-hero h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.04em;
}

.depau-report-hero .eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    opacity: 0.82;
    font-size: 12px;
}

.hero-subtitle {
    margin: 8px 0 0;
    opacity: 0.88;
}

.hero-pill {
    min-width: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-pill strong {
    font-size: 22px;
}

.depau-report-filters {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 0.8fr auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

.depau-report-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.depau-report-filters input,
.depau-report-filters select {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    padding: 8px 10px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.depau-report-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.kpi-card {
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

.kpi-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.kpi-card small {
    display: block;
    margin-top: 6px;
    color: #64748b;
}

.depau-report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.report-card {
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

.report-card-wide {
    grid-column: span 1;
}

.card-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-title-row h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.card-title-row span {
    color: #64748b;
    font-size: 12px;
}

.svg-chart-wrap {
    width: 100%;
    overflow: hidden;
}

.svg-chart-wrap svg {
    width: 100%;
    min-height: 260px;
}

.svg-chart-wrap polyline {
    filter: drop-shadow(0 8px 12px rgba(27, 103, 255, 0.18));
}

.svg-chart-wrap circle {
    fill: #fff;
    stroke: #1b67ff;
    stroke-width: 3;
}

.chart-axis {
    fill: #64748b;
    font-size: 12px;
}

.family-list,
.rank-list,
.insight-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.family-row,
.rank-row,
.insight {
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
}

.family-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.family-bar {
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.family-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1b67ff, #37b6ff);
}

.rank-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.insight.up {
    border-left: 4px solid #16a34a;
}

.insight.down {
    border-left: 4px solid #dc2626;
}

.up {
    color: #16a34a;
}

.down {
    color: #dc2626;
}

.table-scroll {
    overflow: auto;
}

.depau-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.depau-report-table th {
    text-align: left;
    color: #475569;
    background: #f1f5f9;
    padding: 10px;
    white-space: nowrap;
}

.depau-report-table td {
    border-top: 1px solid #e2e8f0;
    padding: 10px;
    vertical-align: top;
}

.depau-report-table td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.stock-note {
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .depau-report-kpis,
    .depau-report-grid,
    .depau-report-filters {
        grid-template-columns: 1fr;
    }

    .depau-report-hero {
        flex-direction: column;
    }
}

/* FASE 415 - stock Depau y Vention informe */
.depau-report-kpis {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.kpi-card.stock-alert {
    border: 1px solid #fecaca;
    background: linear-gradient(180deg, #fff, #fff7f7);
}

.kpi-card.stock-alert strong {
    color: #dc2626;
}

.kpi-card.stock-ok {
    border: 1px solid #bbf7d0;
    background: linear-gradient(180deg, #fff, #f2fff6);
}

.kpi-card.stock-ok strong {
    color: #16a34a;
}

.stock-note.stock-note-ok {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* FASE 423 - UI catalogo familias */
.catalog-taxonomy-hero {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 18px;
    padding: 24px;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, #0f2f6e, #1b67ff 58%, #37b6ff);
    box-shadow: 0 20px 60px rgba(15, 47, 110, 0.22);
}

.catalog-taxonomy-hero h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.catalog-taxonomy-hero p {
    margin: 8px 0 0;
    opacity: 0.9;
}

.catalog-taxonomy-eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
    font-size: 12px;
    opacity: 0.84;
}

.catalog-taxonomy-summary {
    min-width: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.catalog-taxonomy-summary span {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.catalog-taxonomy-summary small {
    margin-top: 6px;
    opacity: 0.9;
}

.catalog-taxonomy-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.catalog-taxonomy-card,
.catalog-taxonomy-tree-card,
.catalog-taxonomy-legacy-note,
.catalog-taxonomy-warning {
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

.catalog-taxonomy-warning {
    margin-bottom: 16px;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.catalog-taxonomy-card-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 14px;
}

.catalog-taxonomy-card-title h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.catalog-taxonomy-card-title span {
    color: #64748b;
    font-size: 12px;
}

.catalog-taxonomy-form-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catalog-taxonomy-form-preview label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.catalog-taxonomy-form-preview input,
.catalog-taxonomy-form-preview select {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    padding: 8px 10px;
    font-size: 14px;
    background: #f8fafc;
}

.catalog-taxonomy-form-preview button {
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    color: #fff;
    background: #94a3b8;
    font-weight: 900;
}

.catalog-taxonomy-form-preview small {
    color: #64748b;
    line-height: 1.35;
}

.catalog-taxonomy-tree-card {
    margin-bottom: 18px;
}

.catalog-taxonomy-tree {
    display: grid;
    gap: 14px;
}

.taxonomy-family {
    padding: 14px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #dbeafe;
}

.taxonomy-family-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: #1b67ff;
}

.taxonomy-family-header strong {
    font-size: 18px;
}

.taxonomy-family-header span,
.taxonomy-category-header span,
.taxonomy-subcategory small {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.taxonomy-category {
    margin: 12px 0 0 18px;
    padding-left: 14px;
    border-left: 3px solid #93c5fd;
}

.taxonomy-category-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.taxonomy-category-header strong {
    color: #0f172a;
}

.taxonomy-subcategory-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.taxonomy-subcategory {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff;
    color: #475569;
}

.taxonomy-subcategory.empty {
    color: #94a3b8;
    font-style: italic;
}

.catalog-taxonomy-legacy-note {
    margin-bottom: 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

@media (max-width: 1100px) {
    .catalog-taxonomy-hero,
    .catalog-taxonomy-layout {
        grid-template-columns: 1fr;
    }
}
