:root {
  --navy: #111b2e;
  --navy-2: #19263d;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --ink: #162033;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --surface: #fff;
  --canvas: #f6f7f9;
  --red: #c4324b;
  --amber: #b76508;
  --green: #087f5b;
  --violet: #6941c6;
  --shadow: 0 1px 2px rgba(16,24,40,.04);
  --shadow-float: 0 16px 50px rgba(16,24,40,.18);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: auto 1fr auto; padding: 32px 42px 24px; color: white; background: var(--navy); }
.login-screen.hidden { display: none; }
.login-brand, .brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: white; background: rgba(255,255,255,.08); font-weight: 800; }
.login-brand strong, .login-brand span, .brand strong, .brand span { display: block; }
.login-brand strong { font-size: 13px; }
.login-brand span { margin-top: 2px; color: #9eabc0; font-size: 11px; }
.login-card { width: min(420px,100%); align-self: center; justify-self: center; padding: 34px; border-radius: 12px; color: var(--ink); background: white; box-shadow: var(--shadow-float); }
.login-lock { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 20px; }
.login-card h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.login-intro { margin: 9px 0 24px; color: var(--muted); font-size: 12px; }
.login-submit { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; }
.microsoft-mark { display: grid; grid-template: repeat(2,7px)/repeat(2,7px); gap: 2px; }
.microsoft-mark i:nth-child(1){background:#f35325}.microsoft-mark i:nth-child(2){background:#81bc06}.microsoft-mark i:nth-child(3){background:#05a6f0}.microsoft-mark i:nth-child(4){background:#ffba08}
.configuration-note { color: var(--red); font-size: 11px; }
.login-footer { display: flex; justify-content: space-between; color: #8290a7; font-size: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; z-index: 20; padding: 0 10px 14px; background: white; border-right: 1px solid var(--line); }
.brand { min-height: 72px; margin: 0 -10px 12px; padding: 14px 20px; background: var(--navy); }
.brand strong { color: white; font-size: 13px; }
.brand span { color: #9eabc0; font-size: 10px; }
nav { padding: 0; }
.nav-label { margin: 19px 11px 7px; color: var(--subtle); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { width: 100%; min-height: 39px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; margin: 2px 0; padding: 9px 11px; border: 0; border-radius: 7px; color: #475467; background: transparent; text-align: left; font-size: 12px; font-weight: 600; }
.nav-item:hover { color: var(--ink); background: #f2f4f7; }
.nav-item.active { color: #1849a9; background: #eef4ff; }
.nav-item > span { color: #7d899b; font-size: 15px; }
.nav-item.active > span { color: var(--blue); }
.nav-item b { min-width: 21px; padding: 2px 6px; border-radius: 9px; color: #475467; background: #eaecf0; font-size: 9px; text-align: center; }
.nav-item .danger-count { color: #b42318; background: #fee4e2; }
.sidebar-footer { margin-top: auto; padding: 16px 9px 2px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; }
.environment { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #475467; font-size: 10px; }
.environment span { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; }

main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.menu-button { display: none; border: 0; background: transparent; }
.search { width: min(430px,42vw); height: 37px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--subtle); }
.search:focus-within { border-color: #84adff; box-shadow: 0 0 0 3px #eff4ff; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search kbd { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--subtle); background: #f9fafb; font-size: 9px; }
.top-actions, .user { display: flex; align-items: center; }
.top-actions { gap: 15px; }
.branch-switcher { display: grid; gap: 2px; }
.branch-switcher span { color: var(--subtle); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.branch-switcher select { max-width: 230px; border: 0; outline: 0; color: #344054; background: transparent; font-size: 11px; font-weight: 650; }
.user { gap: 9px; padding-left: 15px; border-left: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #1849a9; background: #d1e0ff; font-size: 10px; font-weight: 800; }
.user strong, .user span { display: block; }
.user strong { font-size: 11px; }
.user span { color: var(--muted); font-size: 9px; }
.sign-out-button { padding: 5px; border: 0; color: var(--muted); background: transparent; font-size: 17px; }

.content { max-width: 1560px; margin: 0 auto; padding: 30px 32px 60px; }
.view { display: none; }
.view.active { display: block; animation: fade .16s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(2px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.page-heading h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.035em; }
.page-heading p:last-child { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0 0 5px; color: #7f8b9d; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.primary-button, .secondary-button, .filter-button, .full-button { min-height: 38px; padding: 9px 14px; border-radius: 7px; font-size: 11px; font-weight: 750; }
.primary-button { border: 1px solid var(--blue); color: white; background: var(--blue); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button, .filter-button { border: 1px solid var(--line-strong); color: #344054; background: white; }
.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.notice { display: flex; align-items: center; gap: 11px; min-height: 58px; margin-bottom: 18px; padding: 11px 14px; border: 1px solid #b2ccff; border-radius: 8px; color: #1849a9; background: #eff4ff; }
.notice-icon { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #d1e0ff; font-weight: 800; }
.notice strong { font-size: 11px; }
.notice p { margin: 2px 0 0; font-size: 10px; }

.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 16px; }
.panel, .metric-card { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.panel { overflow: hidden; }
.metric-card { min-height: 108px; display: flex; align-items: flex-start; gap: 12px; padding: 17px; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 7px; font-weight: 800; }
.metric-icon.blue{color:#175cd3;background:#eaf2ff}.metric-icon.amber{color:#b54708;background:#fef0c7}.metric-icon.red{color:#b42318;background:#fee4e2}.metric-icon.green{color:#067647;background:#d1fadf}
.metric-card span,.metric-card strong,.metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 10px; font-weight: 650; }
.metric-card strong { margin: 4px 0 1px; font-size: 24px; letter-spacing: -.03em; }
.metric-card small { color: var(--subtle); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.8fr); gap: 15px; }
.activity-panel { grid-column: 1/-1; }
.panel-heading { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.empty-state { padding: 30px 18px; color: var(--subtle); text-align: center; font-size: 11px; }

.attention-row { width: 100%; min-height: 63px; display: grid; grid-template-columns: 8px minmax(0,1fr) 85px; align-items: center; gap: 11px; padding: 11px 17px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; }
.attention-row:hover, tbody tr:hover { background: #f9fafb; }
.attention-row strong,.attention-row small { display: block; font-size: 10px; }
.attention-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.attention-row > div:last-child { text-align: right; }
.severity { width: 7px; height: 7px; border-radius: 50%; }
.severity.critical{background:var(--red)}.severity.high{background:var(--amber)}.severity.moderate,.severity.medium{background:#eaaa08}.severity.review{background:var(--violet)}
.tag { display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; border-radius: 10px; font-size: 8px; font-weight: 800; text-transform: capitalize; }
.tag.critical{color:#b42318;background:#fee4e2}.tag.high{color:#b54708;background:#fef0c7}.tag.moderate,.tag.medium{color:#854a0e;background:#fef7c3}.tag.review{color:#5925dc;background:#ebe9fe}.tag.success{color:#067647;background:#d1fadf}
time { display: block; margin-top: 4px; color: var(--subtle); font-size: 8px; }
.platform,.activity,.marker,.catalogue-row { display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.platform:last-child,.activity:last-child,.marker:last-child,.catalogue-row:last-child { border-bottom: 0; }
.platform-logo,.activity-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 7px; color: #1849a9; background: #eaf2ff; font-size: 10px; font-weight: 850; }
.platform strong,.platform small,.activity strong,.activity p,.activity small,.marker strong,.marker small,.catalogue-row strong,.catalogue-row small { display: block; }
.platform strong,.activity strong,.marker strong,.catalogue-row strong { font-size: 10px; }
.platform small,.activity p,.activity small,.marker small,.catalogue-row small { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.platform time,.activity time,.catalogue-row .tag { margin-left: auto; }
.activity { display: grid; grid-template-columns: 32px 1fr 75px; }
.activity time { text-align: right; }
.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.table-tools { display: flex; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.search.wide { width: min(580px,100%); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 15px; color: #667085; background: #f9fafb; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
td { padding: 12px 15px; border-top: 1px solid var(--line); font-size: 10px; white-space: nowrap; }
.customer-cell { display: flex; align-items: center; gap: 9px; }
.customer-cell strong,.customer-cell small { display: block; }
.customer-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.mini-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #1849a9; background: #eaf2ff; font-size: 9px; font-weight: 800; }
.status-dot { width: 6px; height: 6px; display: inline-block; margin-right: 5px; border-radius: 50%; }
.status-dot.active{background:#12b76a}.status-dot.restricted{background:#f04438}

.section-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 15px; }
.feature-card { position: relative; min-height: 160px; padding: 18px; }
.feature-symbol { width: 31px; height: 31px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 7px; color: #175cd3; background: #eaf2ff; font-weight: 800; }
.feature-card h2 { margin: 0 0 6px; font-size: 13px; }
.feature-card p { min-height: 42px; margin: 0 0 15px; color: var(--muted); font-size: 10px; }
.feature-card .tag { position: absolute; right: 15px; top: 15px; }
.queue-panel { margin-top: 15px; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.admin-tabs button,.settings-nav button { border: 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 650; }
.admin-tabs button { padding: 7px 11px; border-radius: 6px; }
.admin-tabs button.active { color: #1849a9; background: #eaf2ff; }
#roleCards { margin-top: 15px; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 18px; }
.settings-nav { display: flex; flex-direction: column; gap: 3px; align-self: start; }
.settings-nav button { padding: 9px 11px; border-radius: 6px; text-align: left; }
.settings-nav button:hover { background: #eaecf0; }
.settings-nav button.active { color: #1849a9; background: #eaf2ff; }
.settings-panel { margin-bottom: 15px; }
.settings-form label { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 17px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.settings-form label > span small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }
.settings-form input:not([type=checkbox]) { width: 170px; padding: 8px 9px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; }
.settings-form input[type=checkbox] { width: 34px; height: 18px; accent-color: var(--blue); }
.settings-actions { display: flex; justify-content: flex-end; padding: 15px 17px; }
.form-status { min-height: 18px; margin: 12px 17px 0; color: var(--green); font-size: 10px; }

dialog { width: min(520px,calc(100% - 30px)); padding: 0; border: 0; border-radius: 10px; box-shadow: var(--shadow-float); }
dialog::backdrop { background: rgba(16,24,40,.62); }
dialog form,.key-result { padding: 23px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.dialog-heading p:last-child { color: var(--muted); font-size: 10px; }
.dialog-heading > button { border: 0; background: transparent; font-size: 20px; }
dialog label { display: block; margin: 13px 0; color: #475467; font-size: 9px; font-weight: 750; }
dialog input,dialog select,dialog textarea { width: 100%; display: block; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; }
dialog textarea { min-height: 90px; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-error { min-height: 15px; color: var(--red); font-size: 10px; }
fieldset { margin-top: 15px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; }
fieldset legend { padding: 0 5px; font-size: 9px; font-weight: 800; }
fieldset label { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
fieldset input[type=checkbox] { width: auto; margin: 0; }
.key-result pre { padding: 14px; border-radius: 7px; color: #ddebff; background: var(--navy); white-space: pre-wrap; word-break: break-all; font-size: 10px; }
.key-result > button { margin-right: 7px; }
.api-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; padding: 20px; }
.api-guide h2 { margin: 0 0 6px; font-size: 15px; }
.api-guide p { color: var(--muted); font-size: 10px; }
.endpoint-list { display: flex; flex-direction: column; gap: 7px; }
.endpoint-list code { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #f9fafb; font-size: 9px; }

@media (max-width:1100px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .activity-panel { grid-column: auto; }
  .section-grid { grid-template-columns: repeat(2,1fr); }
  .branch-switcher { display: none; }
}
@media (max-width:780px) {
  .login-screen { padding: 22px 16px; }
  .login-card { padding: 25px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -275px; width: 264px; transition: left .2s ease; box-shadow: 12px 0 40px rgba(16,24,40,.15); }
  .sidebar.open { left: 0; }
  .menu-button { display: block; }
  .topbar { padding: 0 15px; gap: 10px; }
  .topbar > .search { flex: 1; width: auto; }
  .search kbd,.user > div:not(.avatar) { display: none; }
  .content { padding: 23px 15px 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metrics,.section-grid { grid-template-columns: 1fr; }
  .record-grid,.settings-layout,.api-guide { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; }
  .settings-form label { align-items: flex-start; flex-direction: column; }
  .settings-form input:not([type=checkbox] ) { width: 100%; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration: .01ms!important; transition-duration: .01ms!important; } }
