:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0b5cff;
  --primary-hover: #0848c9;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b5cff, #4f46e5);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p {
  margin: 4px 0 0;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  transition: 0.2s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.auth-status {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.45;
}

.main {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.page-header h2 {
  margin: 0;
  font-size: 28px;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.card-head h3 {
  margin: 0;
  font-size: 20px;
}

.card-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(11, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(11, 92, 255, 0.08);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin: 18px 0 14px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #eef2ff;
  color: #1e3a8a;
}

.btn-secondary:hover {
  background: #e0e7ff;
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.12);
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 14px 18px;
  font-size: 15px;
}

.message {
  margin-top: 16px;
  border-radius: 14px;
  padding: 14px 16px;
  line-height: 1.55;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.message.success {
  border-color: rgba(6, 118, 71, 0.18);
  background: rgba(6, 118, 71, 0.07);
  color: var(--success);
}

.message.error {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.07);
  color: var(--danger);
}

.message.warning {
  border-color: rgba(181, 71, 8, 0.18);
  background: rgba(181, 71, 8, 0.07);
  color: var(--warning);
}

.hidden {
  display: none !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.stat-box .k {
  font-size: 12px;
  color: var(--muted);
}

.stat-box .v {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.assessment-list,
.company-list,
.assign-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.assessment-item,
.company-item,
.log-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
}

.assessment-item.selected {
  border-color: rgba(11, 92, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(11, 92, 255, 0.06);
}

.assessment-top,
.company-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.assessment-title,
.company-title {
  margin: 0;
  font-size: 16px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.meta-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.meta-box .label {
  font-size: 12px;
  color: var(--muted);
}

.meta-box .value {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.selected-company-box {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
  min-height: 130px;
}

.selected-company-box h4 {
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.pill.weak {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.pill.medium {
  background: rgba(181, 71, 8, 0.08);
  color: var(--warning);
}

.pill.strong {
  background: rgba(6, 118, 71, 0.08);
  color: var(--success);
}

.pill.neutral {
  background: #eef2ff;
  color: #3730a3;
}

.assign-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  margin: 0;
}

.checkline input {
  width: auto;
}

.assign-actions {
  margin-top: 18px;
}

.log-item {
  border-left: 4px solid #0b5cff;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }

  .grid-2,
  .meta-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}