/* JDO Contratos — estilo base */
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0; background: #F3F4F6; color: #111827; line-height: 1.5;
}

/* ─── Topbar ─── */
.topbar {
  background: #1F4E79; color: #fff; padding: 12px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 32px;
}
.brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; gap: 8px;
}
.brand-icon { font-size: 22px; }
.topnav { flex: 1; display: flex; gap: 20px; }
.nav-link {
  color: rgba(255,255,255,0.85); text-decoration: none; padding: 6px 12px;
  border-radius: 4px; font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-cta {
  background: #10B981; color: #fff !important; padding: 8px 16px;
}
.nav-cta:hover { background: #059669; }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.user-nome { font-weight: 600; }
.user-papel {
  padding: 2px 8px; border-radius: 12px; font-size: 11px;
  text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px;
}
.role-gestor { background: #DBEAFE; color: #1E40AF; }
.role-juridico { background: #FEF3C7; color: #92400E; }
.role-financeiro { background: #D1FAE5; color: #065F46; }
.role-admin { background: #E9D5FF; color: #6B21A8; }
.btn-logout {
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 12px;
  border: 1px solid rgba(255,255,255,0.3); padding: 4px 10px; border-radius: 4px;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ─── Container ─── */
.container { max-width: 1280px; margin: 32px auto; padding: 0 24px; }
.page-title { margin: 0 0 8px; font-size: 28px; color: #111827; }
.page-sub { margin: 0 0 24px; color: #6B7280; font-size: 15px; }

/* ─── Flash messages ─── */
.flash {
  padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
  font-size: 14px; font-weight: 500;
}
.flash-ok { background: #D1FAE5; color: #065F46; border-left: 4px solid #10B981; }
.flash-erro { background: #FEE2E2; color: #991B1B; border-left: 4px solid #EF4444; }

/* ─── Buttons ─── */
.btn-primary, .btn-secondary, .btn-back, .btn-link {
  display: inline-block; padding: 10px 20px; border-radius: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; transition: all 0.15s;
}
.btn-primary { background: #1F4E79; color: #fff; }
.btn-primary:hover { background: #163756; }
.btn-secondary { background: #fff; color: #374151; border: 1px solid #D1D5DB; }
.btn-secondary:hover { background: #F9FAFB; }
.btn-back { background: transparent; color: #6B7280; padding: 4px 0; font-size: 13px; }
.btn-back:hover { color: #1F4E79; }
.btn-link { color: #1F4E79; padding: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* ─── Login ─── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff; padding: 40px; border-radius: 12px;
  max-width: 400px; width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.login-title { color: #1F4E79; margin: 0 0 4px; font-size: 24px; text-align: center; }
.login-sub { color: #6B7280; text-align: center; margin: 0 0 32px; font-size: 14px; }
.login-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.login-form input {
  width: 100%; padding: 12px; font-size: 15px;
  border: 1px solid #D1D5DB; border-radius: 6px; margin-bottom: 16px;
}
.login-form input:focus { outline: none; border-color: #1F4E79; box-shadow: 0 0 0 3px rgba(31,78,121,0.1); }
.login-form button { width: 100%; padding: 12px; font-size: 15px; }
.login-note { text-align: center; font-size: 12px; color: #9CA3AF; margin-top: 16px; }
.btn-google {
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #374151; border: 1px solid #D1D5DB;
  padding: 12px; border-radius: 6px; text-decoration: none; font-weight: 600;
}
.btn-google:hover { background: #F9FAFB; }

/* ─── Inbox ─── */
.inbox-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid #E5E7EB;
}
.tab {
  padding: 10px 16px; text-decoration: none; color: #6B7280;
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: #1F4E79; }
.tab-active { color: #1F4E79; border-bottom-color: #1F4E79; }
.tab-count {
  background: #E5E7EB; color: #4B5563; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 700;
}
.tab-active .tab-count { background: #1F4E79; color: #fff; }

.table {
  width: 100%; background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-collapse: separate; border-spacing: 0;
}
.table th {
  text-align: left; padding: 12px 16px; background: #F9FAFB;
  font-size: 12px; text-transform: uppercase; color: #6B7280;
  font-weight: 700; letter-spacing: 0.5px; border-bottom: 1px solid #E5E7EB;
}
.table td {
  padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #F3F4F6;
  vertical-align: top;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #F9FAFB; }
.mono { font-family: 'SF Mono', Monaco, monospace; color: #6B7280; }
.muted { color: #9CA3AF; }
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.status-big { padding: 8px 16px; font-size: 14px; }

.empty-state {
  background: #fff; padding: 48px; text-align: center;
  border-radius: 8px; color: #6B7280;
}
.empty-state p { margin: 0 0 16px; }

/* ─── Form (nova solicitação) ─── */
.form-card {
  background: #fff; border-radius: 8px; padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); max-width: 800px;
}
.form-section { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid #F3F4F6; }
.form-section:last-of-type { border-bottom: none; margin-bottom: 16px; }
.form-section h2 {
  font-size: 16px; margin: 0 0 16px; color: #1F4E79;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; }
.field label { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #374151; }
.field input, .field select, .field textarea {
  padding: 10px 12px; font-size: 14px; border: 1px solid #D1D5DB;
  border-radius: 6px; background: #fff; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: #1F4E79; box-shadow: 0 0 0 3px rgba(31,78,121,0.1);
}
.field small { color: #6B7280; font-size: 12px; margin-top: 4px; }
.field-check { grid-column: 1 / -1; }
.field-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field-check input { width: auto; margin: 0; }
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card {
  border: 2px solid #E5E7EB; padding: 16px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.radio-card:has(input:checked) { border-color: #1F4E79; background: #EFF6FF; }
.radio-card input { margin: 0; }
.radio-card strong { display: block; color: #111827; }
.radio-card span { color: #6B7280; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ─── Detalhe ─── */
.detalhe-header {
  display: flex; justify-content: space-between; align-items: start;
  margin-bottom: 24px; gap: 24px;
}
.detalhe-status { text-align: right; }
.detalhe-status small { display: block; margin-top: 6px; }
.detalhe-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detalhe-main, .detalhe-side { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: #fff; border-radius: 8px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h3 {
  margin: 0 0 16px; font-size: 14px; color: #1F4E79;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.dl { margin: 0; }
.dl dt {
  font-weight: 600; font-size: 12px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px;
}
.dl dt:first-child { margin-top: 0; }
.dl dd { margin: 4px 0 0; font-size: 14px; }
.obs { white-space: pre-wrap; margin: 0; font-size: 14px; }

.anexos-list { list-style: none; padding: 0; margin: 0 0 16px; }
.anexos-list li { padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.anexos-list li:last-child { border-bottom: none; }
.anexo-link { color: #1F4E79; text-decoration: none; font-weight: 600; }
.anexo-link:hover { text-decoration: underline; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; margin-left: 8px;
}
.tag-green { background: #D1FAE5; color: #065F46; }

.upload-inline {
  display: flex; gap: 8px; align-items: center; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid #F3F4F6; flex-wrap: wrap;
}
.upload-inline input[type=file] { flex: 1; }
.upload-inline select { padding: 8px; border: 1px solid #D1D5DB; border-radius: 6px; }

.card textarea, .card select, .card input {
  width: 100%; padding: 10px; font-size: 14px;
  border: 1px solid #D1D5DB; border-radius: 6px; font-family: inherit;
}
.card label {
  display: block; font-weight: 600; font-size: 12px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 4px;
}
.card label:first-child { margin-top: 0; }
.card form button { margin-top: 12px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex; gap: 12px; padding: 8px 0;
  border-bottom: 1px dashed #F3F4F6;
}
.timeline li:last-child { border-bottom: none; }
.tl-date { font-size: 11px; color: #9CA3AF; min-width: 70px; padding-top: 2px; }
.tl-content { flex: 1; font-size: 13px; }
.tl-comment {
  background: #F9FAFB; padding: 8px; border-radius: 4px;
  margin-top: 6px; font-size: 13px; color: #4B5563;
}

@media (max-width: 900px) {
  .detalhe-grid { grid-template-columns: 1fr; }
  .form-grid, .radio-group { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; }
}
