/* ============================================================
   Megawash — Base Styles
   Sistema de gestión de lavado de autos
   ============================================================
   Global reset, typography, layout shell, and mobile nav.
   ============================================================ */

/* --- Imports --------------------------------------------- */
@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@400;500;600&display=swap');


/* ============================================================
   1. CSS Reset
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--color-acento);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}


/* ============================================================
   2. Base Typography & Document
   ============================================================ */
html {
  font-family: var(--fuente-texto);
  font-size: 100%;                          /* 16px default */
  background: var(--color-fondo);
  color: var(--color-tinta);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-width: 360px;
}

body {
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--fuente-titulo);
  font-weight: var(--fuente-peso-bold);
  line-height: 1.2;
}


/* ============================================================
   3. Tabular Numerals
   ============================================================ */
.tabular,
table,
.kpi,
.placa {
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   4. Focus Visible
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--color-acento);
  outline-offset: 2px;
}


/* ============================================================
   5. Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   6. Scrollbar Styling (thin, subtle)
   ============================================================ */
/* Webkit / Blink */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-linea);
  border-radius: var(--radio-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-texto-sec);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-linea) transparent;
}


/* ============================================================
   7. Selection Color
   ============================================================ */
::selection {
  background: var(--color-acento-sutil);
  color: var(--color-tinta);
}


/* ============================================================
   8. Layout Shell
   ============================================================ */

/* --- App wrapper ----------------------------------------- */
.app {
  min-height: 100vh;
  display: flex;
}

/* --- Sidebar --------------------------------------------- */
.sidebar {
  width: 220px;
  background: var(--color-superficie);
  border-right: 1px solid var(--color-linea);
  display: flex;
  flex-direction: column;
  padding-top: var(--espacio-lg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar__logo {
  padding: var(--espacio-md) var(--espacio-lg);
  display: flex;
  align-items: center;
}

.sidebar__logo span {
  font-family: var(--fuente-titulo);
  font-weight: var(--fuente-peso-bold);
  font-size: 1.375rem;
  letter-spacing: 0.03em;
  color: var(--color-tinta);
  line-height: 1.1;
}

.sidebar__nav {
  flex: 1;
  padding: var(--espacio-sm) var(--espacio-xs);
}

/* --- Navigation items ------------------------------------ */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--espacio-sm);
  padding: var(--espacio-sm) var(--espacio-lg);
  border-radius: var(--radio-md);
  color: var(--color-texto-sec);
  text-decoration: none;
  font-size: var(--texto-sm);
  font-weight: var(--fuente-peso-medio);
  transition: color var(--dur-rapida) var(--ease);
  min-height: 44px;
}

.nav-item:hover {
  background: var(--color-acento-sutil);
  color: var(--color-tinta);
  text-decoration: none;
}

.nav-item--activo {
  background: var(--color-acento-sutil);
  color: var(--color-acento);
  font-weight: var(--fuente-peso-semi);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Sidebar footer -------------------------------------- */
.sidebar__footer {
  padding: var(--espacio-md) var(--espacio-lg);
  border-top: 1px solid var(--color-linea);
  font-size: var(--texto-xs);
  color: var(--color-texto-sec);
}

/* --- Topbar ---------------------------------------------- */
.topbar {
  height: 56px;
  background: var(--color-superficie);
  border-bottom: 1px solid var(--color-linea);
  display: flex;
  align-items: center;
  padding: 0 var(--espacio-lg);
  gap: var(--espacio-md);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar__titulo {
  font-family: var(--fuente-titulo);
  font-weight: var(--fuente-peso-bold);
  font-size: var(--texto-xl);
  flex: 1;
}

.topbar__reloj {
  font-variant-numeric: tabular-nums;
  font-size: var(--texto-sm);
  color: var(--color-texto-sec);
}

.topbar__usuario {
  font-size: var(--texto-sm);
  font-weight: var(--fuente-peso-medio);
}

/* --- Main content wrapper -------------------------------- */
.main-wrap {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  padding: var(--espacio-lg);
  max-width: 1200px;
  width: 100%;
}

/* --- Demo banner ----------------------------------------- */
.demo-banner {
  background: var(--color-acento-sutil);
  color: var(--color-acento);
  text-align: center;
  padding: var(--espacio-2xs) var(--espacio-md);
  font-size: var(--texto-xs);
  font-weight: var(--fuente-peso-medio);
}


/* ============================================================
   9. Mobile Navigation
   ============================================================ */

/* Hidden on desktop by default */
.mobile-nav {
  display: none;
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--color-texto-sec);
  text-decoration: none;
  padding: var(--espacio-2xs);
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.mobile-nav__item:hover {
  text-decoration: none;
}

.mobile-nav__item--activo {
  color: var(--color-acento);
}

.mobile-nav__item svg {
  width: 22px;
  height: 22px;
}


/* ============================================================
   10. Responsive — Mobile (< 760px)
   ============================================================ */
@media (max-width: 759px) {

  /* Hide desktop sidebar */
  .sidebar {
    display: none;
  }

  /* Remove sidebar offset */
  .main-wrap {
    margin-left: 0;
  }

  /* Show mobile bottom nav */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--color-superficie);
    border-top: 1px solid var(--color-linea);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
    padding: 0 var(--espacio-xs);
  }

  /* Adjust main padding for bottom nav */
  .main {
    padding: var(--espacio-md);
    padding-bottom: calc(56px + var(--espacio-md));
  }
}
