:root {
  --bg: #f3efe8;
  --bg-accent: #e7dfd1;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1e1a17;
  --muted: #6f665d;
  --line: rgba(53, 42, 34, 0.12);
  --brand: #1f5a57;
  --brand-strong: #174542;
  --brand-soft: rgba(31, 90, 87, 0.12);
  --accent: #b76e3b;
  --good: #316e45;
  --shadow: 0 24px 80px rgba(55, 41, 28, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(183, 110, 59, 0.16), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(31, 90, 87, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f7f3ed 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  opacity: 0.28;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.page {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.shell {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 90, 87, 0.18), transparent 68%);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--brand-strong);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 0 0 5px rgba(31, 90, 87, 0.08);
}

.display {
  margin: 0;
  max-width: 16ch;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.lede {
  max-width: 60ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.layout {
  display: grid;
  gap: 22px;
}

.layout.login-layout {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
}

.panel,
.card,
.stats,
.banner,
.form-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.panel,
.form-shell {
  padding: 24px;
}

.panel h2,
.section-title,
.card-title,
.meta-label {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -0.02em;
}

.panel h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.panel p,
.helper,
.meta-value,
.card-subtitle,
.stat-label,
.stat-value,
.empty-note,
.note {
  color: var(--muted);
}

.alert {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid rgba(183, 110, 59, 0.2);
  background: rgba(183, 110, 59, 0.09);
  color: #8a4c1f;
}

.alert::before,
.banner::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
}

form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.95rem;
  font-weight: 650;
}

input,
textarea,
button,
.button {
  font: inherit;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(53, 42, 34, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input::placeholder { color: rgba(111, 102, 93, 0.7); }

input:focus {
  border-color: rgba(31, 90, 87, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 90, 87, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(31, 90, 87, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(31, 90, 87, 0.26);
  text-decoration: none;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.note,
.helper {
  font-size: 0.92rem;
}

.stack {
  display: grid;
  gap: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
}

.stat {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(53, 42, 34, 0.08);
}

.stat-value {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--text);
  overflow-wrap: anywhere;
}

.stat-help {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  color: var(--muted);
}

.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  color: var(--brand-strong);
}

.banner.cache {
  background: rgba(31, 90, 87, 0.08);
  border-color: rgba(31, 90, 87, 0.18);
}

.banner.cache::before { background: var(--brand); }

.spaced-top { margin-top: 22px; }

.panel-spaced { margin-top: 24px; }

.results-grid {
  display: grid;
  gap: 16px;
}

.card {
  padding: 20px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.86rem;
  font-weight: 650;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.pill-wide {
  align-items: flex-start;
  white-space: normal;
  line-height: 1.25;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.meta {
  padding-top: 12px;
  border-top: 1px solid rgba(53, 42, 34, 0.08);
}

.meta-label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-value {
  color: var(--text);
  word-break: break-word;
}

.empty {
  padding: 28px;
  text-align: center;
}

.empty h2 {
  margin: 0 0 8px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.empty-log {
  position: relative;
  padding: 36px 28px;
}

.empty-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(135deg, rgba(31, 90, 87, 0.18), rgba(183, 110, 59, 0.18));
  box-shadow: inset 0 0 0 1px rgba(53, 42, 34, 0.08);
}

.empty-meta {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.log-hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 90, 87, 0.08), transparent 24%),
    var(--surface);
}

.pill-accent {
  background: rgba(31, 90, 87, 0.12);
  color: var(--brand-strong);
}

.pill-soft {
  background: rgba(183, 110, 59, 0.1);
  color: #8a4c1f;
}

.log-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(53, 42, 34, 0.08);
}

.log-intro .section-title {
  font-size: 1.25rem;
}

.log-range {
  flex: none;
}

.log-shell {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
}

.log-table thead th {
  padding: 18px 20px 14px;
  text-align: left;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(53, 42, 34, 0.1);
  background: rgba(255, 255, 255, 0.52);
}

.log-table tbody tr {
  border-bottom: 1px solid rgba(53, 42, 34, 0.08);
  transition: background-color 160ms ease;
}

.log-table tbody tr:hover {
  background: rgba(31, 90, 87, 0.035);
}

.log-table tbody tr:last-child {
  border-bottom: 0;
}

.log-table td {
  padding: 18px 20px;
  vertical-align: top;
  color: var(--text);
}

.log-table td:first-child {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.doc-pill,
.mono-value {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(53, 42, 34, 0.08);
}

.doc-pill {
  color: var(--brand-strong);
  font-weight: 700;
}

.mono-value {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
}

.time-primary,
.time-secondary {
  display: block;
}

.time-primary {
  font-weight: 700;
}

.time-secondary {
  margin-top: 2px;
  font-size: 0.88rem;
  color: var(--muted);
}

.log-table td[data-label="CPF/Documento"] {
  width: 32%;
}

.log-table td[data-label="Horário"] {
  width: 23%;
}

.log-table td[data-label="IP"] {
  width: 18%;
}

.log-table td[data-label="Localização"] {
  width: 27%;
  color: var(--text);
}

.log-table td[data-label="Horário"] {
  white-space: nowrap;
}

.log-table td[data-label="IP"],
.log-table td[data-label="Localização"] {
  color: var(--muted);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.subtle-link {
  color: var(--brand-strong);
  font-weight: 650;
}

.search-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.divider {
  width: 100%;
  height: 1px;
  background: rgba(53, 42, 34, 0.08);
}

@media (max-width: 860px) {
  .layout.login-layout,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .card-top,
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page { width: min(100% - 20px, 1120px); padding-top: 18px; }
  .hero { padding: 24px; }
}

@media (max-width: 720px) {
  .log-intro {
    padding: 18px 18px 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .log-table thead {
    display: none;
  }

  .log-table,
  .log-table tbody,
  .log-table tr,
  .log-table td {
    display: block;
    width: 100%;
  }

  .log-table tbody tr {
    margin: 14px 14px 0;
    padding: 8px 0;
    border: 1px solid rgba(53, 42, 34, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 28px rgba(55, 41, 28, 0.08);
  }

  .log-table td {
    display: grid;
    gap: 4px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(53, 42, 34, 0.08);
  }

  .log-table td:last-child {
    border-bottom: 0;
  }

  .log-table td::before {
    content: attr(data-label);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }

  .log-table td[data-label="Horário"] {
    white-space: normal;
  }

  .log-table td[data-label="CPF/Documento"],
  .log-table td[data-label="Horário"],
  .log-table td[data-label="IP"],
  .log-table td[data-label="Localização"] {
    width: 100%;
  }

  .doc-pill,
  .mono-value {
    width: fit-content;
    max-width: 100%;
  }
}
