.center-header .site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 6px;
}

.center-header .site-nav > div:not(#account-slot),
.center-header .site-nav > div:not(#account-slot) > div {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  margin: 0 !important;
}

.center-header .site-nav a.ui.button {
  margin: 0 !important;
  padding: 0.42em 0.85em !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: 0.02em;
  border-radius: 4px !important;
  white-space: nowrap;
  box-shadow: none !important;
}

#account-slot {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  margin-left: 4px;
}

#account-slot .auth-btn,
#account-slot .account-trigger {
  height: 24px;
  min-height: 0;
  padding: 0 12px;
  font-size: 12px;
  line-height: 24px;
  box-shadow: none;
}

#account-slot .account-trigger {
  padding: 0 10px 0 3px;
  gap: 6px;
}

#account-slot .account-avatar {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

@media print {
  #account-slot {
    display: none !important;
  }
}

.account-chip,
.account-menu button,
.auth-btn {
  font-family: "Segoe UI", Roboto, sans-serif;
}

.account-chip {
  position: relative;
  display: inline-block;
}

.account-trigger,
.auth-btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 8px 12px 8px 8px;
  background: #fff;
  color: #16325c;
  border: 1px solid #d5e0ee;
  box-shadow: 0 6px 16px rgba(22, 50, 92, 0.06);
}

.account-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1667af;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.account-menu[hidden] {
  display: none !important;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e4ebf4;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(18, 42, 84, 0.14);
  text-align: left;
}

.account-menu button,
.account-menu a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #16325c;
  text-align: left;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

.account-menu button:hover,
.account-menu a:hover {
  background: #f3f7fc;
}

.auth-btn {
  padding: 8px 16px;
  background: #1667af;
  color: #fff;
}

.auth-btn.secondary {
  background: #eef3f9;
  color: #16325c;
}

.auth-btn.danger {
  background: #fff1f0;
  color: #c4321a;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 27, 48, 0.46);
}

.auth-dialog {
  width: min(440px, 100%);
  padding: 28px 28px 22px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(12, 24, 48, 0.28);
  text-align: left;
}

.auth-dialog h2 {
  margin: 0 0 6px;
  color: #16325c;
  font-size: 22px;
}

.auth-dialog p {
  margin: 0 0 18px;
  color: #5d6b7e;
  font-size: 14px;
  line-height: 1.5;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #31445f;
  font-size: 13px;
  font-weight: 650;
}

.auth-field input,
.admin-field input,
.admin-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d5e0ee;
  border-radius: 12px;
  background: #f8fafc;
  color: #16325c;
  font-size: 15px;
  font-weight: 500;
}

.admin-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
}

.auth-field input:focus,
.admin-field input:focus,
.admin-field select:focus {
  outline: 2px solid rgba(22, 103, 175, 0.25);
  border-color: #1667af;
  background: #fff;
}

.auth-error {
  margin: 0 0 12px;
  color: #c4321a;
  font-size: 13px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.admin-wrap {
  padding: 8px 0 40px;
  text-align: left;
  color: #1b2330;
  font-family: "Segoe UI", Roboto, sans-serif;
}

.admin-hero,
.admin-card {
  background: #fff;
  border: 1px solid #e4ebf4;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(18, 42, 84, 0.05);
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 22px 24px;
}

.admin-hero h1 {
  margin: 0 0 6px;
  color: #16325c;
  font-size: 26px;
}

.admin-hero p,
.admin-note {
  margin: 0;
  color: #5d6b7e;
  line-height: 1.55;
}

.admin-card {
  margin-bottom: 16px;
  padding: 22px 24px;
}

.admin-card h2 {
  margin: 0 0 14px;
  color: #16325c;
  font-size: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr;
  gap: 12px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #31445f;
  font-size: 13px;
  font-weight: 650;
}

.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 14px;
}

.perm-grid label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #e4ebf4;
  border-radius: 12px;
  background: #f8fafc;
  color: #16325c;
  font-size: 14px;
  font-weight: 600;
}

.perm-grid small {
  display: block;
  color: #6b7c90;
  font-weight: 500;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.user-table th {
  color: #6b7c90;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-name {
  display: block;
  color: #16325c;
  font-weight: 700;
}

.user-name span,
.muted {
  color: #6b7c90;
  font-weight: 500;
}

.badge {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f2fb;
  color: #1667af;
  font-size: 12px;
  font-weight: 700;
}

.badge.off {
  background: #f4f6f8;
  color: #8b98a8;
}

.badge.admin {
  background: #fff4e8;
  color: #b8610a;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.row-actions button {
  border: 0;
  border-radius: 9px;
  padding: 6px 10px;
  background: #eef3f9;
  color: #16325c;
  font-weight: 700;
  cursor: pointer;
}

.row-actions button.danger {
  background: #fff1f0;
  color: #c4321a;
}

.admin-lock {
  padding: 48px 20px;
  text-align: center;
}

.admin-lock h1 {
  margin-bottom: 8px;
  color: #16325c;
}

@media (max-width: 900px) {
  .admin-grid,
  .perm-grid,
  .admin-hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .user-table {
    display: block;
    overflow-x: auto;
  }
}
