:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17251f;
  background: #f4f6f2;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #176b49; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { background: #102a20; color: #f5fff9; padding: 28px 20px; }
.brand { font-size: 1.2rem; font-weight: 800; margin-bottom: 30px; }
.nav { display: grid; gap: 6px; }
.nav a { color: #d5e8de; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 550; }
.nav a:hover, .nav a.active { background: #204334; color: white; }
.main { padding: 34px; max-width: 1280px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.card { background: white; border: 1px solid #dce4df; border-radius: 12px; padding: 20px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(16, 42, 32, .04); }
.card h2 { margin-top: 0; margin-bottom: 16px; font-size: 1.15rem; color: #102a20; }
.narrow { max-width: 480px; margin: 10vh auto; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #bccbc3; border-radius: 8px; padding: 10px 12px; background: white; }
.field textarea { min-height: 88px; resize: vertical; }
.password-field-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.password-field-wrapper input { padding-right: 42px; }
.password-toggle-button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #65766d;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.password-toggle-button:hover { color: #17251f; background: #e8eee9; }
.password-toggle-button:focus-visible { outline: 2px solid #176b49; outline-offset: 1px; }
.button { border: 0; background: #176b49; color: white; padding: 10px 15px; border-radius: 8px; font-weight: 650; }
.button.secondary { background: #e5ece8; color: #1c3328; }
.button.danger { background: #a63131; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.error { background: #ffebeb; color: #8e2020; padding: 11px 13px; border-radius: 8px; margin-bottom: 14px; }
.success { background: #e8f6ed; color: #165c3d; padding: 11px 13px; border-radius: 8px; margin-bottom: 14px; overflow-wrap: anywhere; }
.muted { color: #65766d; }

.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #e6eee9; font-size: .78rem; font-weight: 700; align-items: center; gap: 4px; }
.badge.badge-validated, .badge.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge.badge-rejected, .badge.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge.badge-under_review, .badge.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge.badge-to_complete, .badge.badge-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge.badge-processing, .badge.badge-received { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.tab-group { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-button { background: #e8eee9; border: 1px solid #d4dfd8; padding: 7px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; color: #2d4538; font-size: .85rem; }
.tab-button:hover { background: #dce7df; }
.tab-button.active { background: #176b49; color: white; border-color: #176b49; }

.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input { flex: 1; border: 1px solid #bccbc3; border-radius: 8px; padding: 9px 12px; background: white; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.info-item { background: #f8faf9; border-radius: 8px; padding: 11px 14px; border: 1px solid #e6ebe8; }
.info-label { font-size: 0.73rem; text-transform: uppercase; color: #65766d; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.04em; }
.info-value { font-size: 0.95rem; font-weight: 650; color: #17251f; word-break: break-word; }

.match-yes { color: #15803d; font-weight: 700; }
.match-no { color: #b91c1c; font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #e6ebe8; vertical-align: middle; }
th { color: #52645b; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; background: #fafcfa; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f2f7f4; }
table a.table-link { color: #176b49; font-weight: 650; text-decoration: none; }
table a.table-link:hover { text-decoration: underline; }

.proofs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.proof-item { background: #edf1ee; border-radius: 10px; overflow: hidden; border: 1px solid #dce4df; display: flex; flex-direction: column; }
.proof-item img { width: 100%; max-height: 480px; object-fit: contain; background: #0000000a; }
.proof-caption { padding: 9px 13px; font-size: 0.83rem; font-weight: 600; background: white; border-top: 1px solid #e6ebe8; display: flex; justify-content: space-between; align-items: center; }

.webhook-panel { border-top: 1px solid #e6ebe8; margin-top: 20px; padding-top: 16px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f4f6f4; padding: 12px; border-radius: 8px; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-header h1 { margin: 0; font-size: 1.4rem; }

@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { padding: 18px; }
  .brand { margin-bottom: 12px; }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main { padding: 20px 14px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
}
