/* CONTAB — look & feel oscuro sobre Bulma 1.x (data-theme="dark") */
:root {
	--c-bg: #0b0b0d;
	--c-side: #0e0e11;
	--c-card: #17171b;
	--c-card-2: #1d1d22;
	--c-line: #26262c;
	--c-text: #f2f2f4;
	--c-muted: #8b8b95;
	--c-ok: #4ade80;
	--radius: 18px;
}
html, body { background: var(--c-bg); color: var(--c-text); }
body { font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.card-dark { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.5rem; }
.input { background: var(--c-card-2); border-color: var(--c-line); color: var(--c-text); border-radius: 12px; height: 2.9em; }
.input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.label { color: var(--c-muted); font-weight: 500; font-size: .85rem; }
.button.is-light { background: #fff; color: #0b0b0d; border-radius: 12px; font-weight: 600; }
.button.is-light:hover { background: #e6e6ea; }

/* Login / offline */
.login-body { min-height: 100vh; min-height: 100dvh; display: flex; }
.login-wrap { margin: auto; width: 100%; max-width: 420px; padding: 1rem; }
.login-card { padding: 2.25rem 2rem; }
.login-logo { display: block; height: 42px; margin: 0 auto 1.5rem; }
.login-title { text-align: center; font-size: 1.35rem; font-weight: 600; letter-spacing: .01em; }
.login-sub { text-align: center; color: var(--c-muted); margin: .25rem 0 1.5rem; font-size: .9rem; }
.login-error { color: #ff6b6b; font-size: .875rem; margin-bottom: .75rem; }
.login-btn { margin-top: .5rem; height: 2.9em; }
.login-foot { text-align: center; color: var(--c-muted); font-size: .75rem; margin-top: 1.5rem; }

/* Shell de la aplicación */
.app { display: flex; min-height: 100vh; }
.side { width: 250px; flex: none; background: var(--c-side); border-right: 1px solid var(--c-line); padding: 1.25rem .75rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side-logo { display: block; height: 34px; margin: .25rem auto 1.75rem; }
.side a.item { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 12px; color: var(--c-muted); margin-bottom: .3rem; transition: background .15s, color .15s; }
.side a.item:hover { color: var(--c-text); background: var(--c-card); }
.side a.item.is-active { color: var(--c-text); background: linear-gradient(90deg, #2a2a30, #17171b); font-weight: 600; }
.side a.item.is-disabled { opacity: .35; pointer-events: none; }
.side a.item i { width: 1.2rem; text-align: center; }
.side-user { margin-top: auto; padding: .75rem; border-top: 1px solid var(--c-line); font-size: .85rem; color: var(--c-muted); }
.side-user strong { color: var(--c-text); display: block; }
.main { flex: 1; min-width: 0; padding: 1.5rem 2rem 3rem; }
.main-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--c-line); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.main-head h1 { font-size: 1.6rem; font-weight: 700; color: #cfcfd6; }
.burger-app { display: none; }

@media (max-width: 900px) {
	.side { position: fixed; z-index: 30; left: 0; transform: translateX(-100%); transition: transform .25s; }
	.side.is-open { transform: none; }
	.main { padding: 1rem; }
	.burger-app { display: inline-flex; }
}

/* Tablas, filtros, etiquetas y formularios */
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.sub { color: var(--c-muted); font-size: .78rem; }
.r { text-align: right; }
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; background: transparent; color: var(--c-text); }
.tabla th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); font-weight: 600; padding: .75rem 1rem; background: var(--c-card-2); text-align: left; white-space: nowrap; }
.tabla th.r { text-align: right; }
.tabla td { padding: .75rem 1rem; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.tabla tbody tr:hover { background: rgba(255,255,255,.025); }
.tabla .vacio { text-align: center; color: var(--c-muted); padding: 2rem; }
.acciones { white-space: nowrap; }
.acciones .button { margin-left: .25rem; }
.filtros { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.filtros .input { width: auto; min-width: 12rem; }
.filtros-total { margin-left: auto; color: var(--c-muted); font-size: .9rem; }
.select select { background: var(--c-card-2); border-color: var(--c-line); color: var(--c-text); border-radius: 12px; }
.button.is-dark { background: var(--c-card-2); border-color: var(--c-line); color: var(--c-text); }
.button.is-dark:hover { background: #2a2a30; }
.tag-estado { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #fff; color: #0b0b0d; }
.tag-estado.e-enviado, .tag-estado.e-en_proceso { background: #3b3b44; color: #fff; }
.tag-estado.e-aceptado { background: #16382a; color: var(--c-ok); }
.tag-estado.e-aceptado_condicional { background: #3d3410; color: #fbbf24; }
.tag-estado.e-rechazado { background: #3d1616; color: #ff7b7b; }
.amb { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .65rem; font-weight: 700; letter-spacing: .05em; background: #3d3410; color: #fbbf24; text-transform: uppercase; margin-right: .35rem; }
.amb-ecf { background: #16382a; color: var(--c-ok); }
.side-user .amb { display: block; width: fit-content; margin-bottom: .5rem; }
.estado-fila { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--c-line); }
.estado-fila .ok { color: var(--c-ok); } .estado-fila .mal { color: #ff7b7b; }
.totales-form > div { display: flex; justify-content: space-between; padding: .3rem 0; }
.totales-form .grande { font-size: 1.25rem; border-top: 1px solid var(--c-line); margin-top: .5rem; padding-top: .75rem; }
.items-form input.r { text-align: right; }
.items-form .monto-linea { font-variant-numeric: tabular-nums; white-space: nowrap; }
.consulta-result { margin-top: 1.25rem; }
.toast { position: fixed; top: 1rem; right: 1rem; z-index: 9999; max-width: 24rem; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.pagination-previous.is-disabled, .pagination-next.is-disabled { pointer-events: none; opacity: .4; }
.notification.is-warning.is-light { background: #3d3410; color: #fbbf24; }
.notification.is-warning.is-light a { color: #fff; }
/* select2 oscuro */
.select2-container--default .select2-selection--single { background: var(--c-card-2); border: 1px solid var(--c-line); border-radius: 12px; height: 2.9em; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--c-text); line-height: 2.8em; padding-left: 1rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 2.8em; }
.select2-dropdown { background: var(--c-card-2); border-color: var(--c-line); color: var(--c-text); }
.select2-container--default .select2-search--dropdown .select2-search__field { background: var(--c-card); color: var(--c-text); border-color: var(--c-line); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: #fff; color: #0b0b0d; }
.jconfirm .jconfirm-box { border-radius: 18px; }
.items-form { min-width: 860px; }
.items-form td:first-child { min-width: 220px; }
.tabla td.r { white-space: nowrap; }

/* Tablero */
.mes-titulo { color: #f2f2f4; font-size: 1.25rem; font-weight: 600; }
.dash-card { height: 100%; transition: opacity .2s; }
.dash-card.cargando { opacity: .55; }
.dash-titulo { font-size: 1rem; font-weight: 600; letter-spacing: .02em; }
.kpi-fila { display: flex; align-items: baseline; gap: .9rem; margin-top: .4rem; }
.kpi-num { font-size: 3.4rem; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.kpi-delta { font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 8px; }
.kpi-delta.is-up { background: #16382a; color: var(--c-ok); }
.kpi-delta.is-down { background: #3d1616; color: #ff7b7b; }
.chart { width: 100%; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-titulo { font-weight: 600; }
.cal-btn { background: var(--c-card-2); border: 1px solid var(--c-line); color: var(--c-text); width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; }
.cal-btn:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.cal-h { text-align: center; color: var(--c-muted); font-size: .72rem; padding-bottom: .25rem; }
.cal-d { background: var(--c-card-2); border: 1px solid transparent; border-radius: 10px; padding: .35rem 0 .3rem; text-align: center; font-size: .85rem; }
.cal-d.hoy { border-color: #fff; }
.cal-d.futuro { opacity: .35; }
.cal-barras { display: flex; justify-content: center; gap: 2px; margin-top: .25rem; height: 8px; align-items: flex-end; }
.cal-barras i { width: 3px; height: 4px; border-radius: 1px; background: #33333a; }
.cal-barras i:nth-child(2) { height: 5px; } .cal-barras i:nth-child(3) { height: 6px; } .cal-barras i:nth-child(4) { height: 7px; } .cal-barras i:nth-child(5) { height: 8px; }
.cal-barras i.on { background: #fff; }
.pend-lista { list-style: none; margin: .75rem 0 0; }
.pend-lista li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--c-line); }
.pend-lista li b { display: block; }
.pend-monto { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pend-vacio { justify-content: center !important; color: var(--c-ok); border: 0 !important; padding: 2rem 0 !important; }

/* Selector de tipo de comprobante */
.tipo-switch { display: inline-flex; background: var(--c-card-2); border: 1px solid var(--c-line); border-radius: 12px; padding: 3px; }
.tipo-switch button { background: transparent; border: 0; color: var(--c-muted); padding: .4rem .9rem; border-radius: 9px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.tipo-switch button.on { background: #fff; color: #0b0b0d; }
.notification.is-info.is-light { background: #16283d; color: #9fd0ff; }
.amb-demo { background: #2a2140; color: #c4a8ff; }
.button.is-danger.is-outlined { background: transparent; border-color: #7a2b2b; color: #ff7b7b; }
.button.is-danger.is-outlined:hover { background: #3d1616; }
