/* =============================================
   Sistema de Compromissos Jurídicos
   Estilo: Elegante / Escritório de Advocacia
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --cor-primaria:   #1a3055;
  --cor-acento:     #c49a3c;
  --cor-fundo:      #f4f2ee;
  --cor-branco:     #ffffff;
  --cor-texto:      #1c1c1c;
  --cor-texto-sub:  #6b6b6b;
  --cor-borda:      #ddd8ce;
  --cor-danger:     #c0392b;
  --sombra:         0 2px 14px rgba(26,48,85,0.09);
  --radius:         8px;
  --fonte-display:  'Playfair Display', serif;
  --fonte-corpo:    'DM Sans', sans-serif;
}

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

body {
  font-family: var(--fonte-corpo);
  background: var(--cor-fundo);
  color: var(--cor-texto);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- NAVBAR ---- */
.navbar {
  background: var(--cor-primaria);
  color: #fff;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fonte-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}
.brand-icon-sm { font-size: 20px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 13px; color: rgba(255,255,255,0.75); }

/* ---- CONTAINER ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
}
.container-sm { max-width: 700px; }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 {
  font-family: var(--fonte-display);
  font-size: 22px;
  color: var(--cor-primaria);
  font-weight: 700;
}
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--fonte-corpo);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--cor-primaria);
  color: #fff;
}
.btn-primary:hover { background: #254878; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--cor-primaria);
  color: var(--cor-primaria);
}
.btn-outline:hover { background: var(--cor-primaria); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--cor-texto-sub);
  border: 1.5px solid var(--cor-borda);
}
.btn-ghost:hover { background: var(--cor-borda); color: var(--cor-texto); }
.btn-danger { background: var(--cor-danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: background .15s;
}
.btn-icon:hover { background: rgba(0,0,0,0.07); }

/* ---- FILTROS ---- */
.filtros-form {
  background: var(--cor-branco);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--sombra);
}
.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.filtros-actions { display: flex; gap: 10px; }

/* ---- CARD ---- */
.card {
  background: var(--cor-branco);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--sombra);
}

/* ---- FORM FIELDS ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--cor-texto-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field input,
.field select,
.field textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--cor-borda);
  border-radius: 6px;
  font-family: var(--fonte-corpo);
  font-size: 14px;
  color: var(--cor-texto);
  background: #fff;
  transition: border-color .2s;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(26,48,85,0.08);
}
.field textarea { resize: vertical; }
.obrigatorio { color: var(--cor-danger); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-grid .field,
.field { margin-bottom: 16px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--cor-borda);
}

/* ---- TABLE ---- */
.table-wrap {
  background: var(--cor-branco);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  overflow-x: auto;
}
.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tabela thead th {
  background: var(--cor-primaria);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.tabela tbody tr { transition: background .12s; }
.tabela tbody tr:hover td { background: #f0ece4; }
.tabela td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--cor-borda);
  vertical-align: middle;
}
.tabela tbody tr:last-child td { border-bottom: none; }
.td-data { white-space: nowrap; font-weight: 500; }
.td-hora { white-space: nowrap; font-family: monospace; font-size: 13px; }
.td-processo { font-size: 11px; color: var(--cor-texto-sub); white-space: nowrap; }
.td-obs { font-size: 12px; color: var(--cor-texto-sub); max-width: 200px; }
.td-acoes { white-space: nowrap; }
.table-footer {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--cor-texto-sub);
  border-top: 1px solid var(--cor-borda);
  text-align: right;
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.badge-audiencia    { background: #dbeafe; color: #1a4fa0; }
.badge-delegacia    { background: #fef3c7; color: #7b3f00; }
.badge-pericia      { background: #ede9fe; color: #5a2d82; }
.badge-atendimento  { background: #d1fae5; color: #0e6b3e; }
.badge-manifestacao { background: #fee2e2; color: #8b4513; }
.badge-particular   { background: #f3f4f6; color: #4a4a4a; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--cor-texto-sub);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 18px; font-size: 15px; }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13px;
}
.alert-erro { background: #fee2e2; color: #7b1c1c; border: 1px solid #fca5a5; }
.alert-ok   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ---- LOGIN ---- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26,48,85,0.15) 0%, transparent 60%),
    var(--cor-fundo);
}
.login-wrap {
  background: var(--cor-branco);
  border: 1px solid var(--cor-borda);
  border-radius: 12px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(26,48,85,0.13);
}
.login-brand {
  text-align: center;
  margin-bottom: 30px;
}
.brand-icon { font-size: 40px; margin-bottom: 10px; }
.login-brand h1 {
  font-family: var(--fonte-display);
  font-size: 20px;
  color: var(--cor-primaria);
  font-weight: 700;
}
.login-brand p { font-size: 13px; color: var(--cor-texto-sub); margin-top: 4px; }
.login-form .field { margin-bottom: 16px; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-box h3 {
  font-family: var(--fonte-display);
  color: var(--cor-primaria);
  margin-bottom: 10px;
}
.modal-box p { font-size: 14px; color: var(--cor-texto-sub); margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .login-wrap { padding: 32px 20px; }
  .filtros-grid { grid-template-columns: 1fr 1fr; }
}
