:root {
  color-scheme: dark;
  --bg: #091018;
  --bg-soft: #0d1620;
  --panel: rgba(18, 27, 37, 0.96);
  --panel-border: #2a394a;
  --ink: #eef4fb;
  --muted: #a6b7ca;
  --accent: #1d6ec8;
  --accent-hover: #165ba7;
  --chip: #172637;
  --shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(46, 116, 201, 0.22), transparent 28%),
    linear-gradient(180deg, #0c141d 0%, #081018 100%);
}

body.signed-out {
  display: grid;
  place-items: center;
  padding: clamp(112px, 18vh, 144px) 24px 24px;
  background:
    linear-gradient(180deg, rgba(7, 12, 18, 0.44), rgba(8, 16, 24, 0.7)),
    url('./assets/login-bg.svg?v=20260627top') center top / cover no-repeat,
    #091018;
}

body.has-test-banner {
  padding-top: 48px;
}

body.signed-out.has-test-banner {
  padding: clamp(112px, 18vh, 144px) 24px 24px;
}

.test-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px;
  background: #8a1f2d;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.test-banner-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-banner-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.test-banner-btn[data-enabled="false"] {
  background: rgba(0, 0, 0, 0.24);
  border-color: rgba(255, 255, 255, 0.22);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

body.signed-out .page-shell {
  width: min(480px, 100%);
  padding: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  text-align: center;
}

body.signed-out .hero {
  display: none;
}

body.signed-out .content-shell {
  gap: 14px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fa8d6;
}

.hero h1,
.panel-head h2,
#userName {
  margin: 0;
  line-height: 1;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
}

.hero-title-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.hero-app-icon-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
}

.hero-app-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
}

.hero-copy,
.muted-copy,
.empty-state {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.5;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.content-shell {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.email-log-card {
  width: min(920px, calc(100vw - 32px));
}

.change-log-card {
  width: min(900px, calc(100vw - 32px));
}

.change-log-list {
  max-height: 60vh;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.change-log-entry {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(10, 17, 24, 0.72);
}

.change-log-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.change-log-time {
  font-size: 12px;
  color: #8fa2bc;
  white-space: nowrap;
}

.change-log-summary {
  margin-top: 6px;
  color: #e8eef8;
  font-weight: 600;
}

.change-log-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #8fa2bc;
}

.email-log-list {
  max-height: 60vh;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.email-log-entry {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(10, 17, 24, 0.72);
}

.email-log-entry.is-open {
  background: rgba(14, 24, 35, 0.9);
}

.email-log-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 6px;
}

.email-log-pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #172637;
  color: #8fc4ff;
}

.email-log-pill[data-status="suppressed"] {
  background: rgba(138, 31, 45, 0.18);
  color: #ffb3bf;
}

.email-log-pill[data-status="sent"] {
  background: rgba(23, 110, 200, 0.18);
  color: #9fd1ff;
}

.email-log-meta,
.email-log-reason {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.email-log-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.email-log-toggle {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(23, 110, 200, 0.12);
  color: #cfe5ff;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.email-log-toggle:hover {
  background: rgba(23, 110, 200, 0.2);
}

.email-log-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(143, 196, 255, 0.12);
}

.email-log-details.is-open {
  display: block;
}

.email-log-details pre {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: #cfe0f2;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.panel-head {
  margin-bottom: 16px;
  text-align: center;
}

.auth-panel,
.warning-panel {
  max-width: 760px;
}

body.signed-out .auth-panel {
  width: min(480px, 100%);
  padding: 28px;
  border-radius: 18px;
  text-align: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 12px;
}

.brand-title {
  font-size: clamp(22px, 4vw, 26px);
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.login-title {
  margin: 0 0 8px;
  font-size: 24px;
  text-align: center;
}

.login-copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.muted {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.session-panel {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  cursor: pointer;
}

body.has-test-banner .session-panel {
  top: 60px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1c2330, #121821);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--panel-border);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #eef4fb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.session-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.session-meta .section-label {
  display: none;
}

.session-meta h2 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.session-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.session-meta .muted-copy {
  margin: 2px 0 0;
  font-size: 12px;
  max-width: none;
}

.primary-btn,
.ghost-btn,
.app-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.primary-btn,
.ghost-btn {
  appearance: none;
  border-radius: 12px;
  padding: 14px 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.primary-btn {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover {
  background: var(--accent-hover);
}

.ghost-btn {
  border: 1px solid var(--panel-border);
  background: rgba(21, 32, 43, 0.9);
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: #3d6fa7;
  background: rgba(29, 110, 200, 0.14);
}

.app-card:hover {
  transform: translateY(-2px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  background: #16304d;
  color: #8ec3ff;
  text-transform: uppercase;
}

.user-menu {
  position: fixed;
  left: 16px;
  top: 70px;
  z-index: 31;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
}

body.has-test-banner .user-menu {
  top: 118px;
}

.user-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.user-menu button:hover {
  background: rgba(29, 110, 200, 0.14);
}

.form-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #7e3743;
  background: #2a1418;
  color: #ffd6dc;
  font-size: 14px;
  text-align: center;
}

.form-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}

.form-status[data-tone="success"] {
  border: 1px solid #24553b;
  background: #13271d;
  color: #9fe2ba;
}

.form-status[data-tone="error"] {
  border: 1px solid #7e3743;
  background: #2a1418;
  color: #ffd6dc;
}

.form-status[data-tone="info"] {
  border: 1px solid #274462;
  background: #102031;
  color: #b9d9fb;
}

.warning-panel {
  border-color: #5b4a22;
  background: #221b12;
  color: #ffd786;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

#appGrid {
  display: grid;
  gap: 22px;
}

.launcher-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.environment-toggle {
  display: flex;
  width: max-content;
  gap: 6px;
  align-items: center;
  padding: 6px;
  margin: 0 auto 18px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(12, 19, 28, 0.9);
  justify-content: center;
}

.launcher-toggles .environment-toggle {
  margin: 0;
}

.environment-toggle-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.environment-toggle-btn:hover:not(:disabled) {
  color: var(--ink);
}

.environment-toggle-btn.active {
  background: rgba(29, 110, 200, 0.18);
  border-color: #3d6fa7;
  color: #eef4fb;
}

.environment-toggle-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-group {
  display: grid;
  gap: 14px;
}

.app-group-head {
  text-align: center;
}

.app-group-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ec3ff;
}

.feedback-actions {
  display: flex;
  justify-content: center;
}

.admin-sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(140, 177, 219, 0.22);
  border-radius: var(--radius-md);
  background: rgba(17, 29, 42, 0.72);
}

.admin-sync-copy {
  display: grid;
  gap: 4px;
}

.admin-sync-copy strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-sync-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-sync-btn {
  white-space: nowrap;
}

.admin-sync-meta {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.admin-tools-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(140, 177, 219, 0.22);
  border-radius: var(--radius-md);
  background: rgba(17, 29, 42, 0.72);
}

.admin-tools-copy {
  display: grid;
  gap: 4px;
}

.admin-tools-copy strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-tools-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-task-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-task-list {
  display: grid;
  gap: 10px;
}

.admin-task-entry {
  padding: 10px 12px;
  border: 1px solid rgba(140, 177, 219, 0.18);
  border-radius: 12px;
  background: rgba(11, 19, 31, 0.66);
}

.admin-task-entry.is-unhealthy {
  border-color: rgba(208, 125, 76, 0.45);
}

.admin-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.admin-task-meta,
.admin-task-issues,
.admin-task-empty {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.admin-task-issues {
  color: #ffcfaa;
}

.admin-task-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-task-pill.healthy {
  background: #193a28;
  color: #9fe2ba;
}

.admin-task-pill.problem {
  background: #4d2916;
  color: #ffbf8e;
}

.admin-repair-controls {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px 12px;
  align-items: center;
  justify-items: stretch;
  justify-content: end;
  margin-left: auto;
  width: fit-content;
  max-width: 100%;
}

.admin-repair-controls .admin-sync-btn {
  width: 220px;
  justify-self: end;
}

.admin-repair-select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(10, 17, 25, 0.92);
  color: var(--ink);
  font: inherit;
}

.admin-tools-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(140, 177, 219, 0.22);
  border-radius: var(--radius-md);
  background: rgba(17, 29, 42, 0.72);
}

.admin-tools-copy {
  display: grid;
  gap: 4px;
}

.admin-tools-copy strong {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-tools-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.feedback-launchers {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.feedback-launch-btn {
  min-width: 220px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.feedback-form {
  text-align: center;
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.feedback-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feedback-input,
.feedback-textarea {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(10, 17, 25, 0.92);
  color: var(--ink);
  font: inherit;
  padding: 14px 16px;
}

.feedback-select {
  appearance: none;
}

.feedback-input::placeholder,
.feedback-textarea::placeholder {
  color: #7890a8;
}

.feedback-textarea {
  min-height: 140px;
  resize: vertical;
}

.feedback-btn {
  min-width: 220px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.feedback-field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.feedback-field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.feedback-input[type="date"],
.feedback-select {
  color-scheme: dark;
}

.feedback-attach {
  display: grid;
  gap: 12px;
  text-align: left;
}

.feedback-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.feedback-attach-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-choose-btn {
  min-width: 0;
  padding: 10px 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

.feedback-file-input:focus-visible + .feedback-attach-controls .feedback-choose-btn,
.feedback-choose-btn:focus-visible {
  border-color: #3d6fa7;
  outline: 2px solid rgba(29, 110, 200, 0.55);
  outline-offset: 2px;
}

.feedback-attach-hint {
  color: var(--muted);
  font-size: 13px;
}

.feedback-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-attach-list:empty {
  display: none;
}

.feedback-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(10, 17, 25, 0.92);
}

.feedback-attach-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  flex: none;
}

.feedback-attach-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--chip);
  color: #8ec3ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: none;
}

.feedback-attach-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.feedback-attach-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}

.feedback-attach-size {
  font-size: 12px;
  color: var(--muted);
}

.feedback-attach-remove {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(21, 32, 43, 0.9);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.feedback-attach-remove:hover {
  border-color: #7e3743;
  background: rgba(126, 55, 67, 0.2);
  color: #ffd6dc;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.operator-docs-card {
  width: min(860px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
}

.access-matrix-card {
  width: min(1080px, 100%);
  max-height: min(88vh, 960px);
  display: flex;
  flex-direction: column;
}

.operator-docs-body {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  padding-right: 4px;
}

.access-matrix-body {
  overflow-y: auto;
  padding-right: 4px;
}

.operator-docs-section {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(127, 168, 214, 0.16);
  background: rgba(10, 18, 28, 0.32);
}

.operator-docs-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.operator-docs-section p,
.operator-docs-section li {
  color: var(--muted);
  line-height: 1.5;
}

.operator-docs-section ul,
.operator-docs-section ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.operator-docs-section pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(127, 168, 214, 0.16);
  background: rgba(6, 11, 18, 0.72);
}

.operator-docs-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.modal-head {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  text-align: center;
}

.modal-head > div {
  width: 100%;
}

.modal-close {
  position: absolute;
  right: 0;
  top: 0;
  border: 1px solid var(--panel-border);
  background: rgba(21, 32, 43, 0.9);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.modal-close:hover {
  border-color: #3d6fa7;
  background: rgba(29, 110, 200, 0.14);
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 18px 14px;
  min-height: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(24, 35, 47, 0.98), rgba(17, 25, 35, 0.98)),
    linear-gradient(135deg, rgba(46, 116, 201, 0.12), transparent);
}

.app-card:hover {
  border-color: #3d6fa7;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.app-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: linear-gradient(135deg, #18334d, #1d6ec8);
  color: #f5f9ff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.app-icon-wrap {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  position: relative;
}

.app-status-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(8, 16, 24, 0.92);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  z-index: 3;
}

.app-status-inline {
  position: static;
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -1px;
  box-shadow: none;
}

.app-status-green {
  background: #33c46d;
}

.app-status-yellow {
  background: #f1c94a;
}

.app-status-orange {
  background: #f48a32;
}

.app-status-red {
  background: #dd4c5c;
}

.app-status-gray {
  background: #7f8fa4;
}

.app-icon-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(10, 16, 24, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

/* Per-app TEST email controls: each app is its icon with an on/off button on top. */
.app-email-control-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 18px;
  margin-top: 14px;
}

.app-email-control-list[data-master-off="true"] {
  opacity: 0.55;
}

.app-email-tile {
  position: relative;
  width: 76px;
}

.app-email-tile-icon {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
}

.app-email-tile-icon .app-icon-image,
.app-email-tile-icon .app-icon {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  font-size: 1rem;
}

.app-email-toggle {
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  min-width: 46px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 2px solid rgba(8, 16, 24, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  z-index: 4;
}

.app-email-toggle--on {
  background: #2fae63;
}

.app-email-toggle--off {
  background: #7f8fa4;
}

.app-email-toggle:hover {
  filter: brightness(1.08);
}

.app-email-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}

.app-test-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #8a1f2d;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.app-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.admin-matrix {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #15202b;
  align-items: start;
}

.admin-row-heading {
  text-align: center;
}

.admin-row-heading strong,
.admin-row-heading span {
  display: block;
}

.admin-row-heading strong {
  margin-bottom: 6px;
}

.admin-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.admin-row strong,
.admin-row span {
  display: block;
}

.admin-row strong {
  margin-bottom: 4px;
}

.admin-row span {
  color: var(--muted);
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: normal;
}

.admin-row > :last-child {
  text-align: left;
}

.admin-disclosure {
  border: 1px solid rgba(127, 168, 214, 0.16);
  border-radius: 10px;
  background: rgba(10, 18, 28, 0.32);
  padding: 0;
}

.admin-disclosure-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.admin-disclosure-toggle strong,
.admin-disclosure-toggle span {
  margin: 0;
}

.admin-disclosure-toggle span {
  font-size: 12px;
  white-space: nowrap;
}

.admin-disclosure-body {
  padding: 0 12px 12px;
}

.admin-disclosure-body[hidden] {
  display: none;
}

.admin-disclosure-body span,
.admin-row-meta > span {
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero,
  .admin-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .admin-row-grid {
    grid-template-columns: 1fr;
  }

  .feedback-row {
    grid-template-columns: 1fr;
  }

  .modal-head {
  text-align: center;
    flex-direction: column;
  }

  .admin-row > :last-child {
    text-align: left;
  }

  .session-panel {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .hero-mark {
    width: 96px;
    height: 96px;
    border-radius: 28px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }
}


/* Standard estate sign-in button — Delivery Planner's blue Microsoft button (dark-theme friendly). */
.btn-ms { display:inline-flex; align-items:center; gap:10px; justify-content:center; width:100%; padding:13px 18px; border:0; border-radius:10px; background:#1d6ec8; color:#fff; font-size:15px; font-weight:700; cursor:pointer; }
.btn-ms:hover { background:#165ba7; }
.btn-ms svg { width:18px; height:18px; }
