/* Personal ERP — ERP-UI6: Settings, Notifications, Security, Login & 2FA.
   UI/UX styles only. Do not alter submitted fields, security, settings or event handlers.
   Loaded only on the two settings endpoints and the standalone auth templates. */

/* Scoped design vocabulary. Auth has its own layout and does not inherit the ERP shell. */
body.erp-helios-theme .erp-main .erp-page-content {
  --u6-ink: #1c2b22;
  --u6-text: #55655b;
  --u6-muted: #718177;
  --u6-line: #dde7df;
  --u6-green: #28513a;
  --u6-green-dark: #1e422e;
  --u6-green-soft: #eef6f0;
  --u6-gold: #957544;
  --u6-shadow: 0 8px 28px rgba(24, 46, 32, .055);
  color: var(--u6-ink);
  min-width: 0;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid,
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  min-width: 0;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid > .span-full,
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid > .span-full {
  grid-column: 1 / -1;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid > :where(.panel, details.panel),
body.erp-helios-theme .erp-main .erp-page-content > details.panel {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--u6-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--u6-shadow);
}
body.erp-helios-theme .erp-main .erp-page-content > details.panel { margin-top: 18px; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .panel-header {
  min-width: 0;
  padding: 0 0 14px;
  margin: 0 0 16px;
  border-bottom: 1px solid #e9efea;
  background: transparent;
  gap: 12px;
  flex-wrap: wrap;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .panel-header h3,
body.erp-helios-theme .erp-main .erp-page-content > details.panel .panel-header h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.02rem;
  line-height: 1.4;
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--u6-ink);
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .panel-header h3 > i,
body.erp-helios-theme .erp-main .erp-page-content > details.panel .panel-header h3 > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid #dfebdf;
  border-radius: 10px;
  color: var(--u6-green);
  background: var(--u6-green-soft);
  font-size: .9rem;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid :where(.panel-header p, .security-note, .section-note, .field-hint),
body.erp-helios-theme .erp-main .erp-page-content > details.panel .field-hint {
  color: var(--u6-text);
  line-height: 1.6;
  font-weight: 450;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #dbe5dc;
  border-radius: 10px;
  background: #fff;
  color: var(--u6-ink);
  box-shadow: 0 1px 2px rgba(12, 28, 18, .025);
  min-height: 42px;
  padding: 10px 12px;
  font-family: Inter, system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid textarea { min-height: 96px; resize: vertical; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  border-color: #56936a;
  outline: 2px solid rgba(66, 124, 80, .15);
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(65, 114, 79, .09);
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid :where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--u6-green);
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid :where(label, .form-section-heading) { color: var(--u6-ink); }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .form-grid { min-width: 0; gap: 14px; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .form-grid > * { min-width: 0; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .btn.primary {
  background: var(--u6-green);
  border-color: var(--u6-green);
  color: #fff;
  box-shadow: 0 4px 11px rgba(35, 73, 48, .13);
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .btn.primary:hover { background: var(--u6-green-dark); }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .btn.soft {
  background: #f2f6f2;
  border: 1px solid #e0eae1;
  color: var(--u6-green);
  box-shadow: none;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .btn.danger {
  border: 1px solid #f0d0cb;
  background: #b54e43;
  color: #fff;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid :where(.btn, .link-button) { border-radius: 10px; min-height: 38px; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .badge {
  border: 1px solid #dfe9e0;
  border-radius: 999px;
  background: #f4f7f4;
  color: #516657;
  box-shadow: none;
  font-size: .72rem;
  font-weight: 700;
  padding: 5px 9px;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .badge.success,
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .badge.warning { border-color: #d7e9d9; background: #ebf6ee; color: #2b7041; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .badge.danger { border-color: #f1d8d5; background: #fff1ef; color: #a34339; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .badge.muted { border-color: #e5eae6; background: #f5f6f5; color: #6b766d; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e4ece5;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid table { min-width: 730px; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid thead th {
  background: #f5f8f5;
  color: #5d6d60;
  font-size: .73rem;
  font-weight: 750;
  text-transform: none;
  white-space: nowrap;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid tbody td { border-color: #edf1ee; color: #45564a; vertical-align: middle; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid tbody tr:hover { background: #fafcf9; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-summary > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e3ebe4;
  border-radius: 12px;
  background: #f7faf7;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-summary > div span {
  display: block;
  color: var(--u6-muted);
  font-size: .76rem;
  margin-bottom: 5px;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-summary > div strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--u6-ink);
  font-size: .93rem;
  font-weight: 750;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-note {
  padding: 11px 13px;
  margin: 16px 0 0;
  border: 1px solid #e6e9dc;
  background: #fafbf6;
  border-radius: 10px;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 260px;
  padding: 14px;
  border: 1px solid #dbe7de;
  background: #fff;
  border-radius: 12px;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .qr-box img { display: block; width: 100%; height: auto; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .secret-box {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid #e3e9df;
  background: #f8faf7;
  border-radius: 12px;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .secret-box code {
  max-width: 100%;
  color: #214b34;
  overflow-wrap: anywhere;
  white-space: normal;
}
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-form { max-width: 620px; }
body.erp-helios-theme .erp-main .erp-page-content .settings-grid .danger-form { border: 1px solid #f0d5d0; background: #fff9f8; padding: 16px; border-radius: 12px; }

/* Native collapsibles stay native: no scripting or changed form submission semantics. */
body.erp-helios-theme .erp-main .erp-page-content .settings-grid details.collapsible-panel,
body.erp-helios-theme .erp-main .erp-page-content > details.collapsible-panel { overflow: visible; }
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-panel > summary.collapsible-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 2px;
  min-width: 0;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-panel > summary::-webkit-details-marker { display: none; }
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-panel[open] > summary.collapsible-summary {
  padding-bottom: 14px;
  border-bottom: 1px solid #e7efe7;
  margin-bottom: 16px;
}
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-panel > summary:focus-visible,
body.erp-helios-theme .erp-main .erp-page-content details.template-card > summary:focus-visible {
  outline: 2px solid #548863;
  outline-offset: 5px;
}
body.erp-helios-theme .erp-main .erp-page-content .show-hide-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #e2e9e3;
  border-radius: 8px;
  background: #f4f8f4;
  color: #41634a;
  font-size: .8rem;
}
/* The legacy stylesheet uses English “Show/Hide” labels. Use compact, accessible
   visual symbols while the native summary remains keyboard-operable. */
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-panel:not([open]) > summary .show-hide-label::before,
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-subpanel:not([open]) > summary .show-hide-label::before { content: "+"; font-size: 1rem; font-weight: 700; }
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-panel[open] > summary .show-hide-label::before,
body.erp-helios-theme .erp-main .erp-page-content details.collapsible-subpanel[open] > summary .show-hide-label::before { content: "−"; font-size: 1rem; font-weight: 700; }
body.erp-helios-theme .erp-main .erp-page-content .delivery-groups,
body.erp-helios-theme .erp-main .erp-page-content .notification-template-list { display: grid; gap: 12px; }
body.erp-helios-theme .erp-main .erp-page-content .delivery-group,
body.erp-helios-theme .erp-main .erp-page-content .template-card {
  min-width: 0;
  border: 1px solid #e1eae2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}
body.erp-helios-theme .erp-main .erp-page-content .delivery-group > summary,
body.erp-helios-theme .erp-main .erp-page-content .template-card > summary {
  padding: 13px 15px;
  background: #f8faf8;
  color: #22362a;
  cursor: pointer;
  line-height: 1.5;
}
body.erp-helios-theme .erp-main .erp-page-content .delivery-group[open] > summary,
body.erp-helios-theme .erp-main .erp-page-content .template-card[open] > summary { border-bottom: 1px solid #e3ebe4; }
body.erp-helios-theme .erp-main .erp-page-content .delivery-list { padding: 0 10px; }
body.erp-helios-theme .erp-main .erp-page-content .delivery-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 6px;
  min-width: 0;
  border-bottom: 1px solid #edf2ed;
  background: #fff;
}
body.erp-helios-theme .erp-main .erp-page-content .delivery-row:hover { background: #fbfdfb; }
body.erp-helios-theme .erp-main .erp-page-content .delivery-row span { flex: 1; min-width: 0; }
body.erp-helios-theme .erp-main .erp-page-content .delivery-row small { color: var(--u6-muted); overflow-wrap: anywhere; }
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .template-card-body { padding: 16px; }
body.erp-helios-theme .erp-main .erp-page-content .email-preview-block {
  padding: 14px;
  border: 1px solid #e4eae4;
  border-radius: 12px;
  background: #fbfcfa;
  min-width: 0;
}
body.erp-helios-theme .erp-main .erp-page-content .email-preview-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid #e6ece7;
  background: #fff;
  border-radius: 9px;
}
body.erp-helios-theme .erp-main .erp-page-content .email-html-source textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
body.erp-helios-theme .erp-main .erp-page-content .email-preview-empty { border: 1px dashed #dfd9c1; border-radius: 10px; background: #fdfaf0; }
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid #e3ebe3;
  background: #f8faf8;
  border-radius: 11px;
  padding: 12px 13px;
  min-width: 0;
}
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .check-row input[type="checkbox"] { width: 17px; height: 17px; min-width: 17px; margin: 2px 0 0; }
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .check-row > span { min-width: 0; }
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .check-row small { display: block; margin-top: 4px; }
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .notification-sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 6;
  border: 1px solid #cfe0d0;
  box-shadow: 0 12px 30px rgba(33, 61, 40, .12);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .notification-sticky-actions .form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 9px;
  margin: 0;
}
body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .notification-sticky-actions .btn { white-space: normal; }
body.erp-helios-theme .erp-main .erp-page-content :where(details, [hidden])[hidden] { display: none !important; }

/* Standalone Login / 2FA: the same visual language, without touching auth data. */
html:has(body.login-body) { background: #f3f6f3; }
body.login-body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 30px 16px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 15% 5%, #e2eee6, transparent 44%),
              radial-gradient(ellipse at 95% 95%, #e8eee6, transparent 36%),
              #f3f6f3;
  color: #223429;
}
body.login-body .login-card {
  position: relative;
  width: min(100%, 448px);
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 20px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid #e0e9e0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(23, 45, 30, .095);
  overflow: visible;
  color: #223429;
}
body.login-body .login-number {
  position: static;
  top: auto;
  right: auto;
  pointer-events: none;
  width: 54px;
  height: 54px;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
  border: 1px solid #d9e9db;
  border-radius: 14px;
  background: #eaf4ec;
  color: #285139;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: none;
  transform: none;
}
body.login-body .two-factor-card .login-number { font-size: .95rem; letter-spacing: -.02em; }
body.login-body .login-card h1 {
  margin: 3px 0 0;
  color: #1d3023;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.22;
  font-weight: 780;
  letter-spacing: -.045em;
}
body.login-body .login-card .eyebrow {
  margin: 0 0 6px;
  color: #4b7356;
  font-family: Inter, system-ui, sans-serif;
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .065em;
}
body.login-body .login-card :where(.muted, .tiny-note, p) { color: #627267; line-height: 1.65; }
body.login-body .login-card .form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
body.login-body .login-card .form-grid label:not(.check-row) {
  display: grid;
  gap: 7px;
  color: #2b4031;
  font-family: Inter, system-ui, sans-serif;
  font-size: .86rem;
  font-weight: 670;
}
body.login-body .login-card input:not([type="checkbox"]):not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 11px 13px;
  border: 1px solid #d9e4da;
  border-radius: 11px;
  background: #fff;
  color: #203225;
  box-shadow: none;
  font: 500 .94rem/1.35 Inter, system-ui, sans-serif;
  transition: border-color .16s ease, box-shadow .16s ease;
}
body.login-body .login-card input:not([type="checkbox"]):not([type="hidden"]):focus-visible {
  border-color: #568c64;
  outline: 3px solid rgba(72, 137, 87, .16);
  outline-offset: 0;
  box-shadow: 0 0 0 2px rgba(73, 136, 87, .06);
}
body.login-body .login-card input[type="checkbox"] { accent-color: #285139; }
body.login-body .login-card .check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5ede6;
  background: #f9fbf8;
  color: #506254;
  line-height: 1.55;
  font-size: .83rem;
}
body.login-body .login-card .check-row input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; }
body.login-body .login-card .btn.primary.full {
  width: 100%;
  min-height: 46px;
  border: 1px solid #285139;
  border-radius: 11px;
  background: #285139;
  color: #fff;
  box-shadow: 0 5px 14px rgba(29, 75, 45, .16);
  font: 750 .91rem Inter, system-ui, sans-serif;
  transform: none;
}
body.login-body .login-card .btn.primary.full:hover:not(:disabled) { background: #1c402b; }
body.login-body .login-card .btn:focus-visible { outline: 3px solid rgba(72, 137, 87, .36); outline-offset: 2px; }
body.login-body .login-card :where(input, button):disabled { opacity: .62; cursor: not-allowed; }
body.login-body .login-card .auth-lockout-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid #f1d6cd;
  border-radius: 12px;
  background: #fff6f2;
  box-shadow: none;
  color: #823d31;
}
body.login-body .login-card .auth-lockout-panel .auth-lockout-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  background: #ffe6dc;
  color: #a14d36;
}
body.login-body .login-card .auth-lockout-panel strong,
body.login-body .login-card .auth-lockout-panel small { color: #823d31; line-height: 1.55; }
body.login-body .login-card .auth-lockout-panel.is-expired { background: #eef7ee; border-color: #d3e5d3; }
body.login-body .login-card .auth-lockout-panel.is-expired :where(strong, small) { color: #2a633c; }
body.login-body .login-card .flash,
body.login-body .login-card .toast-popup { border-radius: 11px; box-shadow: none; }
body.login-body .login-card .flash :where(span, strong, small),
body.login-body .login-card .toast-popup :where(span, strong, small) { color: #334539; }
body.login-body .login-card .flash.danger :where(span, strong, small),
body.login-body .login-card .toast-popup.danger :where(span, strong, small) { color: #8e4036; }
body.login-body .login-card .toast-close { color: inherit; }
body.login-body .login-card .tiny-note { margin: 0; font-size: .8rem; }
body.login-body .two-factor-card { width: min(100%, 478px); }
body.login-body .two-factor-card input[name="code"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: .16em;
  font-weight: 700;
}
@media (max-width: 1100px) {
  body.erp-helios-theme .erp-main .erp-page-content .settings-grid,
  body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  body.erp-helios-theme .erp-main .erp-page-content .settings-grid,
  body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid { gap: 12px; }
  body.erp-helios-theme .erp-main .erp-page-content .settings-grid > :where(.panel, details.panel),
  body.erp-helios-theme .erp-main .erp-page-content > details.panel { padding: 16px; border-radius: 13px; }
  body.erp-helios-theme .erp-main .erp-page-content .settings-grid .security-summary { grid-template-columns: minmax(0, 1fr); }
  body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .delivery-row { flex-wrap: wrap; }
  body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .notification-sticky-actions {
    position: static;
    backdrop-filter: none;
  }
  body.erp-helios-theme .erp-main .erp-page-content .notification-settings-grid .notification-sticky-actions .btn { width: 100%; }
  body.login-body { padding: 18px 12px; }
  body.login-body .login-card { padding: 24px 20px; border-radius: 16px; gap: 16px; }
  body.login-body .login-card .auth-lockout-panel { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body.login-body .login-card * { transition-duration: 0.01ms !important; }
}
