:root {
  --lean-blue: #345574;
  --lean-blue-dark: #263f58;
  --lean-gray: #696969;
  --lean-light-gray: #e9e9e9;
  --lean-bg: #f7f7f6;
  --lean-white: #ffffff;
  --lean-black: #111111;
  --line: #dedede;
  --line-dark: #cfcfcf;
  --shadow: 0 18px 50px rgba(32, 48, 62, 0.12);
  --font-title: 'Barlow Condensed', sans-serif;
  --font-text: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--lean-bg);
  color: var(--lean-black);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.6;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.eyebrow {
  display: inline-block;
  color: var(--lean-blue);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* LOGIN */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  background: var(--lean-white);
}
.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(40px, 8vw, 120px);
}
.login-brand { width: 210px; margin-bottom: 70px; }
.login-copy { max-width: 650px; }
.login-copy h1,
.dashboard-hero h1,
.workspace-head h2,
.drawer-head h2 {
  margin: 10px 0 0;
  color: var(--lean-blue);
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.05;
}
.login-copy h1 { font-size: clamp(42px, 5vw, 62px); }
.login-copy p {
  max-width: 58ch;
  margin: 18px 0 0;
  color: var(--lean-gray);
  font-size: 15px;
  line-height: 1.62;
}
.login-form { width: min(100%, 500px); margin-top: 44px; }
.login-form > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.password-field { position: relative; }
.password-field input,
.filters input,
.filters select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--lean-white);
  color: var(--lean-black);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.password-field input { padding: 0 92px 0 14px; }
.filters input, .filters select { padding: 0 14px; }
.password-field input:focus,
.filters input:focus,
.filters select:focus {
  border-color: var(--lean-blue);
  box-shadow: 0 0 0 3px rgba(52, 85, 116, .10);
}
.text-button {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--lean-blue);
  font-size: 12px;
  font-weight: 600;
}
.primary-button,
.secondary-button,
.ghost-button,
.view-button {
  border-radius: 4px;
  font-weight: 600;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.primary-button {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--lean-blue);
  background: var(--lean-blue);
  color: var(--lean-white);
}
.primary-button:hover { background: var(--lean-blue-dark); border-color: var(--lean-blue-dark); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.primary-button.full { width: 100%; margin-top: 14px; }
.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--lean-blue);
  background: var(--lean-white);
  color: var(--lean-blue);
}
.secondary-button:hover { background: #f1f4f6; }
.ghost-button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--lean-gray);
}
.ghost-button:hover { color: var(--lean-blue); }
.view-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  background: var(--lean-white);
  color: var(--lean-blue);
  white-space: nowrap;
}
.view-button:hover { border-color: var(--lean-blue); background: #f6f8fa; }
.form-error { margin: 10px 0 0; color: #8c2e2e; font-size: 12px; }
.security-note { margin-top: 26px; color: #929292; font-size: 11px; }
.login-aside {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--lean-blue);
  color: var(--lean-white);
  padding: 70px;
}
.aside-number {
  position: absolute;
  top: 25px;
  right: -20px;
  font-family: var(--font-title);
  font-size: clamp(145px, 19vw, 280px);
  font-weight: 600;
  line-height: .82;
  color: rgba(255,255,255,.07);
}
.aside-content { position: relative; max-width: 450px; }
.aside-content strong { display: block; font-family: var(--font-title); font-size: 34px; font-weight: 600; line-height: 1.08; }
.aside-content p { margin: 14px 0 0; color: rgba(255,255,255,.72); max-width: 44ch; }

/* APP */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  width: min(100% - 64px, 1400px);
  min-height: 74px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand { width: 132px; }
.topbar-title { padding-left: 24px; border-left: 1px solid var(--line); line-height: 1.25; }
.topbar-title span { display: block; color: var(--lean-gray); font-size: 11px; }
.topbar-title strong { color: var(--lean-blue); font-size: 13px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.dashboard { width: min(100% - 64px, 1400px); margin: 0 auto; padding: 64px 0 90px; }
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 72px;
  align-items: end;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}
.dashboard-hero h1 { font-size: clamp(44px, 5vw, 62px); }
.dashboard-hero-copy p { margin: 0; color: var(--lean-gray); max-width: 56ch; }
.latest-summary { display: block; margin-top: 14px; color: #8d8d8d; font-size: 11px; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--lean-white);
}
.summary-card {
  min-height: 150px;
  padding: 26px 28px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.summary-card:last-child { border-right: 0; }
.summary-label { color: var(--lean-gray); font-size: 10px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase; }
.summary-card strong { margin-top: 18px; color: var(--lean-blue); font-family: var(--font-title); font-size: 38px; font-weight: 600; line-height: 1; }
.summary-card small { margin-top: 7px; color: var(--lean-gray); font-size: 11px; line-height: 1.35; }
.workspace { margin-top: 56px; background: var(--lean-white); border: 1px solid var(--line); }
.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 22px;
  border-bottom: 1px solid var(--line);
}
.workspace-head h2 { font-size: 34px; }
.result-count { color: var(--lean-gray); font-size: 12px; }
.type-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 30px 0;
  border-bottom: 0;
  background: #fbfbfb;
}
.type-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: var(--lean-gray);
  font-size: 12px;
  font-weight: 600;
}
.type-tab span {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ededed;
  color: #777;
  font-size: 10px;
}
.type-tab.active {
  border-color: var(--line);
  background: var(--lean-white);
  color: var(--lean-blue);
}
.type-tab.active span { background: var(--lean-blue); color: var(--lean-white); }
.filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(210px, 280px) minmax(180px, 230px);
  gap: 12px;
  padding: 18px 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfbfb;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  color: var(--lean-gray);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 17px 18px;
  border-bottom: 1px solid #eeeeee;
  vertical-align: middle;
  color: #343434;
  font-size: 13px;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.company-cell strong { display: block; color: var(--lean-blue); font-size: 13px; font-weight: 600; }
.company-cell small { display: block; max-width: 330px; margin-top: 3px; overflow: hidden; color: var(--lean-gray); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: #999; }
.type-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}
.type-badge.bpo { background: var(--lean-blue); color: var(--lean-white); }
.type-badge.mentoria { border: 1px solid #b9c7d3; background: #f8fafb; color: var(--lean-blue); }
.status-badge { border: 1px solid var(--line); background: #fafafa; color: var(--lean-gray); }
.state-block {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 40px;
  color: var(--lean-gray);
  text-align: center;
}
.state-block strong { color: var(--lean-blue); font-family: var(--font-title); font-size: 24px; font-weight: 600; }
.state-block p { margin: 0; }
.spinner { width: 24px; height: 24px; border: 2px solid #d9dfe4; border-top-color: var(--lean-blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* DRAWER */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(13, 20, 27, .35); }
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(820px, 94vw);
  height: 100vh;
  overflow-y: auto;
  background: var(--lean-white);
  box-shadow: -20px 0 60px rgba(18, 34, 49, .18);
  transform: translateX(102%);
  transition: transform .25s ease;
}
.detail-drawer.open { transform: translateX(0); }
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
}
.drawer-head-copy { min-width: 0; }
.drawer-kickers { display: flex; align-items: center; gap: 10px; }
.drawer-head h2 { font-size: 36px; overflow-wrap: anywhere; }
.drawer-head p { margin: 7px 0 0; color: var(--lean-gray); font-size: 11px; }
.close-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--lean-white);
  color: var(--lean-gray);
  font-size: 24px;
  line-height: 1;
}
.close-button:hover { border-color: var(--lean-blue); color: var(--lean-blue); }
.drawer-loading { display: flex; gap: 10px; align-items: center; padding: 36px 32px; color: var(--lean-gray); }
.drawer-content { padding: 0 32px 60px; }
.detail-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section-title { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; margin-bottom: 21px; }
.detail-section-title span { color: #a3a3a3; font-family: Georgia, serif; font-size: 14px; }
.detail-section-title h3 { margin: 0; color: var(--lean-blue); font-family: var(--font-title); font-size: 24px; font-weight: 600; line-height: 1.15; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.detail-field.full { grid-column: 1 / -1; }
.detail-field label { display: block; margin-bottom: 5px; color: #8a8a8a; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.detail-field p { margin: 0; color: #303030; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-field.empty p { color: #aaa; }

/* TOAST */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: min(520px, calc(100vw - 28px));
  padding: 11px 16px;
  border-radius: 4px;
  background: #263f58;
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #6f3232; }

@media (max-width: 1040px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:nth-child(2) { border-right: 0; }
  .summary-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-panel { min-height: 100vh; padding: 48px 28px; }
  .login-brand { margin-bottom: 50px; }
  .topbar-inner, .dashboard { width: min(100% - 32px, 1400px); }
  .dashboard { padding-top: 42px; }
  .dashboard-hero { grid-template-columns: 1fr; gap: 22px; }
  .topbar-title { display: none; }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .brand { width: 122px; }
  .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
}
@media (max-width: 620px) {
  .topbar-inner, .dashboard { width: min(100% - 24px, 1400px); }
  .topbar-actions { gap: 2px; }
  .secondary-button { padding: 0 10px; }
  .dashboard { padding-bottom: 60px; }
  .dashboard-hero h1 { font-size: 42px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { min-height: 126px; padding: 20px; }
  .summary-card strong { font-size: 32px; }
  .workspace { margin-top: 36px; }
  .workspace-head, .filters { padding-left: 18px; padding-right: 18px; }
  .type-tabs { padding-left: 18px; overflow-x: auto; }
  th, td { padding-left: 14px; padding-right: 14px; }
  .detail-drawer { width: 100vw; }
  .drawer-head { padding: 22px 20px 18px; }
  .drawer-content { padding: 0 20px 45px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field.full { grid-column: auto; }
}
