/* Panel comercio — tema neo-brutalism Guiadeo */
/* Incluye todo lo de dashboard/gestion-theme.css + overrides específicos del panel comercio */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ------------------------------------------------------------------ */
/* Reset mínimo                                                        */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ */
/* Sombras offset                                                      */
/* ------------------------------------------------------------------ */
.shadow-brutal    { box-shadow: 4px 4px 0 #000; }
.shadow-brutal-sm { box-shadow: 2px 2px 0 #000; }
.shadow-brutal-lg { box-shadow: 6px 6px 0 #000; }

/* ------------------------------------------------------------------ */
/* Transiciones                                                        */
/* ------------------------------------------------------------------ */
.t-fast { transition: all 120ms linear; }
.t-med  { transition: all 180ms linear; }
.t-step { transition: all 100ms steps(3, end); }

/* ------------------------------------------------------------------ */
/* Botones                                                             */
/* ------------------------------------------------------------------ */
.btn-brutal {
  transition: transform 120ms linear, box-shadow 120ms linear;
  cursor: pointer;
  border: none;
  background: none;
}
.btn-brutal:hover  { transform: translate(2px, 2px); box-shadow: none !important; }
.btn-brutal:active { transform: translate(4px, 4px); box-shadow: none !important; }

.btn-primary {
  background: #000;
  color: #fff;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 0.75rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-secondary {
  background: #fff;
  color: #000;
  border: 2px solid #000;
  padding: 0.75rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
}
.btn-secondary:hover { background: #F5F2EB; }

.btn-cta {
  background: #CCFF00;
  color: #000;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  border-radius: 6px;
  padding: 1.5rem 2rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  text-transform: uppercase;
  width: 100%;
}
.btn-cta:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 #000 !important;
}
.btn-destructive {
  background: #FF3B30;
  color: #fff;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 0.75rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Focus visible                                                       */
/* ------------------------------------------------------------------ */
*:focus-visible {
  outline: 2px dashed #000;
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Inputs                                                              */
/* ------------------------------------------------------------------ */
.input-brutal {
  border: 2px solid #000;
  background: #fff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  width: 100%;
  transition: background 120ms linear;
}
.input-brutal:focus {
  background: #CCFF00;
  outline: none;
}
.input-brutal::placeholder { color: #9A9A9A; }

/* ------------------------------------------------------------------ */
/* Badges                                                              */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid #000;
  border-radius: 2px;
}
.badge-activo   { background: #CCFF00; color: #000; }
.badge-pausado  { background: #E5E5E5; color: #000; }
.badge-error    { background: #FF3B30; color: #fff; }
.badge-nuevo    { background: #FF6B35; color: #fff; }
.badge-pendiente{ background: #FFB800; color: #000; }

/* ------------------------------------------------------------------ */
/* Tabla                                                               */
/* ------------------------------------------------------------------ */
.tabla-brutal { width: 100%; border-collapse: collapse; }
.tabla-brutal thead tr { background: #000; color: #fff; }
.tabla-brutal thead th {
  padding: 0.625rem 1rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
}
.tabla-brutal thead th:last-child { text-align: right; }
.tabla-brutal tbody tr { border-bottom: 2px solid #000; transition: background 120ms linear; }
.tabla-brutal tbody tr:hover { background: #F5F2EB; }
.tabla-brutal tbody td { padding: 0.75rem 1rem; font-size: 0.875rem; }
.tabla-brutal tbody td.num { font-family: 'JetBrains Mono', monospace; text-align: right; }

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */
#toast-brutal {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  background: #fff;
  z-index: 200;
  transition: opacity 120ms linear, transform 120ms linear;
  white-space: nowrap;
  pointer-events: none;
}
#toast-brutal.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast-brutal.ok      { background: #CCFF00; color: #000; }
#toast-brutal.error   { background: #FF3B30; color: #fff; }
#toast-brutal.warning { background: #FFB800; color: #000; }

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-panel {
  background: #fff;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 #000;
  max-width: 42rem;
  width: calc(100% - 2rem);
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

/* ------------------------------------------------------------------ */
/* Shell layout                                                        */
/* ------------------------------------------------------------------ */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar — 80px colapsado, 220px expandido (hover/open) */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 80px;
  background: #000;
  border-right: 2px solid #000;
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow: hidden;
  transition: width 180ms linear;
}
#sidebar:hover,
#sidebar.expanded {
  width: 220px;
}

.sidebar-logo {
  padding: 1.25rem 1rem;
  border-bottom: 2px solid #1A1A1A;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo-mark {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #CCFF00;
  border: 2px solid #CCFF00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.75rem;
  color: #000;
}
.sidebar-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.25rem;
  color: #9A9A9A;
  text-decoration: none;
  cursor: pointer;
  transition: color 120ms linear, background 120ms linear;
  overflow: hidden;
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
}
.nav-item:hover { color: #fff; background: #1A1A1A; }
.nav-item.active { color: #CCFF00; border-left: 3px solid #CCFF00; }
.nav-item-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.nav-item-label {
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.sidebar-footer {
  border-top: 2px solid #1A1A1A;
  padding: 0.75rem 1rem;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #9A9A9A;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
}
.sidebar-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #1A1A1A;
  border: 2px solid #9A9A9A;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
}

/* Main content — margen izquierdo para el sidebar */
#main-content {
  flex: 1;
  margin-left: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 180ms linear;
}
#sidebar:hover ~ #main-content,
#sidebar.expanded ~ #main-content {
  margin-left: 220px;
}

/* Topbar */
#topbar {
  border-bottom: 2px solid #000;
  background: #fff;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}
.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Page container */
#page-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
}

/* ------------------------------------------------------------------ */
/* Mobile — topbar hamburguesa, sin sidebar fijo                       */
/* ------------------------------------------------------------------ */
#mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #000;
  border-bottom: 2px solid #000;
  z-index: 40;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.hamburger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
}
#mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}
#mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: #000;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 180ms linear;
}
#mobile-drawer.open { transform: translateX(0); }

@media (max-width: 767px) {
  #sidebar { display: none; }
  #main-content { margin-left: 0; padding-top: 56px; }
  #mobile-topbar { display: flex; }
}

/* ------------------------------------------------------------------ */
/* Copiloto — botón flotante y drawer                                  */
/* ------------------------------------------------------------------ */
#copilot-trigger {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  background: #000;
  color: #CCFF00;
  border: 2px solid #CCFF00;
  border-radius: 9999px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  z-index: 40;
  transition: transform 120ms linear, box-shadow 120ms linear;
}
#copilot-trigger:hover { transform: translate(1px, 1px); }

#copilot-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: #fff;
  border-left: 2px solid #000;
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 180ms linear;
}
#copilot-drawer.open { transform: translateX(0); }
