:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17191f;
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

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

.panel {
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 32px rgba(38, 48, 68, 0.08);
}

.compact {
  max-width: 640px;
}

.header,
.toolbar,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #5a6474;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
}

.lead {
  color: #5a6474;
}

.status,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf8ef;
  color: #146c35;
  font-size: 0.84rem;
  font-weight: 700;
}

.status.warning,
.pill.warning {
  background: #fff4df;
  color: #946200;
}

.pill.muted {
  background: #eef2f7;
  color: #4d5868;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.summary div {
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 16px;
}

.summary span {
  display: block;
  color: #667085;
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.toolbar {
  margin-bottom: 18px;
}

.toolbar-group,
.row-actions,
.auth-row,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.toolbar a,
.actions a {
  min-height: 40px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #ffffff;
  color: #202532;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger {
  color: #b42318;
}

.primary,
.toolbar button {
  background: #2f6df6;
  border-color: #2f6df6;
  color: #ffffff;
}

.toolbar button:not(.primary) {
  background: #ffffff;
  border-color: #cfd7e3;
  color: #202532;
}

.auth {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #f8fafc;
}

.auth label,
.dialog-card label {
  display: grid;
  gap: 8px;
  color: #4d5868;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #ffffff;
  color: #17191f;
  padding: 10px 12px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.auth-row input {
  min-width: min(100%, 360px);
  flex: 1;
}

.notice {
  margin: 0 0 18px;
  min-height: 20px;
  color: #5a6474;
}

.notice:empty {
  display: none;
}

.notice[data-tone="warning"] {
  color: #946200;
}

.notice[data-tone="success"] {
  color: #146c35;
}

.notice[data-tone="error"] {
  color: #b42318;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid #e3e8f0;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #5a6474;
  font-size: 0.88rem;
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: 0;
}

td small {
  display: block;
  margin-top: 4px;
  color: #667085;
}

.empty {
  color: #667085;
}

dialog {
  width: min(720px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dialog-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mail-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #ffffff;
}

.mail-input input {
  border: 0;
  border-radius: 0;
}

.mail-input span {
  padding: 0 12px;
  color: #667085;
  white-space: nowrap;
}

.dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .panel {
    padding: 18px;
  }

  .header,
  .toolbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .toolbar-group,
  .row-actions,
  .auth-row,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid #e3e8f0;
    padding: 12px 0;
  }

  td {
    border: 0;
    padding: 8px 0;
  }
}
