:root{
  --brand: #2e7d32;
  --brand-600: #1b5e20;
  --border: #e5e7eb;
  --bg: #f6f7f9;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #b00020;
  --blue: #0b5c9a;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text);}

header.app{ background: var(--brand); color:#fff; padding:16px 20px; display:flex; align-items:center; justify-content:space-between; }
header.app a{ color:#fff; text-decoration:none; }
header.app .brand{ display:flex; align-items:center; gap:10px; }
header.app .brand img{ height:28px; width:auto; display:block; }

main.app{ padding:16px; }

.grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:16px; }
.cols-3{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
@media (max-width: 1100px){ .cols-3{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px){ .cols-3{ grid-template-columns: 1fr; } }
.card{ background:#fff; border-radius:12px; border:1px solid var(--border); box-shadow:0 6px 18px rgba(0,0,0,.06); padding:18px; }

h1,h2,h3{ margin:0 0 10px; }
table{ width:100%; border-collapse:collapse; font-size:14px; }
th,td{ text-align:left; padding:8px; border-bottom:1px solid var(--border); }

label{ display:block; font-size:13px; color:#374151; margin:8px 0 4px; }
input[type=text], input[type=password], input[type=file], select, textarea{
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px; font-size:14px; background:#fff;
}
textarea{ min-height:120px; }

.row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.muted{ color:#6b7280; font-size:14px; }
.flash{ background:#e7f6ed; color:var(--brand); padding:8px 12px; border-radius:8px; display:inline-block; }
.error{ background:#fde7e9; color:#b00020; padding:8px 12px; border-radius:8px; display:inline-block; }

/* Botones sutiles en admin */
.btn{
  background:#fff;
  color:var(--text);
  border:1px solid var(--border);
  padding:10px 14px;
  border-radius:8px;
  cursor:pointer;
  font-weight:600;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.btn:hover{
  background:#f8fafc;
  border-color:#d1d5db;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.btn:active{ box-shadow:0 1px 3px rgba(0,0,0,.06); }

/* Variantes sutiles */
.btn.secondary{
  background:#f1f5f9;
  color:#0b5c9a;
  border-color:#d1e3f3;
}
.btn.secondary:hover{ background:#e8f1f9; border-color:#c7d8ec; }

.btn.danger{
  background:#fff5f5;
  color:var(--danger);
  border-color:#f5c2c7;
}
.btn.danger:hover{ background:#ffe8ea; border-color:#f1aeb5; }

.index-pill{ background:#eef2f6; color:#334155; padding:4px 8px; border-radius:999px; font-size:12px; }
.preview{ display:flex; justify-content:center; padding:8px 0; }
.preview img{ max-width:100%; max-height:160px; height:auto; border-radius:8px; border:1px solid var(--border); }

/* Galería (admin) */
.gallery{ margin-top:8px; }
.gallery .row{ justify-content:space-between; }
.gallery-wrap{ display:grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap:10px; margin-top:8px; }
.gallery-item{ position:relative; border:1px solid var(--border); border-radius:8px; overflow:hidden; background:#f8fafc; display:flex; align-items:center; justify-content:center; }
.gallery-item img{ width:100%; height:90px; object-fit:cover; display:block; }
.gallery-item .remove-gallery{ position:absolute; top:6px; right:6px; }

.logo-small{ height:36px; width:auto; display:block; margin: 24px auto 8px; }

/* Login: logo a ancho completo del formulario */
.login-brand{ text-align:center; }
.login-logo{ width:360px; max-width:100%; height:auto; display:block; margin: 0 auto 8px; }

@media (max-width: 768px){
  header.app{ position: sticky; top: 0; z-index: 100; }
}
