:root {
  --admin-web-ink: #17212b;
  --admin-web-muted: #66727f;
  --admin-web-line: #dce4e9;
  --admin-web-surface: #ffffff;
  --admin-web-accent: #087f8c;
  --admin-web-accent-strong: #075d67;
  --admin-web-danger: #c43a48;
}

body.admin-web-login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  color: var(--admin-web-ink);
  background: #eef3f5;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.admin-web-login-shell {
  width: min(880px, 100%);
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(280px, .86fr) minmax(340px, 1.14fr);
  overflow: hidden;
  border: 1px solid #d6e0e5;
  border-radius: 8px;
  background: var(--admin-web-surface);
  box-shadow: 0 24px 70px rgba(28, 46, 58, .16);
}

.admin-web-login-brand {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 36px;
  color: #fff;
  background:
    linear-gradient(rgba(10, 36, 43, .70), rgba(10, 36, 43, .90)),
    url("/assets/top-trophy.jpg") center / cover no-repeat;
}

.admin-web-login-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  font-size: 19px;
  font-weight: 900;
}

.admin-web-login-kicker {
  margin-bottom: 5px;
  color: #8ee5d9;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-web-login-brand h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.admin-web-login-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 46px;
}

.admin-web-login-heading span,
.admin-web-dialog-head span {
  color: var(--admin-web-accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-web-login-heading h2,
.admin-web-dialog-head h3 {
  margin: 4px 0 24px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0;
}

.admin-web-login-form,
.admin-web-dialog {
  display: grid;
  gap: 16px;
}

.admin-web-login-form label,
.admin-web-dialog label {
  display: grid;
  gap: 7px;
  color: #41505d;
  font-size: 13px;
  font-weight: 700;
}

.admin-web-login-form input,
.admin-web-dialog input {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid #cbd7dd;
  border-radius: 6px;
  padding: 0 13px;
  color: var(--admin-web-ink);
  background: #fff;
  font: inherit;
  outline: none;
}

.admin-web-login-form input:focus,
.admin-web-dialog input:focus {
  border-color: var(--admin-web-accent);
  box-shadow: 0 0 0 3px rgba(8,127,140,.13);
}

.admin-web-password-field {
  position: relative;
}

.admin-web-password-field input {
  padding-right: 48px;
}

.admin-web-password-field button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 5px;
  color: #60717f;
  background: transparent;
  cursor: pointer;
}

.admin-web-primary-button,
.admin-web-secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-web-primary-button {
  color: #fff;
  background: var(--admin-web-accent);
}

.admin-web-primary-button:hover { background: var(--admin-web-accent-strong); }
.admin-web-primary-button:disabled { opacity: .62; cursor: wait; }
.admin-web-secondary-button { color: #34424d; background: #e7edf0; }

.admin-web-form-message {
  min-height: 19px;
  color: var(--admin-web-danger);
  font-size: 13px;
  font-weight: 700;
}

.admin-web-account {
  position: relative;
  margin-left: 4px;
}

.admin-web-account-trigger {
  min-width: 176px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(122,142,155,.24);
  border-radius: 7px;
  padding: 4px 10px 4px 5px;
  color: #293846;
  background: rgba(255,255,255,.88);
  cursor: pointer;
}

.admin-web-account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #fff;
  background: var(--admin-web-accent);
  font-weight: 900;
}

.admin-web-account-copy {
  min-width: 0;
  display: grid;
  flex: 1;
  text-align: left;
}

.admin-web-account-copy b,
.admin-web-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-web-account-copy b { font-size: 12px; }
.admin-web-account-copy small { color: #73818d; font-size: 10px; }

.admin-web-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 3000;
  width: 180px;
  display: none;
  padding: 6px;
  border: 1px solid var(--admin-web-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(29,44,54,.18);
}

.admin-web-account-menu.is-open { display: grid; }
.admin-web-account-menu button {
  border: 0;
  border-radius: 5px;
  padding: 10px;
  color: #31404d;
  background: transparent;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.admin-web-account-menu button:hover { background: #edf4f5; }
.admin-web-account-menu button:last-child { color: var(--admin-web-danger); }

.admin-web-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18,30,39,.58);
}

.admin-web-dialog {
  width: min(440px, 100%);
  box-sizing: border-box;
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 26px 75px rgba(12,25,34,.3);
}

.admin-web-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.admin-web-dialog-head h3 { margin-bottom: 6px; }
.admin-web-dialog-head button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 5px;
  color: #53616d;
  background: #edf1f3;
  font-size: 22px;
  cursor: pointer;
}

.admin-web-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

body.admin-web-portal .app-login-overlay { display: none !important; }

/* The portal HTML is only served after server-side authentication. Do not
   leave the admin workspace hidden while the Mini App bootstrap is pending. */
html body.admin-portal.admin-web-portal #admin_layout.admin-shell-pro {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.admin-web-portal[data-theme="dark"] .admin-web-account-trigger,
body.admin-web-portal[data-theme="dark"] .admin-web-account-menu {
  color: #e4edf3;
  border-color: rgba(148,163,184,.25);
  background: #17222e;
}
body.admin-web-portal[data-theme="dark"] .admin-web-account-copy small { color: #98a8b5; }
body.admin-web-portal[data-theme="dark"] .admin-web-account-menu button { color: #e4edf3; }
body.admin-web-portal[data-theme="dark"] .admin-web-account-menu button:hover { background: #223140; }
body.admin-web-portal[data-theme="dark"] .admin-web-account-menu button:last-child { color: #ff8792; }

@media (max-width: 760px) {
  body.admin-web-login-page { padding: 12px; }
  .admin-web-login-shell { min-height: 0; grid-template-columns: 1fr; }
  .admin-web-login-brand { min-height: 122px; align-items: center; padding: 24px; }
  .admin-web-login-brand h1 { font-size: 25px; }
  .admin-web-login-form-wrap { padding: 28px 22px 30px; }
  .admin-web-login-heading h2 { font-size: 24px; }
  .admin-web-account-trigger { min-width: 44px; width: 44px; padding: 5px; }
  .admin-web-account-copy,
  .admin-web-account-trigger > span:last-child { display: none; }
  .admin-web-account-menu { position: fixed; top: auto; right: 12px; bottom: 74px; }
}

@media (max-width: 420px) {
  .admin-web-login-brand { min-height: 96px; padding: 18px; }
  .admin-web-login-mark { width: 46px; height: 46px; }
  .admin-web-login-form-wrap { padding: 24px 18px; }
  .admin-web-dialog { padding: 19px; }
}
