/* Tickets › COTIZACIONES › Aprobación de cotizaciones (Pages/Tickets/Cotizaciones/AprobacionCotizaciones.razor).
   Tema claro/oscuro como el resto de Tickets: el oscuro va scoped a html.dark. */
.cz-page {
    --cz-bg: #f5f5f5;
    --cz-surface: #ffffff;
    --cz-text: #1f2937;
    --cz-subtle: #6b7280;
    --cz-border: #e5e7eb;
    --cz-track: #f1f3f6;
    --cz-brand: #bd3521;
    --cz-ok: #0f8a5f;
    --cz-ok-bg: #e7f6ef;
    --cz-warn: #b7791f;
    --cz-warn-bg: #fdf3e1;
    --cz-info: #2f6fb0;
    --cz-info-bg: #e8f1fb;
    --cz-muted-bg: #eef0f3;
    --cz-danger: #c2410c;
    --cz-skel-a: #eceff3;
    --cz-skel-b: #f7f8fa;
    color: var(--cz-text);
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
    display: grid;
    gap: 14px;
    max-width: 880px;
    margin: 0 auto;
}
html.dark .cz-page, html.dark .cz-sheet {
    --cz-bg: #0e1726;
    --cz-surface: #172235;
    --cz-text: #e5e7eb;
    --cz-subtle: #a5b3c5;
    --cz-border: #2c3a50;
    --cz-track: #1f2c42;
    --cz-brand: #ff8a73;
    --cz-ok: #4fd1a1;
    --cz-ok-bg: #12352c;
    --cz-warn: #f5c26b;
    --cz-warn-bg: #3a2e14;
    --cz-info: #8bbcf0;
    --cz-info-bg: #16304d;
    --cz-muted-bg: #222f44;
    --cz-danger: #fb923c;
    --cz-skel-a: #1f2c42;
    --cz-skel-b: #2a3953;
}
.cz-page button, .cz-page input, .cz-page select, .cz-sheet button, .cz-sheet input, .cz-sheet textarea { font: inherit; }

.cz-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cz-eyebrow { font-size: .64rem; letter-spacing: .12em; font-weight: 800; color: var(--cz-brand); }
.cz-header h1 { margin: 2px 0 0; font-size: 1.3rem; font-weight: 800; }

.cz-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex-shrink: 0;
    border: 1px solid var(--cz-border); border-radius: 12px;
    background: var(--cz-surface); color: var(--cz-text); font-size: 1.05rem;
}
.cz-icon-btn:disabled { opacity: .45; }
.cz-spin { display: inline-block; animation: cz-spin .9s linear infinite; }
@keyframes cz-spin { to { transform: rotate(360deg); } }

/* Filtros */
.cz-filtros { display: grid; gap: 10px; }
.cz-select, .cz-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--cz-surface); border: 1px solid var(--cz-border); border-radius: 12px;
    padding: 0 12px; min-height: 46px; color: var(--cz-subtle);
}
.cz-select select, .cz-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    color: var(--cz-text); font-size: .9rem; min-height: 44px; padding: 0;
}
.cz-select select option { color: #111827; }
.cz-search-clear { border: 0; background: transparent; color: var(--cz-subtle); padding: 6px; }
.cz-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cz-chips::-webkit-scrollbar { display: none; }
.cz-chip {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    min-height: 38px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--cz-border); background: var(--cz-surface); color: var(--cz-subtle);
    font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.cz-chip-count {
    min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--cz-track);
    color: var(--cz-text); font-size: .72rem; text-align: center;
}
.cz-chip.is-active { color: #fff; border-color: transparent; background: var(--cz-brand); }
.cz-chip.is-active .cz-chip-count { background: rgba(255,255,255,.25); color: #fff; }
html.dark .cz-chip.is-active { color: #1b1b1b; }
html.dark .cz-chip.is-active .cz-chip-count { background: rgba(0,0,0,.18); color: #1b1b1b; }

/* Lista */
.cz-list-meta { display: flex; justify-content: space-between; align-items: center; color: var(--cz-subtle); font-size: .78rem; font-weight: 600; }
.cz-updating { display: inline-flex; align-items: center; gap: 6px; }
.cz-list { display: grid; gap: 12px; transition: opacity .15s; }
.cz-list.is-refreshing { opacity: .7; }
.cz-card {
    background: var(--cz-surface); border: 1px solid var(--cz-border); border-left: 4px solid var(--cz-border);
    border-radius: 16px; padding: 14px 14px 12px; display: grid; gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .12s, opacity .2s;
}
.cz-card:active { transform: scale(.985); }
.cz-card.is-busy { opacity: .65; }
.cz-card--por-aprobar { border-left-color: var(--cz-info); }
.cz-card--pendiente { border-left-color: var(--cz-warn); }
.cz-card--aprobado { border-left-color: var(--cz-ok); }
.cz-card--descartado { border-left-color: var(--cz-danger); }
.cz-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cz-card-id { font-size: .72rem; font-weight: 700; color: var(--cz-subtle); letter-spacing: .02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-card-title {
    margin: 0; font-size: .95rem; font-weight: 700; line-height: 1.35; color: var(--cz-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.cz-card-valor { font-size: 1.2rem; font-weight: 800; color: var(--cz-text); display: flex; align-items: baseline; gap: 8px; }
.cz-card-valor small { font-size: .7rem; font-weight: 600; color: var(--cz-subtle); }
.cz-card-info { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cz-card-info li { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--cz-subtle); line-height: 1.35; }
.cz-card-info li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-card-info li.cz-alerta { color: var(--cz-danger); font-weight: 700; }
.cz-card-actions { display: flex; gap: 8px; margin-top: 4px; }

.cz-pill { flex-shrink: 0; padding: 3px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.cz-pill--por-aprobar { color: var(--cz-info); background: var(--cz-info-bg); }
.cz-pill--pendiente { color: var(--cz-warn); background: var(--cz-warn-bg); }
.cz-pill--aprobado { color: var(--cz-ok); background: var(--cz-ok-bg); }
.cz-pill--historial { color: var(--cz-subtle); background: var(--cz-muted-bg); }
.cz-pill--descartado { color: var(--cz-danger); background: var(--cz-muted-bg); }

.cz-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 42px; padding: 8px 12px; border-radius: 11px; border: 1px solid transparent;
    font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.cz-btn:disabled { opacity: .55; }
.cz-btn--ghost { background: var(--cz-surface); border-color: var(--cz-border); color: var(--cz-text); }
.cz-btn--ok { background: var(--cz-ok); color: #fff; flex: 1; }
.cz-btn--warn { background: var(--cz-warn-bg); color: var(--cz-warn); border-color: color-mix(in srgb, var(--cz-warn) 35%, transparent); }
.cz-btn--grow { flex: 1; }
html.dark .cz-btn--ok { color: #0b1f17; }

/* Paginación */
.cz-pager { display: flex; justify-content: center; align-items: center; gap: 14px; font-size: .85rem; color: var(--cz-subtle); padding: 4px 0; }
.cz-pager strong { color: var(--cz-text); }

/* Vacío / error */
.cz-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 16px; color: var(--cz-subtle); }
.cz-empty i { font-size: 2.4rem; opacity: .6; }
.cz-empty p { margin: 0; font-size: .9rem; max-width: 320px; }

/* Skeleton */
.cz-card--skel { cursor: default; border-left-color: var(--cz-skel-a); }
.cz-skel, .cz-skel-inline {
    background: linear-gradient(90deg, var(--cz-skel-a) 0%, var(--cz-skel-b) 50%, var(--cz-skel-a) 100%);
    background-size: 200% 100%; animation: cz-shimmer 1.2s ease-in-out infinite; border-radius: 8px;
}
.cz-skel--sm { height: 11px; }
.cz-skel--lg { height: 15px; }
.cz-skel--xl { height: 22px; }
.cz-skel--btn { height: 40px; flex: 1; border-radius: 11px; }
.cz-skel-actions { display: flex; gap: 8px; margin-top: 4px; }
.cz-skel-inline { display: inline-block; width: 22px; height: 16px; }
@keyframes cz-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cz-skel, .cz-skel-inline, .cz-spin { animation: none; } }

/* Sheet inferior (detalle / pendiente) */
.cz-sheet-backdrop {
    position: fixed; inset: 0; z-index: 1050; background: rgba(15, 23, 42, .45);
    display: flex; align-items: flex-end; justify-content: center; animation: cz-fade .15s ease-out;
}
.cz-sheet-backdrop--top { z-index: 1060; }
.cz-sheet {
    --cz-surface: #ffffff; --cz-text: #1f2937; --cz-subtle: #6b7280; --cz-border: #e5e7eb; --cz-track: #f1f3f6;
    --cz-ok: #0f8a5f; --cz-ok-bg: #e7f6ef; --cz-warn: #b7791f; --cz-warn-bg: #fdf3e1; --cz-info: #2f6fb0; --cz-info-bg: #e8f1fb;
    --cz-muted-bg: #eef0f3; --cz-danger: #c2410c;
    width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column;
    background: var(--cz-surface); color: var(--cz-text);
    border-radius: 20px 20px 0 0; padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0,0,0,.18); animation: cz-up .2s ease-out;
}
.cz-sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--cz-border); margin: 4px auto 10px; }
.cz-sheet-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cz-sheet-header h2 { margin: 4px 0 0; font-size: 1.05rem; font-weight: 800; line-height: 1.35; word-break: break-word; }
.cz-sheet-body { overflow-y: auto; padding: 12px 0; display: grid; gap: 12px; -webkit-overflow-scrolling: touch; }
.cz-sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--cz-border); }
.cz-sheet-actions .cz-btn { flex: 1; }
.cz-detalle-valor { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cz-detalle-valor strong { font-size: 1.45rem; font-weight: 800; }
.cz-detalle-valor small { color: var(--cz-subtle); font-size: .75rem; }
.cz-dl { margin: 0; display: grid; gap: 0; border: 1px solid var(--cz-border); border-radius: 14px; overflow: hidden; }
.cz-dl > div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--cz-border); }
.cz-dl > div:last-child { border-bottom: 0; }
.cz-dl dt { font-size: .75rem; font-weight: 700; color: var(--cz-subtle); }
.cz-dl dd { margin: 0; font-size: .85rem; word-break: break-word; }
.cz-field { display: grid; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--cz-subtle); margin: 0; }
.cz-field b { color: var(--cz-danger); }
.cz-field input, .cz-field textarea {
    width: 100%; border: 1px solid var(--cz-border); border-radius: 11px; background: var(--cz-surface);
    color: var(--cz-text); padding: 10px 12px; font-size: .9rem; font-weight: 500; min-height: 46px;
}
.cz-muted { margin: 0; color: var(--cz-subtle); font-size: .85rem; }
.cz-error { margin: -4px 0 0; color: var(--cz-danger); font-size: .8rem; font-weight: 700; }
html.dark .cz-sheet {
    --cz-surface: #172235; --cz-text: #e5e7eb; --cz-subtle: #a5b3c5; --cz-border: #2c3a50; --cz-track: #1f2c42;
    --cz-ok: #4fd1a1; --cz-ok-bg: #12352c; --cz-warn: #f5c26b; --cz-warn-bg: #3a2e14; --cz-info: #8bbcf0; --cz-info-bg: #16304d;
    --cz-muted-bg: #222f44; --cz-danger: #fb923c;
}
@keyframes cz-fade { from { opacity: 0; } }
@keyframes cz-up { from { transform: translateY(24px); opacity: .6; } }

@media (min-width: 768px) {
    .cz-filtros { grid-template-columns: 240px 1fr; }
    .cz-chips { grid-column: 1 / -1; }
    .cz-sheet-backdrop { align-items: center; }
    .cz-sheet { border-radius: 20px; }
}

/* ── Colaborador: Quejas y Anticipos (Pages/Tickets/Colaborador) — reutiliza los tokens cz-* ── */
.cs-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: var(--cz-track); }
.cs-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 6px 4px; border: 0; border-radius: 11px; background: transparent; color: var(--cz-subtle); font-size: .74rem; font-weight: 700; }
.cs-tab i { font-size: 1.1rem; }
.cs-tab.is-active { background: var(--cz-surface); color: var(--cz-brand); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.cs-form { cursor: default; gap: 16px; padding: 16px; }
.cs-form:active { transform: none; }
.cs-autor { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--cz-track); }
.cs-autor i { font-size: 1.4rem; color: var(--cz-subtle); }
.cs-autor div { display: grid; min-width: 0; }
.cs-autor strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-autor span { font-size: .75rem; color: var(--cz-subtle); }
.cs-field { display: grid; gap: 8px; margin: 0; }
.cs-label { font-size: .82rem; font-weight: 800; color: var(--cz-text); }
.cs-label em { font-weight: 500; color: var(--cz-subtle); font-style: normal; }
.cs-hint { font-size: .72rem; color: var(--cz-subtle); }
.cs-hint--error { color: var(--cz-danger); font-weight: 700; }
.cs-input { width: 100%; border: 1px solid var(--cz-border); border-radius: 12px; background: var(--cz-surface); color: var(--cz-text); padding: 12px; font-size: 1rem; min-height: 48px; }
textarea.cs-input { resize: vertical; line-height: 1.4; }
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-chips--fill .cs-chip { flex: 1; }
.cs-chip { min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--cz-border); background: var(--cz-surface); color: var(--cz-text); font-size: .85rem; font-weight: 700; }
.cs-chip.is-active { background: var(--cz-brand); border-color: var(--cz-brand); color: #fff; }
html.dark .cs-chip.is-active { color: #1b1b1b; }
.cs-cuotas { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cs-cuotas .cs-chip { padding: 8px 0; }
.cs-options { display: grid; gap: 8px; }
.cs-options--grid { grid-template-columns: 1fr 1fr; }
.cs-option { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--cz-border); background: var(--cz-surface); color: var(--cz-text); font-size: .85rem; font-weight: 600; line-height: 1.3; }
.cs-option i { color: var(--cz-subtle); flex-shrink: 0; }
.cs-option.is-active { border-color: var(--cz-brand); background: color-mix(in srgb, var(--cz-brand) 8%, var(--cz-surface)); }
.cs-option.is-active i { color: var(--cz-brand); }
.cs-submit { width: 100%; min-height: 50px; font-size: .95rem; }
.cs-monto { display: flex; align-items: center; gap: 6px; border: 1px solid var(--cz-border); border-radius: 12px; padding: 0 12px; background: var(--cz-surface); }
.cs-monto span { font-size: 1.3rem; font-weight: 800; color: var(--cz-subtle); }
.cs-monto input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--cz-text); font-size: 1.5rem; font-weight: 800; min-height: 54px; }
.cs-monto--sm input { font-size: 1.05rem; min-height: 44px; }
.cs-resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-radius: 12px; background: var(--cz-ok-bg); }
.cs-resumen div { display: grid; }
.cs-resumen span { font-size: .72rem; color: var(--cz-subtle); font-weight: 700; }
.cs-resumen strong { font-size: 1.05rem; color: var(--cz-ok); text-transform: capitalize; }
.cs-link { grid-column: 1 / -1; justify-self: start; border: 0; background: transparent; padding: 0; color: var(--cz-ok); font-size: .8rem; font-weight: 800; }
.cs-tabla { width: 100%; border-collapse: collapse; font-size: .8rem; }
.cs-tabla th { text-align: left; color: var(--cz-subtle); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--cz-border); }
.cs-tabla td { padding: 6px 4px; border-bottom: 1px solid var(--cz-border); }
.cs-tabla td:nth-child(n+3), .cs-tabla th:nth-child(n+3) { text-align: right; }
.cs-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: .88rem; color: var(--cz-text); margin: 0; }
.cs-check input { width: 20px; height: 20px; accent-color: var(--cz-brand); }
.cs-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--cz-warn-bg); color: var(--cz-warn); font-size: .88rem; font-weight: 600; }
.cs-aviso--info { background: var(--cz-info-bg); color: var(--cz-info); }
.cs-aviso i { font-size: 1.2rem; }
.cs-subtitulo { margin: 8px 0 0; font-size: 1rem; font-weight: 800; }
.cs-meta { margin: 0; font-size: .8rem; color: var(--cz-subtle); }
.cs-detalle { margin: 0; font-size: .85rem; color: var(--cz-text); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cs-queja { cursor: default; }
.cs-queja--0 { border-left-color: var(--cz-warn); }
.cs-queja--1 { border-left-color: var(--cz-info); }
.cs-queja--2 { border-left-color: var(--cz-ok); }
.cs-respuesta { display: flex; gap: 8px; padding: 10px; border-radius: 10px; background: var(--cz-track); font-size: .82rem; }
.cs-respuesta div { display: grid; gap: 2px; }
.cs-respuesta strong { font-size: .74rem; color: var(--cz-subtle); }
@media (max-width: 360px) { .cs-options--grid { grid-template-columns: 1fr; } .cs-cuotas { grid-template-columns: repeat(4, 1fr); } }

/* Teclado abierto (--teclado lo pone index.html con la altura real): el panel inferior sube por encima. */
.cz-sheet-backdrop { padding-bottom: var(--teclado, 0px); transition: padding-bottom .2s ease; }
.cz-sheet { max-height: calc(88vh - var(--teclado, 0px)); }

/* Buzón de quejas: pestañas de 2, aviso de respuesta nueva y conversación */
.cs-tabs--2 { grid-template-columns: repeat(2, 1fr); }
.bz-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--cz-danger); color: #fff; font-size: .66rem; font-weight: 800; vertical-align: 1px; }
.bz-card--nuevo { box-shadow: 0 0 0 2px color-mix(in srgb, var(--cz-info) 45%, transparent); }
.bz-nuevo { color: var(--cz-info); font-weight: 800; }
.bz-hilo { cursor: default; gap: 10px; }
.bz-hilo:active { transform: none; }
.bz-msg { display: grid; gap: 4px; max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: .88rem; line-height: 1.4; }
.bz-msg p { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--cz-text); }
.bz-msg-autor { font-size: .7rem; font-weight: 800; color: var(--cz-subtle); }
.bz-msg--yo { justify-self: end; background: var(--cz-track); border-bottom-right-radius: 4px; }
.bz-msg--admin { justify-self: start; background: var(--cz-info-bg); border-bottom-left-radius: 4px; }
.bz-msg--admin .bz-msg-autor { color: var(--cz-info); }
.cs-tabs--4 { grid-template-columns: repeat(4, 1fr); }
.bz-volver { display: flex; } .bz-card { cursor: pointer; }
