:root {
  color-scheme: light;
  --navy: #263f99;
  --navy-2: #304cae;
  --blue: #3159c5;
  --blue-2: #426de0;
  --ink: #172033;
  --muted: #75809a;
  --line: #e5e9f2;
  --surface: #ffffff;
  --canvas: #f5f7fc;
  --green: #19a875;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button { font: inherit; cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 260px; flex: 0 0 260px; min-height: 100vh; max-height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  color: #e8edff; background: linear-gradient(180deg, #304da9 0%, #263f91 100%);
  padding: 22px 15px 14px; position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 7px 23px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: white; font-weight: 800; background: linear-gradient(145deg, #3d76ff, #2143bd);
  box-shadow: 0 5px 15px #081b5740;
}
.brand-mark.has-logo { padding: 3px; background: white; }
.brand-logo-image { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 14px; letter-spacing: .055em; white-space: nowrap; }
.brand-copy span { color: #c1ccf2; font-size: 13px; }
.icon-button { border: 0; background: transparent; color: inherit; width: 32px; height: 32px; border-radius: 8px; font-size: 18px; }
.icon-button:hover { background: #ffffff16; }
.mobile-close { display: none; margin-left: auto; }
.workspace-switch { display: flex; align-items: center; gap: 10px; padding: 11px 10px; margin: 0 1px 22px; border: 1px solid #ffffff20; border-radius: 10px; background: #ffffff0c; }
.workspace-switch strong, .workspace-switch small { display: block; }
.workspace-switch strong { font-size: 14px; }
.workspace-switch small { color: #c1ccf2; font-size: 13px; margin-top: 3px; }
.workspace-dot { width: 8px; height: 8px; border-radius: 50%; background: #40d7a1; box-shadow: 0 0 0 4px #40d7a122; }
.chevron { margin-left: auto; color: #aab9eb; }
.nav-groups { display: flex; flex-direction: column; gap: 4px; }
.nav-label { padding: 0 10px 8px; color: #b7c5f0; font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.nav-label-spaced { margin-top: 21px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 11px; color: #d6def7; background: transparent; border: 0; border-radius: 8px; text-align: left; font-size: 14px; transition: .15s ease; }
.nav-item:hover { color: white; background: #ffffff12; }
.nav-item.active { color: white; background: linear-gradient(90deg, #4268dc, #3455bd); box-shadow: 0 5px 14px #0b1d5840; }
.nav-icon { width: 17px; text-align: center; font-size: 15px; color: #a9bcff; }
.nav-item.active .nav-icon { color: white; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 17px 5px 2px; border-top: 1px solid #ffffff1a; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #d7e2ff; color: #263d91; font-size: 14px; font-weight: 800; }
.user-copy { flex: 1; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { font-size: 14px; }
.user-copy small { color: #c1ccf2; font-size: 13px; margin-top: 3px; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 66px; flex: 0 0 66px; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; background: white; border-bottom: 1px solid var(--line); }
.topbar-left, .topbar-right, .breadcrumbs { display: flex; align-items: center; gap: 13px; }
.breadcrumbs { font-size: 14px; color: #77839b; }
.breadcrumbs b { color: #c4cad7; font-weight: 400; }
.breadcrumbs strong { color: #28334d; font-weight: 650; }
.topbar-right { gap: 18px; }
.auth-controls { display: flex; align-items: center; gap: 8px; }
.auth-button { white-space: nowrap; text-decoration: none; }
#authUser { color: #52617b; font-size: 14px; }
.environment { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #e6eaf3; border-radius: 6px; color: #53617e; font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.environment i { width: 6px; height: 6px; border-radius: 50%; background: #3e70df; }
.connection-status { display: flex; align-items: center; gap: 7px; color: #64718a; font-size: 14px; }
.connection-status i, .status-indicator { width: 7px; height: 7px; border-radius: 50%; background: #aeb8c9; }
.menu-toggle { display: none; color: #5a6680; }
.button { min-height: 42px; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 650; border: 1px solid transparent; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 3px 8px #3154c82b; }
.button-primary:hover { background: #2447b8; }
.button-secondary { color: #52617e; border-color: #e1e6f0; background: white; }
.button-secondary:hover { background: #f7f9fd; }
.page-content { flex: 1; padding: 30px 32px 38px; min-width: 0; }
.statusbar { min-height: 42px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 24px; background: white; border-top: 1px solid var(--line); color: #68758e; font-size: 13px; }
.statusbar > div { display: flex; align-items: center; gap: 8px; }
.statusbar-actions { justify-content: flex-end; gap: 10px; }
.status-indicator { background: #20b783; }
.status-divider { color: #d1d6e0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.eyebrow { color: #4263c7; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-heading h1 { margin: 8px 0 6px; font-size: 30px; letter-spacing: -.035em; font-weight: 720; }
.page-heading p { margin: 0; color: #5e6a83; font-size: 15px; }
.grid { display: grid; gap: 14px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 17px; }
.panel-grid { grid-template-columns: minmax(0, 1.55fr) minmax(240px, .85fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px #1c2d5a05; }
.metric-card { padding: 20px; min-height: 132px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #596781; font-size: 14px; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #edf2ff; color: #3b5dcc; font-size: 18px; }
.metric-value { margin-top: 12px; color: #26365f; font-size: 30px; font-weight: 750; letter-spacing: -.04em; }
.metric-note { margin-top: 3px; color: #68758e; font-size: 13px; }
.panel { overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-header strong { font-size: 15px; }
.panel-header span { color: #68758e; font-size: 13px; }
.panel-body { padding: 20px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 13px 14px; background: #f8f9fc; color: #596781; font-size: 13px; font-weight: 750; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 14px; border-bottom: 1px solid #edf0f5; color: #3f4c66; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.empty-state { padding: 36px 18px; text-align: center; color: #68758e; font-size: 14px; }
.empty-state strong { display: block; margin-bottom: 7px; color: #3f4c66; font-size: 16px; }
.status-pill { display: inline-flex; padding: 6px 10px; border-radius: 20px; background: #eaf8f2; color: #16845d; font-size: 13px; font-weight: 700; }
.status-pill.status-offline { background: #fff3e8; color: #a45b16; }
.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #3f4c66; text-align: left; font-size: 14px; }
.quick-link:hover { border-color: #b9c8f5; background: #f8faff; }
.quick-link span:first-child { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; color: #3457c3; background: #edf2ff; font-size: 17px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-input { width: min(340px, 100%); min-height: 44px; border: 1px solid #d5ddec; border-radius: 8px; padding: 10px 13px; outline: none; color: var(--ink); font-size: 14px; }
.search-input:focus { border-color: #7893e9; box-shadow: 0 0 0 3px #4267df16; }
.table-count { color: #596781; font-size: 13px; }
.notice { padding: 16px 18px; border: 1px solid #dce6ff; border-radius: 9px; background: #f2f6ff; color: #43557f; font-size: 14px; line-height: 1.65; }
.dashboard-links { margin-top: 12px; }
.workspace-placeholder { min-height: 230px; display: grid; place-items: center; text-align: center; padding: 30px; }
.placeholder-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: #edf2ff; color: #3559c5; font-size: 24px; }
.workspace-placeholder h3 { margin: 0 0 8px; font-size: 18px; }
.workspace-placeholder p { max-width: 440px; margin: 0; color: #68758e; font-size: 14px; line-height: 1.7; }
.toast { position: fixed; right: 22px; bottom: 45px; z-index: 50; padding: 13px 17px; border-radius: 8px; background: #172554; color: white; font-size: 14px; box-shadow: 0 8px 30px #0d1b3d30; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.data-form { display: grid; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); background: #fbfcff; }
.data-form h3 { margin: 0; font-size: 18px; }
.data-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.data-field { display: grid; gap: 7px; color: #52617b; font-size: 14px; font-weight: 600; }
.data-field input, .data-field select, .data-field textarea { width: 100%; min-height: 46px; border: 1px solid #d5ddec; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: white; font: inherit; font-weight: 400; }
.data-field input:focus, .data-field select:focus, .data-field textarea:focus { outline: none; border-color: #426de0; box-shadow: 0 0 0 3px #426de020; }
.data-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.data-error { margin: 14px 16px; padding: 13px 15px; border: 1px solid #f1caca; border-radius: 8px; color: #8b2929; background: #fff6f6; font-size: 13px; }
.login-form { display: grid; gap: 14px; max-width: 380px; margin: 20px auto 0; text-align: left; }
.login-form label { display: grid; gap: 7px; color: #52617b; font-size: 14px; }
.login-form input { width: 100%; min-height: 46px; border: 1px solid #d5ddec; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: white; font: inherit; }
.login-form input:focus { outline: none; border-color: #7893e9; box-shadow: 0 0 0 3px #4267df16; }
.login-form .data-error { margin: 0; }
.login-brand { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 22px; text-align: left; }
.login-brand-mark { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 58px; overflow: hidden; border-radius: 14px; background: linear-gradient(145deg, #3d76ff, #2143bd); color: white; font-size: 25px; font-weight: 800; box-shadow: 0 5px 15px #081b5740; }
.login-brand-mark > span { color: white; }
.login-brand-mark img { width: 100%; height: 100%; padding: 4px; object-fit: contain; background: white; }
.login-brand > div:last-child { display: grid; gap: 3px; }
.login-brand strong { color: #172033; font-size: 19px; }
.login-brand span { color: #68758e; font-size: 14px; }
.branding-assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.branding-asset { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.branding-preview { display: grid; place-items: center; width: 100%; min-height: 110px; overflow: hidden; border: 1px dashed #cbd5e5; border-radius: 8px; background: #f8faff; color: #3159c5; font-size: 28px; font-weight: 800; }
.branding-preview img { max-width: 100%; max-height: 140px; object-fit: contain; }
.branding-favicon-preview { width: 80px; min-height: 80px; font-size: 12px; }
.branding-favicon-preview img { width: 48px; height: 48px; }
.branding-asset small { color: #596781; font-size: 13px; }
.branding-asset .button { justify-self: start; }
.data-table-wrap { overflow-x: auto; }
.data-table-wrap td:last-child { text-align: right; }
.data-empty { padding: 36px 18px; color: #68758e; text-align: center; font-size: 14px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); color: #596781; font-size: 13px; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.report-card { padding: 18px; }
.report-card strong { display: block; margin-top: 10px; font-size: 26px; }
.report-card span { color: #596781; font-size: 13px; }
@media (max-width: 640px) {
  .data-form-grid, .report-grid, .branding-assets { grid-template-columns: 1fr; }
}
.sidebar-scrim { display: none; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 15px 0 35px #0c1a3b30; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.show { display: block; position: fixed; inset: 0; z-index: 15; background: #08163870; }
  .mobile-close, .menu-toggle { display: inline-grid; place-items: center; }
  .topbar { padding: 0 14px; }
  .topbar-right { gap: 9px; }
  .environment { display: none; }
  #authUser { display: none; }
  .page-content { padding: 19px 14px 25px; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 21px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .statusbar { padding: 10px 12px; flex-wrap: wrap; }
  .statusbar-actions { width: 100%; }
  .statusbar-actions .button { flex: 1; }
  .breadcrumbs span, .breadcrumbs b { display: none; }
}
@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .connection-status { font-size: 0; }
}
