* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
}
.topbar {
  background: #1f2430;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; }
.topbar a { color: #cfd4e0; text-decoration: none; }
.topbar a:hover { color: #fff; }
.back-link { color: #fff; }
.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.stat-label { font-size: 12px; color: #6b7280; margin: 0 0 4px; }
.stat-value { font-size: 26px; font-weight: 600; margin: 0; }
.stat-value.warn { color: #b45309; }
.stat-value.danger { color: #b91c1c; }

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-bar input[type="text"] { flex: 1; min-width: 200px; }
input, select, button {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}
button {
  background: #1f2430;
  color: #fff;
  border: none;
  cursor: pointer;
}
button:hover { background: #34394a; }

.table-wrap {
  background: #fff;
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #eee; }
th { color: #6b7280; font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr.row-link { cursor: pointer; }
tr.row-link:hover { background: #f9fafb; }
.muted { color: #6b7280; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.ok { background: #d1fae5; color: #065f46; }

.detail-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.label { font-size: 12px; color: #6b7280; text-transform: uppercase; }
.folio-form { margin-top: 14px; }
.folio-row { display: flex; gap: 8px; align-items: center; }
.folio-row input { flex: 1; }
.doc-list, .event-list { list-style: none; padding: 0; margin: 10px 0 0; }
.doc-list li, .event-list li { padding: 10px 0; border-bottom: 1px solid #eee; }
.doc-list li:last-child, .event-list li:last-child { border-bottom: none; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 280px;
  text-align: center;
}
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card .sub { color: #6b7280; font-size: 13px; margin: 0 0 20px; }
.login-card input { width: 100%; margin-bottom: 12px; }
.login-card button { width: 100%; }
.error { color: #b91c1c; font-size: 13px; }
