:root {
  --auth-green: #25a817;
  --auth-green-hover: #1f9414;
  --auth-border: #dfe3e8;
  --auth-text: #30343b;
  --auth-muted: #8a9199;
  --auth-danger: #e64b4b;
}

html.app-auth-pending body {
  visibility: hidden;
}

html.auth-guest .global-header,
html.auth-guest .app-shell,
html.auth-admin .global-header,
html.auth-admin .app-shell {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  box-sizing: border-box;
  background: #f4f6f8;
  color: var(--auth-text);
}

.auth-card {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid #e8ebee;
  border-radius: 8px;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 14px 38px rgba(24, 34, 45, 0.09);
}

.auth-card-body {
  padding: 25px 34px 24px;
}

.auth-card-head {
  margin-bottom: 18px;
  text-align: center;
}

.auth-card-head h1 {
  margin: 0;
  color: #3d4249;
  font-size: 21px;
  font-weight: 600;
  line-height: 30px;
}

.auth-card-head p {
  margin: 8px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 20px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 5px;
}

.auth-field > span {
  color: #454950;
  font-size: 14px;
  line-height: 20px;
}

.auth-input-wrap {
  height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input-wrap:focus-within {
  border-color: var(--auth-green);
  box-shadow: 0 0 0 2px rgba(37, 168, 23, 0.1);
}

.auth-input-wrap input {
  min-width: 0;
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  box-sizing: border-box;
  color: var(--auth-text);
  background: transparent;
  font-size: 14px;
}

.auth-input-wrap input::placeholder {
  color: #b8bdc3;
}

.auth-password-toggle {
  position: relative;
  width: 40px;
  height: 38px;
  flex: 0 0 40px;
  border: 0;
  color: #89919a;
  background: transparent;
  cursor: pointer;
}

.auth-password-toggle::before {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 20px;
  height: 20px;
  background: url("./assets/icons/survey-lucide/eye.svg?v=auth-eye-3") center / 20px 20px no-repeat;
  content: "";
  transform: translate(-50%, -50%);
}

.auth-password-toggle.is-hidden::before {
  background-image: url("./assets/icons/survey-lucide/eye-off.svg?v=auth-eye-3");
}

.auth-password-toggle:hover {
  color: #59616a;
  background-color: #f5f7f8;
}

.auth-error {
  min-height: 18px;
  margin: -8px 0 0;
  color: var(--auth-danger);
  font-size: 12px;
  line-height: 18px;
}

.auth-error:empty {
  display: none;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  color: #666c73;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  user-select: none;
}

.auth-remember-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--auth-green);
  cursor: pointer;
}

.auth-submit {
  height: 40px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--auth-green);
  font-size: 15px;
  cursor: pointer;
}

.auth-submit:hover {
  background: var(--auth-green-hover);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #f0f1f3;
}

.auth-links button {
  padding: 0;
  border: 0;
  color: var(--auth-green);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.auth-toast {
  min-width: 180px;
  max-width: min(420px, calc(100vw - 32px));
  position: fixed;
  z-index: 13000;
  top: 22px;
  left: 50%;
  padding: 10px 16px;
  transform: translateX(-50%);
  border: 1px solid #cfe8ca;
  border-radius: 4px;
  color: #246b1b;
  background: #f1faef;
  box-shadow: 0 8px 22px rgba(30, 45, 55, 0.12);
  text-align: center;
  font-size: 13px;
}

.auth-toast.error {
  border-color: #f2caca;
  color: #b72e2e;
  background: #fff4f4;
}

.global-tools {
  position: relative;
}

.auth-header-logout {
  height: 28px;
  margin: 0 8px 0 7px;
  padding: 0 2px;
  border: 0;
  color: #666d75;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.auth-header-logout:hover {
  color: #219516;
}

.admin-app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  color: var(--auth-text);
  background: #f3f5f7;
}

.admin-header {
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid #e4e7eb;
  background: #fff;
}

.admin-brand {
  font-size: 17px;
  font-weight: 600;
}

.admin-header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #656b73;
  font-size: 13px;
}

.admin-header-tools button {
  height: 30px;
  padding: 0 13px;
  border: 1px solid #d9dde2;
  border-radius: 4px;
  color: #4f555c;
  background: #fff;
  cursor: pointer;
}

.admin-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
}

.admin-sidebar {
  padding: 16px 10px;
  background: #202225;
}

.admin-menu-item {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  color: #c9cdd2;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
}

.admin-menu-item + .admin-menu-item {
  margin-top: 4px;
}

.admin-menu-item:hover {
  color: #fff;
  background: #303338;
}

.admin-menu-item.active {
  color: #fff;
  background: #269f1a;
}

.admin-main {
  min-width: 0;
  padding: 18px 22px 24px;
  overflow: auto;
}

.admin-page-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.admin-page-head h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.admin-page-head span {
  margin-left: 10px;
  color: #8a9199;
  font-size: 13px;
}

.admin-panel {
  border: 1px solid #e0e4e8;
  background: #fff;
}

.admin-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e7eaed;
  box-sizing: border-box;
}

.admin-search-control {
  width: 260px;
}

.admin-status-select {
  width: 120px;
}

.admin-add-button {
  height: 34px;
  margin-left: auto;
  padding: 0 15px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--auth-green);
  cursor: pointer;
}

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

.admin-account-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.admin-account-table th,
.admin-account-table td {
  height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid #eceff1;
  box-sizing: border-box;
  text-align: left;
  vertical-align: middle;
}

.admin-account-table th {
  height: 42px;
  color: #555b63;
  background: #f7f8f9;
  font-weight: 600;
}

.admin-account-table tr:last-child td {
  border-bottom: 0;
}

.admin-account-table .account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-account-table .account-name strong,
.admin-account-table .account-name > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.admin-account-table .account-name small {
  color: #9aa0a6;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #299d20;
}

.admin-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.admin-status.disabled {
  color: var(--auth-danger);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.admin-actions button {
  padding: 0;
  border: 0;
  color: #269f1a;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.admin-actions button.danger {
  color: #858c94;
}

.admin-actions button.danger:hover:not(:disabled) {
  color: #555d66;
}

.admin-actions button:disabled {
  color: #b4b9bf;
  cursor: not-allowed;
}

.admin-empty {
  padding: 72px 20px;
  color: #92989f;
  text-align: center;
}

.admin-modal-shell {
  position: fixed;
  z-index: 12000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.38);
}

.admin-modal {
  width: min(480px, 100%);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.admin-modal header {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid #e6e8eb;
}

.admin-modal header strong {
  font-size: 15px;
}

.admin-modal header button {
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 0;
  color: #8d939a;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.admin-modal form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-modal label {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.admin-modal input,
.admin-modal select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9dde2;
  border-radius: 4px;
  box-sizing: border-box;
  outline: 0;
}

.admin-modal .auth-input-wrap {
  width: 100%;
  height: 34px;
}

.admin-modal .auth-input-wrap input {
  height: 32px;
  border: 0;
}

.admin-modal .auth-password-toggle {
  width: 34px;
  height: 32px;
  flex-basis: 34px;
}

.admin-modal .auth-password-toggle::before {
  width: 17px;
  height: 17px;
}

.admin-modal-error {
  min-height: 18px;
  margin: 0 0 -4px 92px;
  color: var(--auth-danger);
  font-size: 12px;
}

.admin-modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #e6e8eb;
}

.admin-modal footer button {
  height: 34px;
  min-width: 70px;
  padding: 0 15px;
  border: 1px solid #d9dde2;
  border-radius: 4px;
  color: #4f555c;
  background: #fff;
  cursor: pointer;
}

.admin-modal footer button.primary {
  border-color: var(--auth-green);
  color: #fff;
  background: var(--auth-green);
}

@media (max-width: 760px) {
  .auth-card-body { padding: 23px 22px 24px; }
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar { padding: 8px 12px; }
  .admin-menu-item { width: 140px; }
  .admin-main { padding: 14px 12px; }
  .admin-toolbar { flex-wrap: wrap; }
  .admin-search-control { width: min(100%, 240px); }
  .admin-add-button { margin-left: 0; }
}
