/* Estilos propios de Factum. Tailwind viene precompilado en public/build,
   así que las clases nuevas viven aquí con prefijo fc-. */
:root {
    --fc-ink: #0f172a;
    --fc-muted: #64748b;
    --fc-line: #e2e8f0;
    --fc-bg: #f1f5f9;
    --fc-card: #ffffff;
    --fc-brand: #0f766e;
    --fc-brand-ink: #ffffff;
    --fc-ok: #15803d;
    --fc-ok-bg: #dcfce7;
    --fc-warn: #a16207;
    --fc-warn-bg: #fef9c3;
    --fc-bad: #b91c1c;
    --fc-bad-bg: #fee2e2;
    --fc-radius: 12px;
}

.fc-page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 96px; color: var(--fc-ink); }
.fc-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.fc-title { font-size: 1.4rem; font-weight: 600; margin: 0; }
.fc-sub { color: var(--fc-muted); margin: 4px 0 0; font-size: .92rem; }

.fc-card { background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: var(--fc-radius); padding: 18px; margin-bottom: 16px; }
.fc-card h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; }

.fc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: var(--fc-brand); color: var(--fc-brand-ink); font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; }
.fc-btn:hover { filter: brightness(1.08); }
.fc-btn:disabled { opacity: .55; cursor: not-allowed; }
.fc-btn--ghost { background: #fff; color: var(--fc-ink); border-color: var(--fc-line); }
.fc-btn--danger { background: var(--fc-bad); }
.fc-btn--lg { min-height: 52px; font-size: 1.05rem; padding: 0 22px; }
.fc-btn--sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }

.fc-alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: .93rem; }
.fc-alert--ok { background: var(--fc-ok-bg); color: var(--fc-ok); }
.fc-alert--warn { background: var(--fc-warn-bg); color: var(--fc-warn); }
.fc-alert--bad { background: var(--fc-bad-bg); color: var(--fc-bad); }
.fc-alert ul { margin: 6px 0 0 18px; list-style: disc; }

.fc-badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--fc-bg); color: var(--fc-muted); }
.fc-badge--ok { background: var(--fc-ok-bg); color: var(--fc-ok); }
.fc-badge--warn { background: var(--fc-warn-bg); color: var(--fc-warn); }
.fc-badge--bad { background: var(--fc-bad-bg); color: var(--fc-bad); }

.fc-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.fc-chip { border: 1px solid var(--fc-line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .85rem; color: var(--fc-ink); text-decoration: none; }
.fc-chip.is-active { background: var(--fc-ink); color: #fff; border-color: var(--fc-ink); }
.fc-search { flex: 1 1 220px; min-width: 0; border: 1px solid var(--fc-line); border-radius: 10px; padding: 9px 12px; font-size: .95rem; }

.fc-table-wrap { overflow-x: auto; }
.fc-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.fc-table th { text-align: left; font-weight: 600; color: var(--fc-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--fc-line); white-space: nowrap; }
.fc-table td { padding: 12px; border-bottom: 1px solid var(--fc-line); vertical-align: middle; }
.fc-table tr:last-child td { border-bottom: 0; }
.fc-table tbody tr { cursor: pointer; }
.fc-table tbody tr:hover { background: #f8fafc; }
.fc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-empty { color: var(--fc-muted); }
.fc-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--fc-line); background: var(--fc-bg); }

/* En celular la tabla pasa a tarjetas. */
@media (max-width: 720px) {
    .fc-table thead { display: none; }
    .fc-table, .fc-table tbody, .fc-table tr, .fc-table td { display: block; width: 100%; }
    .fc-table tr { border: 1px solid var(--fc-line); border-radius: var(--fc-radius); margin-bottom: 10px; padding: 6px 4px; background: #fff; }
    .fc-table td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .fc-table td::before { content: attr(data-label); color: var(--fc-muted); font-size: .82rem; text-align: left; }
    .fc-table td.fc-cell-thumb::before { content: none; }
    .fc-table td.fc-cell-thumb { justify-content: flex-start; }
    .fc-num { text-align: right; }
}

.fc-fab { position: fixed; right: 18px; bottom: 18px; z-index: 30; box-shadow: 0 10px 24px rgba(15, 118, 110, .35); border-radius: 999px; }
@media (min-width: 721px) { .fc-fab { display: none; } }

.fc-capture { display: grid; gap: 12px; }
.fc-drop { border: 2px dashed var(--fc-line); border-radius: var(--fc-radius); padding: 24px; text-align: center; color: var(--fc-muted); }
.fc-preview { max-width: 100%; max-height: 60vh; border-radius: var(--fc-radius); border: 1px solid var(--fc-line); display: block; margin: 0 auto; }
.fc-progress { height: 8px; background: var(--fc-bg); border-radius: 999px; overflow: hidden; }
.fc-progress > span { display: block; height: 100%; width: 0; background: var(--fc-brand); transition: width .2s; }
.fc-hidden { display: none !important; }
.fc-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.fc-detail { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .fc-detail { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } .fc-sticky { position: sticky; top: 16px; } }
.fc-photo { width: 100%; border-radius: var(--fc-radius); border: 1px solid var(--fc-line); background: var(--fc-bg); }

.fc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fc-field label { display: block; font-size: .8rem; color: var(--fc-muted); margin-bottom: 4px; font-weight: 600; }
.fc-field input, .fc-field select, .fc-field textarea { width: 100%; border: 1px solid var(--fc-line); border-radius: 9px; padding: 8px 10px; font-size: .95rem; background: #fff; }
.fc-field.is-manual input, .fc-field.is-manual select { border-color: #93c5fd; background: #eff6ff; }
.fc-field .fc-error { color: var(--fc-bad); font-size: .8rem; margin-top: 4px; }
.fc-value { font-size: .98rem; min-height: 1.4em; }
.fc-items td { padding: 6px; }
.fc-items input { width: 100%; min-width: 70px; border: 1px solid var(--fc-line); border-radius: 8px; padding: 6px 8px; font-size: .9rem; background: #fff; }
.fc-items td.fc-num input { text-align: right; }
.fc-items td:nth-child(2) input { min-width: 200px; }
.is-manual .fc-items input { border-color: #93c5fd; background: #eff6ff; }
.fc-table tr.is-mismatch td { background: #fef3c7; }
.fc-error { color: var(--fc-bad); font-size: .8rem; margin-top: 4px; }
span.fc-meta { display: inline; }
@media (max-width: 720px) { .fc-items td:nth-child(2) input { min-width: 0; } .fc-items input { max-width: 60%; } }
.fc-section { margin: 18px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fc-muted); font-weight: 700; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fc-meta { display: grid; gap: 6px; font-size: .88rem; color: var(--fc-muted); }
.fc-meta strong { color: var(--fc-ink); font-weight: 600; }
.fc-json { background: var(--fc-bg); border-radius: 9px; padding: 10px; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

.fc-pagination { margin-top: 12px; }

.fc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.fc-kpi { background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: var(--fc-radius); padding: 12px; }
.fc-kpi span { display: block; color: var(--fc-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.fc-kpi b { display: block; margin-top: 4px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fc-pos { display: grid; gap: 16px; }
@media (min-width: 960px) {
    .fc-pos { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: start; }
    .fc-pos-cart { position: sticky; top: 12px; }
}
.fc-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fc-product { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--fc-line); border-radius: 12px; padding: 12px; cursor: pointer; min-height: 84px; }
.fc-product:hover { border-color: var(--fc-brand); }
.fc-product strong { font-size: .95rem; }
.fc-product span { color: var(--fc-muted); font-size: .82rem; }
.fc-pos-cart .fc-search { min-width: 0; width: 100%; }
.fc-ticket { width: min(80mm, 100%); margin: 16px auto; background: #fff; color: #111; border: 1px solid var(--fc-line); border-radius: 8px; padding: 16px; font-size: .86rem; }
.fc-ticket h1 { font-size: 1rem; margin: 0 0 8px; text-align: center; }
.fc-ticket p { margin: 8px 0; }
.fc-notice { text-align: center; font-weight: 700; }
.fc-ticket table { width: 100%; border-collapse: collapse; }
.fc-ticket td { padding: 6px 0; border-top: 1px dashed #cbd5e1; vertical-align: top; }
.fc-ticket td:last-child { text-align: right; white-space: nowrap; }
.fc-ticket-total { font-size: 1.05rem; font-weight: 700; text-align: right; }
@media print {
    .fc-no-print, nav, header { display: none !important; }
    .min-h-screen, body { background: #fff !important; }
    .fc-page { padding: 0; max-width: none; }
    .fc-ticket { border: 0; margin: 0; width: 80mm; }
}
