:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --panel: rgba(255, 255, 255, 0.98);
  --text: #111111;
  --muted: #6b6b6b;
  --border: #000000;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-shell, .app-shell {
  width: min(820px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.04);
}
.login-shell { width: min(490px, 100%); }
.logo-wrap { display: flex; justify-content: center; margin: 2px 0 14px; }
.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.login-logo { width: min(160px, 100%); height: auto; }
.login-subtitle {
  margin: 10px 0 20px;
  text-align: center;
  color: #555;
  font-size: 1.28rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stack-md, .app-stack { display: grid; gap: 12px; }
.login-flow-stack { display: grid; gap: 12px; }
.auth-grid-row { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr) 170px; }
.login-input, .action-button, .primary-button {
  min-height: 54px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 1rem;
}
.login-input { padding: 0 18px; background: #fff; width: 100%; }
.password-input-wrap {
  position: relative;
  display: grid;
}
.password-input {
  padding-right: 84px;
}
.password-eye-button {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #555;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.password-eye-button:disabled {
  color: #aaa;
  cursor: not-allowed;
}
.action-button, .primary-button { cursor: pointer; background: #111; color: #fff; padding: 0 18px; }
.primary-button { width: 100%; }
.button-success {
  background: #0b7a32;
  border-color: #0b7a32;
  color: #fff;
}
.button-failure {
  background: #8b0000;
  border-color: #8b0000;
  color: #fff;
}
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button-neutral { background: #efefef; color: #111; border-color: var(--border); }
.button-danger { background: #b00020; color: #fff; border-color: #b00020; }
.help-button {
  width: auto;
  min-width: 140px;
  justify-self: start;
}
.header-button {
  width: auto;
  min-width: 120px;
}
.button-inactive { background: #efefef; color: #999; border-color: #ddd; cursor: not-allowed; }
.status-banner {
  margin: 0 0 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.98rem;
}
.status-banner-error { color: #b00020; }
.status-banner-success { color: #0b7a32; }
.reset-panel {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}
.build-label {
  margin: 10px 0 0;
  text-align: center;
  color: #999;
  font-size: 0.82rem;
}
.app-build-label {
  margin-top: 4px;
}
.hidden-form { display: none; }
.app-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 0.5px solid var(--border);
  border-radius: 22px;
  background: #fcfcfc;
}
.app-kicker {
  margin: 0;
  color: #555;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hr-admin-kicker {
  font-size: 2.88rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #222;
}
.tech-admin-kicker {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #222;
}
.app-title { margin: 0; font-size: 1.45rem; font-weight: 300; }
.app-copy { margin: 0; color: #6b6b6b; font-size: 0.9rem; line-height: 1.5; }
.app-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-grid-tight { align-items: stretch; }
.app-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-value { margin: 0; font-size: 2.5rem; font-weight: 300; }
.stat-panel,
.action-tile { min-height: 160px; align-content: space-between; }
.wide-panel { gap: 14px; }
.employee-form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-submit-wide { grid-column: 1 / -1; }
.form-submit-row { display: grid; gap: 12px; grid-template-columns: 170px minmax(0, 1fr); }
.directory-table-wrap { overflow-x: auto; border: 0.5px solid var(--border); border-radius: 22px; background: #fff; }
.directory-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.directory-table th, .directory-table td { padding: 12px 14px; border-bottom: 0.5px solid var(--border); text-align: left; }
.directory-table th { color: #555; font-size: 0.68rem; font-weight: 300; letter-spacing: 0.05em; text-transform: uppercase; }
.directory-table tbody tr:last-child td { border-bottom: 0; }
.filter-grid { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr 170px; }
.tech-admin-grid { align-items: stretch; }
.tech-admin-divider {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}
.smtp-settings-grid {
  display: grid;
  gap: 14px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.smtp-test-grid {
  display: grid;
  gap: 14px 12px;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
}
.policy-settings-grid {
  display: grid;
  gap: 14px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}
.field-stack {
  display: grid;
  gap: 8px;
}
.policy-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 0.95rem;
}
.policy-checkbox input {
  width: 18px;
  height: 18px;
}
.policy-textarea {
  min-height: 110px;
  padding: 14px 18px;
  resize: vertical;
}
.field-label {
  color: #555;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.smtp-action-row {
  display: flex;
  align-items: flex-end;
}
.smtp-action-row .primary-button {
  width: 100%;
}
.select-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #111 50%), linear-gradient(135deg, #111 50%, transparent 50%); background-position: calc(100% - 24px) calc(50% - 3px), calc(100% - 18px) calc(50% - 3px); background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 42px; }
.file-input { padding-top: 14px; }
.action-link { color: #111; text-decoration: underline; }
.info-list { display: grid; gap: 10px; }
.info-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: #555;
  font-size: 0.9rem;
}
.info-row strong { color: #111; font-weight: 400; }
.list-line { line-height: 1.45; }
.redirect-uri-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.secret-box {
  display: grid;
  gap: 4px;
}
.secret-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-all;
}
.secret-meta {
  color: #6b6b6b;
  font-size: 0.72rem;
  line-height: 1.4;
}
.redirect-uri-row form { margin: 0; }
.redirect-uri-add-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 88px;
  margin-top: 10px;
}
.compact-input {
  min-height: 42px;
  border-radius: 14px;
  font-size: 0.88rem;
}
.compact-button {
  min-height: 42px;
  border-radius: 14px;
  font-size: 0.88rem;
  padding: 0 12px;
}
.audit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
}
.audit-badge-high { color: #b00020; background: #fff4f6; }
.audit-badge-medium { color: #8a5200; background: #fff8ec; }
.audit-badge-low { color: #0b7a32; background: #f3fff7; }
.audit-badge-neutral { color: #555; background: #f5f5f5; }
.directory-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.directory-actions form { margin: 0; }
.directory-actions .action-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.action-link-danger { color: #b00020; }

@media (max-width: 900px) {
  .app-grid,
  .app-grid-four,
  .two-col-grid,
  .filter-grid,
  .auth-grid-row,
  .employee-form-grid,
  .smtp-settings-grid,
  .smtp-test-grid,
  .policy-settings-grid {
    grid-template-columns: 1fr;
  }
  .info-row { grid-template-columns: 1fr; }
  .form-submit-row { grid-template-columns: 1fr; }
  .form-submit-wide { grid-column: auto; }
  .redirect-uri-row,
  .redirect-uri-add-form { grid-template-columns: 1fr; display: grid; }
}
