/* =====================================================
   🎯 VARIABLES (opcional pero prolijo)
===================================================== */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
}





/* =========================================
   TOPBAR (PERFIL FLOTANTE)
========================================= */

.fx-topbar {
  position: fixed;
  top: 0;
  right: 0;

  height: 55px;
  display: flex;
  align-items: center;

  padding-right: 20px;

  background: transparent;
  border: none;

  z-index: 100; /* encima del header */
}



.profile-menu {
  position: relative;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  cursor: pointer;
  transition: 0.2s ease;
}

.profile-button:hover {
  background: #f9fafb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.profile-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.profile-info strong {
  font-size: 12px;
  font-weight: 700;
}

.profile-info small {
  font-size: 11px;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-arrow {
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.profile-menu.open .profile-arrow {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.14);
  padding: 7px;
  display: none;
  z-index: 100;
}

.profile-menu.open .profile-dropdown {
  display: block;
}

.profile-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.profile-option:hover {
  background: #f3f4f6;
}

.profile-option.danger {
  color: #dc2626;
}

.profile-option.danger:hover {
  background: #fef2f2;
}

/* MOBILE */
@media (max-width: 600px) {
  .fx-topbar {
    padding: 0 10px;
  }

  .profile-info {
    display: none;
  }

  .profile-button {
    padding: 5px 8px 5px 5px;
  }

  .profile-dropdown {
    right: 0;
    width: 190px;
  }
}




/* =====================================================
   📊 BANNER MENSUAL
===================================================== */
.banner-mensual {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.banner-header {
  font-size: 13px;
  opacity: 0.9;
}

.banner-total {
  font-size: 22px;
  font-weight: bold;
  margin: 5px 0 10px;
}

.banner-middle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.up { color: #86efac; }
.down { color: #fca5a5; }

.banner-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.banner-stats span {
  display: block;
  opacity: 0.8;
}

.banner-stats strong {
  font-size: 14px;
}

/* botón */
.btn-vermas {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* =====================================================
   📦 MENU MES
===================================================== */
#menuMes {
  position: absolute;
  top: 40px;
  right: 0;
  background: white;
  color: var(--text);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
}

.menu-hidden {
  display: none !important;
}

#menuMes select,
#menuMes button {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
}

#menuMes select {
  border: 1px solid #ddd;
}

#menuMes button {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
}

/* =====================================================
   📅 FILTROS (ACÁ ESTÁ TU FIX)
===================================================== */
.dashboard-filtros {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* input ocupa todo */
.dashboard-filtros input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* botón consistente */
.dashboard-filtros button {
  padding: 10px 16px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

/* =====================================================
   📊 TABLA
===================================================== */
.dashboard-table {
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-compact tr {
  border-bottom: 1px solid #eee;
}

.table-compact td {
  padding: 10px 12px;
}

.table-compact td:first-child {
  color: var(--muted);
}

.table-compact td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

/* separador */
.separator td {
  background: #f3f4f6;
  font-weight: bold;
}

/* colores */
.ok { color: #059669; }
.info { color: #3b82f6; }
.warn { color: #f59e0b; }
.danger { color: #ef4444; }

/* =====================================================
   💰 TOTAL BOX
===================================================== */
.total-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 16px;
  text-align: center;
}

.total-box h1 {
  font-size: 26px;
  margin-top: 5px;
}

/* =====================================================
   📱 MOBILE
===================================================== */
@media (max-width: 500px) {

  .table thead {
    display: none;
  }

  .table tr {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .table td {
    display: flex;
    justify-content: space-between;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #666;
  }
}

/* =====================================================
   🖥️ DESKTOP
===================================================== */
@media (min-width: 1024px) {

  .banner-mensual {
    max-width: 500px;
    margin: 20px 0;
  }

  .dashboard-table {
    max-width: 525px;
    margin: 2px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  }

  .dashboard-filtros input {
    max-width: 300px;
  }

  .dashboard-filtros {
    align-items: center;
  }

}

/* =====================================================
    SWITCH DE CAMBIO DE TIENDA
===================================================== */
.switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.label {
  font-size: 13px;
  color: #6b7280;
}

/* switch base */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* ocultar checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* fondo */
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #316b50;
  border-radius: 34px;
  transition: 0.3s;
}

/* círculo */
.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

/* activo */
input:checked + .slider {
  background-color: #4f46e5;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

input:checked ~ .label:last-child {
  color: #111;
  font-weight: 600;
}
