/* Lo que Tailwind por CDN no cubre bien: el rail con tooltips, la animación
   del panel derecho, y unas clases de formulario para no repetir 20 utilidades
   en cada input. Todo lo demás es Tailwind en el HTML. Paleta PO Box: teal
   #03989e / #016266, amarillo #febb0a. */

.app { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 16px 0; background: linear-gradient(180deg, #062b2d 0%, #021718 100%); z-index: 30;
}
.rail-logo {
  width: 50px; height: 50px; margin-bottom: 14px; border-radius: 15px; display: grid; place-items: center;
  background: #fff; box-shadow: 0 8px 20px rgba(3,152,158,.35); overflow: hidden;
}
.rail-logo img { width: 42px; height: 42px; object-fit: contain; }
.rail-btn {
  position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  color: rgba(255,255,255,.55); transition: background .15s, color .15s;
}
.rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-btn.activo { background: linear-gradient(135deg, #03989e, #016266); color: #fff; box-shadow: 0 8px 20px rgba(3,152,158,.4); }
.rail-btn .tip {
  position: absolute; left: 64px; top: 50%; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  background: #0f1b2d; color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px;
  opacity: 0; transition: opacity .12s; z-index: 40;
}
.rail-btn:hover .tip { opacity: 1; }
.rail-esp { flex: 1; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: sticky; height: auto; flex-direction: row; padding: 8px 12px; gap: 4px; overflow-x: auto; }
  .rail-logo { width: 40px; height: 40px; margin: 0 8px 0 0; }
  .rail-logo img { width: 34px; height: 34px; }
  .rail-btn { width: 44px; height: 44px; }
  .rail-btn .tip { display: none; }
}

/* Panel derecho: flotante, con margen, esquinas redondeadas. */
.panel-fondo {
  position: fixed; inset: 0; z-index: 60; background: rgba(2,23,24,.4); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .22s;
}
.panel-fondo.on { opacity: 1; }
.panel {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 61;
  width: min(640px, calc(100vw - 24px)); display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: 0 4px 12px rgba(15,40,70,.08), 0 24px 56px rgba(15,40,70,.16);
  transform: translateX(calc(100% + 20px)); transition: transform .26s cubic-bezier(.32,.72,0,1);
}
.panel.on { transform: translateX(0); }
.panel.ancho { width: min(900px, calc(100vw - 24px)); }
body.panel-abierto { overflow: hidden; }

/* Formularios */
.campo {
  width: 100%; border: 1px solid #d3dde0; border-radius: 12px; padding: 9px 12px; font-size: 14px; background: #fff;
  color: #0f1b2d; outline: none; transition: border-color .12s, box-shadow .12s;
}
.campo:focus { border-color: #03989e; box-shadow: 0 0 0 3px rgba(3,152,158,.16); }
.campo-sm { padding: 6px 9px; font-size: 13px; border-radius: 10px; }
textarea.campo { min-height: 84px; resize: vertical; }
.etq { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #5b6675; margin-bottom: 5px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700; transition: transform .08s, box-shadow .12s, background .12s; cursor: pointer; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primario { background: linear-gradient(135deg, #03989e, #016266); color: #fff; box-shadow: 0 6px 16px rgba(3,152,158,.28); }
.btn-primario:hover { box-shadow: 0 8px 22px rgba(3,152,158,.38); }
.btn-amarillo { background: #febb0a; color: #3b2a00; box-shadow: 0 6px 16px rgba(254,187,10,.3); }
.btn-amarillo:hover { background: #ffc629; }
.btn-verde { background: #0f9d58; color: #fff; box-shadow: 0 6px 16px rgba(15,157,88,.25); }
.btn-suave { background: #fff; color: #0f1b2d; border: 1px solid #d3dde0; }
.btn-suave:hover { background: #f3f8f8; }
.btn-peligro { background: #fdecec; color: #b42323; }
.btn-icono { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #5b6675; }
.btn-icono:hover { background: #eef5f5; color: #0f1b2d; }
.btn-mini { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; transition: transform .08s, background .12s; }
.btn-mini:active { transform: translateY(1px); }
.tarjeta { background: #fff; border-radius: 22px; box-shadow: 0 1px 2px rgba(15,27,45,.04), 0 6px 20px rgba(15,27,45,.06); }
.fila { cursor: pointer; transition: background .1s; }
.fila:hover { background: #f4f9f9; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13px; font-weight: 700; color: #5b6675; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tab:hover { color: #0f1b2d; }
.tab.on { color: #016266; border-image: linear-gradient(90deg, #2fc0c5, #016266) 1; }
.tab .n { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #e8eef0; color: #5b6675; }
.tab.on .n { background: #e8f6f6; color: #016266; }
.tnum { font-variant-numeric: tabular-nums; }
.tabla th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #5b6675; background: #f6f9fa; text-align: left; padding: 10px 14px; white-space: nowrap; }
.tabla td { padding: 11px 14px; border-top: 1px solid #edf1f2; vertical-align: middle; }
.desplegable > summary::-webkit-details-marker { display: none; }

/* Gráfica: resalta el mes bajo el mouse */
.barra-mes:hover > rect:first-of-type { fill: rgba(3,152,158,.07); }

/* Selector de cliente con búsqueda */
.buscador-lista { max-height: 320px; overflow-y: auto; }
.buscador-op { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.buscador-op:hover, .buscador-op.on { background: #e8f6f6; }

/* Tailwind pone display en clases (.grid, .flex) y le gana al atributo hidden. */
[hidden] { display: none !important; }

@media print {
  .no-imprimir { display: none !important; }
  body { background: #fff !important; }
}
