/* ================================================================
   MIS CATAS DE WHISKY — Malt Library Dark Theme
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Jost:wght@300;400;500;600&display=swap');

/* ---- Variables ---- */
:root {
  --bg-root:        #0a0806;
  --bg-surface:     #100d0a;
  --bg-card:        #161210;
  --bg-card-h:      #1e1913;
  --bg-input:       #0e0b08;
  --bg-section:     #120f0c;

  --amber-dim:      #5a3a08;
  --amber-mid:      #8a5c14;
  --amber:          #c8872a;
  --amber-bright:   #e8a83c;
  --amber-pale:     #f5d888;
  --amber-cream:    #f0ddb0;

  --glow-xs:        rgba(200,135,42,0.08);
  --glow-sm:        rgba(200,135,42,0.14);
  --glow:           rgba(200,135,42,0.22);
  --glow-lg:        rgba(200,135,42,0.40);

  --text-h:         #f0e0c0;
  --text-p:         #c8b898;
  --text-muted:     #7a6848;
  --text-accent:    #e8a83c;

  --border-faint:   rgba(200,135,42,0.10);
  --border:         rgba(200,135,42,0.22);
  --border-bright:  rgba(200,135,42,0.50);

  --success:        #4a7a4a;
  --danger:         #8a3030;
  --danger-bright:  #c04040;

  --radius-sm:      6px;
  --radius:         12px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-ui:        'Jost', system-ui, sans-serif;

  --header-h:       64px;
  --max-w:          960px;
  --transition:     0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-root);
  color: var(--text-p);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100dvh;
  /* Grain texture overlay */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,135,42,0.06) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-p);
}
a { color: var(--amber); text-decoration: none; }
::selection { background: rgba(200,135,42,0.3); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-root); }
::-webkit-scrollbar-thumb { background: var(--amber-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-mid); }

/* ================================================================
   UTILITIES
   ================================================================ */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.text-muted { color: var(--text-muted); }

/* ================================================================
   HEADER
   ================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: rgba(10,8,6,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-faint);
}

.header-back {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  color: var(--amber);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}
.header-back:hover { background: var(--glow-sm); }

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.logo-icon { font-size: 1.4rem; line-height: 1; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-h);
  letter-spacing: 0.02em;
}

.header-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-nueva {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--amber);
  color: #0a0806;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-nueva:hover {
  background: var(--amber-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--glow);
}
.btn-nueva:active { transform: translateY(0); }

/* ================================================================
   VIEWS
   ================================================================ */
.view {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 80px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   FILTERS BAR
   ================================================================ */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
@media (min-width: 640px) {
  .filters-bar { flex-direction: row; align-items: center; }
}

.search-wrap {
  position: relative;
  flex: 1;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text-p);
  transition: border var(--transition), box-shadow var(--transition);
}
#search-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--glow-sm);
}
#search-input::placeholder { color: var(--text-muted); }

.filter-selects {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.filter-selects select {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text-p);
  cursor: pointer;
  font-size: 0.82rem;
  transition: border var(--transition);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6848' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.filter-selects select:focus { outline: none; border-color: var(--amber); }

/* ================================================================
   LISTA STATES
   ================================================================ */
.lista-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 16px;
  color: var(--text-muted);
}
.lista-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-p);
}
.lista-state p { font-size: 0.88rem; max-width: 320px; }

.empty-glass { font-size: 3.5rem; opacity: 0.4; }

.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   CATAS GRID
   ================================================================ */
.catas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
@media (min-width: 640px) {
  .catas-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* ---- Card ---- */
.cata-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.cata-card:hover {
  border-color: var(--border);
  background: var(--bg-card-h);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--glow-sm), inset 0 0 0 1px var(--glow-xs);
}

.card-image {
  position: relative;
  height: 160px;
  background: var(--bg-root);
  overflow: hidden;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.cata-card:hover .card-image img { transform: scale(1.04); }

.card-image-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #0f0c09 0%, #1a1410 100%);
}

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10,8,6,0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amber);
  backdrop-filter: blur(8px);
}

.card-color-stripe {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-region {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.card-nombre {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-h);
  line-height: 1.2;
}
.card-destileria {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--glow-xs);
  border: 1px solid var(--border-faint);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================================================================
   DETALLE VIEW
   ================================================================ */
.detalle-hero {
  position: relative;
  height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
}
@media (min-width: 640px) { .detalle-hero { height: 340px; } }
.detalle-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.detalle-hero-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, #0f0c09, #1a1410);
}
.detalle-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,8,6,0.95) 0%, rgba(10,8,6,0.3) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}
.detalle-region {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.detalle-nombre {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-h);
  line-height: 1.15;
}
@media (min-width: 640px) { .detalle-nombre { font-size: 2.6rem; } }

.detalle-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 28px;
}
.det-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius);
  min-width: 70px;
}
.det-chip-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.det-chip-value { font-size: 0.92rem; font-weight: 600; color: var(--text-h); }

.detalle-sections { display: flex; flex-direction: column; gap: 20px; }

.det-section {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.det-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-faint);
}
.det-section-icon { font-size: 1.1rem; }
.det-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-h);
}
.det-section-body { padding: 16px 20px; }

.det-subsection { margin-bottom: 14px; }
.det-subsection:last-child { margin-bottom: 0; }
.det-sub-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-mid);
  margin-bottom: 8px;
}
.det-note-text { font-size: 0.9rem; color: var(--text-p); line-height: 1.65; font-style: italic; }
.det-notas-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.det-pill {
  padding: 4px 10px;
  background: var(--glow-xs);
  border: 1px solid var(--border-faint);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-p);
}

.det-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-faint);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-p);
}
.det-color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.det-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.det-glass {
  font-size: 1.6rem;
  filter: grayscale(1) brightness(0.4);
  transition: filter 0.15s;
}
.det-glass.active { filter: none; }

.det-compraria {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}
.det-compraria.si  { background: rgba(74,122,74,0.2); color: #6aaa6a; border: 1px solid rgba(74,122,74,0.4); }
.det-compraria.no  { background: rgba(138,48,48,0.2); color: #c07070; border: 1px solid rgba(138,48,48,0.4); }
.det-compraria.tal { background: var(--glow-xs); color: var(--amber); border: 1px solid var(--border); }

.det-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 20px;
}

/* ================================================================
   FORM
   ================================================================ */
.form-section {
  background: var(--bg-section);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  margin-bottom: 16px;
}
.form-section--last { margin-bottom: 0; }

@media (min-width: 640px) { .form-section { padding: 32px 28px; } }

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-faint);
}
.section-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  color: var(--amber-dim);
  flex-shrink: 0;
  margin-top: -4px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-h);
  line-height: 1.2;
}
.section-header p { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* Fields */
.field-group {
  margin-bottom: 20px;
}
.field-group:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field-label.required::after {
  content: ' *';
  color: var(--amber);
}

.field-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text-p);
  transition: border var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--glow-sm);
}
.field-input::placeholder { color: var(--text-muted); font-size: 0.86rem; }
.field-input:invalid { border-color: var(--danger); }

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6848' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.field-select option { background: #1a1410; }

.field-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text-p);
  resize: vertical;
  min-height: 90px;
  transition: border var(--transition), box-shadow var(--transition);
  line-height: 1.6;
}
.field-textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--glow-sm);
}
.field-textarea::placeholder { color: var(--text-muted); font-size: 0.86rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
@media (min-width: 480px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-group--sm { max-width: 140px; }
}
@media (min-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr 1fr; }
}

/* Photo upload */
.photo-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}
.photo-upload-area:hover { border-color: var(--amber); background: var(--glow-xs); }

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}
.photo-placeholder svg { color: var(--amber-dim); }

.photo-preview {
  width: 100%;
  height: 200px;
  object-fit: contain;
  padding: 8px;
  background: var(--bg-input);
}

.photo-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Color picker */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
  position: relative;
}
@media (min-width: 480px) { .color-swatch { width: 40px; height: 40px; } }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: var(--amber-bright);
  box-shadow: 0 0 0 2px var(--bg-section), 0 0 0 4px var(--amber);
  transform: scale(1.12);
}
.color-label {
  font-size: 0.8rem;
  color: var(--amber);
  font-style: italic;
  min-height: 20px;
}

/* Pills */
.pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-input);
  transition: all var(--transition);
  line-height: 1.3;
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--amber-mid);
  color: var(--amber);
  background: var(--glow-xs);
}
.pill.active {
  background: var(--glow);
  border-color: var(--amber);
  color: var(--amber-bright);
  font-weight: 500;
}
.pill--yes.active  { background: rgba(74,122,74,0.25); border-color: #4a7a4a; color: #6aaa6a; }
.pill--no.active   { background: rgba(138,48,48,0.25); border-color: #8a3030; color: #c07070; }
.pill--maybe.active{ background: var(--glow); border-color: var(--amber); color: var(--amber-bright); }

/* Notes categories */
.notes-categories { display: flex; flex-direction: column; gap: 16px; }
.notes-cat { display: flex; flex-direction: column; gap: 8px; }
.notes-cat-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Rating widget */
.rating-widget {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.rating-glass {
  font-size: 1.8rem;
  line-height: 1;
  filter: grayscale(1) brightness(0.3);
  transition: all 0.18s ease;
  transform: scale(0.95);
}
.rating-glass:hover, .rating-glass.active {
  filter: none;
  transform: scale(1.1);
}
.rating-glass.hover-highlight { filter: grayscale(0.3) brightness(0.7); }

.rating-label {
  font-size: 0.82rem;
  color: var(--amber);
  font-style: italic;
  min-height: 20px;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 24px 0 8px;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px;
  background: var(--amber);
  color: #0a0806;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  background: var(--amber-bright);
  box-shadow: 0 4px 20px var(--glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-ghost:hover {
  border-color: var(--border);
  color: var(--text-p);
  background: var(--glow-xs);
}

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  background: var(--danger);
  color: #f0c0c0;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-danger:hover { background: var(--danger-bright); }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(10,8,6,0.3);
  border-top-color: #0a0806;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ================================================================
   MODAL
   ================================================================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.modal p {
  font-size: 1rem;
  color: var(--text-p);
  margin-bottom: 20px;
  line-height: 1.5;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ================================================================
   TOAST
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  animation: slideIn 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border: 1px solid;
}
.toast-success {
  background: rgba(74,122,74,0.2);
  border-color: rgba(74,122,74,0.5);
  color: #8acc8a;
}
.toast-error {
  background: rgba(138,48,48,0.2);
  border-color: rgba(138,48,48,0.5);
  color: #e08080;
}
.toast-info {
  background: var(--glow-sm);
  border-color: var(--border);
  color: var(--amber);
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ================================================================
   RESPONSIVE FIXES
   ================================================================ */
@media (max-width: 480px) {
  .app-header { padding: 0 12px; }
  .btn-nueva span { display: none; }
  .btn-nueva { padding: 8px 10px; }
  .view { padding: 16px 12px 80px; }
  .form-section { padding: 20px 14px; }
  .det-actions { flex-direction: column; }
  .detalle-nombre { font-size: 1.7rem; }
  .section-num { font-size: 2rem; }
}

/* ================================================================
   PRINT (fichas de cata)
   ================================================================ */
@media print {
  .app-header, .det-actions { display: none; }
  body { background: white; color: #333; }
  .det-section { border: 1px solid #ccc; }
  .view { padding: 0; }
}
