/* ClickDialog Reputation OS — design system compartido */
:root {
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: #eff4ff;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5f6672;
  --line: #e4e8ef;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }

/* ---- Shell de app (sidebar + contenido) ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: #10214d; color: #cfd9f4;
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo { color: #fff; font-weight: 700; font-size: 17px; padding: 6px 10px 18px; letter-spacing: .2px; }
.sidebar .logo small { display: block; font-weight: 400; font-size: 11px; color: #8fa3d9; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #cfd9f4; padding: 9px 12px; border-radius: 8px; font-size: 14px;
  display: flex; align-items: center; gap: 9px; text-decoration: none;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar nav .count {
  margin-left: auto; background: rgba(255,255,255,.16); border-radius: 99px;
  font-size: 11px; padding: 1px 8px; font-weight: 600;
}
.sidebar .foot { font-size: 12px; color: #8fa3d9; padding: 12px 10px 4px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar .foot button { background: none; border: none; color: #cfd9f4; cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }
.main { flex: 1; padding: 26px 32px 60px; max-width: 1200px; }
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 22px; }
.topbar .sub { color: var(--muted); font-size: 13px; }

/* ---- Componentes ---- */
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.card .hint { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 26px; font-weight: 700; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi.warn b { color: var(--warning); }
.kpi.bad b { color: var(--danger); }
.kpi.good b { color: var(--success); }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap;
}
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.gray { background: #eef0f4; color: var(--muted); }

.stars { color: #d97706; letter-spacing: 1px; font-size: 13px; white-space: nowrap; }

button, .btn {
  font-family: var(--font); font-size: 13.5px; font-weight: 600; cursor: pointer;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { border-color: #c7cdd8; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger-soft); border-color: #f3c1c1; color: var(--danger); }
.btn-success { background: var(--success-soft); border-color: #bfe6cd; color: var(--success); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: not-allowed; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: var(--brand-soft); }

input, select, textarea {
  font-family: var(--font); font-size: 14px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29, 78, 216, .35); border-color: var(--brand); }
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin: 10px 0 4px; }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex-shrink: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 140px; }

.review-item { border-bottom: 1px solid var(--line); padding: 14px 4px; }
.review-item:last-child { border-bottom: none; }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.review-head b { font-size: 14.5px; }
.review-text { margin: 4px 0 8px; }
.response-box {
  background: var(--brand-soft); border: 1px solid #d6e2fb; border-radius: 10px;
  padding: 10px 14px; margin: 8px 0; font-size: 14px;
}
.response-box.published { background: var(--success-soft); border-color: #bfe6cd; }
.risk-note {
  background: var(--danger-soft); border: 1px solid #f3c1c1; border-radius: 10px;
  padding: 10px 14px; margin: 8px 0; font-size: 13.5px; color: var(--danger);
}

.modal-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex;
  align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto;
}
.modal { background: #fff; border-radius: 14px; padding: 22px 24px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin-top: 0; font-size: 18px; }

.toast {
  position: fixed; bottom: 22px; right: 22px; background: #10214d; color: #fff;
  padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 99;
  font-size: 14px; max-width: 380px;
}
.toast.error { background: var(--danger); }

.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 14px; }
.section-gap { margin-top: 22px; }
.checklist li { margin: 6px 0; }
.checklist .done { color: var(--success); }
.checklist .todo { color: var(--muted); }
.mono { font-family: Consolas, monospace; font-size: 13px; background: #f1f3f8; border-radius: 6px; padding: 2px 6px; word-break: break-all; }
.copy-block { background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.kit-qr { text-align: center; }
.kit-qr img { max-width: 220px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #10214d 0%, #1d4ed8 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 34px 34px 28px; width: 100%; max-width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.login-card h1 { margin: 0 0 4px; font-size: 21px; }
.login-card p.hint { color: var(--muted); font-size: 13px; margin-top: 0; }
.login-demo { margin-top: 16px; font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 10px 12px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 18px 14px 50px; }
}
@media print {
  .sidebar, .topbar .actions, .no-print { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; }
}
