/* ============================================================
   ceva-brand.css — CEVA Logistics Risk Assessment
   Identidade visual corporativa CEVA Logistics
   Light theme • Corporate brand • Professional grade
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* CEVA Brand Core */
  --ceva-navy:       #0a1628;
  --ceva-blue:       #003DA5;
  --ceva-blue-mid:   #1a56db;
  --ceva-blue-light: #2563eb;
  --ceva-blue-pale:  #e8f0fb;
  --ceva-blue-dim:   rgba(0, 61, 165, 0.10);
  --ceva-red:        #E4002B;
  --ceva-red-dim:    rgba(228, 0, 43, 0.10);

  /* Background layers — Light theme */
  --bg-base:      #f0f2f5;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f8f9fb;
  --bg-overlay:   #eef1f6;

  /* Status / Risk */
  --status-conforme:     #059669;
  --status-parcial:      #d97706;
  --status-nao-conforme: #dc2626;
  --status-na:           #9ca3af;

  --risk-low:     #059669;
  --risk-medium:  #d97706;
  --risk-high:    #dc2626;
  --risk-low-bg:     rgba(5, 150, 105, 0.10);
  --risk-medium-bg:  rgba(217, 119, 6, 0.10);
  --risk-high-bg:    rgba(220, 38, 38, 0.10);

  /* Criticality */
  --crit-low:      #9ca3af;
  --crit-medium:   #2563eb;
  --crit-high:     #d97706;
  --crit-critical: #dc2626;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-white:     #ffffff;
  --text-sidebar:   rgba(255, 255, 255, 0.82);

  /* Borders */
  --border:       #e5e7eb;
  --border-hover: #d1d5db;
  --border-focus: rgba(0, 61, 165, 0.4);

  /* Sidebar — navy dark */
  --sidebar-width:  240px;
  --sidebar-bg:     #0f1e3d;
  --sidebar-text:   rgba(255, 255, 255, 0.72);
  --sidebar-active: rgba(255, 255, 255, 0.12);
  --sidebar-hover:  rgba(255, 255, 255, 0.07);
  --sidebar-accent: #3b82f6;
  --sidebar-border: rgba(255, 255, 255, 0.08);

  /* Effects */
  --glow-blue:   0 4px 16px rgba(0, 61, 165, 0.25);
  --glow-red:    0 4px 16px rgba(228, 0, 43, 0.25);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.10);

  /* Layout */
  --header-height: 58px;
  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;

  /* Accent — alias para elementos interativos ativos */
  --accent: var(--ceva-blue);

  /* Transitions */
  --t: 0.16s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ceva-blue); text-decoration: none; }
a:hover { color: var(--ceva-blue-light); text-decoration: none; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-base);
}
.content-area {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Brand / Logo area */
.sidebar-brand {
  background: var(--sidebar-bg);
  padding: 22px 16px 18px;
  text-align: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-border);
  box-shadow: none;
}

.sidebar-brand-logo {
  height: 52px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
  filter: brightness(0) invert(1);
  background: transparent;
}

.sidebar-brand-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.sidebar-brand-iso {
  font-size: 0.625rem;
  font-style: italic;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  margin-top: 4px;
  line-height: 1;
}

/* Keep legacy selectors so old HTML references don't break */
.sidebar-logo-block { display: none; }
.sidebar-brand-divider { display: none; }
.sidebar-brand-text { display: none; }
.brand-name { display: none; }
.brand-sub  { display: none; }

/* Status bar no sidebar */
.sidebar-status {
  margin: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  border: 1px solid var(--sidebar-border);
}
.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34d399;
  margin-right: 6px;
  animation: pulse 2.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0); }
}
.status-text { font-size: 0.6875rem; color: rgba(255,255,255,0.55); }

.sidebar-nav { flex: 1; padding: 6px 0; }

.nav-label {
  padding: 14px 16px 5px;
  font-size: 0.5625rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: var(--t);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--ceva-red);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  font-size: 0.9375rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  background: rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* User widget inside sidebar footer */
.sidebar-user-widget {
  margin-left: 0 !important;
  width: 100%;
  padding: 8px 10px !important;
  border-radius: var(--radius-sm) !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user-widget:hover { background: rgba(255,255,255,0.1) !important; }
.sidebar-user-widget .header-user-name { color: #fff !important; font-size: 0.8rem; }
.sidebar-user-widget .header-user-role { color: rgba(255,255,255,0.45) !important; }
.sidebar-user-widget .header-user-dropdown {
  bottom: calc(100% + 6px);
  top: auto !important;
  left: 0;
  right: 0;
  min-width: 0;
  width: 100%;
}

/* Clock no footer do sidebar */
.sidebar-footer-clock {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Copyright */
.sidebar-footer-copy {
  font-size: 0.575rem;
  color: rgba(255,255,255,0.2);
  text-align: center;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

/* Header user widget */
.header-user {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; position: relative; cursor: pointer;
  padding: 5px 10px; border-radius: var(--radius);
  transition: background .15s;
}
.header-user:hover { background: var(--bg-elevated); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ceva-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 700;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.header-user-info { line-height: 1.25; }
.header-user-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.header-user-role { font-size: 0.6875rem; color: var(--text-muted); }
.header-user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 160px; z-index: 300;
  display: none; overflow: hidden;
}
/* Dropdown controlado por JS (click-toggle) — evita bug do gap 6px do :hover */
.header-user.open .header-user-dropdown { display: block; }
.header-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 0.8125rem;
  color: var(--text-secondary); cursor: pointer;
  transition: background .12s;
  background: none; border: none; width: 100%; text-align: left;
}
.header-dropdown-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.header-dropdown-item.danger:hover { color: var(--risk-high); background: rgba(239,68,68,.06); }

/* Legacy sidebar user styles (kept for zero breakage) */
.user-name { font-size: 0.8125rem; font-weight: 600; color: #ffffff; }
.user-role  { font-size: 0.6875rem; color: rgba(255, 255, 255, 0.45); }
.btn-logout {
  background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer;
  padding: 5px; border-radius: 4px; font-size: 0.85rem; transition: var(--t);
}
.btn-logout:hover { color: #fca5a5; background: rgba(220,38,38,0.15); }

/* ── Top Header ─────────────────────────────────────────────── */
.top-header {
  min-height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.page-info { flex: 1; }
.page-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.page-breadcrumb {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-right { display: flex; align-items: center; gap: 10px; }
.header-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* Header badge */
.header-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--ceva-blue-pale);
  color: var(--ceva-blue);
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 18px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--t);
  white-space: nowrap; text-decoration: none;
  letter-spacing: 0.01em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--ceva-blue);
  color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover:not(:disabled) {
  background: var(--ceva-blue-mid);
  box-shadow: var(--glow-blue);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-overlay);
  border-color: var(--ceva-blue);
  color: var(--ceva-blue);
}

.btn-danger {
  background: var(--ceva-red);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #c2001f;
  box-shadow: var(--glow-red);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-outline-blue {
  background: var(--ceva-blue-pale);
  color: var(--ceva-blue);
  border: 1px solid rgba(0, 61, 165, 0.2);
}
.btn-outline-blue:hover:not(:disabled) {
  background: #d4e3f9;
  border-color: rgba(0, 61, 165, 0.4);
}

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 11px 22px; font-size: 0.9375rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: var(--t);
  outline: none;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--ceva-blue);
  box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.12);
}
.form-control::placeholder { color: #b0b8c8; }
.form-control.with-icon { padding-left: 37px; }

.input-group { position: relative; }
.input-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.875rem;
  pointer-events: none;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
select.form-control option { background: #fff; color: var(--text-primary); }

/* ── form-input — alias para form-control (usado nos filtros de Score & Resumo) ── */
.form-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: var(--t);
  outline: none;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--ceva-blue);
  box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.12);
}
.form-input::placeholder { color: #b0b8c8; }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
select.form-input option { background: #fff; color: var(--text-primary); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-low      { background: var(--risk-low-bg);    color: var(--risk-low);    border: 1px solid rgba(5,150,105,0.25); }
.badge-medium   { background: var(--risk-medium-bg); color: var(--risk-medium); border: 1px solid rgba(217,119,6,0.25); }
.badge-high     { background: var(--risk-high-bg);   color: var(--risk-high);   border: 1px solid rgba(220,38,38,0.25); }
.badge-blue     { background: var(--ceva-blue-dim);  color: var(--ceva-blue);   border: 1px solid rgba(0,61,165,0.20); }
.badge-gray     { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* ── Criticality indicators ──────────────────────────────────── */
.crit-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
}
.crit-low      { background: var(--crit-low); }
.crit-medium   { background: var(--crit-medium); }
.crit-high     { background: var(--crit-high); }
.crit-critical { background: var(--crit-critical); box-shadow: 0 0 5px rgba(220,38,38,0.5); }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-container { margin-bottom: 20px; }
.progress-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px;
}
.progress-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); }
.progress-pct   { font-size: 0.8125rem; font-weight: 700; color: var(--ceva-blue); }
.progress-track {
  height: 6px;
  background: var(--bg-overlay);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ceva-blue), #3b82f6);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Score display ───────────────────────────────────────────── */
.score-display {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.score-value {
  font-size: 1.5rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.score-value.risk-low    { color: var(--risk-low); }
.score-value.risk-medium { color: var(--risk-medium); }
.score-value.risk-high   { color: var(--risk-high); }
.score-label { font-size: 0.75rem; color: var(--text-muted); }

/* ── Assessment category cards ───────────────────────────────── */
.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.category-card:hover { border-color: var(--border-hover); }
.category-card.expanded {
  border-color: rgba(0, 61, 165, 0.3);
  box-shadow: 0 2px 12px rgba(0, 61, 165, 0.08);
}

.category-header {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px;
  cursor: pointer;
  user-select: none;
  transition: background var(--t);
}
.category-header:hover { background: var(--bg-elevated); }

.category-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.0625rem; flex-shrink: 0;
}
.category-info { flex: 1; }
.category-name { font-size: 0.9375rem; font-weight: 700; color: var(--text-primary); }
.category-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

.category-stats {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.cat-progress-mini {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}
.cat-score-mini {
  font-size: 0.75rem; font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.cat-score-bar-wrap {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 64px;
}
.cat-score-bar {
  width: 64px; height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden;
}
.cat-score-bar-fill {
  height: 100%; border-radius: 3px; transition: width .4s ease, background .4s ease;
}
.cat-score-bar-pct {
  font-size: 0.6875rem; font-weight: 700; white-space: nowrap;
}
.chevron {
  color: var(--text-muted); font-size: 0.6875rem;
  transition: transform 0.2s ease; flex-shrink: 0;
}
.category-card.expanded .chevron { transform: rotate(180deg); }

.category-body {
  display: none;
  border-top: 1px solid var(--border);
}
.category-card.expanded .category-body { display: block; }

/* ── Question cards ──────────────────────────────────────────── */
.question-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.question-card:last-child { border-bottom: none; }
.question-card:hover { background: var(--bg-elevated); }
.question-card.answered { border-left: 3px solid transparent; }
.question-card.answered.ans-conforme     { border-left-color: var(--status-conforme); }
.question-card.answered.ans-parcial      { border-left-color: var(--status-parcial); }
.question-card.answered.ans-nao_conforme { border-left-color: var(--status-nao-conforme); }
.question-card.answered.ans-na           { border-left-color: var(--status-na); }

.question-top {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px;
}
.question-code {
  font-size: 0.625rem; font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-overlay);
  padding: 2px 7px; border-radius: 3px;
  flex-shrink: 0; margin-top: 2px;
  font-family: 'Courier New', monospace;
  border: 1px solid var(--border);
}
.question-text {
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5; flex: 1;
}
.question-meta {
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0; margin-top: 2px;
}

/* ── Answer buttons ──────────────────────────────────────────── */
.answer-group {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 10px;
}
.answer-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8125rem; font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: var(--t);
  white-space: nowrap;
}
.answer-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

/* Selected states */
.answer-btn.selected-conforme {
  background: rgba(5, 150, 105, 0.08);
  border-color: var(--status-conforme);
  color: var(--status-conforme);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.answer-btn.selected-parcial {
  background: rgba(217, 119, 6, 0.08);
  border-color: var(--status-parcial);
  color: var(--status-parcial);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}
.answer-btn.selected-nao_conforme {
  background: rgba(220, 38, 38, 0.08);
  border-color: var(--status-nao-conforme);
  color: var(--status-nao-conforme);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.answer-btn.selected-na {
  background: #f3f4f6;
  border-color: var(--status-na);
  color: #6b7280;
}

/* ── Observation + Upload ────────────────────────────────────── */
.question-extras {
  display: grid; grid-template-columns: 1fr auto;
  gap: 7px; align-items: start;
  margin-top: 8px;
}
.obs-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  outline: none; resize: none;
  transition: var(--t);
  font-family: inherit;
}
.obs-input:focus {
  border-color: var(--ceva-blue);
  color: var(--text-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.08);
}
.obs-input::placeholder { color: #b0b8c8; }

.upload-area {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.upload-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: var(--t);
  white-space: nowrap;
}
.upload-btn:hover {
  border-color: var(--ceva-blue);
  color: var(--ceva-blue);
  background: var(--ceva-blue-dim);
}
.upload-btn input { display: none; }

.upload-badge {
  font-size: 0.6875rem;
  background: var(--ceva-blue-dim);
  color: var(--ceva-blue);
  padding: 1px 6px; border-radius: 10px;
  border: 1px solid rgba(0, 61, 165, 0.2);
  font-weight: 700;
}
.upload-btn.evidence-required {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239,68,68,.06);
}
.upload-btn.evidence-required::after {
  content: ' *';
  font-weight: 700;
}

/* ── Auto-save indicator ─────────────────────────────────────── */
.autosave-bar {
  position: fixed; bottom: 20px; right: 24px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  z-index: 300;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.autosave-bar.visible { opacity: 1; transform: translateY(0); }
.autosave-bar.saving { color: var(--status-parcial); }
.autosave-bar.saved  { color: var(--status-conforme); }
.autosave-bar.error  { color: var(--status-nao-conforme); }

/* ── Toast notifications ─────────────────────────────────────── */
#toast-container {
  position: fixed; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem; color: var(--text-primary);
  min-width: 260px; max-width: 360px;
  pointer-events: auto;
  animation: slideIn 0.22s ease forwards;
}
.toast.success { border-left: 3px solid var(--status-conforme); }
.toast.error   { border-left: 3px solid var(--status-nao-conforme); }
.toast.warning { border-left: 3px solid var(--status-parcial); }
.toast.info    { border-left: 3px solid var(--ceva-blue); }
@keyframes slideIn {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Loading ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-overlay) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 14px;
}
.alert-error   { background: var(--risk-high-bg);   color: #991b1b; border: 1px solid rgba(220,38,38,0.25); }
.alert-success { background: var(--risk-low-bg);    color: #065f46; border: 1px solid rgba(5,150,105,0.25); }
.alert-warning { background: var(--risk-medium-bg); color: #92400e; border: 1px solid rgba(217,119,6,0.25); }
.alert-info    { background: var(--ceva-blue-dim);  color: var(--ceva-blue); border: 1px solid rgba(0,61,165,0.2); }

/* ── Login Page ─────────────────────────────────────────────── */
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 440px;
  background: var(--bg-base);
}

/* Brand panel — navy background matching sidebar */
.login-brand {
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
  position: relative; overflow: hidden;
}

/* Subtle grid pattern */
.login-brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* CEVA red stripe on top */
.login-brand::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--ceva-red);
}

.login-brand-inner {
  position: relative; z-index: 1;
  text-align: center; max-width: 560px;
}

/* CEVA Logo — PNG oficial */
.login-brand-logo {
  width: 160px; height: 70px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  padding: 10px 18px;
}
.login-brand-logo img {
  width: 100%; height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.login-brand h1 {
  font-size: 1.75rem; font-weight: 800; color: #ffffff;
  letter-spacing: -0.02em; margin-bottom: 8px;
}
.login-brand-sub {
  font-size: 0.9375rem; color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
}

.login-iso-ref {
  font-size: 0.6875rem;
  font-style: italic;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* Red accent divider */
.login-divider {
  width: 40px; height: 3px;
  background: var(--ceva-red);
  border-radius: 2px;
  margin: 20px auto;
}

.login-features {
  margin-top: 32px;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; text-align: left;
}
.login-feature {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 11px 14px;
  transition: background var(--t);
}
.login-feature:hover { background: rgba(255,255,255,0.07); }
.login-feature-icon { font-size: 1.125rem; flex-shrink: 0; }
.login-feature-text { font-size: 0.875rem; color: rgba(255, 255, 255, 0.65); }

/* Right panel — clean white */
.login-panel {
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  border-left: 1px solid var(--border);
}
.login-box { width: 100%; max-width: 340px; }

/* Mini CEVA logo for login panel */
.login-panel-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
}
.login-panel-logo-mark {
  height: 36px;
  width: auto;
  background: none;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login-panel-logo-mark img {
  height: 32px; width: auto;
  object-fit: contain;
  display: block;
}
.login-panel-logo-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}
.login-panel-logo-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.login-header { margin-bottom: 28px; }
.login-header h2 {
  font-size: 1.375rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.01em; margin-bottom: 5px;
}
.login-header p  { font-size: 0.875rem; color: var(--text-muted); }

/* Blue accent under h2 */
.login-header-accent {
  width: 32px; height: 3px;
  background: var(--ceva-blue);
  border-radius: 2px;
  margin-top: 10px;
}

/* ── Session list ────────────────────────────────────────────── */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-item {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: var(--t);
}
.session-item:hover {
  border-color: rgba(0, 61, 165, 0.25);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.session-unit { font-weight: 700; color: var(--text-primary); font-size: 0.9375rem; }
.session-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.session-score { margin-left: auto; text-align: right; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px;
  text-align: center; color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.25; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 0.875rem; color: var(--text-muted); max-width: 280px; }

/* ── Summary / Finalize ──────────────────────────────────────── */
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.summary-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-card);
}
.summary-kpi-icon {
  font-size: 2rem; line-height: 1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--bg-elevated); border-radius: 12px;
}
.summary-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.summary-kpi-value { font-size: 1.875rem; font-weight: 800; line-height: 1; }
.summary-kpi-label {
  font-size: 0.6875rem; color: var(--text-muted);
  margin-top: 4px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── Summary tabs ────────────────────────────────────────────── */
.sum-tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.sum-tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 10px 18px; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.sum-tab-btn:hover  { color: var(--text-primary); }
.sum-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.sum-tab-panel      { display: none; }
.sum-tab-panel.active { display: block; }

/* ── Info bar ────────────────────────────────────────────────── */
.info-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}
.info-bar-item {}
.info-bar-label {
  font-size: 0.625rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.info-bar-value { font-size: 0.9375rem; font-weight: 700; color: var(--text-primary); }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden  { display: none !important; }
.d-flex  { display: flex; }
.d-grid  { display: grid; }
.ai-center { align-items: center; }
.jc-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mt-24  { margin-top: 24px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.text-sm    { font-size: 0.8125rem; }
.text-xs    { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.fw-700 { font-weight: 700; }
.col-accent { color: var(--ceva-blue); }
.col-success{ color: var(--status-conforme); }
.col-warn   { color: var(--status-parcial); }
.col-danger { color: var(--status-nao-conforme); }

/* ── Menu Toggle (hambúrguer mobile) ──────────────────────────── */
.menu-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary);
  transition: var(--t);
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }
@media (max-width: 600px) {
  .menu-toggle { display: flex; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  :root { --sidebar-width: 220px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand  { display: none; }
  .login-panel  { padding: 32px 24px; min-height: 100vh; }
  .content-area { padding: 16px; }
}
@media (max-width: 600px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .answer-group { flex-direction: column; }
  .answer-btn { justify-content: center; }
  .question-extras { grid-template-columns: 1fr; }
}
