:root {
  color-scheme: light;
  font-family: Inter, Arial, sans-serif;
  color: #111;
  background: #f4f4f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  background: #111;
}

.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 48px;
  background: #fff;
  border-right: 1px solid #d8d8d8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: #111;
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-title {
  display: grid;
  gap: 2px;
}

.brand-title strong {
  font-size: 1.1rem;
}

.brand-title span,
.muted,
.role-meta,
.table-caption {
  color: #666;
}

.login-copy h1 {
  margin: 0 0 10px;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: 0;
}

.login-copy p {
  margin: 0;
  line-height: 1.6;
  color: #555;
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #333;
  font-weight: 700;
  font-size: .92rem;
}

input {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 13px 14px;
  background: #fff;
  color: #111;
}

select {
  min-height: 42px;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 0 36px 0 12px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 700;
}

input:focus {
  outline: 3px solid #d8d8d8;
  border-color: #111;
}

select:focus {
  outline: 3px solid #d8d8d8;
  border-color: #111;
}

.primary-button,
.secondary-button,
.role-button,
.tab-button {
  min-height: 42px;
  border-radius: 4px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: #111;
  color: #fff;
}

.primary-button:hover,
.role-button:hover {
  background: #333;
}

.secondary-button,
.tab-button {
  border: 1px solid #cfcfcf;
  background: #fff;
  color: #111;
}

.tab-button.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.login-side {
  display: flex;
  align-items: end;
  padding: 56px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08) 0 25%, transparent 25% 50%, rgba(255,255,255,.08) 50% 75%, transparent 75%),
    #111;
  background-size: 28px 28px;
}

.login-side p {
  max-width: 560px;
  margin: 0;
  color: #ddd;
  font-size: 1.35rem;
  line-height: 1.5;
}

.error {
  padding: 12px 14px;
  border-left: 4px solid #111;
  background: #eee;
  color: #111;
}

.app-shell {
  min-height: 100vh;
  background: #f4f4f4;
}

.workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.workspace.with-menu {
  width: 100%;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  padding: 0;
}

.side-menu {
  min-height: calc(100vh - 72px);
  padding: 22px 14px;
  background: #fff;
  border-right: 1px solid #d8d8d8;
}

.menu-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  padding: 0 14px;
  background: transparent;
  color: #222;
  font-weight: 800;
  text-align: left;
}

.menu-item:hover,
.menu-item.active {
  background: #111;
  color: #fff;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid #d8d8d8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-switcher {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: #444;
  font-size: .82rem;
}

.active-role {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: #111;
  font-weight: 800;
}

.page {
  width: 100%;
}

.with-menu .page {
  padding: 32px 28px 56px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-head h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.section-head p {
  margin: 0;
  color: #555;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.role-card,
.panel {
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
}

.role-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.role-card h2,
.panel h2 {
  margin: 0;
  font-size: 1.12rem;
}

.role-button {
  width: max-content;
  background: #111;
  color: #fff;
}

.panel {
  padding: 20px;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #111;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: #555;
}

.centre-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  gap: 12px;
  margin-bottom: 18px;
}

.centre-option {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 18px;
  background: #fff;
  color: #111;
  text-align: left;
}

.centre-option:hover {
  background: #f7f7f7;
  border-color: #111;
}

.centre-option span {
  color: #666;
  line-height: 1.45;
}

.compact-head {
  margin-bottom: 16px;
}

.clean-home {
  min-height: 420px;
}

.centre-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  grid-auto-rows: minmax(138px, auto);
  gap: 12px;
  width: 100%;
}

.centre-tile {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
  color: #111;
  text-align: left;
}

.centre-tile strong {
  font-size: 1rem;
}

.centre-tile span,
.centre-tile small {
  color: #666;
  line-height: 1.35;
}

.centre-tile em {
  width: max-content;
  max-width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  padding: 4px 8px;
  color: #333;
  font-size: .78rem;
  font-style: normal;
}

.add-centre-tile,
.list-centre-tile {
  align-items: flex-start;
  justify-content: center;
  border: 2px dashed #777;
  cursor: pointer;
}

.add-centre-tile:hover,
.list-centre-tile:hover {
  border-color: #111;
  background: #f7f7f7;
}

.tile-plus,
.tile-list {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.tile-list {
  font-size: 1.35rem;
}

.empty-tile {
  background: #ededed;
  border-style: dashed;
}

.notice {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  border-left: 4px solid #111;
  padding: 12px 14px;
  background: #fff;
  color: #222;
}

.notice strong {
  display: inline;
}

.notice span {
  overflow-wrap: anywhere;
  color: #666;
  font-size: .92rem;
}

.centre-form {
  display: grid;
  gap: 24px;
}

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

.form-section h2 {
  grid-column: 1 / -1;
  padding-bottom: 10px;
  border-bottom: 1px solid #dedede;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.user-table th,
.user-table td {
  padding: 14px;
  border-bottom: 1px solid #dedede;
  text-align: left;
  vertical-align: top;
}

.user-table th {
  color: #333;
  background: #f2f2f2;
  font-size: .86rem;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.wide-checks {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #222;
}

.check input {
  width: 16px;
  height: 16px;
}

@media (max-width: 840px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-panel,
  .login-side {
    min-height: auto;
    padding: 32px 22px;
  }

  .login-side {
    align-items: start;
  }

  .topbar,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .workspace.with-menu {
    grid-template-columns: 1fr;
  }

  .side-menu {
    min-height: auto;
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-right: 0;
    border-bottom: 1px solid #d8d8d8;
  }

  .menu-item {
    width: auto;
  }

  .with-menu .page {
    padding: 24px 20px 44px;
  }

  .centre-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

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