/* ============================================================
   FlotaTrack — Estilo claro / pastel (terracota)
   Paleta: #FFFFFF base · #FBF0EA sidebar · #D98B6E acento
           #FFFFFF card · #3D342E texto · #8C8079 muted
   ============================================================ */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/poppins-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/poppins-700.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }

:root {
  --bg:          #FFFFFF;
  --sidebar-bg:  #FBF0EA;
  --card-bg:     #FFFFFF;
  --card-hover:  #FAEFE8;
  --accent:      #D98B6E;
  --accent-dim:  rgba(217, 139, 110, 0.18);
  --on-accent:   #3A2115;
  --text:        #3D342E;
  --muted:       #8C8079;
  --border:      #ECE0D8;
  --danger:      #E0685A;
  --danger-dim:  rgba(224, 104, 90, 0.16);
  --success:     #6FAE7C;
  --success-dim: rgba(111, 174, 124, 0.18);
  --usd:         #5B93C9;
  --usd-dim:     rgba(91, 147, 201, 0.16);
  --hover-tint:  rgba(61, 52, 46, 0.05);
  --sidebar-w:   220px;
  --radius:      10px;
}

body {
  font-family: 'Poppins', 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ===== LAYOUT ===== */
#app {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  padding: 0 4px;
}
.logo-icon { font-size: 22px; }
.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.nav-btn:hover { background: var(--accent-dim); color: var(--text); }
.nav-btn.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.nav-icon { font-size: 16px; }

.btn-nueva-maquina {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  transition: opacity 0.15s;
  letter-spacing: 0.2px;
}
.btn-nueva-maquina:hover { opacity: 0.88; }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  width: 40px; height: 40px;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== MAIN ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.view-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-wrap input,
.search-wrap select {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  width: 180px;
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus,
.search-wrap select:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }

.filtros-dropdown-wrap { position: relative; }
.filtros-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  width: 220px;
  box-shadow: 0 12px 30px rgba(61,52,46,0.15);
  z-index: 50;
  flex-direction: column;
  gap: 12px;
}
.filtros-dropdown.open { display: flex; }

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle-btn {
  background: var(--card-bg);
  border: none;
  color: var(--muted);
  font-size: 15px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--border); }
.view-toggle-btn.active { background: var(--accent-dim); color: var(--accent); }

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  box-shadow: 0 2px 10px rgba(61,52,46,0.06);
}
.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-num-usd { font-size: 13px; font-weight: 600; color: var(--usd); }
.stat-num-usd:empty { display: none; }

/* ===== GRID DE MÁQUINAS ===== */
.maquinas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.maquina-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative;
  box-shadow: 0 2px 10px rgba(61,52,46,0.06);
}
.maquina-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(217,139,110,0.22);
}
.maquina-card.archivada {
  opacity: 0.65;
  border-color: transparent;
}
.maquina-card.archivada:hover {
  opacity: 1;
  border-color: var(--muted);
  transform: none;
}

.card-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 7px;
  margin-bottom: 14px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder {
  width: 100%;
  height: 140px;
  background: var(--sidebar-bg);
  border-radius: 7px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--accent);
  opacity: 0.55;
}

.card-tipo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.card-tipo {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
}
.condicion-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.condicion-badge.nuevo { background: var(--success-dim); color: #3D7A4C; }
.condicion-badge.usado { background: var(--hover-tint); color: var(--muted); }
.card-nombre {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.card-comprador {
  font-size: 12px;
  color: var(--text);
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
  margin-bottom: 14px;
}
.card-comprador strong { color: var(--accent-strong, var(--accent)); }
.row-comprador {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: middle;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.card-gasto-total {
  font-size: 15px;
  font-weight: 700;
}
.card-gasto-label { font-size: 11px; color: var(--muted); }
.card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
}
.card-badge.archivada { background: var(--hover-tint); color: var(--muted); }

/* ===== VISTA LISTA ===== */
.maquinas-grid.list-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.maquina-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(61,52,46,0.05);
}
.maquina-row:hover { border-color: var(--accent); box-shadow: 0 6px 16px rgba(217,139,110,0.2); }
.maquina-row.archivada { opacity: 0.65; }
.row-thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.row-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  color: var(--accent);
  font-size: 18px;
  opacity: 0.7;
}
.row-tipo {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  width: 110px;
  flex-shrink: 0;
}
.row-nombre {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub {
  font-size: 12px;
  color: var(--muted);
  width: 180px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-serie {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  width: 160px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-gasto {
  font-size: 13px;
  font-weight: 700;
  width: 100px;
  text-align: right;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .row-tipo, .row-sub { display: none; }
  .row-serie { width: auto; max-width: 130px; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; font-size: 15px; }
.empty-state button {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61,52,46,0.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-xl { align-items: flex-start; padding-top: 40px; }

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
  box-shadow: 0 12px 40px rgba(61,52,46,0.18);
}
.modal-large { max-width: 860px; max-height: none; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== FORM ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.3px; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group select option { background: var(--card-bg); }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-secondary:hover { color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 12px;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 12px;
}
.btn-danger-outline:hover { border-color: var(--danger); color: var(--danger); }

/* ===== UPLOAD ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  color: var(--muted);
  font-size: 13px;
}
.upload-area:hover { border-color: var(--accent); color: var(--accent); }

.upload-botones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.upload-botones .btn-secondary { flex: 1; min-width: 120px; }

.fotos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.foto-thumb {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.foto-thumb .remove-foto {
  position: absolute;
  top: 3px; right: 3px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 11px;
  width: 18px; height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ===== DETALLE ===== */
.detalle-body { padding: 24px; display: flex; flex-direction: column; gap: 24px; }

.detalle-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.detalle-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detalle-field { display: flex; flex-direction: column; gap: 2px; }
.detalle-field .lbl { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.3px; }
.detalle-field .val { font-size: 14px; color: var(--text); }

.detalle-fotos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.detalle-foto-item {
  width: 100px; height: 80px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
}
.detalle-foto-item img { width: 100%; height: 100%; object-fit: cover; }
.foto-portada-badge {
  position: absolute;
  top: 3px; left: 3px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}
.foto-portada-btn {
  position: absolute;
  top: 3px; left: 3px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 11px;
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}
.foto-portada-btn:hover { background: var(--accent); }

/* ===== RESUMEN GASTOS ===== */
.gastos-resumen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.resumen-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.resumen-tipo { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.resumen-monto { font-size: 18px; font-weight: 700; color: var(--accent); }
.resumen-monto-usd { font-size: 12px; font-weight: 600; color: var(--usd); margin-top: 2px; }

/* ===== GASTOS LIST ===== */
.gastos-section { display: flex; flex-direction: column; gap: 14px; }
.gastos-header { display: flex; align-items: center; justify-content: space-between; }
.gastos-header h3 { font-size: 15px; font-weight: 700; }

.gastos-filters {
  display: flex;
  gap: 10px;
}
.gastos-filters select,
.gastos-filters input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  outline: none;
}

.gastos-list { display: flex; flex-direction: column; gap: 8px; }

.gasto-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gasto-tipo-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-combustible   { background: var(--usd-dim); color: #3D6E9C; }
.badge-reparacion    { background: var(--danger-dim); color: #B14A3D; }
.badge-mano-de-obra  { background: var(--success-dim); color: #3D7A4C; }
.badge-otro          { background: var(--hover-tint); color: var(--muted); }

.gasto-info { flex: 1; }
.gasto-desc { font-size: 13px; font-weight: 500; }
.gasto-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.gasto-monto { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.gasto-foto-thumb {
  width: 48px; height: 40px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}
.gasto-foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gasto-actions { display: flex; gap: 6px; }
.btn-icon {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 5px;
}
.btn-icon:hover { color: var(--danger); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger); color: var(--danger); }

/* ===== SETUP BANNER ===== */
.setup-banner {
  position: fixed;
  inset: 0;
  background: rgba(61,52,46,0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.setup-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.setup-content h2 { font-size: 20px; }
.setup-content p { color: var(--muted); font-size: 14px; }
.setup-help a { color: var(--accent); font-size: 13px; }

/* ===== LOADING ===== */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== LIGHTBOX ===== */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}
#lightbox .lb-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .main-content { margin-left: 0; padding: 20px 16px; padding-top: 60px; }

  .stats-bar { flex-direction: column; }
  .maquinas-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .detalle-top { grid-template-columns: 1fr; }
  .gastos-resumen { grid-template-columns: 1fr 1fr; }
  .modal-large { max-width: 100%; }
  .top-bar { flex-direction: column; align-items: flex-start; }
  .top-bar-right { width: 100%; }
  .search-wrap { width: 100%; }
  .search-wrap input,
  .search-wrap select { width: 100%; }
  .filtros-dropdown-wrap { width: 100%; }
  .filtros-dropdown { left: 0; right: 0; width: auto; }
}

.btn-config {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: all 0.15s;
}
.btn-config:hover { color: var(--accent); border-color: var(--accent); }

/* ===== CATEGORÍAS / SUBCATEGORÍAS ===== */
#subcatNav {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-tabs {
  display: flex;
  gap: 4px;
}

.cat-tab {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.subcat-tabs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.subcat-tab {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.subcat-tab:hover { color: var(--text); background: var(--hover-tint); }
.subcat-tab.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }

/* ===== PRECIOS EDITABLES ===== */
.precio-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-precio-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 5px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-precio-edit:hover { opacity: 1; }

/* ===== GASTO COMENTARIO ===== */
.gasto-comentario {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 3px;
}
.gasto-monto-usd {
  color: var(--usd);
  font-size: 13px;
}

/* ===== ROLES (viewer / editor) ===== */
/* ===== PAPELERA ===== */
.papelera-wrap { grid-column: 1 / -1; }
.papelera-titulo { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.papelera-vacio { color: var(--muted); font-size: 13px; padding: 4px 0 8px; }
.papelera-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(61,52,46,0.05);
}
.papelera-nombre { font-size: 14px; font-weight: 600; }
.papelera-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.papelera-acciones { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

body.viewer-mode .edit-only { display: none !important; }
.admin-only { display: none !important; }
body.admin-mode .admin-only { display: flex !important; }
body.admin-mode button.admin-only.btn-config,
body.admin-mode button.admin-only.btn-sm { display: inline-flex !important; }
