:root {
  --green: #2db84b;
  --dark-green: #1a8c35;
  --ink: #0a0a0a;
  --paper: #f0f0f0;
  --card: #ffffff;
  --muted: #5f6368;
  --line: #e2e2e2;
  --danger: #c0392b;
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; }
a { color: var(--dark-green); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

.topbar { background: var(--ink); height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 50; }
.logo { color: var(--green); font-weight: 900; letter-spacing: .5px; white-space: nowrap; font-size: 1.02rem; text-decoration: none; }
.logo span { color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .who { color: rgba(255,255,255,.75); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; display: inline-flex; }
.btn { white-space: nowrap; border: none; border-radius: 22px; padding: 9px 18px; font-weight: 700; font-size: .92rem; background: var(--green); color: #fff; }
.btn:hover { filter: brightness(.94); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.dark { background: rgba(255,255,255,.14); color: #fff; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: .82rem; }
.link-btn { background: none; border: none; color: var(--dark-green); font-weight: 600; text-decoration: underline; padding: 0; }

.wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px 60px; }
.card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 24px; }
.msg { font-size: .9rem; padding: 10px 12px; border-radius: 8px; margin-top: 12px; display: none; }
.msg.show { display: block; }
.msg.err { background: #fdecea; color: #8a1f14; }
.msg.ok { background: #e7f6ea; color: #155c27; }

label.f { display: block; font-size: .82rem; font-weight: 700; margin: 14px 0 6px; color: #333; }
input.f, select.f, textarea.f { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: .95rem; }
input.f:focus, select.f:focus, textarea.f:focus { outline: none; border-color: var(--green); }

/* LOGIN */
.login-wrap { min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.login h1 { font-size: 1.35rem; margin-bottom: 4px; }
.login p.sub { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.login .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.login .actions .btn { width: 100%; padding: 11px; }
.login .alt { text-align: center; margin-top: 16px; font-size: .88rem; color: var(--muted); }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #222; border: 1.5px solid var(--line); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 18px 0 2px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* HOME */
.hello h1 { font-size: 1.6rem; }
.hello p { color: var(--muted); margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 24px; }
.tile { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-3px); border-color: var(--green); }
.tile .ico { font-size: 2.2rem; }
.tile h2 { font-size: 1.1rem; }
.tile p { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.tile.soon { opacity: .6; pointer-events: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile .tag.alert { background: #fdecea; color: #8a1f14; }
.tile .tag { align-self: flex-start; font-size: .72rem; font-weight: 800; background: #fff4d6; color: #7a5600; border-radius: 10px; padding: 3px 8px; }

@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; }
  .topbar .who { max-width: none; flex-shrink: 0; }
  .btn.small { padding: 6px 10px; }
  .card { padding: 20px 16px; }
}

/* Usuario conectado */
.yo { text-decoration: none; border-radius: 22px; padding: 2px 8px 2px 2px; display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 1; }
.yo-ini { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-weight: 800; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.yo-admin .yo-ini { background: #f5a623; color: #111; }
.yo-txt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.yo-nom { color: #fff; font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22vw; }
.yo-rol { color: rgba(255,255,255,.6); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.yo-admin .yo-rol { color: #f5a623; }
@media (max-width: 760px) { .yo-txt { display: none; } }
.yo:hover { background: rgba(255,255,255,.1); }

/* Bienvenida */
.bienv { text-align: center; max-width: 440px; }
.bienv-logo { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 10px; display: block; }
.bienv h1 { font-size: 1.55rem; }
.bienv-op { border: 1.5px solid var(--line); border-radius: 14px; padding: 18px 16px; margin-top: 16px; }
.bienv-op.nuevo { border-color: var(--green); background: #f3fbf4; }
.bienv-op h2 { font-size: 1.12rem; margin-bottom: 4px; }
.bienv-op p { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.btn.big { width: 100%; padding: 14px; font-size: 1.02rem; }

/* Inicio: tarjetas con portada */
.tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tile.tile-cover { padding: 0; overflow: hidden; gap: 0; }
.tile-cover .cover { position: relative; aspect-ratio: 16 / 9; background: #0e0e0e center / cover no-repeat; }
.tile-cover .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.45)); }
.tile-cover .cover.sin-foto { display: flex; align-items: center; justify-content: center; color: var(--green);
  background: radial-gradient(120% 90% at 20% 10%, #1d3b25 0%, #0f1a12 45%, #0a0a0a 100%); }
.tile-cover .cover.sin-foto svg { width: 54px; height: 54px; opacity: .9; }
.cover-tag { position: absolute; z-index: 1; left: 14px; bottom: 12px; font-size: .68rem; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #fff; background: rgba(45,184,75,.92); border-radius: 6px; padding: 3px 8px; }
.tile-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.tile-body h2 { font-size: 1.12rem; line-height: 1.25; }
.tile-cover .cover.collage { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: #0e0e0e; }
.tile-cover .cover.collage span { background: center / cover no-repeat; }
.tile-cover .cover.collage span:first-child { grid-row: 1 / 3; }
.tile-cover .cover.collage span:only-child, .tile-cover .cover.collage span:first-child:nth-last-child(2) { grid-row: 1 / 3; }
.tile-cover .cover.collage span:nth-child(2):last-child { grid-row: 1 / 3; }
.tile-cover:hover .cover { filter: brightness(1.06); }
.cuenta { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 20px; }
.tile.tile-mini { flex-direction: row; align-items: flex-start; gap: 14px; padding: 16px 18px; }
.tile-mini h2 { font-size: 1rem; }
.tile-mini p { margin-top: 2px; }
.mini-ico { width: 40px; height: 40px; border-radius: 10px; background: #eef8f0; color: var(--dark-green); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-ico.admin { background: #fff3dc; color: #a46a00; }
.mini-ico svg { width: 22px; height: 22px; }
