/* ═══════════════════════════════════════════════
   CONSTRUCASA — styles.css  v4 (Dorado & Negro)
   Mobile-first · Chrome + Safari · Form completo
═══════════════════════════════════════════════ */

:root {
  /* Paleta DORADO & NEGRO */
  --blue:       #C9A84C;
  --blue-dark:  #A07830;
  --blue-light: #F0C060;
  --blue-glow:  rgba(201, 168, 76, 0.20);
  --black:        #0A0900;
  --dark:         #111008;
  --dark2:        #1A1710;
  --dark3:        #222018;
  --steel:        #3A3620;
  --mid:          #6B6040;
  --muted:        #9C9070;
  --light:        #C8BC90;
  --cream:        #F2EAC8;
  --white:        #FAFAF0;
  --green:        #27AE60;
  --green-bg:     rgba(39, 174, 96, 0.12);
  --red:          #E74C3C;
  --red-bg:       rgba(231, 76, 60, 0.12);
  --yellow:       #F0C060;
  --yellow-bg:    rgba(240, 192, 96, 0.15);
  --primary:      #C9A84C;
  --primary-bg:   rgba(201, 168, 76, 0.15);
  --gold:         #C9A84C;
  --gold-dark:    #A07830;
  --gold-light:   #F0C060;
  --gold-glow:    rgba(201, 168, 76, 0.20);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --radius:       10px;
  --radius-lg:    16px;
  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h:        60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  /* iOS safe area */
  padding-bottom: env(safe-area-inset-bottom);
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 3px; }

img  { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); -webkit-tap-highlight-color: transparent; }

input, select, textarea {
  font-family: var(--font-body);
  background: var(--dark3);
  border: 1px solid var(--steel);
  color: var(--white);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 16px; /* 16px evita zoom en iOS Safari */
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239C9590' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
select option { background: var(--dark3); }
textarea { resize: vertical; min-height: 70px; }
.hidden { display: none !important; }

/* ─── BOTONES ─────────────────────────────────*/
.btn-primary {
  background: var(--blue);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600; letter-spacing: 0.3px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  touch-action: manipulation;
}
.btn-primary:hover  { background: var(--blue-light); box-shadow: 0 4px 20px var(--blue-glow); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.full   { width: 100%; text-align: center; padding: 14px 24px; }

.btn-secondary {
  background: var(--dark3); color: var(--light);
  border: 1px solid var(--steel);
  padding: 11px 24px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.btn-secondary:hover { background: var(--steel); color: var(--white); }

.btn-icon {
  background: var(--dark3); border: 1px solid var(--steel);
  color: var(--muted); padding: 7px 10px; border-radius: 8px;
  font-size: 13px; transition: all var(--transition);
}
.btn-icon:hover         { border-color: var(--blue); color: var(--blue); }
.btn-icon.danger:hover  { border-color: var(--red); color: var(--red); }

.btn-approve {
  background: var(--green-bg); border: 1px solid var(--green); color: var(--green);
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-approve:hover { background: var(--green); color: white; }
.btn-reject {
  background: var(--red-bg); border: 1px solid var(--red); color: var(--red);
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-reject:hover  { background: var(--red); color: white; }
.btn-edit {
  background: var(--yellow-bg,rgba(234,179,8,.12)); border: 1px solid var(--yellow,#eab308); color: var(--yellow,#eab308);
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-edit:hover { background: var(--yellow,#eab308); color: #000; }
.btn-download {
  background: var(--primary-bg); border: 1px solid var(--primary); color: var(--primary);
  padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-download:hover { background: var(--primary); color: white; }
.btn-download-small {
  background: transparent; border: 1px solid var(--primary); color: var(--primary);
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  transition: all var(--transition);
}
.btn-download-small:hover { background: var(--primary); color: white; }

/* ─── AUTH ────────────────────────────────────*/
/* ─── LOGIN INDUSTRIAL ─────────────────────────*/
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;900&family=Barlow:wght@400;500;600&display=swap');

#auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: stretch;
  z-index: 9999;
  transition: opacity .6s ease, transform .6s ease;
  overflow: hidden;
}
#auth-screen.exit { opacity: 0; transform: scale(1.03); pointer-events: none; }

/* Panel izquierdo — fondo oscuro con patrón DORADO */
.auth-bg-lines {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, #0A0900 0%, #1A1500 50%, #0D0C00 100%);
  overflow: hidden;
  display: none;
}
@media (min-width: 768px) { .auth-bg-lines { display: block; } }

/* Patrón de puntos dorados */
.auth-bg-lines::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(201,168,76,0.25) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Líneas diagonales doradas */
.auth-bg-lines::after {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    transparent, transparent 44px,
    rgba(201,168,76,0.06) 44px,
    rgba(201,168,76,0.06) 45px
  );
}

/* Contenido izquierdo dentro del fondo */
.auth-visual {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  z-index: 3;
}

.auth-visual-gear {
  font-size: 340px;
  line-height: 1;
  position: absolute;
  right: -70px; bottom: -70px;
  opacity: 0.05;
  animation: slowspin 40s linear infinite;
  user-select: none;
  pointer-events: none;
}
@keyframes slowspin { to { transform: rotate(360deg); } }

.auth-visual-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #C9A84C;
  width: fit-content;
}
.auth-visual-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #C9A84C;
  border-radius: 50%;
  box-shadow: 0 0 8px #C9A84C;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(0.7)} }

.auth-visual-headline {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(54px, 5.5vw, 82px);
  line-height: 0.9;
  letter-spacing: -1px;
  color: #fff;
  text-transform: uppercase;
}
.auth-visual-headline em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(201,168,76,0.85);
}

.auth-visual-stats {
  display: flex;
  gap: 28px;
}
.auth-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid rgba(201,168,76,0.45);
  padding-left: 14px;
}
.auth-stat-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}
.auth-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* Panel derecho — formulario DORADO & NEGRO */
.auth-box {
  position: relative;
  z-index: 10;
  width: 100%;
  background: #111008;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .auth-box {
    width: 420px;
    padding: 52px 44px;
    border-left: 1px solid rgba(201,168,76,0.25);
  }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.logo-icon {
  font-size: 20px;
  display: inline-block;
  animation: spin 10s linear infinite;
  color: #C9A84C;
}
@keyframes spin { to { transform: rotate(360deg); } }

.logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #C9A84C;
  text-transform: uppercase;
}

.auth-tagline {
  font-size: 12px;
  color: #9C9070;
  margin-bottom: 36px;
  font-weight: 500;
}

/* ── Logo personalizable en login ── */
.auth-logo-area {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  cursor: pointer;
}
.auth-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100px;
  height: 80px;
  border: 2px dashed rgba(201,168,76,0.4);
  border-radius: 12px;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.auth-logo-placeholder:hover {
  border-color: #C9A84C;
  background: rgba(201,168,76,0.06);
}
.auth-logo-upload-icon { font-size: 22px; }
.auth-logo-upload-hint { font-size: 10px; color: #9C9070; letter-spacing: 0.5px; text-transform: uppercase; }
.auth-logo-img {
  max-width: 140px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 8px;
}

.auth-form-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 34px;
  font-weight: 900;
  color: #FAFAF0;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 28px;
}
.auth-form-title span { color: #C9A84C; }

.auth-form { display: none; flex-direction: column; gap: 18px; }
.auth-form.active { display: flex; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #9C9070;
}
.field-group input {
  background: #1A1710 !important;
  border: 1.5px solid #3A3620 !important;
  color: #FAFAF0 !important;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field-group input:focus {
  border-color: #C9A84C !important;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15) !important;
  outline: none;
}
.field-group input::placeholder { color: #6B6040 !important; }

.req { color: #C9A84C; }

#btn-login {
  background: #C9A84C;
  color: #0A0900;
  border: none;
  border-radius: 6px;
  padding: 14px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 4px;
  transition: background .2s, transform .1s;
  overflow: hidden;
  position: relative;
}
#btn-login::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,220,100,0.3) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .5s ease;
}
#btn-login:hover { background: #F0C060; }
#btn-login:hover::after { transform: translateX(100%); }
#btn-login:active { transform: scale(0.98); }

.auth-footer-text {
  text-align: center;
  font-size: 11px;
  color: #6B6040;
  margin-top: 24px;
  letter-spacing: 0.3px;
}

.auth-error {
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.4);
  color: #e74c3c;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 4px;
}

/* ─── NAVBAR ──────────────────────────────────*/
.navbar {
  position: sticky; top: 0; z-index: 500;
  background: rgba(15,14,12,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--dark3);
  padding: 0 20px;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 20px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.nav-brand .logo-text { font-size: 20px; letter-spacing: 2px; }

.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: all var(--transition); position: relative;
}
.nav-link:hover  { color: var(--white); background: var(--dark3); }
.nav-link.active { color: var(--white); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: -1px; left: 14px; right: 14px;
  height: 2px; background: var(--blue); border-radius: 1px;
}

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cart-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--dark3); border: 1px solid var(--steel);
  color: var(--light); padding: 8px 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; transition: all var(--transition); position: relative;
}
.cart-btn:hover { border-color: var(--blue); color: var(--blue); }
.cart-btn-label { display: none; }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--blue); color: white;
  font-size: 11px; font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  animation: popIn .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-glow); border: 1px solid var(--blue);
  color: var(--blue); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-logout {
  font-size: 13px; color: var(--muted); padding: 6px 10px;
  border-radius: 7px; border: 1px solid transparent;
  transition: all var(--transition); white-space: nowrap;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px; padding: 6px 8px;
  border-radius: 8px; border: 1px solid var(--steel);
  background: var(--dark3);
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--light); border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

/* Mobile nav menu */
.mobile-menu {
  display: none;
  position: sticky; top: var(--nav-h); z-index: 490;
  background: var(--dark2); border-bottom: 1px solid var(--dark3);
  flex-direction: column; padding: 8px 12px;
  gap: 4px;
}
.mobile-menu.open { display: flex; animation: slideDown .25s ease; }
@keyframes slideDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }

.mobile-nav-link {
  padding: 12px 16px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--light);
  text-align: left; transition: all var(--transition);
}
.mobile-nav-link:hover, .mobile-nav-link.active { background: var(--dark3); color: var(--white); }

/* ─── MAIN / VIEWS ────────────────────────────*/
#main { min-height: calc(100vh - var(--nav-h)); }
.view { display: none; padding: 0 20px 60px; animation: fadeIn .3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* ─── HERO ────────────────────────────────────*/
.hero {
  padding: 48px 0 36px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
  border-bottom: 1px solid var(--dark3); margin-bottom: 28px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-glow); border: 1px solid var(--blue);
  color: var(--blue); font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 100px; margin-bottom: 18px;
  letter-spacing: .5px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 var(--blue-glow)} 50%{box-shadow:0 0 0 6px transparent} }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 8vw, 88px); line-height: 1; letter-spacing: 1px; color: var(--white);
}
.hero-title em { color: var(--blue); font-style: normal; }
.hero-sub { font-size: 15px; color: var(--muted); max-width: 480px; margin-top: 14px; line-height: 1.7; }

.hero-stats { display: flex; gap: 10px; flex-shrink: 0; }
.stat-card {
  background: var(--dark2); border: 1px solid var(--dark3);
  border-radius: var(--radius-lg); padding: 16px 20px; text-align: center;
  min-width: 90px; transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--blue); }
.stat-num { display: block; font-family: var(--font-display); font-size: 38px; color: var(--blue); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 3px; }

/* ─── FILTROS ─────────────────────────────────*/
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 160px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#search-input { padding-left: 38px; }
.category-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 8px 14px; border-radius: 100px;
  border: 1px solid var(--steel); background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
}
.pill:hover  { border-color: var(--blue); color: var(--blue); }
.pill.active { background: var(--blue); border-color: var(--blue); color: white; }
#sort-select { width: auto; min-width: 150px; font-size: 14px; padding: 9px 36px 9px 12px; }

/* ─── CATÁLOGO ────────────────────────────────*/
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--dark); border: 1px solid var(--dark3);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  animation: cardIn .4s ease both;
}
.tool-card:hover { transform: translateY(-4px); border-color: var(--steel); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.tool-card.unavailable { opacity: .6; }
.tool-card.unavailable:hover { transform: none; }
@keyframes cardIn { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

.card-visual {
  height: 140px; background: var(--dark2);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--dark3); position: relative;
  transition: background var(--transition);
}
.tool-card:hover .card-visual { background: var(--dark3); }

.card-status {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 600; padding: 4px 8px; border-radius: 100px;
  letter-spacing: .5px; text-transform: uppercase;
}
.status-disponible    { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.status-pocas         { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.status-agotado       { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.status-mantenimiento { background: rgba(100,100,100,.15); color: var(--muted); border: 1px solid var(--steel); }

.card-body    { padding: 14px 16px; }
.card-cat     { font-size: 11px; color: var(--blue); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.card-name    { font-size: 16px; font-weight: 600; color: var(--white); margin-bottom: 4px; line-height: 1.3; }
.card-desc    { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-ubic    { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.card-ubic span { color: var(--white); font-weight: 500; }
.card-footer  { display: flex; align-items: center; justify-content: space-between; }
.card-price   { display: flex; flex-direction: column; }
.price-amount { font-family: var(--font-mono); font-size: 17px; font-weight: 500; color: var(--blue); }
.price-label  { font-size: 11px; color: var(--muted); }
.card-stock   { font-size: 12px; color: var(--muted); }
.card-stock strong { color: var(--green); }

.card-actions  { display: flex; gap: 8px; padding: 0 14px 14px; }
.btn-detail    { flex: 1; }
.btn-add-cart  { background: var(--blue); color: white; padding: 9px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 600; transition: all var(--transition); white-space: nowrap; }
.btn-add-cart:hover     { background: var(--blue-light); transform: scale(1.02); }
.btn-add-cart:disabled  { background: var(--steel); color: var(--muted); cursor: not-allowed; transform: none; }

/* ─── ADMIN ───────────────────────────────────*/
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 36px 0 24px; flex-wrap: wrap; gap: 14px;
}
.view-title { font-family: var(--font-display); font-size: 36px; letter-spacing: 1px; }

.admin-tabs, .tab-switch {
  display: flex; background: var(--dark2); border-radius: var(--radius); padding: 4px; gap: 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn { padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); transition: all var(--transition); white-space: nowrap; }
.tab-btn.active { background: var(--dark3); color: var(--white); }

.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeIn .3s ease; }

.admin-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
#admin-search  { max-width: 280px; font-size: 14px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
.admin-table th { text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--dark3); }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--dark2); color: var(--light); vertical-align: middle; }
.admin-table tr:hover td { background: var(--dark2); }
.admin-table tr:last-child td { border-bottom: none; }
.tool-cell { display: flex; align-items: center; gap: 10px; }
.tool-cell-icon { font-size: 22px; }
.tool-cell-name { font-weight: 600; color: var(--white); font-size: 14px; }
.action-btns { display: flex; gap: 6px; }

.rent-pill { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.rent-pill.pendiente  { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.rent-pill.aprobado   { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.rent-pill.rechazado  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.rent-pill.completado { background: var(--dark3); color: var(--muted); border: 1px solid var(--steel); }
.rent-pill.entregado  { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.rent-pill.devuelto   { background: rgba(16,185,129,.12); color: #34d399;  border: 1px solid rgba(16,185,129,.3); }

/* Solicitudes */
.solicitudes-list { display: flex; flex-direction: column; gap: 12px; }
.solicitud-card {
  background: var(--dark); border: 1px solid var(--dark3);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.solicitud-info   { flex: 1; min-width: 180px; }
.solicitud-title  { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.solicitud-meta   { font-size: 13px; color: var(--muted); line-height: 1.7; }
.solicitud-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.solicitud-card[style*="border-left"] { animation: pulse-border 2s ease-in-out infinite; }
@keyframes pulse-border { 0%,100%{border-left-color:var(--red)} 50%{border-left-color:rgba(231,76,60,.3)} }

/* ─── REPORTES ────────────────────────────────*/
.report-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 32px;
}
.report-card { background: var(--dark); border: 1px solid var(--dark3); border-radius: var(--radius-lg); padding: 24px 20px; transition: border-color var(--transition); }
.report-card:hover  { border-color: var(--steel); }
.report-card.accent { border-color: var(--blue); background: var(--blue-glow); }
.report-num   { font-family: var(--font-display); font-size: 44px; color: var(--blue); line-height: 1; margin-bottom: 4px; }
.report-label { font-size: 12px; color: var(--muted); font-weight: 500; }

.section-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; margin-bottom: 14px; }
.top-tools { margin-bottom: 32px; }
.top-tool-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--dark2); }
.top-tool-row:last-child { border-bottom: none; }
.top-rank  { font-family: var(--font-display); font-size: 26px; color: var(--steel); width: 32px; }
.top-icon  { font-size: 22px; }
.top-name  { flex: 1; font-weight: 600; font-size: 14px; }
.top-count { font-family: var(--font-mono); color: var(--blue); font-size: 13px; }

/* Historial */
.rental-history { margin-top: 32px; }
.history-filters { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; }
.history-filters .field-group { flex: 1; min-width: 100px; max-width: 160px; }
#rental-history-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.rental-history-item { background: var(--dark2); border: 1px solid var(--dark3); border-radius: var(--radius); padding: 14px; }
.rental-history-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.rental-emoji  { font-size: 22px; }
.rental-name   { font-weight: 600; flex: 1; min-width: 100px; font-size: 14px; }
.rental-status { font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 500; }
.rental-status.pendiente  { background: var(--yellow-bg); color: var(--yellow); }
.rental-status.aprobado   { background: var(--green-bg);  color: var(--green); }
.rental-status.rechazado  { background: var(--red-bg);    color: var(--red); }
.rental-status.entregado  { background: rgba(59,130,246,.12); color:#60a5fa; }
.rental-status.devuelto, .rental-status.completado { background: var(--dark3); color: var(--muted); }
.rental-history-details { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }

/* ─── EXPORT BOX ──────────────────────────────*/
.export-box {
  background: var(--dark2); border: 1px solid var(--dark3);
  border-radius: var(--radius-lg); padding: 20px;
  margin: 20px 0;
}
.export-title { font-size: 14px; font-weight: 600; color: var(--light); margin-bottom: 14px; }
.export-controls {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}
.export-controls .field-group { flex: 1; min-width: 120px; max-width: 200px; }
.btn-export-csv {
  background: var(--green-bg); border: 1px solid var(--green); color: var(--green);
  padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-export-csv:hover { background: var(--green); color: white; }
.btn-export-pdf {
  background: var(--primary-bg); border: 1px solid var(--primary); color: var(--primary);
  padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-export-pdf:hover { background: var(--primary); color: white; }

/* ─── DANGER ZONE ─────────────────────────────*/
.danger-zone {
  background: var(--red-bg); border: 1px solid var(--red);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 20px 0;
}
.danger-zone-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 200px; }
.danger-icon { font-size: 28px; flex-shrink: 0; }
.danger-zone-info strong { display: block; color: var(--white); font-size: 14px; margin-bottom: 2px; }
.danger-zone-info p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.btn-danger {
  background: transparent; border: 1px solid var(--red); color: var(--red);
  padding: 10px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-danger:hover { background: var(--red); color: white; }

/* ─── CARRITO SIDEBAR ─────────────────────────*/
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 800;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100vw;
  background: var(--dark); border-left: 1px solid var(--steel);
  z-index: 900; display: flex; flex-direction: column;
  animation: slideRight .3s cubic-bezier(0.34, 1.2, 0.64, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes slideRight { from{transform:translateX(100%)} to{transform:translateX(0)} }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--dark3); flex-shrink: 0;
}
.cart-header h3 { font-size: 16px; font-weight: 600; }
#cart-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--dark3); border: 1px solid var(--steel);
  color: var(--muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
#cart-close:hover { color: var(--white); border-color: var(--white); }

.cart-items { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.cart-item { background: var(--dark2); border: 1px solid var(--dark3); border-radius: var(--radius); padding: 12px; display: flex; gap: 10px; animation: cardIn .3s ease; }
.cart-item-icon  { font-size: 26px; flex-shrink: 0; }
.cart-item-info  { flex: 1; min-width: 0; }
.cart-item-name  { font-size: 14px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: var(--blue); font-family: var(--font-mono); }
.cart-item-qty   { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-btn  { width: 26px; height: 26px; border-radius: 6px; background: var(--dark3); border: 1px solid var(--steel); color: var(--white); font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.qty-btn:hover { border-color: var(--blue); color: var(--blue); }
.qty-num  { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-remove { color: var(--muted); font-size: 14px; width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); align-self: flex-start; flex-shrink: 0; }
.cart-item-remove:hover { color: var(--red); background: var(--red-bg); }

.cart-footer { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 20px; border-top: 1px solid var(--dark3); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; max-height: 75vh; }

.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.cart-total strong { font-family: var(--font-mono); font-size: 20px; color: var(--blue); }

/* Separadores secciones del form */
.form-section-label {
  font-size: 11px; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--dark3);
  margin-top: 4px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; padding: 32px; }
.cart-empty .empty-icon { font-size: 44px; }
.cart-empty p { font-size: 14px; line-height: 1.7; }

/* ─── MODAL ───────────────────────────────────*/
.tool-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 620px; max-width: calc(100vw - 24px); max-height: 90vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--dark); border: 1px solid var(--steel);
  border-radius: var(--radius-lg); z-index: 850;
  animation: modalIn .3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes modalIn { from{opacity:0;transform:translate(-50%,-48%)scale(0.96)} to{opacity:1;transform:translate(-50%,-50%)scale(1)} }

.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 8px; background: var(--dark3); border: 1px solid var(--steel);
  color: var(--muted); font-size: 14px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--white); border-color: var(--white); }

.modal-content     { padding: 28px; }
.modal-title       { font-family: var(--font-display); font-size: 30px; letter-spacing: 1px; margin-bottom: 4px; }
.modal-visual      { height: 140px; background: var(--dark2); border-radius: var(--radius); margin-bottom: 18px; display: flex; align-items: center; justify-content: center; font-size: 64px; }
.modal-meta        { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.modal-badge       { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 100px; letter-spacing: .5px; text-transform: uppercase; }
.badge-cat         { background: var(--blue-glow); border: 1px solid var(--blue); color: var(--blue); }
.badge-ubic        { background: rgba(255,165,0,.12); border: 1px solid var(--orange); color: var(--orange); }
.modal-desc        { font-size: 14px; color: var(--light); line-height: 1.7; margin-bottom: 18px; }
.modal-specs       { background: var(--dark2); border-radius: var(--radius); padding: 14px; margin-bottom: 20px; }
.modal-specs h4    { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.modal-specs p     { font-size: 13px; color: var(--light); font-family: var(--font-mono); line-height: 1.6; }
.modal-pricing     { display: flex; align-items: center; justify-content: space-between; background: var(--dark2); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.modal-price-label { font-size: 12px; color: var(--muted); }
.modal-price-value { font-family: var(--font-display); font-size: 34px; color: var(--blue); }
.modal-price-unit  { font-size: 13px; color: var(--muted); }
.modal-availability { margin-bottom: 22px; }
.avail-bar-wrap    { background: var(--dark3); border-radius: 100px; height: 8px; margin-top: 6px; overflow: hidden; }
.avail-bar         { height: 100%; border-radius: 100px; transition: width 1s ease; }
.modal-add-cart    { width: 100%; font-size: 15px; padding: 13px; border-radius: var(--radius); }

/* Form modal tool */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.full-col   { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── ESTADO VACÍO ────────────────────────────*/
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state p { font-size: 14px; line-height: 1.7; }

/* ─── TOAST ───────────────────────────────────*/
#toast-container { position: fixed; bottom: 24px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: var(--dark3); border: 1px solid var(--steel); border-radius: var(--radius); padding: 11px 18px; font-size: 14px; max-width: 300px; display: flex; align-items: center; gap: 10px; animation: toastIn .3s cubic-bezier(0.34,1.56,0.64,1), toastOut .3s ease 3.5s forwards; }
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }
.toast.info    { border-color: var(--blue); }
.toast-icon    { font-size: 15px; flex-shrink: 0; }
@keyframes toastIn  { from{opacity:0;transform:translateY(14px) scale(0.95)} to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes toastOut { from{opacity:1} to{opacity:0;transform:translateY(-8px)} }

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
═══════════════════════════════════════════════ */

/* Tablet 1024 */
@media (max-width: 1024px) {
  .view { padding: 0 16px 48px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* Mobile 768 */
@media (max-width: 768px) {
  :root { --nav-h: 56px; }

  /* Navbar */
  .navbar { padding: 0 14px; gap: 8px; }
  .desktop-only { display: none !important; }
  .hamburger { display: flex; }
  .nav-links  { display: none; } /* Replaced by mobile-menu */
  .cart-btn-label { display: none; }
  .btn-logout { padding: 6px 8px; font-size: 12px; }

  /* Mobile nav links must also navigate */
  .mobile-nav-link { font-size: 15px; }

  /* Views */
  .view { padding: 0 12px 48px; }

  /* Hero */
  .hero { padding: 28px 0 24px; flex-direction: column; gap: 20px; }
  .hero-title { font-size: clamp(40px, 12vw, 64px); }
  .hero-sub   { font-size: 14px; }
  .hero-stats { width: 100%; gap: 8px; }
  .stat-card  { flex: 1; padding: 14px 10px; }
  .stat-num   { font-size: 32px; }
  .stat-label { font-size: 10px; }

  /* Filtros */
  .filters-bar { flex-direction: column; align-items: stretch; }
  .category-pills { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 4px; }
  #sort-select { width: 100%; }

  /* Catálogo */
  .catalog-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-visual  { height: 110px; }
  .card-visual span:first-child { font-size: 46px !important; }
  .card-body  { padding: 10px 12px; }
  .card-name  { font-size: 14px; }
  .card-desc  { font-size: 12px; }
  .card-actions { padding: 0 10px 12px; gap: 6px; }
  .btn-detail { font-size: 12px; padding: 8px 6px; }
  .btn-add-cart { font-size: 12px; padding: 8px 8px; }

  /* Admin tabs */
  .view-header { flex-direction: column; align-items: flex-start; padding: 20px 0 16px; }
  .view-title  { font-size: 28px; }
  .admin-tabs  { width: 100%; }
  .tab-btn     { flex: 1; text-align: center; font-size: 12px; padding: 8px 8px; }

  .admin-toolbar { flex-direction: column; align-items: stretch; }
  #admin-search  { max-width: 100%; }

  /* Solicitud cards */
  .solicitud-card { flex-direction: column; gap: 12px; padding: 14px 14px; }
  .solicitud-actions { flex-wrap: wrap; }

  /* Reportes */
  .report-grid { grid-template-columns: 1fr 1fr; }
  .history-filters { flex-direction: column; }
  .history-filters .field-group { max-width: 100%; }

  /* Export */
  .export-controls { flex-direction: column; align-items: stretch; }
  .export-controls .field-group { max-width: 100%; }
  .btn-export-csv, .btn-export-pdf { width: 100%; text-align: center; padding: 12px; }

  /* Danger zone */
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .btn-danger  { width: 100%; text-align: center; }

  /* Cart */
  .cart-sidebar { width: 100%; }
  .cart-footer  { max-height: 70vh; }
  .form-row-2   { grid-template-columns: 1fr; }

  /* Modals */
  .tool-modal  { max-width: calc(100vw - 16px); max-height: 92vh; }
  .modal-content { padding: 20px 16px; }
  .modal-title   { font-size: 26px; }
  .form-grid     { grid-template-columns: 1fr; }
  .full-col      { grid-column: auto; }
  .form-actions  { flex-direction: column-reverse; }

  /* Toast */
  #toast-container { bottom: 16px; right: 8px; left: 8px; align-items: center; }
  .toast { max-width: 100%; width: 100%; }
}

/* Small mobile 480 */
@media (max-width: 480px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .card-visual  { height: 120px; }
  .card-visual span:first-child { font-size: 56px !important; }
  .report-grid  { grid-template-columns: 1fr 1fr; }
  .admin-tabs   { gap: 2px; }
  .tab-btn      { font-size: 11px; padding: 7px 6px; }
  .hero-stats   { flex-wrap: wrap; }
  .stat-card    { min-width: 80px; }
}

/* Landscape móvil */
@media (max-height: 500px) and (orientation: landscape) {
  .cart-footer { max-height: 60vh; }
  .tool-modal  { max-height: 95vh; }
}
/* ═══════════════════════════════════════════════
   LOGO ÁREA en Navbar
═══════════════════════════════════════════════ */
.nav-logo-img {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: opacity var(--transition);
}
.nav-logo-img:hover { opacity: 0.8; }
.nav-logo-placeholder {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1.5px dashed var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
  background: var(--dark3);
  transition: border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.nav-logo-placeholder:hover { border-color: var(--gold-light); background: var(--dark2); }
#logo-input { display: none; }

/* ═══════════════════════════════════════════════
   MÓDULO FACTURAS VIEJAS
═══════════════════════════════════════════════ */
.facturas-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.facturas-toolbar input { max-width: 300px; }

.factura-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 8px;
}
.factura-form-grid .full-col { grid-column: 1 / -1; }

.facturas-list { display: flex; flex-direction: column; gap: 10px; }
.factura-card {
  background: var(--dark2);
  border: 1px solid var(--steel);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.factura-card:hover { border-color: var(--gold); }
.factura-info { flex: 1; }
.factura-id {
  font-size: 11px; color: var(--gold); font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px;
}
.factura-cliente { font-size: 15px; font-weight: 600; color: var(--white); }
.factura-detalle { font-size: 13px; color: var(--muted); margin-top: 4px; }
.factura-total {
  font-size: 17px; font-weight: 700; color: var(--gold);
  white-space: nowrap;
}
.factura-actions { display: flex; gap: 6px; align-items: center; }

/* ═══════════════════════════════════════════════
   MÓDULO GASTOS
═══════════════════════════════════════════════ */
.gastos-summary {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 24px;
}
.gasto-kpi {
  background: var(--dark2); border: 1px solid var(--steel);
  border-radius: var(--radius-lg); padding: 16px;
  text-align: center;
}
.gasto-kpi.accent { border-color: var(--gold); }
.gasto-kpi-num { font-size: 24px; font-weight: 700; color: var(--gold); }
.gasto-kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.gastos-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px;
}

.gasto-form-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 8px;
}
.gasto-form-grid .full-col { grid-column: 1 / -1; }

.gastos-list { display: flex; flex-direction: column; gap: 10px; }
.gasto-card {
  background: var(--dark2);
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.gasto-card:hover { border-color: var(--gold); }
.gasto-left { display: flex; gap: 12px; align-items: center; }
.gasto-cat-badge {
  background: var(--primary-bg); border: 1px solid var(--gold);
  color: var(--gold); font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.gasto-desc { font-size: 14px; color: var(--white); font-weight: 500; }
.gasto-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gasto-monto {
  font-size: 16px; font-weight: 700; color: var(--red);
  white-space: nowrap;
}
.gasto-actions { display: flex; gap: 6px; }

@media (max-width: 768px) {
  .gastos-summary { grid-template-columns: 1fr 1fr; }
  .gasto-form-grid { grid-template-columns: 1fr 1fr; }
  .factura-form-grid { grid-template-columns: 1fr; }
  .gasto-form-grid .full-col { grid-column: auto; }
}
@media (max-width: 480px) {
  .gastos-summary { grid-template-columns: 1fr; }
  .gasto-form-grid { grid-template-columns: 1fr; }
  .gasto-card { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════
   MÓDULO FINANZAS (Ingresos + Facturas + Gastos)
═══════════════════════════════════════════════ */
.finanzas-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.fin-kpi {
  background: var(--dark2);
  border: 1px solid var(--steel);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: border-color var(--transition);
}
.fin-kpi.verde  { border-color: rgba(39,174,96,0.5); }
.fin-kpi.dorado { border-color: var(--gold); }
.fin-kpi.rojo   { border-color: rgba(231,76,60,0.5); }
.fin-kpi.neutro { border-color: var(--steel); }
.fin-kpi.azul   { border-color: rgba(52,152,219,0.5); }
.fin-kpi-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}
.fin-kpi.verde  .fin-kpi-num { color: var(--green); }
.fin-kpi.rojo   .fin-kpi-num { color: var(--red); }
.fin-kpi.neutro .fin-kpi-num { color: var(--blue); }
.fin-kpi.azul   .fin-kpi-num { color: #3498DB; }
.fin-kpi-label {
  font-size: 12px;
  color: var(--muted);
}

/* Sub-tabs dentro de Finanzas */
.fin-subtabs {
  display: flex;
  background: var(--dark2);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}
.fin-tab {
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.fin-tab.active {
  background: var(--dark3);
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
}
.fin-tab:hover:not(.active) {
  color: var(--white);
  background: var(--dark3);
}

/* Paneles internos */
.fin-panel { display: none; }
.fin-panel.active { display: block; animation: fadeIn .3s ease; }

@media (max-width: 768px) {
  .finanzas-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .finanzas-kpis { grid-template-columns: 1fr; }
  .fin-tab { font-size: 12px; padding: 8px 10px; }
}

/* ══════════════════════════════════════════════
   IMAGEN HERRAMIENTA — card y modal
══════════════════════════════════════════════ */
.card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: block;
}
.modal-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
/* Upload area en formulario herramienta */
.tool-img-upload-area {
  border: 2px dashed rgba(201,168,76,0.4);
  border-radius: var(--radius-md);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}
.tool-img-upload-area:hover { border-color: var(--gold); background: rgba(201,168,76,0.05); }
.tool-img-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; }
.tool-img-preview { width: 100%; max-height: 180px; object-fit: cover; display: block; }

/* ══════════════════════════════════════════════
   FINANZAS — Día + Mes KPIs y filtros
══════════════════════════════════════════════ */
.fin-kpi-section { margin-bottom: 20px; }
.fin-kpi-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.fin-filtros {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--dark2);
  border: 1px solid var(--steel);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.fin-filtro-group { display: flex; flex-direction: column; gap: 4px; }
.fin-filtro-group label { font-size: 11px; color: var(--muted); }
.fin-filtro-group select,
.fin-filtro-group input { font-size: 13px; }

/* ══════════════════════════════════════════════
   CAJA — estilos
══════════════════════════════════════════════ */
.caja-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  flex-direction: column;
}
.caja-estado-badge {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.caja-info { font-size: 13px; color: var(--muted); }
.caja-base-display { font-size: 13px; font-weight: 600; }
.caja-acciones { display: flex; gap: 12px; margin-bottom: 20px; }
.btn-caja-abrir {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-caja-abrir:hover { opacity: 0.85; }
.btn-caja-cerrar {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-caja-cerrar:hover { opacity: 0.85; }
.caja-resumen {
  background: var(--dark2);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}
.caja-resumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.caja-item {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  background: rgba(255,255,255,0.04);
}
.caja-item span { color: var(--muted); font-size: 11px; }
.caja-item strong { font-size: 16px; font-family: var(--font-mono); }
.caja-item.verde strong { color: var(--green); }
.caja-item.azul strong  { color: #3498DB; }
.caja-item.dorado strong{ color: var(--gold); }
.caja-item.rojo strong  { color: var(--red); }
.caja-item.neutro strong { color: var(--blue); }
.caja-item.total { border: 1px solid var(--steel); grid-column: 1/-1; }
.caja-corte-card {
  background: var(--dark2);
  border: 1px solid var(--steel);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.caja-corte-fecha { font-size: 12px; color: var(--muted); }
.caja-corte-nums { display: flex; gap: 12px; font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.caja-corte-nums .verde { color: var(--green); }
.caja-corte-nums .azul  { color: #3498DB; }
.caja-corte-nums .rojo  { color: var(--red); }

/* ══════════════════════════════════════════
   MEJORAS v11 — Imágenes grandes, en calle, factura
══════════════════════════════════════════ */

/* ── Tarjetas con imagen grande ── */
.tool-card .card-visual {
  position: relative;
  height: 200px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--dark2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.tool-card .card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .4s ease;
}
.tool-card:hover .card-img {
  transform: scale(1.04);
}
.card-emoji-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ── Precios en tarjeta ── */
.card-prices {
  margin: 6px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.card-price-row .price-amount {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--orange);
}
.card-price-row .price-label {
  font-size: 11px;
  color: var(--muted);
}
.card-stock-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ── En calle badge en tarjeta ── */
.card-street-info {
  background: rgba(249,115,22,.08);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
}
.card-en-pedido {
  background: rgba(255,165,0,.07);
  border: 1px solid rgba(255,165,0,.28);
}
.street-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--orange);
  margin-bottom: 4px;
}
.street-detail {
  font-size: 11px;
  color: var(--muted);
  margin: 1px 0;
}
.street-detail strong {
  color: var(--white);
}
.card-en-calle {
  border: 1.5px solid rgba(249,115,22,.35) !important;
}

/* ── Modal imagen grande ── */
.modal-visual-img {
  width: 100%;
  max-height: 300px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--dark2);
}
.modal-img-full {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  padding: 8px;
}

/* ── Modal pricing mejorado ── */
.modal-pricing {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.modal-price-block {
  flex: 1;
  min-width: 90px;
  background: var(--dark2);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.modal-price-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.modal-price-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--orange);
}

/* ── Modal en calle ── */
.modal-street-box {
  background: rgba(249,115,22,.07);
  border: 1px solid rgba(249,115,22,.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.modal-street-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}
