@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,600;14..32,700;14..32,800;14..32,900&display=swap');

:root {
  --navy: #142540;
  --navy-2: #10203A;
  --blue: #3771AE;
  --blue-2: #51A7F2;
  --white: #FBF9FA;

  --bg: var(--navy);
  --bg2: #0a1420;
  --panel: #1a2a3f;       /* fundo opaco para drawer e cards */
  --panel2: #0f1a2a;
  --line: #2a3a50;
  --line-2: #3a4a60;

  --text: #eaf0ff;
  --muted: rgba(234, 240, 255, 0.78);

  --radius: 16px;
  --radius2: 12px;
  --radius3: 999px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.3);
  --max: 1320px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --danger: #ef4444;
  --ok: #10b981;
  --warning: #f59e0b;
  --blue-soft: rgba(81, 167, 242, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  border-bottom: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  object-fit: contain;
  border: 2px solid white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.brand__name {
  font-weight: 900;
  line-height: 1.15;
  color: white;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 999px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar__btn, .topbar__link {
  padding: 0 20px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: white;
  color: var(--blue);
  cursor: pointer;
  transition: all .18s ease;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.topbar__btn:hover, .topbar__link:hover {
  background: var(--blue-2);
  color: white;
  border-color: var(--blue-2);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.16);
}

/* Hero */
.hero {
  padding: 30px 0 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.5vw, 38px);
  letter-spacing: -0.03em;
  color: var(--blue-2);
  font-weight: 900;
  line-height: 1.08;
}

.hero p {
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 72ch;
}

/* Busy */
.busy {
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Cards */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  margin: 22px 0;
  z-index: 1;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
}

.card.subtle {
  box-shadow: none;
  background: var(--panel2);
  border: 1px solid var(--line);
}

.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--blue-2);
  font-size: 1.45rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.card__desc {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 18px;
  max-width: 70ch;
}

/* Stats grid */
.stats-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-top: 16px;
}
.stat-item {
  text-align: center;
  flex: 1 1 150px;
  background: var(--panel2);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}
.stat-item i {
  font-size: 2rem;
  color: var(--blue-2);
}
.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--ok);
}
.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 20px;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 980px) { .grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid--2 { grid-template-columns: 1fr; } }

/* Fields */
input, select, textarea, button {
  font: inherit;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border-radius: var(--radius2);
  border: 1.5px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  padding: 12px 15px;
  outline: none;
  transition: all 0.2s;
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px var(--blue-soft);
  transform: translateY(-1px);
}

select {
  width: 100%;
  border-radius: var(--radius2);
  border: 1.5px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  padding: 12px 15px;
  outline: none;
  transition: all 0.2s;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}

.hint {
  margin-top: 7px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* Actions */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.actions.inline {
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 24px;
}

/* Botões padronizados (altura 42px) */
.btn, .btnSmall {
  border: 0;
  border-radius: 999px;
  height: 42px;
  padding: 0 20px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.btn {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: white;
}

.btnSmall {
  background: var(--bg2);
  border: 1.5px solid var(--line-2);
  color: var(--blue-2);
}

.btn:hover, .btnSmall:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btnSmall:hover {
  background: var(--blue-2);
  color: white;
  border-color: var(--blue-2);
}

/* Botão específico para exportar Excel (verde) */
.btn-excel {
  border: 0;
  border-radius: 999px;
  height: 42px;
  padding: 0 20px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
  background: var(--bg2);
  border: 1.5px solid var(--ok);
  color: var(--ok);
}

.btn-excel:hover {
  transform: translateY(-2px);
  background: var(--ok);
  color: white;
  border-color: var(--ok);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  display: inline-block;
  animation: spin .9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Table */
.tableTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tableTop__desc {
  color: var(--muted);
  font-size: 14px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tableWrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.table th, .table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  text-align: left;
  font-size: 12px;
  color: var(--text);
  background: var(--panel2);
  position: sticky;
  top: 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.table td {
  font-size: 14px;
  background: var(--panel);
}

.table tbody tr:hover td {
  background: var(--panel2);
}

.name {
  font-weight: 800;
  color: var(--blue-2);
}

.sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.actionsTd {
  width: 1%;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px;
  font-style: italic;
}

.mono {
  font-family: ui-monospace, monospace;
}

.muted {
  color: var(--muted);
}

/* Badges com cores vivas */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge--new    { background: #dbeafe; color: #1e3a8a; border-color: #a5c9ff; }
.badge--review { background: #fed7aa; color: #9a3412; border-color: #fed7aa; }
.badge--contact{ background: #e2e3e5; color: #1f2937; border-color: #d3d6d8; }
.badge--interview { background: #cff4fc; color: #0c4a6e; border-color: #b6effb; }
.badge--ok     { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.badge--no     { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.badge--talent { background: #e0f2fe; color: #0369a1; border-left: 4px solid #0284c7; }

/* Drawer - opaco */
.drawerBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 50;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(540px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform .22s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer.open ~ .drawerBackdrop {
  opacity: 1;
  pointer-events: auto;
}

.drawer__head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel2);
}

.drawer__id {
  color: var(--muted);
  font-size: 13px;
}

.drawer__title {
  font-weight: 900;
  font-size: 1.35rem;
  margin-top: 2px;
  color: var(--blue-2);
  letter-spacing: -0.02em;
}

.drawer__sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.drawer__body {
  padding: 20px;
  overflow: auto;
  flex: 1;
}

/* Blocks internos */
.block {
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.block.subtle {
  box-shadow: none;
  background: var(--panel2);
}

.block__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--blue-2);
  font-size: 1.05rem;
}

.block__desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.block__text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.block__meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.link {
  display: inline-block;
  color: var(--blue-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kv__row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.kv__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kv__k {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.kv__v {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
  text-align: right;
  font-weight: 700;
}

/* Notas e histórico */
.note-item, .hist {
  background-color: var(--bg2);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  border-left: 4px solid var(--blue-2);
}

.note__meta, .hist__meta {
  color: var(--muted);
  font-size: 13px;
}

.note__text, .hist__text {
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.doc:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.doc__name {
  font-weight: 800;
  color: var(--blue-2);
}

.doc__meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* Toast centralizado */
.toast {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9999 !important;
  min-width: 320px !important;
  max-width: 90vw !important;
  text-align: center !important;
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  padding: 18px 24px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(12px) !important;
  animation: fadeInOut 0.3s ease-out !important;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
}

.toast--success {
  border-left: 6px solid var(--ok) !important;
  background: rgba(16, 185, 129, 0.2) !important;
  color: var(--ok) !important;
}

.toast--error {
  border-left: 6px solid var(--danger) !important;
  background: rgba(239, 68, 68, 0.2) !important;
  color: var(--danger) !important;
}

.toast--info {
  border-left: 6px solid var(--blue-2) !important;
  background: rgba(81, 167, 242, 0.2) !important;
  color: var(--blue-2) !important;
}

/* Auth page (login) */
.auth {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 24px 0 32px;
}

.auth__box {
  width: min(560px, 100%);
}

.auth__box h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--blue-2);
  font-weight: 900;
  line-height: 1.08;
}

.auth__box p {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
}

.small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

/* Modal */
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 70;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100% - 24px));
  transform: translate(-50%, -50%) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 80;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modalBackdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal__head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel2);
}

.modal__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--blue-2);
  letter-spacing: -0.02em;
}

.modal__sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.modal__body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: var(--panel2);
  position: relative;
  z-index: 1;
  margin-top: 48px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  color: var(--muted);
  font-size: 14px;
  gap: 12px;
}

.footer__small {
  color: var(--placeholder);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--blue-2);
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* Responsividade mobile geral */
@media (max-width: 680px) {
  .footer__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .stats-grid {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  input, select, textarea {
    font-size: 16px;
    padding: 12px;
  }
  .card {
    padding: 18px;
    border-radius: 16px;
  }
  .card__title {
    font-size: 1.25rem;
  }
  .toast {
    top: 40% !important;
    min-width: 260px !important;
    padding: 14px 20px !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(var(--max), calc(100% - 20px));
  }
  .topbar__inner {
    flex-direction: column;
    gap: 12px;
  }
  .brand {
    flex-direction: column;
    text-align: center;
  }
  .hero h1 {
    font-size: 26px;
  }
  .tableTop {
    flex-direction: column;
    align-items: stretch;
  }
  .pager {
    justify-content: center;
  }
  .actions {
    flex-direction: column;
    width: 100%;
  }
  .btn, .btnSmall, .btn-excel {
    width: 100%;
    justify-content: center;
  }
  .grid--2, .grid--3 {
    grid-template-columns: 1fr;
  }
  .modal__head {
    flex-direction: column;
    align-items: stretch;
  }
  .kv__row {
    flex-direction: column;
    align-items: flex-start;
  }
  .kv__v {
    text-align: left;
  }
  .doc {
    flex-direction: column;
    align-items: flex-start;
  }
  .drawer {
    width: 100%;
  }
  .modal {
    max-height: 90vh;
    overflow-y: auto;
  }
  .tableWrap {
    overflow-x: auto;
  }
  .topbar__right {
    justify-content: center;
    width: 100%;
  }
}