:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d2721;
  background: #f4f6f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  isolation: isolate;
  background: #f4f6f4 url("/static/bg.jpeg") center / cover fixed no-repeat;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: rgba(244, 246, 244, 0.6);
  content: "";
}
a { color: inherit; }
button, input { font: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 28px; line-height: 1.2; letter-spacing: 0; }
h2 { margin-bottom: 4px; font-size: 17px; letter-spacing: 0; }
.muted { color: #657168; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid #d9dfdb;
  background: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: #24563d; font-weight: 750; text-decoration: none; }
.brand-mark { width: 96px; height: 55px; flex: 0 0 auto; object-fit: contain; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { color: #48564d; font-size: 14px; text-decoration: none; }
.topbar nav a:hover { color: #24563d; }

.management-shell { width: min(1180px, calc(100% - 40px)); margin: 34px auto 60px; }
.management-shell.narrow { width: min(900px, calc(100% - 40px)); }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.page-heading p { margin-bottom: 0; font-size: 14px; }
.back-link { display: inline-block; margin-bottom: 14px; color: #397555; font-size: 14px; text-decoration: none; }

.panel { margin-bottom: 22px; border: 1px solid #d9dfdb; border-radius: 8px; background: #fff; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #e4e8e5; }
.panel-heading p { margin: 0; color: #738078; font-size: 13px; }
.create-panel .management-form { padding-top: 20px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 11px 16px; background: #f8f9f8; color: #667169; font-size: 12px; font-weight: 650; text-align: left; text-transform: uppercase; }
td { padding: 14px 16px; border-top: 1px solid #e8ebe9; vertical-align: middle; }
tbody tr:hover { background: #fbfcfb; }
.actions { width: 1%; text-align: right; white-space: nowrap; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; padding: 3px 7px; border: 1px solid #d7ddd9; border-radius: 4px; background: #f7f9f7; color: #556159; font-size: 12px; }
.tag.admin { margin-left: 8px; border-color: #b9d2c2; background: #eef7f1; color: #245d3e; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: #8b9690; content: ""; }
.status.active::before { background: #2f8a55; }
.status.revoked { color: #8a4d48; }
.status.revoked::before { background: #b65c54; }

.management-form { padding: 22px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.field-grid.single { grid-template-columns: minmax(0, 1fr); }
.account-password-field { margin-top: 18px; }
label { display: block; color: #4d5b52; font-size: 13px; font-weight: 600; }
input:not([type="checkbox"]) { width: 100%; height: 42px; margin-top: 7px; padding: 0 11px; border: 1px solid #cbd3ce; border-radius: 6px; background: #fff; color: #1d2721; outline: none; }
input:not([type="checkbox"]):focus { border-color: #397555; box-shadow: 0 0 0 3px rgba(57, 117, 85, 0.12); }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid #d9dfdb; border-radius: 6px; }
legend { max-width: 100%; padding: 0 4px; overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.project-key { display: block; margin: -2px 0 12px; overflow-wrap: anywhere; color: #7a857e; font-size: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-weight: 500; cursor: pointer; }
.check-row input { flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0; accent-color: #2e6b4a; }
.check-row span { display: grid; gap: 3px; color: #334139; }
.check-row small { color: #758078; font-weight: 400; line-height: 1.35; }
.check-row.compact { align-items: center; }
.setting-list { padding: 2px 0 8px; border-bottom: 1px solid #e4e8e5; }
.project-manager-settings { margin-top: 18px; }
.scope-note { margin: 16px 0 0; padding: 11px 13px; border-left: 3px solid #b8c5bd; background: #f6f8f6; color: #5f6c64; font-size: 13px; line-height: 1.45; }
.section-heading { margin-top: 24px; }
.identity-summary { display: flex; align-items: center; justify-content: space-between; padding: 14px; border: 1px solid #d9dfdb; border-radius: 6px; }
.identity-summary span { color: #758078; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; }
.button.primary { border-color: #285f43; background: #285f43; color: #fff; }
.button.primary:hover { background: #204e37; }
.button.secondary { border-color: #cbd3ce; background: #fff; color: #34433a; }
.button.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.button.danger-text { width: 100%; border-color: #e1c8c5; background: #fff; color: #a34139; }
.button-row.vertical { display: grid; gap: 9px; margin-top: 22px; }
.button-row.vertical form { margin: 0; }

.notice { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #bed8c7; border-radius: 6px; background: #eef8f1; color: #21583a; font-size: 14px; }
.notice.error { border-color: #e5c4c0; background: #fff3f1; color: #9f332b; }

.auth-page { display: grid; place-items: center; padding: 24px; }
.auth-panel { width: min(410px, 100%); padding: 28px; border: 1px solid #d5ddd7; border-radius: 8px; background: #fff; box-shadow: 0 18px 42px rgba(31, 49, 38, 0.09); }
.auth-panel h1 { margin-top: 18px; font-size: 24px; }
.auth-brand { display: flex; align-items: center; gap: 14px; color: #24563d; font-size: 20px; font-weight: 750; }
.auth-brand .brand-mark { width: 124px; height: 71px; }
.form-stack { display: grid; gap: 13px; margin-top: 22px; }
.separator { display: flex; align-items: center; gap: 12px; margin: 24px 0 2px; color: #7b867f; font-size: 12px; }
.separator::before, .separator::after { height: 1px; flex: 1; background: #e0e5e1; content: ""; }
.permission-list { margin-top: 20px; border-top: 1px solid #e1e6e2; }
.permission-list div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #e1e6e2; font-size: 13px; }
.permission-list span { color: #6d7971; }

.project-list { border: 1px solid #d9dfdb; border-radius: 8px; background: #fff; overflow: hidden; }
.project-list > a { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-top: 1px solid #e4e8e5; text-decoration: none; }
.project-list > a:first-child { border-top: 0; }
.project-list > a:hover { background: #f8faf8; }
.project-list strong, .project-list small { display: block; }
.project-list small { margin-top: 4px; color: #77827b; }
.arrow { color: #397555; font-size: 26px; }
.empty-state { padding: 28px; color: #6c7770; text-align: center; }

@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .brand { gap: 9px; }
  .brand-mark { width: 78px; height: 45px; }
  .topbar nav { gap: 14px; }
  .management-shell, .management-shell.narrow { width: min(100% - 24px, 1180px); margin-top: 22px; }
  .field-grid, .permission-grid { grid-template-columns: 1fr; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  .management-form { padding: 16px; }
  .auth-panel { padding: 22px; }
}
