:root {
  color-scheme: dark;
  --bg: #111419;
  --bg-soft: #171b21;
  --panel: #0b0d10;
  --panel-2: #10141a;
  --line: #242b35;
  --line-strong: #334155;
  --text: #f8fafc;
  --muted: #93a4b8;
  --accent: #67e8f9;
  --danger: #fb7185;
  --ok: #22c55e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(103, 232, 249, 0.11), transparent 30rem),
    linear-gradient(180deg, #151a20 0%, #111419 38%, #0e1116 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.site-header,
.panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(1560px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0;
}

.site-header {
  min-height: 8rem;
}

.panel-header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.brand-cluster,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 8px;
  color: #0b0d10;
  background: linear-gradient(135deg, #67e8f9, #a7f3d0);
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.site-header .group-link {
  margin-left: auto;
}

.group-link,
.primary-button,
.ghost-button,
.as-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  color: #071014;
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(103, 232, 249, 0.14);
}

.ghost-button,
.group-link {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.48);
}

.danger {
  color: var(--danger);
}

.public-shell {
  width: min(1560px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.board-toolbar,
.tool-band,
.panel-column {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.78);
  box-shadow: var(--shadow);
}

.board-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: var(--text);
  background: #080b0f;
  padding: 0.52rem 0.65rem;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(103, 232, 249, 0.75);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.1);
}

.search-field {
  width: min(28rem, 100%);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.64);
  padding: 0.35rem 0.65rem;
  font-weight: 800;
}

.chip.active {
  color: #071014;
  background: var(--accent);
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--dot);
}

.dot.large {
  width: 1rem;
  height: 1rem;
}

.staff-board {
  display: grid;
  gap: 2rem;
}

.rank-section {
  display: grid;
  gap: 1rem;
}

.rank-header,
.lane-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rank-header h2,
.lane-header h3 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  line-height: 1.2;
}

.rank-code {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid color-mix(in srgb, var(--rank), #ffffff 20%);
  border-radius: 999px;
  color: var(--text);
  background: #05070a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 0 24px color-mix(in srgb, var(--rank), transparent 78%);
  font-weight: 900;
  font-size: 0.82rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.member-card,
.editor-member-card,
.lookup-card,
.admin-item {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 15, 19, 0.96), rgba(5, 7, 10, 0.96));
}

.member-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  min-height: 9.5rem;
  padding: 1rem;
  overflow: hidden;
}

.member-card::before {
  position: absolute;
  inset: 0;
  height: 0.22rem;
  background: linear-gradient(90deg, var(--accent), transparent);
  content: "";
}

.avatar {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: #071014;
  background: linear-gradient(135deg, #67e8f9, #a7f3d0);
  font-weight: 900;
  overflow: hidden;
  text-decoration: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-main {
  min-width: 0;
}

.member-name {
  display: inline-block;
  max-width: 100%;
  color: #e8fbff;
  font-size: 1rem;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.display-name,
.editor-member-main p {
  margin: 0.1rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.department-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  border: 1px solid color-mix(in srgb, var(--department), #ffffff 15%);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--department), transparent 78%);
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.member-notes {
  margin: 0.6rem 0 0;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.member-meta {
  grid-column: 1 / -1;
  align-self: end;
  margin: 0;
  color: #7890a6;
  font-size: 0.72rem;
}

.empty-state,
.loading-row {
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.45);
  padding: 1.5rem;
  text-align: center;
  font-weight: 800;
}

.panel-login {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-shell {
  width: min(27rem, 100%);
}

.login-card {
  display: grid;
  gap: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(11, 13, 16, 0.92);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.login-card .brand-mark {
  width: 3.25rem;
  height: 3.25rem;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.form-error {
  min-height: 1.2rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.panel-shell {
  width: min(1740px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.accounts-shell {
  width: min(980px, calc(100% - 2rem));
}

.tool-band {
  display: grid;
  grid-template-columns: minmax(16rem, 32rem) 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.lookup-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.7rem;
}

.lookup-result {
  min-height: 3rem;
}

.lookup-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem;
}

.lookup-card h3,
.lookup-card p {
  margin-bottom: 0.15rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(24rem, 34rem);
  gap: 1rem;
}

.panel-column {
  padding: 1rem;
}

.panel-column.wide {
  min-width: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title-row h2,
.admin-tools h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.editor-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 0.9rem;
}

.lane {
  min-height: 14rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.72);
  padding: 0.75rem;
}

.lane.is-over {
  border-color: rgba(103, 232, 249, 0.78);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.08);
}

.lane-header {
  margin-bottom: 0.75rem;
}

.lane-header .rank-code {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.72rem;
}

.count-badge {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.lane-dropzone {
  display: grid;
  gap: 0.65rem;
  min-height: 8rem;
}

.lane-empty {
  display: grid;
  place-items: center;
  min-height: 7rem;
  margin: 0;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: #718096;
  font-size: 0.85rem;
  font-weight: 800;
}

.editor-member-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.65rem;
  padding: 0.65rem;
}

.editor-member-card.is-dragging {
  opacity: 0.55;
}

.drag-handle {
  color: var(--muted);
  font-weight: 900;
  padding-top: 0.8rem;
  cursor: grab;
}

.editor-member-card .avatar,
.lookup-card .avatar {
  width: 3rem;
  height: 3rem;
}

.editor-member-main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.editor-member-main textarea {
  min-height: 2rem;
  font-size: 0.82rem;
}

.rank-select {
  width: 100%;
  min-height: 2rem;
  font-size: 0.82rem;
}

.department-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.department-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.58);
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.department-toggle input {
  width: 0.9rem;
  min-height: 0.9rem;
  accent-color: var(--accent);
}

.compact-note {
  margin: 0;
  font-size: 0.8rem;
}

.card-actions {
  display: grid;
  gap: 0.35rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-tools {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.admin-tools section {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.admin-tools section:last-child {
  border-bottom: 0;
}

.admin-form {
  display: grid;
  gap: 0.5rem;
}

.compact-grid {
  grid-template-columns: minmax(0, 1fr) 4.5rem 3rem 5rem auto;
}

.account-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 7rem auto;
}

.admin-list {
  display: grid;
  gap: 0.5rem;
}

.admin-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 4.5rem 3rem 5rem auto auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem;
}

.admin-item .rank-code {
  width: 2rem;
  height: 2rem;
  font-size: 0.68rem;
}

.account-item {
  grid-template-columns: 1fr;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) 7rem auto;
  align-items: center;
  gap: 0.55rem;
}

.account-options {
  display: grid;
  grid-template-columns: auto auto minmax(10rem, 1fr);
  align-items: center;
  gap: 0.55rem;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: max-content;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  min-width: 0;
}

.inline-check input {
  width: 1rem;
  min-height: 1rem;
}

.signed-in {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.role-label {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.45);
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.5rem;
}

.permission-group {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 0.55rem;
}

.permission-group legend {
  color: var(--muted);
  padding: 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #d8e3ed;
  font-size: 0.76rem;
  font-weight: 800;
}

.permission-check input {
  width: 0.95rem;
  min-height: 0.95rem;
  accent-color: var(--accent);
}

.activity-list {
  display: grid;
  gap: 0.5rem;
  max-height: 28rem;
  overflow: auto;
}

.activity-item {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.72);
  padding: 0.55rem;
}

.activity-item div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.activity-item strong {
  color: #e8fbff;
}

.activity-item span,
.activity-item time,
.activity-item p {
  color: var(--muted);
  font-size: 0.76rem;
}

.activity-item p {
  margin: 0;
  overflow-wrap: anywhere;
}

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 10, 0.82);
  padding: 1rem;
}

.password-gate[hidden] {
  display: none;
}

.password-card {
  display: grid;
  gap: 0.9rem;
  width: min(28rem, 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #0b0d10;
  box-shadow: var(--shadow);
  padding: 1.15rem;
}

.password-card h2,
.password-card p {
  margin-bottom: 0;
}

.logs-shell {
  display: grid;
  gap: 1rem;
}

.log-filters {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(13rem, 1.4fr) 6rem auto auto;
  align-items: end;
  gap: 0.65rem;
}

.logs-table {
  display: grid;
  gap: 0.4rem;
}

.logs-head,
.log-row {
  display: grid;
  grid-template-columns: 12rem 9rem 8rem 9rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.logs-head {
  color: var(--muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0 0.65rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.log-row {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.72);
  padding: 0.65rem;
}

.log-row time,
.log-row span,
.log-row p {
  color: var(--muted);
  font-size: 0.82rem;
}

.log-row strong {
  color: #e8fbff;
  overflow-wrap: anywhere;
}

.log-row p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .workspace-grid,
  .tool-band {
    grid-template-columns: 1fr;
  }

  .admin-tools {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .site-header,
  .panel-header,
  .board-toolbar,
  .lookup-form,
  .lookup-card,
  .panel-actions,
  .log-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    min-height: 0;
  }

  .site-header .group-link {
    margin-left: 0;
  }

  .board-toolbar {
    display: grid;
  }

  .chip-row {
    justify-content: flex-start;
  }

  .lookup-form,
  .lookup-card,
  .compact-grid,
  .account-form,
  .account-row,
  .account-options,
  .logs-head,
  .log-row,
  .admin-item,
  .account-item {
    grid-template-columns: 1fr;
  }

  .account-actions {
    justify-content: stretch;
    min-width: 0;
  }

  .account-actions .ghost-button {
    flex: 1 1 0;
  }

  .logs-head {
    display: none;
  }

  .editor-member-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .editor-member-card .avatar {
    display: none;
  }
}

@media (max-width: 1180px) {
  .log-filters,
  .logs-head,
  .log-row {
    grid-template-columns: 1fr;
  }

  .logs-head {
    display: none;
  }
}
