:root {
  --primary: #0f5c4a;
  --primary-dark: #0a4538;
  --primary-soft: #e8f5f0;
  --accent: #d6b25e;
  --text: #18302a;
  --muted: #66746f;
  --bg: #eef5f1;
  --white: #ffffff;
  --border: #cfe0d8;
  --danger: #c0392b;
  --warning: #d68910;
  --success: #1e8449;
  --info: #2874a6;
  --shadow: 0 10px 30px rgba(15, 92, 74, 0.1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
button, input, select { font: inherit; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(15, 92, 74, 0.12), transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(214, 178, 94, 0.14), transparent 40%),
    linear-gradient(160deg, #dceee6, #eef5f1 50%, #f7faf8);
}
.login-card {
  width: min(400px, 100%);
  background: var(--white);
  border-radius: 22px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.login-card .logo { display: block; width: 160px; margin: 0 auto 18px; mix-blend-mode: multiply; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; text-align: center; color: var(--primary-dark); }
.login-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 14px; outline: none; background: #f7fbf9;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 92, 74, 0.12); }
.login-error { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 20px; margin: -6px 0 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 18px;
  background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; transition: 0.15s;
}
.btn:hover { background: var(--primary-dark); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a93226; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-dark); }

.panel-shell { display: none; min-height: 100vh; }
.panel-shell.visible { display: block; }

.topbar {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 20px rgba(10, 69, 56, 0.25);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  min-height: 68px; display: flex; align-items: center; gap: 18px;
}
.brand-block { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-block .logo {
  height: 34px; background: #fff; border-radius: 8px; padding: 3px 6px; mix-blend-mode: normal;
}
.brand-block strong { display: block; font-size: 14px; }
.brand-block span { font-size: 11px; opacity: 0.8; }
.top-nav { display: flex; gap: 6px; }
.nav-pill {
  border: 0; background: rgba(255,255,255,0.12); color: #fff;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.nav-pill:hover { background: rgba(255,255,255,0.2); }
.nav-pill.active { background: #fff; color: var(--primary-dark); }
.topbar-actions { display: flex; gap: 8px; }
.topbar .btn-ghost { color: #e8f5f0; border-color: rgba(255,255,255,0.35); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.topbar .btn-outline { color: #fff; border-color: rgba(255,255,255,0.55); }
.topbar .btn-outline:hover { background: #fff; color: var(--primary-dark); }

.main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }

.section-panel { display: none; }
.section-panel.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
}
.page-heading h2 { margin: 0; font-size: 28px; letter-spacing: -0.5px; color: var(--primary-dark); }
.eyebrow {
  display: block; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--primary); margin-bottom: 4px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.dash-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(15, 92, 74, 0.05);
}
.dash-card.highlight {
  background: linear-gradient(145deg, var(--primary), #159376);
  border: 0; color: #fff;
  box-shadow: 0 12px 28px rgba(15, 92, 74, 0.28);
}
.dash-card.highlight span { color: rgba(255,255,255,0.85); }
.dash-card.highlight strong { color: #fff; }
.dash-card.accent { border-left: 4px solid var(--info); }
.dash-card.warn { border-left: 4px solid var(--warning); }
.dash-card.ok { border-left: 4px solid var(--success); }
.dash-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary-soft); display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
}
.dash-card.highlight .dash-icon { background: rgba(255,255,255,0.18); }
.dash-card span {
  display: block; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.dash-card strong { display: block; font-size: 26px; margin-top: 2px; color: var(--primary-dark); }

.dash-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.panel-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(15, 92, 74, 0.05);
}
.panel-box-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.panel-box-head h3 { margin: 0; font-size: 16px; color: var(--primary-dark); }
.muted { color: var(--muted); font-size: 12px; font-weight: 600; }

.visits-chart { display: flex; flex-direction: column; gap: 8px; }
.visit-row {
  display: grid; grid-template-columns: 72px 1fr 36px; gap: 10px; align-items: center;
  font-size: 13px;
}
.visit-row .day { color: var(--muted); font-weight: 600; font-size: 12px; }
.visit-bar-track {
  height: 10px; background: var(--primary-soft); border-radius: 999px; overflow: hidden;
}
.visit-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), #1a9b78);
  border-radius: 999px; min-width: 0; transition: width 0.3s;
}
.visit-row .count { text-align: right; font-weight: 800; color: var(--primary-dark); font-size: 12px; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: #f9fcfa; cursor: pointer; transition: 0.15s;
}
.recent-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.recent-item strong { display: block; font-size: 14px; }
.recent-item span { font-size: 12px; color: var(--muted); }
.recent-item .badge { margin-left: auto; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
}
.toolbar input[type="search"], .toolbar select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--white); outline: none; min-width: 180px;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 92, 74, 0.1);
}
.toolbar .spacer { flex: 1; }

.table-wrap {
  background: var(--white); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--primary-soft); font-size: 11px; font-weight: 800; color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: 0.3px;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f7fbf9; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
}
.badge-novo { background: #d6eaf8; color: #1a5276; }
.badge-analise { background: #fdebd0; color: #9a7b0a; }
.badge-aprovado { background: #d5f5e3; color: #196f3d; }
.badge-recusado { background: #fadbd8; color: #922b21; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 69, 56, 0.55);
  z-index: 100; display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white); border-radius: 20px; width: min(740px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2); overflow: hidden;
  animation: fadeIn 0.2s ease;
}
.modal-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
}
.modal-header h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-close {
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 22px; cursor: pointer;
}
.modal-close:hover { background: rgba(255,255,255,0.22); }
.modal-body { padding: 20px; }
.section-label {
  display: block; font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px;
}
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 18px;
}
.detail-item label {
  display: block; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px;
}
.detail-item p { margin: 0; font-size: 14px; font-weight: 600; word-break: break-word; }
.detail-item.full { grid-column: 1 / -1; }
.photos-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photos-row.one { grid-template-columns: 1fr; max-width: 280px; }
.photo-card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #f7fbf9;
}
.photo-card span {
  display: block; padding: 8px 10px; font-size: 12px; font-weight: 700;
  color: var(--muted); border-bottom: 1px solid var(--border); background: var(--primary-soft);
}
.photo-card img {
  display: block; width: 100%; height: 150px; object-fit: cover; cursor: pointer; background: #eef2f0;
}
.photo-card .no-photo {
  height: 150px; display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 8px; text-align: center;
}
.modal-footer {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--border); background: #f7fbf9;
}
.status-select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-weight: 600;
}

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--primary-dark); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 200;
  opacity: 0; transform: translateY(8px); transition: 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); z-index: 150;
  display: none; place-items: center; padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .dash-columns { grid-template-columns: 1fr; }
  .top-nav { display: none; }
  .photos-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
@media (max-width: 600px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .brand-block span { display: none; }
  .toolbar input[type="search"] { min-width: 100%; flex: 1 1 100%; }
}


.login-hint {
  margin: 16px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.change-pwd-box {
  display: none;
  position: fixed;
  right: 20px;
  top: 78px;
  z-index: 60;
  width: min(340px, calc(100vw - 24px));
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.change-pwd-box.open { display: block; animation: fadeIn 0.15s ease; }
.change-pwd-box h3 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--primary-dark);
}
.change-pwd-box label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0 4px;
}
.change-pwd-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #f7fbf9;
}
.change-pwd-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 92, 74, 0.1);
}
.change-pwd-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.change-pwd-msg {
  font-size: 12px;
  font-weight: 600;
  min-height: 16px;
  margin: 8px 0 0;
}
.change-pwd-msg.ok { color: var(--success); }
.change-pwd-msg.err { color: var(--danger); }
