/* ==========================================================================
   AGM SYSTEM - Layout: shell, topbar, navegacion, pagina, tarjetas, tablas,
   modales y pantalla de login.
   ========================================================================== */
.shell { display: flex; flex-direction: column; min-height: 100vh; }

/* --- Topbar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.brand-logo { font-size: 24px; }
.brand-name { font-weight: 800; letter-spacing: 0.5px; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

/* Botones sobre el chrome oscuro: .btn-ghost es transparente y hereda texto
   oscuro, asi que en el topbar azul se veia casi negro hasta el hover. Aqui
   se le da texto/borde claros y un hover acorde. */
.topbar .btn-ghost {
  color: #e8eefc;
  border-color: rgba(255, 255, 255, 0.38);
}
.topbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.62);
  color: #fff;
}
/* Textos secundarios del topbar (ej. la sucursal) legibles sobre azul oscuro. */
.topbar .muted { color: #b7c3da; }

.rate-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}
.rate-label { font-size: 11px; font-weight: 700; color: #ffd9b0; }
.rate-value { font-weight: 700; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-role {
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* --- Layout --- */
.layout { display: flex; flex: 1; min-height: 0; }
.nav {
  width: 210px;
  flex-shrink: 0;
  background: var(--bg);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-icon { font-size: 17px; }

.view { flex: 1; min-width: 0; padding: 18px; overflow-x: hidden; }

/* --- Pagina --- */
.page { display: flex; flex-direction: column; gap: 14px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.section-title { margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }

/* --- Tarjetas --- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}
.card-body { padding: 14px; }

/* --- Tablas --- */
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 9px 10px;
  background: var(--panel-soft);
  border-bottom: 2px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  white-space: nowrap;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fafbfe; }
.data-table td.empty { text-align: center; color: var(--muted); padding: 18px; }
.cell-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; }
.empty { text-align: center; color: var(--muted); padding: 20px; }

/* --- Modales --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 2000;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-body { padding: 16px; overflow: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}
.receipt-paper {
  font-family: var(--mono);
  font-size: 12px;
  background: #fbfbf8;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  margin: 0;
}

/* --- Login --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1c2b4a, var(--bg));
  padding: 18px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 16px; }
.login-logo { font-size: 44px; }
