
:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6673;
  --line: #d7dde5;
  --panel: #ffffff;
  --bg: #eef2f5;
  --accent: #0f6f6f;
  --accent-dark: #0a5555;
  --danger: #a02222;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(238, 242, 245, 0.88), rgba(238, 242, 245, 0.88)),
    url("/portal/static/login-background.jpg") center / cover fixed no-repeat;
  background-color: var(--bg);
  color: var(--ink);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(3, 17, 35, 0.86) 0%, rgba(3, 17, 35, 0.68) 42%, rgba(3, 17, 35, 0.24) 100%),
    url("/portal/static/login-background.jpg") center / cover no-repeat;
}
.login-panel, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(21, 32, 43, 0.08);
}
.login-panel {
  width: min(420px, 100%);
  padding: 28px;
}
.login-logo {
  display: block;
  width: min(300px, 100%);
  height: auto;
  margin: 0 auto 18px;
}
.login-panel h1, .portal-header h1, .panel h2 {
  margin: 0;
  letter-spacing: 0;
}
.login-panel h1 {
  font-size: 25px;
  line-height: 1.15;
  text-align: center;
}
.stack {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
textarea {
  resize: vertical;
}
select {
  min-height: 44px;
}
button, .button, .switch {
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  padding: 10px 14px;
  cursor: pointer;
}
button:hover, .button:hover, .switch:hover { background: var(--accent-dark); }
.secondary {
  background: #334155;
}
.secondary:hover { background: #1f2937; }
.error {
  margin: 16px 0 0;
  color: var(--danger);
  font-weight: 600;
}
.notice {
  margin: 16px 0 0;
  color: var(--accent-dark);
  font-weight: 650;
}
.muted {
  color: var(--muted);
}
.text-link {
  color: var(--accent-dark);
  font-weight: 650;
  text-decoration: none;
}
.text-link:hover {
  text-decoration: underline;
}
.portal-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 24px auto 48px;
}
.portal-header {
  display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 18px;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.portal-logo {
  width: 150px;
  max-width: 36vw;
  height: auto;
  display: block;
}
.portal-header p {
  margin: 6px 0 0;
  color: var(--muted);
}
.panel {
  padding: 20px;
  margin-top: 16px;
}
.panel h2 {
  font-size: 18px;
  margin-bottom: 14px;
}
.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.switch {
  background: #e6ecef;
  color: var(--ink);
}
.switch.active {
  background: var(--accent);
  color: #fff;
}
.user-form, .client-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.user-form button, .client-form button {
  min-height: 44px;
}
.wide-field {
  grid-column: span 2;
}
.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.password-form button {
  min-height: 44px;
}
.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  min-height: 44px;
}
.check-row input {
  width: auto;
}
.row-action-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 6px;
}
.row-action-form input[type="password"] {
  width: min(180px, 100%);
  padding: 8px 10px;
}
.row-action-form button {
  padding: 8px 10px;
  font-size: 13px;
}
button.danger {
  background: var(--danger);
}
button.danger:hover {
  background: #751919;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 650;
}
@media (max-width: 700px) {
  .portal-header, .app-row { align-items: flex-start; flex-direction: column; }
  .user-form, .client-form, .password-form { grid-template-columns: 1fr; }
  .wide-field { grid-column: auto; }
  table { display: block; overflow-x: auto; }
}
