/* ─── BASE ─────────────────────────────────────────────────────────────────── */
:root {
  --primary: #4361ee;
  --primary-dark: #3a0ca3;
  --success: #2ec4b6;
  --danger: #ef233c;
  --warning: #f8961e;
  --bg: #f0f2f9;
  --card-bg: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(67,97,238,.08);
  --shadow-lg: 0 8px 32px rgba(67,97,238,.13);
}

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

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
}

/* ─── NAVBAR ────────────────────────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  box-shadow: 0 2px 16px rgba(67,97,238,.3);
  padding: .85rem 1.5rem;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .4px;
  color: #fff !important;
}

/* ─── LAYOUT ────────────────────────────────────────────────────────────────── */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

/* ─── SEARCH BAR ─────────────────────────────────────────────────────────────── */
.search-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.search-card .input-group {
  flex: 1;
  min-width: 220px;
}

.search-card .form-control {
  border-radius: 8px 0 0 8px !important;
  border-color: var(--border);
  font-size: .92rem;
}

.search-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}

.search-card .btn-search {
  border-radius: 0 8px 8px 0 !important;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-card .btn-search:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ─── CARD TABELA ─────────────────────────────────────────────────────────── */
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-card .table {
  margin: 0;
  font-size: .88rem;
}

.table-card .table thead th {
  background: #f8f9ff;
  color: var(--primary);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 2px solid var(--border);
  padding: .85rem 1rem;
  white-space: nowrap;
}

.table-card .table tbody td {
  padding: .7rem 1rem;
  border-color: var(--border);
  vertical-align: middle;
}

.table-card .table tbody tr {
  transition: background .15s;
}

.table-card .table tbody tr:hover {
  background: #f3f6ff;
}

/* ─── FOTO THUMB ─────────────────────────────────────────────────────────── */
.foto-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge {
  font-size: .75rem;
  font-weight: 500;
  padding: .32em .65em;
  border-radius: 6px;
}

/* ─── BOTÕES AÇÕES ─────────────────────────────────────────────────────── */
.btn-acoes {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.btn-acoes .btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .85rem;
  transition: all .18s;
}

.btn-acoes .btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.15); }

/* ─── BOTÃO NOVO ─────────────────────────────────────────────────────────── */
.btn-novo {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 9px;
  padding: .5rem 1.1rem;
  font-weight: 600;
  font-size: .9rem;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(67,97,238,.3);
  transition: all .18s;
}
.btn-novo:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(67,97,238,.4); color: #fff; }

/* ─── MODAL ─────────────────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1rem 1.25rem;
}

.modal-header.bg-success {
  background: linear-gradient(135deg, #2ec4b6 0%, #0a9396 100%) !important;
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-body { padding: 1.25rem; }

.modal-footer {
  border-top: 1px solid var(--border);
  padding: .85rem 1.25rem;
  background: #fafbff;
  border-radius: 0 0 var(--radius) var(--radius);
}

.nav-tabs .nav-link {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .6rem .9rem;
  transition: all .18s;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.nav-tabs { border-bottom: 1px solid var(--border); }

/* ─── FOTO MODAL ─────────────────────────────────────────────────────────── */
.foto-preview-modal {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #f0f2f9;
  display: block;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

/* ─── WEBCAM ──────────────────────────────────────────────────────────────── */
.webcam-container {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── TOAST ───────────────────────────────────────────────────────────────── */
.toast {
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
}

/* ─── RESPONSIVO ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrapper { padding: 1rem .75rem 2rem; }
  .search-card { padding: .85rem 1rem; }
  .table-card .table thead th,
  .table-card .table tbody td { padding: .6rem .6rem; }
  .btn-acoes .btn { width: 28px; height: 28px; font-size: .78rem; }
}
