/* ===================================================
   EMPREGA INTERIOR SP — Admin Panel Styles
   =================================================== */

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

:root {
  --blue:       #0071e3;
  --blue-hover: #0064c8;
  --blue-light: #dbeafe;
  --red:        #ff3b30;
  --red-light:  #fff0ef;
  --green:      #1a7f4b;
  --green-light:#e6f9f0;
  --gray-50:    #f5f5f7;
  --gray-100:   #ebebeb;
  --gray-200:   #d2d2d7;
  --gray-400:   #86868b;
  --gray-700:   #3a3a3c;
  --text:       #1d1d1f;
  --white:      #ffffff;
  --sidebar-w:  240px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,.09);
  --transition: 0.18s cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

/* ─── UTILS ─── */
.hidden { display: none !important; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  transition: var(--transition);
  border-radius: 980px;
  white-space: nowrap;
  padding: 9px 18px;
}
.btn--primary  { background: var(--blue); color: var(--white); }
.btn--primary:hover  { background: var(--blue-hover); transform: scale(1.02); }
.btn--ghost    { background: var(--gray-100); color: var(--text); }
.btn--ghost:hover    { background: var(--gray-200); }
.btn--danger   { background: var(--red); color: var(--white); }
.btn--danger:hover   { opacity: 0.88; }
.btn--full     { width: 100%; justify-content: center; padding: 12px; }
.btn--sm       { padding: 6px 14px; font-size: 12px; }
.btn svg       { width: 14px; height: 14px; flex-shrink: 0; }
.logo-dot      { color: var(--blue); }

/* ═══════════════════  LOGIN  ═══════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eff6ff 0%, #f5f5f7 100%);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--gray-100);
  text-align: center;
}
.login-logo {
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--text);
}
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.login-sub   { color: var(--gray-400); font-size: 13px; margin-bottom: 32px; }
.login-back  { display: block; margin-top: 20px; font-size: 12px; color: var(--gray-400); text-decoration: none; }
.login-back:hover { color: var(--blue); }

/* ═══════════════════  SHELL  ═══════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 24px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}
.sidebar__brand .logo-dot { font-size: 18px; }
.sidebar__brand-name strong { display: block; }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  width: 100%;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--gray-50); color: var(--text); }
.nav-item.active { background: var(--blue-light); color: var(--blue); }
.nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--gray-400);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  width: 100%;
  text-align: left;
}
.sidebar-link svg { width: 14px; height: 14px; }
.sidebar-link:hover { color: var(--text); background: var(--gray-50); }

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

/* ─── VIEWS ─── */
.view { display: none; }
.view.active { display: block; }

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.page-sub { font-size: 13px; color: var(--gray-400); }

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  padding: 20px;
}
.stat-card__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); margin-bottom: 8px; }
.stat-card__value { font-size: 28px; font-weight: 700; letter-spacing: -0.04em; color: var(--text); }
.stat-card__sub   { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.stat-card--blue  { background: var(--blue-light); border-color: transparent; }
.stat-card--blue .stat-card__label,
.stat-card--blue .stat-card__value { color: var(--blue); }

/* ─── SECTION CARD ─── */
.section-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.section-card__header h2 { font-size: 14px; font-weight: 600; }

/* ─── RECENT LIST ─── */
.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover { background: var(--gray-50); }
.recent-logo { font-size: 1.4rem; flex-shrink: 0; }
.recent-info { flex: 1; min-width: 0; }
.recent-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-company { font-size: 11px; color: var(--gray-400); }
.recent-city-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--blue-light);
  color: var(--blue);
  flex-shrink: 0;
}
.recent-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--gray-700);
}
.icon-btn svg { width: 13px; height: 13px; }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn--danger:hover { border-color: var(--red); color: var(--red); }

/* ─── LIST TOOLBAR ─── */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
}
.search-mini svg { width: 14px; height: 14px; color: var(--gray-400); flex-shrink: 0; }
.search-mini input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  background: transparent;
}
.search-mini input::placeholder { color: var(--gray-400); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row select {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-row select:focus { border-color: var(--blue); }

/* ─── JOBS TABLE ─── */
.jobs-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.jobs-table {
  width: 100%;
  border-collapse: collapse;
}
.jobs-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
  white-space: nowrap;
}
.jobs-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  font-size: 13px;
}
.jobs-table tr:last-child td { border-bottom: none; }
.jobs-table tr:hover td { background: var(--gray-50); }
.job-row-title { font-weight: 600; }
.job-row-company { font-size: 11px; color: var(--gray-400); }

/* Status toggle pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition);
}
.status-pill--active   { background: var(--green-light); color: var(--green); }
.status-pill--inactive { background: var(--gray-100);    color: var(--gray-400); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-dot--active   { background: var(--green);      }
.status-dot--inactive { background: var(--gray-400); }

.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-list { padding: 48px; text-align: center; color: var(--gray-400); }

/* ─── FORM ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
.form-col { display: flex; flex-direction: column; gap: 0; }
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 20px;
}
.field-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row .field-group { flex: 1; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.field-hint { font-weight: 400; color: var(--gray-400); }
.req { color: var(--red); }

.field-input {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.field-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.field-input.error { border-color: var(--red); }
.field-emoji { font-size: 20px; text-align: center; }
.field-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select.field-input { cursor: pointer; }

.field-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 2px;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 500;
  cursor: pointer;
}
.toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 22px;
  transition: .25s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  top: 3px;
  left: 3px;
  transition: .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

/* ─── TOAST ─── */
.admin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 980px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  z-index: 500;
  white-space: nowrap;
}
.admin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── CONFIRM DIALOG ─── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.confirm-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: popIn .22s cubic-bezier(.4,0,.2,1);
}
@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.confirm-icon { font-size: 2.5rem; margin-bottom: 12px; }
.confirm-box h3 { font-size: 16px; margin-bottom: 6px; }
.confirm-box p  { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ─── NAV SECTION LABEL ─── */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 14px 12px 4px;
}

/* ─── CHARTS ─── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.chart-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.chart-wrap {
  height: 200px;
  position: relative;
}
.top-jobs-list {}
.top-job-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.top-job-row:last-child { border-bottom: none; }
.top-job-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.top-job-info { flex: 1; min-width: 0; }
.top-job-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-job-company { font-size: 11px; color: var(--gray-400); }
.top-job-views { font-size: 11px; font-weight: 700; color: var(--blue); white-space: nowrap; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar { width: 56px; padding: 16px 8px; }
  .sidebar__brand-name, .nav-item span:not(.nav-badge), .sidebar-link span { display: none; }
  .nav-item, .sidebar-link { justify-content: center; padding: 10px; }
  .nav-badge { display: none; }
  .main-content { padding: 20px 16px; }
  .jobs-table th:nth-child(3),
  .jobs-table td:nth-child(3),
  .jobs-table th:nth-child(4),
  .jobs-table td:nth-child(4) { display: none; }
}
