/* Costo por cliente (24/10, diseño 2): pestañas, una tarjeta principal y barras. Colores del sistema (cuartico.css),
   así funciona igual en modo noche. */
/* Colores de Cuartico: azules y verdes (24/10, Luis: «los colores de cuartico son azul y verde»). */
.cc { --cc-serve: var(--pro-cyan, #3DD6F5); --cc-fixed: #5B8DEF; --cc-keep: var(--mint, #5BE3A6); --cc-sell: #1E5AA8; }
.cq[data-theme='oscuro'] .cc { --cc-sell: #4F8FE6; }
.cc-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cc-tabs, .cc-days, .cc-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-3, #EEF4F0); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cc-tabs::-webkit-scrollbar { display: none; }
.cc-tabs button, .cc-days button, .cc-switch button { flex: none; border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.cc-days button { padding: 8px 11px; font-size: 12.5px; }
.cc-tabs [aria-selected="true"], .cc-days [aria-pressed="true"], .cc-switch [aria-pressed="true"] { background: var(--surface, #fff); color: var(--text); box-shadow: var(--sh-1); }
.cc-alert { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--cc-fixed) 14%, transparent); color: var(--text); font-weight: 600; font-size: 13.5px; }
.cc-body { display: grid; gap: 14px; animation: cc-in .25s var(--ease, ease); }
@keyframes cc-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .cc-body { animation: none; } }

.cc-kicker { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--text-3); }
.cc-big { margin: 2px 0 0; font-family: var(--f-display); font-size: clamp(34px, 6vw, 48px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.cc-big small { font-size: .38em; font-weight: 700; margin-left: 4px; color: var(--text-3); letter-spacing: 0; }
.cc-mid { margin: 2px 0 0; font-family: var(--f-display); font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.cc-fine { margin: 0; font-size: 12.5px; color: var(--text-3); }
.cc-warn { color: #2F5FC4; }

/* Tarjeta principal (oscura, de marca) */
.cc-hero { padding: 20px; border-radius: var(--r-lg, 22px); background: radial-gradient(120% 140% at 100% 0%, var(--e700, #0A4D38) 0%, var(--e900, #04261C) 60%); color: #E8F4EE; box-shadow: var(--sh-2); }
.cc-hero .cc-kicker { color: #A9D9C2; }
.cc-hero .cc-big, .cc-hero .cc-mid { color: #fff; }
.cc-hero .cc-big small { color: #A9D9C2; }
.cc-hero.is-loss { background: radial-gradient(120% 140% at 100% 0%, var(--pro-700, #143058) 0%, var(--pro-950, #040A16) 65%); }
.cc-hero-top { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: space-between; align-items: flex-end; }
.cc-hero-side { text-align: right; }
.cc-hero.is-loss .cc-hero-side .cc-mid { color: var(--pro-cyan, #3DD6F5); }
.cc-bar { display: flex; height: 14px; margin: 18px 0 10px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.1); gap: 2px; }
.cc-seg { min-width: 6px; flex-basis: 0; }
.cc-seg.is-serve, .cc-legend .is-serve { background: var(--cc-serve); }
.cc-seg.is-fixed, .cc-legend .is-fixed { background: var(--cc-fixed); }
.cc-seg.is-keep, .cc-legend .is-keep { background: var(--mint, #5BE3A6); }
.cc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: #CFE6DA; }
.cc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cc-legend b { color: #fff; margin-left: 2px; }
.cc-hero-note { margin: 14px 0 8px; font-size: 13px; color: #B9DCCB; }
.cc-scale { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cc-scale li { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cc-scale b { font-size: 18px; color: #fff; }
.cc-scale span { margin-left: 4px; font-size: 12px; color: #A9D9C2; }
.cc-scale em { display: block; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--mint, #5BE3A6); }

/* Indicadores pequeños */
.cc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cc-kpis.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-kpi { min-width: 0; padding: 14px; border-radius: var(--r-md, 16px); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.cc-kpi p { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.cc-kpi b { display: block; margin-top: 2px; font-family: var(--f-display); font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-kpi small { font-size: 12px; color: var(--text-3); }

/* Gastos */
.cc-total { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-end; }
.cc-total small { font-size: 13px; color: var(--text-3); }
.cc-in { text-align: right; }
.cc-in .cc-mid { color: var(--pos); }
.cc-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cc-bar-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cc-bar-head b { margin-left: auto; font-variant-numeric: tabular-nums; }
.cc-tag { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; background: var(--surface-3); color: var(--text-2); }
.cc-tag.is-atender { background: color-mix(in srgb, var(--cc-serve) 18%, transparent); color: var(--pro-ink, #0E7490); }
.cc-tag.is-vender { background: color-mix(in srgb, var(--cc-sell) 16%, transparent); color: var(--cc-sell); }
.cc-tag.is-fijo { background: color-mix(in srgb, var(--cc-fixed) 18%, transparent); color: #2F5FC4; }
.cq[data-theme='oscuro'] .cc-tag.is-atender { color: var(--pro-cyan, #3DD6F5); }
.cq[data-theme='oscuro'] .cc-tag.is-fijo { color: #9DBBFF; }
.cc-track { height: 10px; margin-top: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cc-track span { display: block; height: 100%; min-width: 4px; border-radius: 999px; transition: width .4s var(--ease, ease); }
.cc-track .is-atender { background: var(--cc-serve); }
.cc-track .is-vender { background: var(--cc-sell); }
.cc-track .is-fijo { background: var(--cc-fixed); }
.cc-more { border-radius: var(--r-md, 16px); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 16px; font-size: 13.5px; color: var(--text-2); }
.cc-more summary { cursor: pointer; font-weight: 700; color: var(--text); }
.cc-more p { margin: 8px 0 0; }
.cc-wa { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.cc-wa li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; font-size: 12.5px; }
.cc-wa small { color: var(--text-3); }

/* Formularios */
.cc-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.cc-field { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.cc-input { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 44px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-2); }
.cc-input:focus-within { box-shadow: inset 0 0 0 2px var(--g400); }
.cc-input em { font-style: normal; font-size: 13px; color: var(--text-3); }
.cc-input input { width: 84px; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; font-weight: 700; color: var(--text); padding: 0; }
.cc-switch { align-self: flex-end; }
.cc-result .cc-big { font-size: clamp(38px, 7vw, 56px); }
.cc-set { display: grid; gap: 10px; }
.cc-fixed { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cc-fixed li { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; gap: 8px; align-items: center; }
.cc-name { min-height: 44px; min-width: 0; padding: 0 12px; border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font: inherit; font-size: 14.5px; color: var(--text); }
.cc-name:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--g400); }
.cc-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); font-size: 20px; cursor: pointer; }
.cc-x:hover { background: var(--surface-3); color: var(--r600); }
.cc-add { justify-self: start; border: 0; background: transparent; padding: 6px 2px; font-weight: 700; color: var(--g500); cursor: pointer; }

@media (max-width: 720px) {
  .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-kpis.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-kpis.is-3 .cc-kpi:last-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .cc-head { gap: 8px; }
  .cc-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .cc-tabs button { padding: 8px 4px; font-size: 12.5px; }
  .cc-hero { padding: 16px; }
  .cc-hero-side, .cc-in { text-align: left; }
  .cc-scale li { padding: 8px 10px; }
  .cc-scale b { font-size: 16px; }
  .cc-scale span { display: none; }
  .cc-input input { width: 64px; }
  .cc-fixed li { grid-template-columns: minmax(0, 1fr) auto 32px; }
}
