/* ═══════════════════════════════════════════════════════════
   MAP-PSI SYSTEM — MAIN STYLESHEET
   Dark navy + teal-green professional theme
═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base: #080F1D;
  --bg-card: #0D1B30;
  --bg-card-hover: #111F37;
  --bg-sidebar: #060E1A;
  --bg-input: #0A1628;
  --border: #1A2E4A;
  --border-light: #223553;
  --accent: #3CC98B;
  --accent-dark: #2DA875;
  --accent-glow: rgba(60,201,139,.18);
  --teal: #1E8A8A;
  --blue: #2B5FD9;
  --text-primary: #E6EDF8;
  --text-muted: #6B82A0;
  --text-faint: #384D6A;
  --danger: #E04B4B;
  --danger-bg: rgba(224,75,75,.12);
  --warning: #D97706;
  --warning-bg: rgba(217,119,6,.12);
  --success: #3CC98B;
  --success-bg: rgba(60,201,139,.12);
  --info: #3B82F6;
  --info-bg: rgba(59,130,246,.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.2);
  --sidebar-w: 240px;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --transition: 0.18s ease;
}

html { font-size: 15px; }
body { font-family: var(--font-sans); background: var(--bg-base); color: var(--text-primary); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.logo-text { font-family: var(--font-serif); }
.logo-main { font-size: 1.3rem; color: var(--text-primary); letter-spacing: -.5px; }
.logo-accent { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; }
.nav-section-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); padding: 0.75rem 0.5rem 0.25rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--border); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(60,201,139,.25); }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--accent);
  color: var(--bg-base);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; }
.btn-logout:hover { color: var(--danger); }

/* ─── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

/* ─── PAGE HEADER ─────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; }
.page-title { font-family: var(--font-serif); font-size: 1.9rem; color: var(--text-primary); line-height: 1.2; }
.page-desc { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.25rem; }
.back-link { display: inline-block; color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.5rem; }
.back-link:hover { color: var(--accent); }
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #051010; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-card); }
.btn-teal { background: rgba(30,138,138,.2); color: #5ECECE; border-color: rgba(30,138,138,.4); }
.btn-teal:hover { background: rgba(30,138,138,.35); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(224,75,75,.3); }
.btn-danger:hover { background: rgba(224,75,75,.2); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.73rem; }
.btn-full { width: 100%; justify-content: center; }

/* ─── CARDS ─────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-title { font-weight: 600; font-size: 0.9rem; }
.card-body { padding: 1.25rem; }

/* ─── STATS GRID ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-blue { background: rgba(43,95,217,.15); color: #6B9AFF; }
.stat-teal { background: rgba(30,138,138,.15); color: #5ECECE; }
.stat-green { background: var(--accent-glow); color: var(--accent); }
.stat-red { background: var(--danger-bg); color: var(--danger); }
.stat-number { font-family: var(--font-serif); font-size: 2rem; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ─── CONTENT GRID ─────────────────────────────────────────── */
.content-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.content-grid-3 { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; margin-bottom: 1.5rem; }

/* ─── TABLES ─────────────────────────────────────────────────── */
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table thead { background: var(--bg-sidebar); }
.data-table th { padding: 0.7rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.table-total td { background: var(--bg-sidebar); font-weight: 600; border-top: 2px solid var(--border-light); }

/* ─── BADGES ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 0.18rem 0.55rem; border-radius: 100px; font-size: 0.72rem; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--accent); }
.badge-warning { background: var(--warning-bg); color: #F59E0B; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: rgba(255,255,255,.06); color: var(--text-muted); }

/* ─── CLASSIFICATION BADGES ─────────────────────────────────── */
.classification-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.78rem; font-weight: 700; letter-spacing: .02em; }
.badge-sm { padding: 0.12rem 0.4rem; font-size: 0.7rem; }
.c-baixo { background: rgba(60,201,139,.15); color: #3CC98B; border: 1px solid rgba(60,201,139,.25); }
.c-medio { background: rgba(59,130,246,.15); color: #60A5FA; border: 1px solid rgba(59,130,246,.25); }
.c-alto { background: rgba(217,119,6,.15); color: #FBA94C; border: 1px solid rgba(217,119,6,.25); }
.c-critico { background: rgba(224,75,75,.2); color: #F87171; border: 1px solid rgba(224,75,75,.3); }
.c-moderado { background: rgba(59,130,246,.15); color: #60A5FA; border: 1px solid rgba(59,130,246,.25); }

/* ─── FLASH MESSAGES ─────────────────────────────────────────── */
.flash-container { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.flash { display: flex; align-items: center; gap: 10px; padding: 0.7rem 1rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; }
.flash-success { background: var(--success-bg); color: var(--accent); border: 1px solid rgba(60,201,139,.25); }
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(224,75,75,.25); }
.flash-info { background: var(--info-bg); color: var(--info); }
.flash-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: .7; }
.flash-close:hover { opacity: 1; }

/* ─── FORMS ─────────────────────────────────────────────────── */
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 900px; }
.form-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 1.25rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: var(--transition);
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text-faint); }
.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-input-sm { padding: 0.45rem 0.7rem; font-size: 0.82rem; }
.form-hint { font-size: 0.75rem; color: var(--warning); margin-top: 0.25rem; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ─── INFO BOXES ─────────────────────────────────────────────── */
.info-box { display: flex; align-items: flex-start; gap: 10px; background: var(--info-bg); border: 1px solid rgba(59,130,246,.25); border-radius: var(--radius-sm); padding: 0.9rem 1rem; font-size: 0.83rem; color: #93C5FD; margin-bottom: 1.5rem; }
.info-box p { margin: 0; }
.info-box-warning { background: var(--warning-bg); border-color: rgba(217,119,6,.3); color: #FBA94C; }
.info-box-success { background: var(--success-bg); border-color: rgba(60,201,139,.3); color: var(--accent); }

/* ─── EMPTY STATES ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.empty-state h3 { font-size: 1.1rem; }
.empty-state p { color: var(--text-muted); max-width: 380px; }
.empty-state-sm { text-align: center; padding: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.empty-state-sm p { color: var(--text-muted); font-size: 0.85rem; }

/* ─── UTILITY ─────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.text-danger { color: var(--danger); }
.link-primary { color: var(--text-primary); font-weight: 500; }
.link-primary:hover { color: var(--accent); }
.action-btns { display: flex; gap: 0.35rem; align-items: center; }

/* ─── LIST ITEMS ─────────────────────────────────────────────── */
.list-items { display: flex; flex-direction: column; gap: 2px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.list-item:last-child { border-bottom: none; }
.list-item:hover { color: var(--accent); }
.list-item-title { font-size: 0.85rem; font-weight: 500; }
.list-item-sub { font-size: 0.75rem; color: var(--text-muted); }
.list-item-right { display: flex; align-items: center; gap: 0.75rem; }
.list-item-count { font-size: 0.75rem; color: var(--text-muted); }

/* ─── STATUS BARS ─────────────────────────────────────────── */
.status-bars { display: flex; flex-direction: column; gap: 1rem; }
.status-bar-item {}
.status-bar-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; font-size: 0.8rem; }
.progress-bar { height: 6px; background: var(--border); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 0.6s ease; }
.fill-warning { background: var(--warning); }
.fill-info { background: var(--info); }
.fill-success { background: var(--accent); }

/* ─── MINI STATS ─────────────────────────────────────────────── */
.mini-stats { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.mini-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.5rem; text-align: center; flex: 1; min-width: 120px; }
.mini-stat-num { font-family: var(--font-serif); font-size: 1.8rem; color: var(--accent); }
.mini-stat-lbl { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ─── LINK CARD ─────────────────────────────────────────────── */
.link-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.link-card-content { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.link-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.link-url { font-family: monospace; font-size: 0.85rem; color: var(--accent); background: var(--bg-input); padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--border); word-break: break-all; flex: 1; }
.link-warning { font-size: 0.8rem; color: var(--warning); margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

/* ─── DEPARTMENT LIST ─────────────────────────────────────── */
.dept-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.dept-item { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.75rem; background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.dept-name { font-size: 0.85rem; font-weight: 500; }
.add-dept-form { padding-top: 1rem; border-top: 1px solid var(--border); }

/* ─── SURVEYS GRID ─────────────────────────────────────────── */
.surveys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.survey-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; transition: var(--transition); }
.survey-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.survey-card-header { display: flex; align-items: flex-start; justify-content: space-between; }
.survey-company { font-size: 0.75rem; color: var(--text-muted); }
.survey-name { font-weight: 600; font-size: 0.95rem; }
.survey-stats { display: flex; gap: 1rem; }
.survey-stat { text-align: center; }
.survey-stat-num { font-family: var(--font-serif); font-size: 1.4rem; color: var(--accent); }
.survey-stat-lbl { font-size: 0.7rem; color: var(--text-muted); }
.survey-actions { display: flex; gap: 0.5rem; margin-top: auto; }

/* ─── METHODOLOGY CARD ─────────────────────────────────────── */
.methodology-card { margin-top: 1.5rem; }
.methodology-content { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.25rem; }
.methodology-icon { flex-shrink: 0; }
.methodology-steps { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.method-step { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-muted); }
.step-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.dot-m { background: rgba(43,95,217,.2); color: #6B9AFF; border: 2px solid #2B5FD9; }
.dot-a { background: var(--accent-glow); color: var(--accent); border: 2px solid var(--accent); }
.dot-p { background: rgba(30,138,138,.2); color: #5ECECE; border: 2px solid var(--teal); }
.step-arrow { color: var(--text-faint); font-size: 1.2rem; }

/* ─── ACTION PLANS ─────────────────────────────────────────── */
.plan-status-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.plan-status-item { flex: 1; min-width: 100px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.status-num { font-family: var(--font-serif); font-size: 2rem; }
.status-lbl { font-size: 0.75rem; color: var(--text-muted); }
.status-pending .status-num { color: var(--warning); }
.status-progress .status-num { color: var(--info); }
.status-done .status-num { color: var(--accent); }
.status-total .status-num { color: var(--text-primary); }
.status-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.status-select.status-completed { color: var(--accent); border-color: rgba(60,201,139,.3); }
.status-select.status-in_progress { color: var(--info); border-color: rgba(59,130,246,.3); }
.status-select.status-pending { color: var(--warning); border-color: rgba(217,119,6,.3); }
.plan-hazard { font-size: 0.85rem; font-weight: 500; }

/* ─── RISK ASSESSMENT ─────────────────────────────────────── */
.assessment-group { margin-bottom: 2.5rem; }
.group-overall { }
.group-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem; }
.group-title { font-family: var(--font-serif); font-size: 1.4rem; display: flex; align-items: center; gap: 0.75rem; }
.group-tag { background: var(--accent); color: var(--bg-base); font-family: var(--font-sans); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 0.15rem 0.5rem; border-radius: 4px; }
.group-meta { display: flex; align-items: center; gap: 0.75rem; }
.group-respondents { font-size: 0.8rem; color: var(--text-muted); }
.ips-badge { font-size: 0.82rem; padding: 0.35rem 0.85rem; border-radius: var(--radius-sm); }
.ips-crítico, .ips-critico { background: rgba(224,75,75,.15); color: #F87171; border: 1px solid rgba(224,75,75,.3); }
.ips-alto { background: rgba(217,119,6,.15); color: #FBA94C; border: 1px solid rgba(217,119,6,.3); }
.ips-moderado { background: rgba(59,130,246,.15); color: #60A5FA; border: 1px solid rgba(59,130,246,.3); }
.ips-baixo { background: var(--success-bg); color: var(--accent); border: 1px solid rgba(60,201,139,.3); }

.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.domain-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.domain-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; gap: 0.5rem; }
.domain-name { font-size: 0.82rem; font-weight: 600; flex: 1; }
.domain-score {}
.score-bar-wrap { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.score-bar-bg { flex: 1; height: 8px; background: var(--border); border-radius: 100px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 100px; transition: width 0.8s ease; }
.score-value { font-weight: 700; font-size: 1rem; min-width: 28px; text-align: right; }
.domain-stats-row { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; color: var(--text-muted); }
.ds-sep { color: var(--text-faint); }

/* ─── RISK MATRIX ─────────────────────────────────────────── */
.matrix-section { margin-top: 1.5rem; }
.matrix-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; }
.matrix-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
.risk-matrix-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.risk-matrix-table th { padding: 0.5rem 0.6rem; background: var(--bg-sidebar); color: var(--text-muted); font-weight: 600; font-size: 0.68rem; text-transform: uppercase; border: 1px solid var(--border); text-align: center; }
.risk-matrix-table th small { display: block; font-size: 0.6rem; font-weight: 400; opacity: .7; }
.matrix-p-label { background: var(--bg-sidebar); color: var(--text-muted); font-weight: 700; font-size: 0.72rem; border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: center; }
.matrix-cell { padding: 0.45rem 0.6rem; border: 1px solid var(--border); text-align: center; font-weight: 600; font-size: 0.72rem; position: relative; }
.matrix-cell.c-baixo { background: rgba(60,201,139,.08); color: #3CC98B; }
.matrix-cell.c-medio { background: rgba(59,130,246,.08); color: #60A5FA; }
.matrix-cell.c-alto { background: rgba(217,119,6,.1); color: #FBA94C; }
.matrix-cell.c-critico { background: rgba(224,75,75,.12); color: #F87171; }
.cell-active { outline: 2px solid #fff; outline-offset: -3px; }
.cell-dot { position: absolute; top: 3px; right: 3px; font-size: 0.5rem; }
.domain-summary { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.summary-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.summary-item { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.summary-right { display: flex; align-items: center; gap: 0.5rem; }
.summary-matrix { font-size: 0.7rem; color: var(--text-muted); }
.summary-name { flex: 1; font-size: 0.78rem; }
.summary-action { padding: 0.75rem; }

/* ─── LOGIN PAGE ─────────────────────────────────────────────── */
.login-body { background: var(--bg-base); display: flex; align-items: center; justify-content: center; min-height: 100vh; overflow: hidden; position: relative; }
.login-bg { position: fixed; inset: 0; pointer-events: none; }
.login-bg-node { position: absolute; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; opacity: .3; }
.login-bg-line { position: absolute; background: linear-gradient(transparent, rgba(60,201,139,.1), transparent); }
.login-bg-line.l1 { width: 1px; height: 60%; top: 0; left: 30%; }
.login-bg-line.l2 { width: 1px; height: 50%; top: 20%; right: 25%; }
.login-container { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 1.5rem; }
.login-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.login-logo svg { }
.login-title { font-family: var(--font-serif); font-size: 2.2rem; line-height: 1; }
.login-title .accent { color: var(--accent); }
.login-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-footer { margin-top: 1.5rem; text-align: center; font-size: 0.72rem; color: var(--text-faint); }

/* ─── QUESTIONNAIRE ─────────────────────────────────────────── */
.questionnaire-body { background: #0B1525; min-height: 100vh; }
.q-header { background: var(--bg-sidebar); border-bottom: 1px solid var(--border); padding: 1rem 2rem; position: sticky; top: 0; z-index: 50; }
.q-header-inner { max-width: 780px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.q-logo { font-family: var(--font-serif); font-size: 1.2rem; }
.q-logo span { color: var(--accent); }
.q-company { font-size: 0.82rem; color: var(--text-muted); }
.q-container { max-width: 780px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.q-intro { margin-bottom: 2rem; }
.q-title { font-family: var(--font-serif); font-size: 1.8rem; line-height: 1.2; margin-bottom: 0.5rem; }
.q-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.q-notice { display: flex; align-items: flex-start; gap: 10px; background: var(--success-bg); border: 1px solid rgba(60,201,139,.25); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.82rem; color: var(--accent); }
.q-id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.q-field { display: flex; flex-direction: column; gap: 0.4rem; }
.q-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.q-input { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 0.6rem 0.9rem; font-family: var(--font-sans); font-size: 0.88rem; width: 100%; }
.q-input:focus { outline: none; border-color: var(--accent); }
.q-select { cursor: pointer; }
.q-scale-legend { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.scale-items { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.scale-item { padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600; font-size: 0.7rem; }
.scale-1 { background: rgba(60,201,139,.15); color: var(--accent); }
.scale-2 { background: rgba(59,130,246,.1); color: #60A5FA; }
.scale-3 { background: rgba(255,255,255,.07); color: var(--text-muted); }
.scale-4 { background: rgba(217,119,6,.12); color: #FBA94C; }
.scale-5 { background: rgba(224,75,75,.15); color: #F87171; }
.q-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; }
.q-section-title { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-serif); font-size: 1.15rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg-sidebar); }
.q-section-icon { font-size: 1.1rem; }
.q-section-desc { padding: 0.6rem 1.25rem; font-size: 0.78rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.questions-list { padding: 0.5rem 0; }
.question-item { padding: 0.9rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.04); transition: var(--transition); }
.question-item:last-child { border-bottom: none; }
.question-item.answered { background: rgba(60,201,139,.03); }
.question-text { font-size: 0.88rem; font-weight: 500; margin-bottom: 0.7rem; }
.question-options { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.radio-option { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; cursor: pointer; }
.radio-input { display: none; }
.radio-custom { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--border-light); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.radio-label { font-size: 0.7rem; color: var(--text-muted); }
.radio-input:checked + .radio-custom { border-color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 10px var(--accent-glow); }
.radio-option:hover .radio-custom { border-color: var(--border-light); background: rgba(255,255,255,.05); }
.q-submit-section { text-align: center; margin-top: 2rem; }
.q-progress { height: 6px; background: var(--border); border-radius: 100px; overflow: hidden; margin-bottom: 0.5rem; }
.q-progress-fill { height: 100%; background: var(--accent); border-radius: 100px; transition: width 0.3s ease; }
.q-progress-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.q-submit-note { font-size: 0.75rem; color: var(--text-faint); margin-top: 0.75rem; }

/* ─── QUESTIONNAIRE RESULT ─────────────────────────────────── */
.q-result-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.q-result-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 3rem 2.5rem; max-width: 480px; width: 100%; text-align: center; }
.result-icon { margin: 0 auto 1.5rem; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.result-success { background: var(--success-bg); border: 2px solid rgba(60,201,139,.3); }
.result-muted { background: rgba(255,255,255,.05); border: 2px solid var(--border); }
.result-title { font-family: var(--font-serif); font-size: 1.7rem; margin-bottom: 1rem; }
.result-text { color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; margin-bottom: 1.5rem; }
.result-company { font-weight: 700; color: var(--accent); margin-bottom: 0.75rem; }
.result-method { font-size: 0.72rem; color: var(--text-faint); line-height: 1.6; }

/* ─── REPORT ─────────────────────────────────────────────────── */
.report-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: 900px; }
.report-cover { padding: 3rem; background: linear-gradient(135deg, var(--bg-sidebar) 0%, #0D2040 100%); border-bottom: 2px solid var(--accent); text-align: center; }
.report-cover-logo { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 1.5rem; }
.report-cover-logo span { color: var(--accent); }
.report-cover-title { font-family: var(--font-serif); font-size: 1.6rem; line-height: 1.3; margin-bottom: 2rem; }
.report-cover-meta { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.5rem; display: inline-block; text-align: left; margin-bottom: 1.5rem; min-width: 360px; }
.cover-meta-row { font-size: 0.85rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.cover-meta-row:last-child { border-bottom: none; }
.report-cover-method { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.75rem; }
.report-section { padding: 2rem; border-bottom: 1px solid var(--border); }
.report-section:last-child { border-bottom: none; }
.report-section-title { font-family: var(--font-serif); font-size: 1.2rem; margin-bottom: 1rem; color: var(--accent); }
.report-section p { font-size: 0.88rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 0.75rem; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 1rem 0; }
.report-table th { background: var(--bg-sidebar); padding: 0.6rem 0.9rem; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border: 1px solid var(--border); }
.report-table td { padding: 0.65rem 0.9rem; border: 1px solid var(--border); font-size: 0.82rem; vertical-align: middle; }
.report-subsection { margin-bottom: 1.5rem; }
.report-subsection-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.75rem; }
.report-note { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.75rem; font-style: italic; }
.inventory-item { background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; }
.inventory-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; font-weight: 600; }
.inventory-table { width: 100%; font-size: 0.82rem; border-collapse: collapse; }
.inventory-table tr td { padding: 0.3rem 0.5rem; border: 1px solid var(--border); }
.inv-label { font-weight: 600; color: var(--text-muted); width: 35%; font-size: 0.75rem; }
.report-list { padding-left: 1.25rem; color: var(--text-muted); font-size: 0.88rem; line-height: 2; }
.report-signature { margin-top: 2rem; text-align: center; }
.sig-line { width: 200px; height: 1px; background: var(--border-light); margin: 0 auto 0.5rem; }
.sig-label { font-size: 0.8rem; color: var(--text-muted); }
.sig-date { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.25rem; }
.report-footer { padding: 1rem 2rem; text-align: center; font-size: 0.72rem; color: var(--text-faint); background: var(--bg-sidebar); border-top: 1px solid var(--border); line-height: 1.7; }

/* ─── PRINT STYLES ─────────────────────────────────────────── */
@media print {
  .sidebar, .page-header .header-actions, .btn { display: none !important; }
  .main-content { margin-left: 0; padding: 0; }
  .report-container { border: none; background: white; color: black; }
  .report-cover { background: #f0f4f8; color: #111; }
  .report-section-title { color: #1E5C40; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { padding: 1rem; }
  .content-grid, .content-grid-3 { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: 1fr; }
  .q-id-grid { grid-template-columns: 1fr; }
  .methodology-steps { display: none; }
}
