:root {
  --nisum-blue: #0019ff;
  --nisum-blue-mid: #2a87ff;
  --nisum-cyan: #00cbff;
  --nisum-purple: #6e12ff;
  --nisum-gradient: linear-gradient(90deg, var(--nisum-blue) 4%, var(--nisum-cyan) 93%);
  --ink: #0a0a0f;
  --ink-soft: #52525b;
  --border: #e4e4e9;
  --surface: #ffffff;
  --bg: #f6f7fb;
  --danger: #d33a3a;
  --success: #1a9b5c;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 15, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 10, 15, 0.08);
  --font: "Corbel", "Segoe UI", Roboto, Arial, sans-serif;

  --excelente: #1a9b5c;
  --bueno: #2a87ff;
  --regular: #d68a1e;
  --deficiente: #d33a3a;
  --neutral: #8a8a94;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-group img {
  height: 20px;
  width: auto;
  display: block;
}

.logo-group-lg img { height: 30px; }

.logo-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

.logo-group-lg .logo-divider { height: 32px; }

.topbar .app-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.topbar-accent { height: 3px; background: var(--nisum-gradient); flex-shrink: 0; }

.screen { display: none; flex: 1; flex-direction: column; min-height: 0; }
.screen.active { display: flex; }

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 2px; letter-spacing: -0.01em; }
p { line-height: 1.5; margin: 0; }
.hint { color: var(--ink-soft); font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.center-card { max-width: 460px; margin: 0 auto; text-align: center; }
.center-card .logo-group-lg { justify-content: center; margin-bottom: 20px; }
.center-card h1 { margin-top: 4px; }
.center-card .hint { margin-top: 8px; }

.denied-icon, .error-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 20px;
  background: #fdecec; color: var(--danger);
}
.denied { color: var(--danger); }

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

#google-signin-button { display: flex; justify-content: center; margin-top: 20px; }

#dev-login-box {
  margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border);
}
.dev-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-soft); margin: 0 0 8px;
}
#dev-email-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; font-size: 14px; margin-bottom: 8px;
}

.link-button {
  background: none; border: none; color: var(--nisum-blue);
  cursor: pointer; padding: 0; font: inherit; font-size: 14px; font-weight: 600;
}

button.primary {
  background: var(--nisum-gradient); color: white; border: none;
  border-radius: var(--radius-pill); padding: 12px 24px; font-size: 15px;
  font-weight: 600; font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
button.primary:hover { opacity: 0.92; }
button.primary:disabled { background: var(--border); color: var(--ink-soft); cursor: default; box-shadow: none; }

/* ---------- Workspace (dos columnas) ---------- */

.workspace-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px 14px;
}
.workspace-header-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.workspace-header-top h1 { margin: 0; }
.header-progress-count { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.workspace-header-sub { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }

.progress-track {
  height: 6px; border-radius: var(--radius-pill); background: var(--border);
  overflow: hidden; margin-top: 12px;
}
.progress-fill { height: 100%; background: var(--nisum-gradient); width: 0%; transition: width 0.25s ease; }

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 16px;
}
.sidebar-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); margin: 0 0 12px;
}

.provider-list { display: flex; flex-direction: column; gap: 6px; }

.provider-item {
  display: flex; flex-direction: column; gap: 3px;
  text-align: left; background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit;
}
.provider-item:hover { background: var(--bg); }
.provider-item.active { background: #eef2ff; border-color: var(--nisum-blue-mid); }

.provider-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.provider-item strong { font-size: 14px; font-weight: 600; }
.provider-item-status { font-size: 12px; color: var(--ink-soft); }

.empty-state { text-align: center; padding: 40px 16px; color: var(--ink-soft); font-size: 14px; }

.badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill);
  color: white; white-space: nowrap;
}
.badge-excelente { background: var(--excelente); }
.badge-bueno { background: var(--bueno); }
.badge-regular { background: var(--regular); }
.badge-deficiente { background: var(--deficiente); }
.badge-neutral { background: var(--neutral); }

.panel {
  overflow-y: auto;
  padding: 24px 28px 80px;
}
.panel-empty { color: var(--ink-soft); font-size: 14px; padding: 40px 0; text-align: center; }

.panel-thanks { max-width: 380px; margin: 40px auto 0; padding: 0; }
.panel-thanks h2 { color: var(--ink); font-size: 17px; }
.panel-thanks .hint { margin-top: 8px; }

.success-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 20px;
  background: #e8f8f0; color: var(--success);
}

.panel-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 20px;
}
.panel-sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.question-row {
  border: none; border-top: 1px solid var(--border);
  padding: 14px 0; margin: 0;
}
.question-row:last-of-type { border-bottom: 1px solid var(--border); }

.question-row-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.question-row legend {
  font-weight: 600; font-size: 14px; padding: 0;
}

.question-desc {
  color: var(--ink-soft); font-size: 12.5px; line-height: 1.45;
  margin: 6px 0 0; max-width: 640px;
}

.answer-options {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 3px; gap: 2px; background: var(--bg); flex-shrink: 0;
}
.answer-options input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.answer-options label {
  padding: 6px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.answer-options input[type="radio"]:checked + label { background: var(--nisum-gradient); color: white; }
.question-row[disabled] .answer-options label { cursor: default; }

.question-row textarea {
  width: 100%; min-height: 40px; margin-top: 10px; font: inherit; font-size: 13px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  resize: vertical; background: var(--bg);
}
.question-row[disabled] textarea { color: var(--ink-soft); background: var(--surface); }

.panel-footer { margin-top: 24px; display: flex; align-items: center; gap: 12px; }
.save-indicator { color: var(--success); font-size: 14px; font-weight: 600; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none; border-bottom: 1px solid var(--border);
    max-height: 240px;
  }
  .panel { padding: 20px 16px 80px; }
}

@media (max-width: 480px) {
  .center-card { padding: 4px; }
  .card { padding: 20px; }
  .workspace-header { padding: 14px 16px 12px; }
  .question-row-top { flex-direction: column; align-items: flex-start; gap: 10px; }
}
