:root {
  --brand: #0f766e; --brand-dark: #0b5c56; --brand-soft: #e6f4f2;
  --bg: #f5f6f4; --card: #ffffff; --text: #1c1f1e; --muted: #5f6763; --faint: #8a918d;
  --border: #e3e6e3; --border-strong: #cfd4d0;
  --ok: #157a3d; --ok-bg: #e7f5ec; --warn: #9a5b00; --warn-bg: #fdf3e1; --bad: #b42318; --bad-bg: #fdecea;
  --info: #1d5fa8; --info-bg: #e8f1fb;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }

.status-bar { padding: 4px 12px; font-size: 12px; text-align: center; color: #fff; background: var(--ok); }
.status-bar.offline { background: #a15c00; }
.status-bar.pending { background: var(--info); }

.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; letter-spacing: .5px; }
.brand small { display: block; font-weight: 400; font-size: 11px; opacity: .8; letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.user-chip { font-size: 12px; opacity: .9; text-align: right; }
.nav { display: flex; gap: 2px; padding: 0 8px; background: var(--brand-dark); overflow-x: auto; scrollbar-width: none; }
.nav a { color: #d7efec; text-decoration: none; padding: 10px 12px; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a.active { color: #fff; border-bottom-color: #fff; }
.nav .count { background: #fff; color: var(--brand-dark); border-radius: 9px; font-size: 11px; padding: 0 6px; margin-left: 4px; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.card.flat { background: transparent; border: 0; padding: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.stat .v { font-size: 22px; font-weight: 600; } .stat .l { font-size: 12px; color: var(--muted); }
.stat.alert .v { color: var(--warn); }

label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd6cf; border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; }
.check { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; margin: 10px 0; }
.check input { margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sec { font-size: 13px; font-weight: 600; margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text); }
.sec:first-of-type { border-top: 0; padding-top: 0; }

button, .btn { font: inherit; font-size: 14px; padding: 9px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
button:hover { background: #f3f5f3; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); }
button.danger { color: var(--bad); border-color: #f1c4bf; }
button.small { padding: 5px 10px; font-size: 13px; }
button.block { width: 100%; margin-top: 14px; }
button:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; color: var(--brand); padding: 0; text-decoration: underline; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: var(--muted); cursor: pointer; user-select: none; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.chip.static { cursor: default; padding: 2px 9px; font-size: 12px; }

.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #eef0ee; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.nivel { font-weight: 600; }
.nivel-bronze { background: #f6e7d7; color: #8a4b12; } .nivel-silver { background: #e9edf1; color: #3e4c59; }
.nivel-gold { background: #fbefc5; color: #7a5a00; } .nivel-platinum { background: #e4ecfb; color: #2c4a8a; }
.nivel-elite { background: #efe6fb; color: #5b2d91; }

.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; font-size: 13px; } .avatar.lg { width: 76px; height: 76px; font-size: 20px; }
.progress { height: 8px; background: #e8ebe8; border-radius: 4px; overflow: hidden; margin: 6px 0; }
.progress > div { height: 100%; background: var(--brand); }

.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.foto { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eef0ee; }
.foto img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.foto .tag { position: absolute; left: 4px; bottom: 4px; font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 4px; }
.foto .x { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 50%; width: 24px; height: 24px; padding: 0; font-size: 14px; }
.foto.add { border: 1.5px dashed var(--border-strong); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: pointer; }

.list-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.click { cursor: pointer; } .click:hover { background: #fafbfa; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.t td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap { overflow-x: auto; }

.steps { display: flex; gap: 4px; margin: 8px 0 4px; }
.steps div { flex: 1; height: 6px; border-radius: 3px; background: #e3e6e3; }
.steps div.done { background: var(--brand); }
.stars { display: flex; gap: 4px; font-size: 28px; }
.stars span { cursor: pointer; color: #cfd4d0; } .stars span.on { color: #e0a100; }

.notice { padding: 10px 12px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: 14px; margin-bottom: 12px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); } .notice.ok { background: var(--ok-bg); color: var(--ok); } .notice.bad { background: var(--bad-bg); color: var(--bad); }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 6px; }
.loading { color: var(--muted); padding: 24px; text-align: center; }
.empty { color: var(--muted); padding: 18px; text-align: center; font-size: 14px; }

.auth-wrap { max-width: 440px; margin: 24px auto; padding: 0 16px; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head .logo { font-weight: 800; letter-spacing: 1px; color: var(--brand); font-size: 22px; }
.choices { display: grid; gap: 10px; margin-top: 12px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; }
.choice:hover { border-color: var(--brand); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1c1f1e; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 18px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.modal img.full { width: 100%; border-radius: 8px; }
.bar { height: 10px; background: var(--brand); border-radius: 3px; }

@media (max-width: 560px) {
  main { padding: 12px; }
  .card { padding: 14px; }
  .two { grid-template-columns: 1fr; }
  .user-chip { display: none; }
}

/* Logótipo */
.brand-wrap { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; background: #faf2e3; border-radius: 10px; padding: 3px; flex: none; }
.auth-head .logo-img { width: 170px; max-width: 60%; height: auto; display: block; margin: 0 auto 6px; }
.logo-mini { height: 44px; width: auto; }
@media (max-width: 420px) { .brand small { display: none; } .brand-logo { width: 36px; height: 36px; } }
