:root {
  --bg0: #e8f2ec;
  --bg1: #f7faf8;
  --ink: #12231c;
  --muted: #5a7166;
  --accent: #0b6e4f;
  --accent-2: #14916a;
  --line: #c9ddd3;
  --card: rgba(255, 255, 255, 0.88);
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(18, 45, 34, 0.08);
  --radius: 18px;
  --font: "Segoe UI", "Candara", "Calibri", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, #c8ebe0 0%, transparent 42%),
    radial-gradient(circle at 90% 0%, #dce8f4 0%, transparent 36%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, #eef5f1);
}

a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--accent); font-weight: 600; }

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card, .panel, .hero-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 1.6rem;
}
.auth-card h1, .brand {
  margin: 0;
  letter-spacing: 0.04em;
  font-weight: 800;
}
.auth-card h1 span, .brand span { color: var(--accent); }
.auth-card p { margin: 0.4rem 0 1.2rem; }

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}
input, select, button, textarea {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  color: var(--ink);
}
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.secondary, .btn.secondary {
  background: #234;
}
.link { font-size: 0.92rem; }

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.topbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.2fr 0.8fr;
}
@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
}

.panel { width: auto; }
.panel h2 { margin: 0 0 0.4rem; font-size: 1.25rem; }
.panel h3 { margin: 1rem 0 0.5rem; font-size: 1rem; }

.progress {
  height: 8px;
  background: #e3eee8;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.8rem 0;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #3ecf9a);
  transition: width 0.25s ease;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.metric {
  background: #f4faf7;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
}
.metric b {
  display: block;
  font-size: 1.35rem;
  margin-top: 0.2rem;
}

.history-item {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
.history-item:last-child { border-bottom: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.filters label { margin: 0; min-width: 140px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat {
  background: #f4faf7;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}
.stat b { display: block; margin-top: 0.25rem; font-size: 1.15rem; }

.install-list { padding-left: 1.1rem; line-height: 1.6; }
.hidden { display: none !important; }

.note {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.panel-wide { width: auto; max-width: 720px; margin: 0 auto; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
.choice-grid.vertical { grid-template-columns: 1fr; }
@media (max-width: 700px) {
  .choice-grid:not(.vertical) { grid-template-columns: 1fr; }
}

.choice-card {
  display: grid;
  gap: 0.25rem;
  text-align: left;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f4faf7;
  color: var(--ink);
  cursor: pointer;
  width: 100%;
}
.choice-card strong { font-size: 1.05rem; }
.choice-card:hover { border-color: var(--accent-2); }
.choice-card.selectable {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.75rem;
}
.choice-card.selectable input { width: auto; margin-top: 0.2rem; }
.choice-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #eaf7f1;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.steps-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.step-pill {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #e3eee8;
  color: var(--muted);
}
.step-pill.active {
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.actions-row .btn,
.actions-row button,
.actions-row a.btn { min-width: 140px; }

.metric-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .metric-inputs { grid-template-columns: 1fr; }
}

.preview-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin: 0.8rem 0 1rem;
  padding: 0.9rem;
  background: #f4faf7;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.preview-box .muted { display: block; font-size: 0.78rem; }
.preview-box b { font-size: 1.05rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.section-head h2 { margin: 0; }

.rb-form {
  margin: 0.85rem 0 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fbf9;
}
.rb-form h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.btn-sm, button.btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  min-width: 0;
}

.op-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  background: #e3eee8;
  color: var(--ink);
}
.op-badge.op-entel { background: #dceefc; color: #0b4f8a; }
.op-badge.op-viva { background: #ffe8cc; color: #8a4b00; }
.op-badge.op-tigo { background: #e8dcf8; color: #4a1f7a; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(18, 35, 28, 0.45);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}
.modal-card h3 { margin: 0 0 0.35rem; }
