:root {
  --color-primary: #1565c0;
  --color-primary-light: #e3f2fd;
  --color-success: #2e7d32;
  --color-success-light: #e8f5e9;
  --color-danger: #c62828;
  --color-danger-light: #ffebee;
  --color-warning: #e65100;
  --color-warning-light: #fff3e0;
  --color-purple: #6a1b9a;
  --color-purple-light: #f3e5f5;
  --color-orange: #f57f17;
  --color-orange-light: #fff3e0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; color: #333; }
.hidden { display: none !important; }

#login-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 20px; }
#btn-login { padding: 12px 24px; background: #1565c0; color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }

.tabs { display: flex; background: white; border-bottom: 1px solid #e0e0e0; padding: 0 8px; }
.tab { padding: 14px 18px; border: none; background: none; cursor: pointer; font-size: 14px; border-bottom: 3px solid transparent; }
.tab.active { border-bottom-color: #1565c0; color: #1565c0; font-weight: 600; }

main { padding: 16px; max-width: 620px; margin: 0 auto; }

@media (min-width: 700px) {
  main { padding: 24px 20px; }
}

@media (min-width: 900px) {
  main { padding: 28px 0; }
}

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; overflow-y: auto; }
.modal-content { background: white; max-width: 100%; margin: 0; border-radius: 0; padding: 20px; position: relative; min-height: 100vh; }

@media (min-width: 700px) {
  .modal-content { max-width: 860px; margin: 20px auto; border-radius: 12px; min-height: unset; }
}
#btn-cerrar-ficha { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 20px; cursor: pointer; }

/* Cards */
.card { background: white; border-radius: 10px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); cursor: pointer; }
.card.seniado { border-left: 4px solid #f57f17; }
.card-title { font-weight: 700; font-size: 15px; }
.card-sub { font-size: 12px; color: #666; margin-top: 2px; }
.card-footer { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }

/* Badges */
.badge { border-radius: 12px; padding: 3px 10px; font-size: 10px; font-weight: 700; }
.badge-consignacion { background: #fff3e0; color: #e65100; }
.badge-compra { background: #e8f5e9; color: #2e7d32; }
.badge-comision { background: #f3e5f5; color: #6a1b9a; }
.badge-en-venta { background: #e3f2fd; color: #1565c0; }
.badge-seniado { background: #fff3e0; color: #f57f17; }
.badge-vendido { background: #e8f5e9; color: #2e7d32; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 11px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { padding: 10px 20px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary { background: #1565c0; color: white; }
.btn-secondary { background: white; border: 1px solid #ccc; }
.btn-danger { background: #c62828; color: white; }
.btn-ml { background: #ffe600; color: #333; }

/* Search & filters */
.search-bar { width: 100%; padding: 10px 14px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; margin-bottom: 10px; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.pill.active { background: #1565c0; color: white; border-color: #1565c0; }
.pill-venta { border-color: #1565c0; color: #1565c0; }
.pill-seniado { border-color: #f57f17; color: #f57f17; }
.pill-vendido { border-color: #2e7d32; color: #2e7d32; }
.filter-marca { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* Sections in ficha */
.ficha-section { background: #f8f9fa; border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.ficha-section h3 { font-size: 14px; margin-bottom: 12px; color: #333; }
