/* ============================================================
   Elotes Locos — Centro de Operaciones
   Carbón cálido + rojo marca #c40414 + amarillo #f0b30c
   Display: Cormorant Garamond · UI: Jost
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Jost:wght@300;400;500;600;700&display=swap');

:root {
  --rojo: #c40414;
  --rojo-vivo: #e8101f;
  --rojo-hondo: #7d030d;
  --amarillo: #f0b30c;
  --amarillo-suave: #f8cf5e;
  --carbon: #14100d;
  --carbon-2: #1d1713;
  --carbon-3: #271f19;
  --linea: #382c22;
  --crema: #f6ead2;
  --crema-dim: #b8a78c;
  --crema-mute: #79695a;
  --verde: #5fb868;
  --display: 'Cormorant Garamond', serif;
  --ui: 'Jost', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--carbon);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(196,4,20,.16), transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 110%, rgba(240,179,12,.05), transparent 60%);
  background-attachment: fixed;
  color: var(--crema);
  font-family: var(--ui);
  font-weight: 300;
  min-height: 100vh;
  letter-spacing: .01em;
}
body::before { /* grano sutil */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 28px 80px; }

/* ---------------- header ---------------- */
header.top {
  display: flex; align-items: center; gap: 22px;
  padding: 26px 0 18px; margin-bottom: 8px;
  border-bottom: 1px solid var(--linea);
}
header.top img.logo { height: 58px; width: auto; }
header.top .brand h1 {
  font-family: var(--display); font-weight: 600; font-size: 26px;
  letter-spacing: .04em; line-height: 1;
}
header.top .brand small {
  display: block; font-family: var(--ui); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: .34em; color: var(--amarillo); margin-top: 6px;
}
nav.menu { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.menu a {
  color: var(--crema-dim); text-decoration: none; font-size: 14px; font-weight: 400;
  padding: 9px 16px; border-radius: 999px; transition: all .22s ease;
}
nav.menu a:hover { color: var(--crema); background: var(--carbon-3); }
nav.menu a.on { color: #fff; background: var(--rojo); font-weight: 500; }
nav.menu a.salir { color: var(--crema-mute); font-size: 13px; }

/* ---------------- sonrisa motif ---------------- */
.smile { display: block; margin: 4px 0 26px; }

/* ---------------- selector de mes ---------------- */
.barra-mes { display: flex; align-items: baseline; gap: 18px; margin: 26px 0 30px; flex-wrap: wrap; }
.barra-mes h2 {
  font-family: var(--display); font-weight: 500; font-style: italic;
  font-size: clamp(34px, 5vw, 52px); line-height: .9; color: var(--crema);
}
.barra-mes form { margin-left: auto; }
select, input[type=text], input[type=number], input[type=date], input[type=password], input[type=datetime-local] {
  background: var(--carbon-2); color: var(--crema); border: 1px solid var(--linea);
  font-family: var(--ui); font-size: 14px; padding: 10px 14px; border-radius: 10px;
  outline: none; transition: border-color .2s;
}
select:focus, input:focus { border-color: var(--amarillo); }

/* ---------------- KPIs ---------------- */
.kpis { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi {
  background: linear-gradient(160deg, var(--carbon-2), var(--carbon-3));
  border: 1px solid var(--linea); border-radius: 18px; padding: 22px 24px 18px;
  position: relative; overflow: hidden;
}
.kpi .tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .22em;
  color: var(--crema-mute); margin-bottom: 10px;
}
.kpi .num {
  font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1; color: var(--crema); font-variant-numeric: lining-nums;
}
.kpi .sub { font-size: 13px; color: var(--crema-dim); margin-top: 9px; }
.kpi.ventas { grid-column: span 5; }
.kpi.ventas .num { color: var(--amarillo); font-size: clamp(44px, 5vw, 64px); }
.kpi.neto { grid-column: span 4; border-color: rgba(196,4,20,.55); }
.kpi.neto::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 90% at 100% 0%, rgba(196,4,20,.22), transparent 55%);
  pointer-events: none;
}
.kpi.neto .num { color: #fff; }
.kpi.chico { grid-column: span 3; }
.kpi.tercio { grid-column: span 4; }
.kpi .num.malo { color: var(--rojo-vivo); }
.kpi .num.bueno { color: var(--verde); }

/* ---------------- secciones ---------------- */
.seccion { margin-top: 44px; }
.seccion > h3 {
  font-family: var(--ui); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .3em; color: var(--amarillo);
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.seccion > h3::after { content: ''; flex: 1; height: 1px; background: var(--linea); }

/* ---------------- gráfica diaria (CSS bars) ---------------- */
.chart {
  display: flex; align-items: flex-end; gap: 4px; height: 190px;
  background: var(--carbon-2); border: 1px solid var(--linea); border-radius: 18px;
  padding: 24px 20px 34px; position: relative;
}
.chart .dia { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.chart .dia .barra {
  width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--amarillo), #c98f06);
  min-height: 2px; transition: filter .15s;
  animation: crecer .7s cubic-bezier(.2,.8,.25,1) backwards;
}
.chart .dia:nth-child(odd) .barra { animation-delay: .05s; }
.chart .dia:hover .barra { filter: brightness(1.25); }
.chart .dia .lbl { position: absolute; bottom: -24px; font-size: 10px; color: var(--crema-mute); }
.chart .dia .tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--rojo); color: #fff; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap; z-index: 3;
}
.chart .dia:hover .tip { display: block; }
@keyframes crecer { from { transform: scaleY(0); transform-origin: bottom; } }

/* ---------------- canales ---------------- */
.canales { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.canal {
  background: var(--carbon-2); border: 1px solid var(--linea); border-radius: 16px; padding: 18px 20px;
}
.canal .nom { font-weight: 500; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }
.canal .nom small { color: var(--crema-mute); font-weight: 400; }
.canal .monto { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 8px 0 4px; color: var(--crema); }
.canal .fee { font-size: 12.5px; color: var(--crema-dim); }
.canal .track { height: 5px; background: var(--carbon); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.canal .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--rojo), var(--amarillo)); }

/* ---------------- tablas ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th {
  text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: .18em; color: var(--crema-mute); padding: 10px 14px;
  border-bottom: 1px solid var(--linea);
}
table td { padding: 11px 14px; border-bottom: 1px solid rgba(56,44,34,.45); color: var(--crema-dim); }
table tr:hover td { background: rgba(240,179,12,.03); color: var(--crema); }
table td.num, table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table td .pill {
  display: inline-block; font-size: 11.5px; font-weight: 500; padding: 3px 10px;
  border-radius: 999px; background: var(--carbon-3); border: 1px solid var(--linea);
}
table td .pill.efectivo { color: var(--verde); }
table td .pill.tarjeta { color: var(--amarillo-suave); }
table td .pill.didi { color: #ff7a45; }
table td .pill.rappi { color: #ff441f; }
table td .pill.uber { color: #7dd87d; }
table td .pill.whatsapp { color: #25d366; }
.tabla-card { background: var(--carbon-2); border: 1px solid var(--linea); border-radius: 18px; overflow: hidden; }
.tabla-card .scroll { overflow-x: auto; }

/* ---------------- formularios / botones ---------------- */
.btn {
  display: inline-block; background: var(--rojo); color: #fff; border: none; cursor: pointer;
  font-family: var(--ui); font-weight: 500; font-size: 14px; letter-spacing: .04em;
  padding: 11px 26px; border-radius: 999px; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
  box-shadow: 0 6px 18px -8px rgba(196,4,20,.7);
}
.btn:hover { background: var(--rojo-vivo); transform: translateY(-1px); }
.btn.amarillo { background: var(--amarillo); color: var(--carbon); box-shadow: 0 6px 18px -8px rgba(240,179,12,.6); }
.btn.amarillo:hover { background: var(--amarillo-suave); }
.btn.fantasma { background: transparent; border: 1px solid var(--linea); color: var(--crema-dim); box-shadow: none; }
.btn.fantasma:hover { border-color: var(--crema-mute); color: var(--crema); }
.btn.mini { padding: 6px 14px; font-size: 12.5px; }

.form-card {
  background: var(--carbon-2); border: 1px solid var(--linea); border-radius: 18px;
  padding: 26px 28px;
}
.form-card .fila { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.form-card label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--crema-mute); margin-bottom: 6px; }
.form-card .campo { flex: 1; min-width: 140px; }
.form-card input, .form-card select { width: 100%; }

/* ---------------- avisos ---------------- */
.aviso {
  border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; font-size: 14.5px;
  border: 1px solid;
}
.aviso.ok { background: rgba(95,184,104,.08); border-color: rgba(95,184,104,.4); color: #9fd8a5; }
.aviso.warn { background: rgba(240,179,12,.07); border-color: rgba(240,179,12,.4); color: var(--amarillo-suave); }
.aviso.error { background: rgba(196,4,20,.1); border-color: rgba(196,4,20,.5); color: #ff8d96; }

/* ---------------- dropzone ---------------- */
.dropzone {
  border: 2px dashed var(--linea); border-radius: 22px; padding: 56px 30px;
  text-align: center; background: var(--carbon-2); transition: border-color .2s, background .2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--amarillo); background: rgba(240,179,12,.04); }
.dropzone .ico { font-size: 40px; margin-bottom: 12px; }
.dropzone p { color: var(--crema-dim); font-size: 15px; }
.dropzone p b { color: var(--crema); font-weight: 500; }
.dropzone small { color: var(--crema-mute); display: block; margin-top: 8px; }

/* ---------------- login ---------------- */
.login-box {
  max-width: 380px; margin: 12vh auto 0; text-align: center;
}
.login-box img { height: 110px; margin-bottom: 26px; }
.login-box h1 { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 34px; margin-bottom: 6px; }
.login-box p { color: var(--crema-mute); font-size: 13px; letter-spacing: .26em; text-transform: uppercase; margin-bottom: 30px; }
.login-box input { width: 100%; text-align: center; font-size: 16px; padding: 14px; margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 14px; font-size: 15px; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .kpi.ventas, .kpi.neto, .kpi.chico, .kpi.tercio { grid-column: span 12; }
  header.top { flex-wrap: wrap; }
  nav.menu { margin-left: 0; width: 100%; }
  .chart { height: 150px; }
  .chart .dia:nth-child(even) .lbl { display: none; }
}
