@import url("bootstrap-icons/bootstrap-icons.min.css");

:root {
  --ecr_base-color: #4f4da7;
  --sidebar-bg: var(--ecr_base-color);
  --sidebar-border: #f5f7fc;
  --sub-sidebar-bg: #f5f7fc;
  --system-bg: #f5f7fc;
  --system-text: var(--ecr_base-color);
}

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #dfe4ea; border-radius: 6px; }
::-webkit-scrollbar-thumb { background: var(--ecr_base-color); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--ecr_base-color); }
.bi { vertical-align: -0.125em; }

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: #f5f7fc;
  color: #18213a;
}
body .page-transition-content { opacity: 1; transition: opacity .18s ease; }
body.page-transition-enter .page-transition-content,
body.page-transition-leave .page-transition-content { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  body .page-transition-content { transition: none; }
}

body:not(.dashboard-body) {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 40px 16px;
  background: #f5f7fc;
  color: #18213a;
}
body:not(.dashboard-body)::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, #5552ad 0 35%, #91aaf0 35% 68%, #e67e82 68%);
}
body:not(.dashboard-body) .card {
  align-self: flex-start;
  width: 100%;
  max-width: 420px;
  height: fit-content;
  min-height: 0;
  margin-top: 6vh;
  padding: 28px 32px;
  border: 1px solid #e5e9f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(63, 76, 125, .1);
}
body:not(.dashboard-body) h1 { margin-top: 0; color: #4f4da7; font-size: 30px; }
body:not(.dashboard-body) h2 { color: #59637e; font-size: 15px; }
body:not(.dashboard-body) .hint,
body:not(.dashboard-body) label { color: #7f89a5; }
body:not(.dashboard-body) .hint { font-size: 13px; }
body:not(.dashboard-body) form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
body:not(.dashboard-body) input {
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #dfe4f0;
  border-radius: 6px;
  background: #f8f9fd;
  color: #18213a;
}
body:not(.dashboard-body) input:focus { border-color: #7472de; outline: 3px solid rgba(116, 114, 222, .15); }
button,
[type="button"],
[type="submit"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #5552ad;
  color: #fff;
  font: 600 13px/1.3 "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
}
button:hover:not(:disabled),
[type="button"]:hover:not(:disabled),
[type="submit"]:hover:not(:disabled),
.btn:hover:not(:disabled) {
  background: #444295;
  transform: translateY(-1px);
}
button:focus-visible,
[type="button"]:focus-visible,
[type="submit"]:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(116, 114, 222, .2);
  outline-offset: 2px;
}
button:disabled,
[type="button"]:disabled,
[type="submit"]:disabled,
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  border-color: #dfe4f0;
  background: #eef0f7;
  color: #4f4da7;
}
.btn-secondary:hover:not(:disabled) {
  background: #e2e8ff;
}
.btn-ghost,
button.ghost {
  border-color: #d8deed;
  background: transparent;
  color: #59637e;
}
.btn-ghost:hover:not(:disabled),
button.ghost:hover:not(:disabled) {
  border-color: #cad3ee;
  background: #eef0fa;
  color: #4f4da7;
  transform: none;
}
.btn-danger,
button.ghost.danger {
  border-color: #d63b3b;
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover:not(:disabled),
button.ghost.danger:hover:not(:disabled) {
  border-color: #bc1f1f;
  background: #b91c1c;
  color: #fff;
  transform: none;
}
body:not(.dashboard-body) label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
body:not(.dashboard-body) a { color: #5f63c6; }
body:not(.dashboard-body) .status { min-height: 18px; font-size: 13px; }
body:not(.dashboard-body) .status.ok { color: #318b72; }
body:not(.dashboard-body) .status.err { color: #f87171; }

.dashboard-body {
  display: flex;
  flex-direction: column;
  width: auto;
  height: 100vh;
  margin: 0;
  padding: 0 0 0 106px;
  overflow: hidden;
  background: #f5f7fc;
  color: #18213a;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}
.app-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 106px;
  flex-direction: column;
  align-items: center;
  border: 0;
  background: var(--sidebar-bg);
}
.rail-brand {
  display: flex;
  width: 100%;
  height: 86px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.rail-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 23px;
  font-weight: 700;
}
.rail-nav { display: flex; width: 100%; flex-direction: column; gap: 4px; padding-top: 18px; }
.rail-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0 10px;
  padding: 14px 4px;
  border-radius: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .15s, color .15s;
}
.rail-link:hover,
.rail-link.active { color: var(--system-text); background: var(--system-bg); }
.rail-link.active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #fff;
}
.rail-icon { display: grid; width: 26px; height: 26px; place-items: center; font-size: 24px; line-height: 1; }
.rail-profile-card { display: flex; width: 84px; flex-direction: column; align-items: center; gap: 5px; margin: auto 8px 12px; padding: 9px 5px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .24); border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; text-align: center; text-decoration: none; }
.rail-profile-card:hover, .rail-profile-card.active { background: rgba(255, 255, 255, .22); color: #fff; }
.rail-profile-avatar { position: relative; display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; overflow: hidden; border: 2px solid rgba(255, 255, 255, .85); border-radius: 50%; background: #dce6ff; color: #4f4da7; font-size: 13px; font-weight: 700; }
.rail-profile-image { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rail-profile-avatar.has-profile-picture .rail-profile-image { display: block; }
.rail-profile-avatar.has-profile-picture #railProfileInitials { display: none; }
.rail-profile-name { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-profile-name { font-size: 9px; font-weight: 700; }
.rail-profile-user-id { display: inline-flex; max-width: 100%; align-items: center; overflow: hidden; padding: 2px 6px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .9); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.topbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid #e5e9f3;
  background: transparent;
}
.topbar h1 { margin: 0; color: #202944; font-size: 18px; }
.topbar h1 .page-title-icon { margin-right: 8px; color: var(--ecr_base-color); font-size: .9em; vertical-align: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.muted { color: #7f89a5; font-size: 13px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.panel-kicker {
  margin: 0 0 6px;
  color: #6575c7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.help-icon { position: relative; display: inline-flex; width: 15px; height: 15px; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 50%; background: #334155; color: #cbd5e1; font-size: 10px; font-weight: 700; cursor: help; }
.help-icon:hover, .help-icon:focus { background: #475569; outline: none; }
.help-tooltip { position: absolute; z-index: 20; top: 100%; left: 0; width: 260px; margin-top: 6px; padding: 10px 12px; border: 1px solid #334155; border-radius: 8px; background: #0f172a; box-shadow: 0 10px 30px rgba(0,0,0,.4); color: #cbd5e1; font-size: 12px; font-weight: 400; line-height: 1.5; visibility: hidden; opacity: 0; transition: opacity .12s; }
.help-tooltip code { padding: 1px 4px; border-radius: 4px; background: #1e293b; }
.help-icon:hover + .help-tooltip, .help-icon:focus + .help-tooltip { visibility: visible; opacity: 1; }
button.ghost {
  padding: 7px 12px;
}
button.ghost.danger { color: #fff; border-color: #d63b3b; }
button.ghost.danger:hover { background: #b91c1c; }

@media (max-width: 680px) {
  .dashboard-body { width: 100%; padding: 0 0 64px; overflow-x: hidden; }
  .app-rail { inset: auto 0 0; width: auto; height: 64px; flex-direction: row; border-top: 1px solid #edf0f7; }
  .rail-brand { display: none; }
  .rail-nav { width: auto; min-width: 0; flex: 1; flex-direction: row; justify-content: space-around; gap: 0; padding: 0; }
  .rail-link { flex: 1; margin: 0; padding: 8px 4px; }
  .rail-link.active::before { inset: 0 0 auto; width: auto; height: 3px; }
  .rail-profile-card { width: 44px; height: 48px; flex: 0 0 44px; justify-content: center; margin: 0 8px; padding: 3px; border: 0; background: transparent; }
  .rail-profile-card:hover, .rail-profile-card.active { background: rgba(255, 255, 255, .14); }
  .rail-profile-name, .rail-profile-user-id { display: none; }
  .rail-profile-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 11px; }
  .topbar { width: 100%; box-sizing: border-box; gap: 10px; padding: 10px 14px; }
  .topbar h1 { font-size: 16px; }
  .topbar-right { min-width: 0; gap: 8px; }
  .topbar-right .muted { display: none; }
}
@media (max-width: 480px) {
  body:not(.dashboard-body) { padding: 28px 12px; }
  body:not(.dashboard-body) .card { margin-top: 3vh; padding: 22px 18px; }
  body:not(.dashboard-body) h1 { font-size: 26px; }
}
