:root {
  --red: #ff0000;
  --text: #f5f5f5;
  --muted: #c9c9c9;
  --border: #3b3b3b;
  --surface: #111111;
  --surface-muted: #1b1b1b;
  --focus: #ffffff;
  --page-bg: #070707;
  --input-bg: #171717;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  color: var(--text);
  background: var(--page-bg);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.16;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 650;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  border-top: 10px solid var(--red);
  gap: 12px;
}

.login-panel,
.admin-login,
.admin-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.login-header {
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--border);
}

.brand-logo,
.app-logo {
  display: block;
  width: min(240px, 58vw, 100%);
  height: auto;
  margin: 0 auto 28px;
}

.app-logo {
  width: min(280px, 72vw, 100%);
  margin-bottom: 24px;
}

.system-label {
  margin: 0 0 6px;
  padding-left: 12px;
  color: var(--text);
  border-left: 6px solid var(--red);
  font-size: 14px;
  font-weight: 700;
}

.login,
.admin-login {
  padding: 28px;
}

.login label,
.form-stack label,
.form-grid label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.login__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select,
button {
  min-height: 50px;
  border-radius: 4px;
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid #666666;
}

button {
  padding: 0 18px;
  color: #ffffff;
  background: var(--red);
  border: 2px solid var(--red);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  text-decoration: underline;
}

.secondary-button {
  color: var(--text);
  background: transparent;
  border-color: #707070;
  font-weight: 650;
}

.secondary-button:hover {
  border-color: var(--text);
}

.login__hint,
.form-status {
  min-height: 44px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.login-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 28px 18px;
  color: var(--muted);
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.login-footer__title {
  font-weight: 700;
}

.login-footer__by,
.admin-credit a,
.subtle-link,
.admin-entry {
  opacity: 0.78;
  color: inherit;
  text-decoration: none;
}

.login-footer__by:hover,
.login-footer__by:focus-visible,
.admin-credit a:hover,
.subtle-link:hover,
.admin-entry:hover {
  opacity: 1;
  text-decoration: underline;
}

.build-line,
.admin-credit {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.78;
  text-align: center;
}

.admin-entry {
  font-size: 13px;
}

.admin-body {
  border-top: 10px solid var(--red);
}

.admin-shell {
  width: min(1180px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px;
}

.admin-login {
  margin: clamp(24px, 10vh, 96px) auto 0;
}

.form-stack {
  display: grid;
  gap: 10px;
}

.subtle-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
}

.admin-workspace {
  display: grid;
  gap: 18px;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 0 8px;
}

.workspace-head p,
.form-card-head p {
  margin: 0 0 4px;
  color: var(--muted);
}

.workspace-logo {
  display: block;
  width: 190px;
  height: auto;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-card {
  width: 100%;
  padding: 22px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

.check-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--red);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

td span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.count-pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.status-ok {
  border-color: #ffffff;
}

.status-stop {
  border-color: var(--red);
  color: #ffffff;
  background: var(--red);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button,
.staff-item button,
.form-card-head button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.staff-panel {
  width: 100%;
}

.staff-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
  margin: 16px 0;
}

.staff-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.staff-item span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.empty-state {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .staff-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .login-shell,
  .admin-shell {
    justify-content: start;
    align-items: stretch;
    padding: 18px;
  }

  .login-header,
  .login,
  .admin-login,
  .admin-card {
    padding: 20px;
  }

  .brand-logo,
  .app-logo {
    width: min(270px, 100%);
  }

  h1 {
    font-size: 30px;
  }

  .login__row,
  .inline-field,
  .staff-form {
    grid-template-columns: 1fr;
  }

  .workspace-head,
  .form-card-head,
  .staff-item {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-logo {
    width: min(190px, 72vw);
  }
}
