@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-regular.ttf') format('truetype');
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-bold.ttf') format('truetype');
  font-weight: 650 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font: 15px/1.5 Manrope, system-ui, sans-serif;
  color: #211a2b;
  background: #f7f5f9;
  --muted: #675d72;
  --paper: #fff;
  --line: #e8e1ed;
  --plum: #762062;
  --accent: #962775;
  --focus: #9d2e88;
  --nav: #20122b;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea, a { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); }
[hidden] { display: none !important; }
a { color: var(--plum); text-underline-offset: .18em; }
button {
  cursor: pointer;
  min-height: 38px;
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  font-weight: 750;
}
button:hover { background: #f8f1fa; border-color: #d9c3de; }
button:disabled { opacity: .62; cursor: wait; }
.primary { background: var(--plum); color: white; border-color: var(--plum); }
.primary:hover { background: #5c154d; border-color: #5c154d; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
h2 { font-size: 1.17rem; }
.muted, small { color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sign-in-layout {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr);
  background: #fff;
}
.sign-in-brand {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 85%, #70164a, transparent 56%),
    radial-gradient(ellipse at 12% 12%, #58206d, transparent 52%),
    #1e112b;
}
.sign-in-brand::before, .sign-in-brand::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 110%;
  aspect-ratio: 1 / .42;
  border: 1px solid #f6cef454;
  border-radius: 50%;
  transform: rotate(-29deg);
}
.sign-in-brand::after { width: 133%; border-color: #ff7db052; }
.logo-stage {
  padding: clamp(.7rem, 2vw, 1.65rem);
  background: white;
  border-radius: clamp(24px, 4vw, 48px);
  box-shadow: 0 22px 85px #140c23a8;
}
.logo-stage img { display: block; width: clamp(160px, 23vw, 318px); height: auto; }
.sign-in-content { display: grid; place-items: center; padding: clamp(24px, 5vw, 90px); }
.login { width: min(100%, 390px); }
.login h1 { font-size: clamp(2rem, 3.4vw, 3.15rem); line-height: 1.07; margin-bottom: .72rem; letter-spacing: -.067em; }
.login-help { margin-bottom: 2rem; color: var(--muted); }
.mobile-logo { display: none; }
.stack { display: grid; gap: .85rem; }
label { display: grid; gap: .4rem; font-size: .87rem; font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #dcd1e4;
  border-radius: 9px;
  background: var(--paper);
  padding: .58rem .7rem;
}
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: auto; min-height: auto; accent-color: var(--plum); }
label.check { display: flex; align-items: center; gap: .55rem; }
.login input { min-height: 49px; }
.login label[for=login-password] { margin-top: .16rem; }
.password-control { position: relative; margin-top: -.48rem; }
.password-control input { padding-right: 4.5rem; }
.password-control button { position: absolute; inset: 5px 5px 5px auto; padding: .28rem .65rem; min-height: 35px; border: 0; color: var(--plum); }
.login-submit { display: flex; justify-content: space-between; align-items: center; min-height: 49px; margin-top: .45rem; padding-inline: 1rem; }
.form-error { margin: 0; color: #a21a43; font-size: .9rem; }

.layout { min-height: 100svh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
#section-sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.1rem .84rem .85rem;
  color: #fff8ff;
  background: var(--nav);
}
.brand { display: flex; align-items: center; gap: .68rem; padding-inline: .44rem; line-height: 1.25; }
.brand img { flex: none; object-fit: contain; border-radius: 10px; }
.brand strong { display: block; font-size: 1.22rem; letter-spacing: -.035em; }
.brand small, .sidebar-footer small { color: #cdbbd6; }
.section-search { margin: 1.25rem .25rem .8rem; }
.section-search input { min-height: 38px; background: #302039; border-color: #4f3c59; color: #fff; }
.section-search input::placeholder { color: #d0bdD6; }
#section-sidebar nav { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #6e567c transparent; }
.nav-group { padding: .28rem .24rem .68rem; }
.nav-group + .nav-group { border-top: 1px solid #4b3354; }
.nav-group p { margin: .44rem .6rem .24rem; color: #d2bfdc; font-size: .73rem; font-weight: 750; }
.nav-group button { display: block; width: 100%; min-height: 32px; padding: .36rem .62rem; border: 0; background: transparent; text-align: left; color: #f7ebfa; font-weight: 550; font-size: .85rem; }
.nav-group button:hover { background: #3c2847; }
.nav-group button[aria-current=page] { background: #593155; box-shadow: inset 3px 0 #f39ec9; color: #fff; font-weight: 800; }
#section-sidebar :focus-visible { outline-color: #f5a9db; outline-offset: -2px; }
.no-sections { margin: .45rem; color: #d2bfdc; }
.sidebar-footer { display: flex; align-items: center; gap: .65rem; padding: .77rem .33rem .06rem; margin-top: .35rem; border-top: 1px solid #4b3354; }
.sidebar-footer > div { min-width: 0; }
.sidebar-footer strong, .sidebar-footer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #66436b; color: #fff2fa; font-size: .77rem; font-weight: 750; }
.sections-toggle, .drawer-backdrop { display: none; }

.workspace { min-width: 0; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  min-height: 70px;
  padding: .8rem clamp(16px, 3vw, 44px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.top-title, .header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.top h1 { margin: 0; font-size: clamp(1.22rem, 2.2vw, 1.64rem); line-height: 1.12; }
.top h1:focus { outline: none; }
.context-label { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.workspace-body { margin-inline: auto; width: min(100%, 1490px); padding: clamp(16px, 3vw, 44px); padding-top: clamp(16px, 2vw, 30px); }
.period-bar { justify-content: flex-end; }
.period-label { margin-right: .15rem; color: var(--muted); }
.period-bar select, .period-bar input { min-height: 38px; width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.dashboard-overview {
  isolation: isolate;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 1rem;
  overflow: hidden;
  min-height: 145px;
  padding: clamp(19px, 2.7vw, 37px);
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 100% 110%, #912660, transparent 59%), linear-gradient(112deg, #271539, #572252);
  color: #fff9ff;
}
.dashboard-overview::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 58%;
  top: -78%;
  width: 62%;
  aspect-ratio: 1/.55;
  border: 1px solid #f8b5dd5c;
  box-shadow: 0 0 0 22px #f8b5dd16, 0 0 0 54px #f8b5dd0e;
  border-radius: 50%;
  transform: rotate(-23deg);
}
.dashboard-overview h2 { margin-bottom: .3rem; font-size: clamp(1.55rem, 3vw, 2.45rem); line-height: 1.12; }
.dashboard-overview p { margin: 0; color: #f6dcee; }
.dashboard-overview button { white-space: nowrap; color: var(--plum); }
.dashboard-overview button span, .quick-panel button span { margin-left: .55rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: .22rem;
  padding: .88rem .94rem;
  min-height: 95px;
  text-align: left;
  border-radius: 13px;
  background: var(--paper);
}
.metric strong { font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.065em; }
.metric > span:first-child { color: var(--muted); font-size: .8rem; padding-right: .9rem; }
.metric-arrow { position: absolute; right: .8rem; top: .66rem; color: var(--plum); font-size: .95rem; }
.dashboard-panels { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 15px; }
.pane { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(13px, 2vw, 24px); margin-bottom: 15px; }
.pane h2 { margin: 0 0 .65rem; }
.pane p:last-child { margin-bottom: 0; }
.progress-value { font-size: 2.35rem; font-weight: 800; line-height: 1.17; letter-spacing: -.065em; color: var(--plum); }
.progress-value span { margin-left: .15rem; font-size: 1.1rem; }
.pane progress { width: 100%; height: .75rem; margin-bottom: .65rem; accent-color: var(--accent); }
.quick-panel button {
  display: flex;
  min-height: 37px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  padding: .42rem 0;
  background: transparent;
}
.quick-panel button:last-child { border-bottom: 0; }
.quick-panel button:hover { color: var(--accent); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.activity ul { padding: .55rem 0 0; list-style: none; margin: 0; }
.activity li { display: flex; justify-content: space-between; gap: .7rem; padding-block: .6rem; border-bottom: 1px solid var(--line); }
.activity li:last-child { border: 0; padding-bottom: 0; }
.activity li div small { display: block; }

.list-head { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-bottom: .85rem; }
.list-head input { max-width: 320px; }
.list-head select { max-width: 176px; }
.scroll { overflow-x: auto; }
table { width: 100%; min-width: 610px; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: .72rem .62rem; vertical-align: middle; }
thead th { background: #f5eff7; color: #5b4569; font-size: .79rem; font-weight: 800; }
tbody tr:hover { background: #fcf9fc; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; }
.status { display: inline-flex; border-radius: 99px; padding: .24rem .55rem; font-size: .76rem; font-weight: 800; background: #f0e8f5; color: #5c3974; white-space: nowrap; }
.status.active,.status.approved,.status.completed,.status.accepted,.status.resolved,.status.reviewed { background: #e8f6ec; color: #19563a; }
.status.pending,.status.escalated,.status.expired { background: #fff2d7; color: #834908; }
.status.revoked,.status.rejected,.status.failed,.status.suspended,.status.removed,.status.restricted { background: #f9e5ea; color: #9e2d4e; }
.product-panels { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,290px),1fr)); gap: 12px; }
.product-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.product-line:last-child { border-bottom: 0; }
.product-line > div { flex: 1; min-width: 0; }
.product-line p { margin: .22rem 0 0; }
.banner-thumbnail { width: 96px; aspect-ratio: 2; object-fit: cover; border-radius: 8px; }
.catalog-scroll { max-height: 32rem; overflow-y: auto; margin-top: .75rem; }
dl.details { margin: 0; display: grid; grid-template-columns: minmax(90px,1fr) minmax(105px,1.55fr); gap: 9px; font-size: .9rem; overflow-wrap: anywhere; }
dl dt { color: var(--muted); }
dl dd { margin: 0; font-weight: 700; }
.preview { max-width: min(220px,100%); max-height: 155px; object-fit: contain; margin: .6rem; border-radius: 9px; background: #f3eef6; }
dialog { border: 1px solid var(--line); border-radius: 18px; width: min(630px,calc(100% - 28px)); max-height: min(86svh,820px); padding: 1.25rem; box-shadow: 0 20px 90px #2411314a; }
dialog::backdrop { background: #220f2d94; }
dialog h2 { margin: 0 0 .8rem; }
dialog .actions { margin-top: .85rem; justify-content: flex-end; }
#toast { position: fixed; bottom: 16px; right: 16px; z-index: 5; background: #29173a; color: white; border-radius: 12px; padding: .73rem .9rem; max-width: min(380px,calc(100% - 32px)); }
#toast:empty { display: none; }

@media (max-width: 1010px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sections-toggle { display: inline-flex; align-items: center; padding-inline: .65rem; }
  #section-sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: min(280px, calc(100vw - 52px)); height: 100dvh; z-index: 4; }
  .nav-open #section-sidebar { display: flex; }
  .nav-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 3; border: 0; background: #200f2a86; border-radius: 0; }
  .nav-open .drawer-backdrop:hover { background: #200f2a86; }
  .top { min-height: 65px; align-items: flex-start; }
  .top h1 { padding-block: .45rem; }
  .context-label { display: none; }
}
@media (max-width: 640px) {
  .sign-in-layout { grid-template-columns: 1fr; min-height: 100svh; align-items: center; }
  .sign-in-brand { display: none; }
  .sign-in-content { padding: 28px; }
  .mobile-logo { display: block; margin-bottom: 1.25rem; border: 1px solid var(--line); border-radius: 15px; }
  .dashboard-panels { display: block; }
  .metric { min-height: 84px; }
  .top-title { gap: .4rem; }
  .period-bar { justify-content: flex-start; }
  .activity li > span { white-space: nowrap; }
}
