:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f5f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fb; }

.topbar {
  min-height: 106px;
  padding: 22px 30px;
  background: #fff;
  border-bottom: 1px solid #dbe2ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow { font-size: 12px; font-weight: 700; color: #0277f8; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 3px 0 0; font-size: 28px; font-weight: 700; color: #0f172a; }
.subhead { margin-top: 4px; font-size: 13px; color: #64748b; }
.top-actions { display: flex; gap: 10px; }

.page { padding: 24px 30px 40px; }
.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}
.card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.toolbar {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}
.search-wrap label,
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #475569; }
input, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  color: #111827;
}
input:focus, textarea:focus { outline: 2px solid rgba(2,119,248,.18); border-color: #0277f8; }
.metric { padding: 8px 12px; border-left: 3px solid #0277f8; background: #f8fafc; }
.metric span { display:block; font-size:11px; color:#64748b; text-transform:uppercase; font-weight:700; }
.metric strong { display:block; margin-top:2px; font-size:24px; color:#0f172a; }
.status { font-size: 12px; color: #64748b; text-align: right; padding-bottom: 8px; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1050px; font-size: 12px; }
th { background: #f1f5f9; color: #075ea8; text-align: left; padding: 10px; border-bottom: 1px solid #cbd5e1; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
tbody tr:hover td { background: #f8fbff; }
.actions-col { width: 135px; text-align: right; }
.row-actions { display:flex; justify-content:flex-end; gap:6px; }
.empty { text-align:center; padding:30px; color:#94a3b8; }

.btn {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: #0277f8; color: #fff; }
.btn.primary:hover { filter: brightness(.94); }
.btn.secondary { background:#fff; border-color:#bfdbfe; color:#0f172a; }
.btn.secondary:hover { background:#f8fafc; }
.btn.danger { background:#fff; border-color:#fecaca; color:#b91c1c; }
.btn.small { padding: 6px 9px; font-size: 11px; }
button:disabled { opacity:.55; cursor:not-allowed; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.48); display:flex; align-items:center; justify-content:center; padding:24px; z-index:1000;
}
.modal-backdrop.hidden { display:none; }
.modal { width:min(900px, 100%); max-height:92vh; background:#fff; border-radius:12px; box-shadow:0 22px 60px rgba(15,23,42,.28); display:flex; flex-direction:column; overflow:hidden; }
.modal-header { padding:16px 20px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid #e2e8f0; }
.modal-header h2 { margin:0; font-size:18px; }
.icon-btn { width:34px; height:34px; border-radius:50%; border:0; background:#111827; color:#fff; font-size:22px; line-height:1; cursor:pointer; }
.modal-body { padding:20px; overflow:auto; }
.modal-footer { padding:14px 20px; border-top:1px solid #e2e8f0; display:flex; justify-content:flex-end; gap:10px; }
.form-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:15px; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.checkbox-field { flex-direction: row; align-items:center; padding-top:25px; }
.checkbox-field input { width:auto; }

@media (max-width: 900px) {
  .topbar { align-items:flex-start; flex-direction:column; }
  .toolbar { grid-template-columns: 1fr; }
  .status { text-align:left; }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-4 { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .page, .topbar { padding-left:16px; padding-right:16px; }
  .top-actions { width:100%; }
  .top-actions .btn { flex:1; }
  .form-grid { grid-template-columns:1fr; }
  .span-2, .span-4 { grid-column:auto; }
}
