
: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; }
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
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);
}
body.portal-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(238, 242, 245, 0.64), rgba(238, 242, 245, 0.72)),
    url("/portal/static/login-background.jpg") center / cover fixed no-repeat;
}
.site-header {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 227, 235, 0.9);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(9, 34, 63, 0.12);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(128px, 14vw, 168px);
  height: 56px;
  padding: 5px 8px;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}
.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 30px);
  font-size: 0.92rem;
  font-weight: 700;
  color: #34506c;
}
.site-nav a:hover {
  color: #057886;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  background: #09223f;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 124px 24px 32px;
  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);
}
body.portal-page .panel {
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 18px 44px rgba(21, 32, 43, 0.14);
  backdrop-filter: blur(8px);
}
.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, .field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}
.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.password-toggle {
  min-width: 72px;
  padding-inline: 12px;
}
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;
}
@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }
  .brand {
    width: clamp(124px, 26vw, 158px);
  }
  .site-nav {
    display: none;
  }
}
@media (max-width: 680px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    min-height: 64px;
    padding: 8px 10px;
    gap: 10px;
  }
  .brand {
    width: min(34vw, 142px);
    height: 46px;
  }
  .header-cta {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.78rem;
  }
  .login-shell {
    padding: 94px 16px 24px;
  }
}
.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; }
}
