@font-face {
  font-family:'Noto Sans';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('/ui/img/fonts/noto-sans-cyrillic-ext.woff2') format('woff2');
  unicode-range:U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family:'Noto Sans';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('/ui/img/fonts/noto-sans-cyrillic.woff2') format('woff2');
  unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family:'Noto Sans';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('/ui/img/fonts/noto-sans-latin-ext.woff2') format('woff2');
  unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family:'Noto Sans';
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  src:url('/ui/img/fonts/noto-sans-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IQDATA — shared interface tokens and responsive components. */
:root {
  --iq-blue:#2449a4;
  --iq-blue-text:#2449a4;
  --iq-blue-dark:#19377e;
  --iq-blue-light:#5278df;
  --iq-peri:#a9b8d6;
  --iq-bg:#f4f6fa;
  --iq-surface:#fff;
  --iq-text:#202c42;
  --iq-muted:#738097;
  --iq-border:#e5eaf2;
  --iq-green:#238364;
  --iq-red:#c34451;
  --iq-amber:#b37925;
  --iq-sidebar-w:240px;
  --radius:16px;
  --font-head:'Noto Sans',system-ui,sans-serif;
  --font-body:'Noto Sans',system-ui,sans-serif;
  --iq-soft:#f8faff;
  --iq-sidebar:#142544;
}

* {
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html,body {
  min-height:100%;
  height:100%;
}

body {
  font-family:var(--font-body);
  font-size:14px;
  line-height:1.5;
  color:var(--iq-text);
  background:var(--iq-bg);
  -webkit-font-smoothing:antialiased;
}

button,input,select,textarea {
  font:inherit;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color:transparent;
}

button {
  cursor:pointer;
}

a {
  color:var(--iq-blue-text);
  text-underline-offset:3px;
}

button:disabled {
  cursor:not-allowed;
  opacity:.45;
}

:focus-visible {
  outline:3px solid #7398ef;
  outline-offset:3px;
}

.hidden,[hidden] {
  display:none!important;
}

::selection {
  background:#dce7ff;
  color:#142544;
}

.muted {
  color:var(--iq-muted);
}

.mono {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
  overflow-wrap:anywhere;
}

.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:40px;
  padding:10px 16px;
  border:1px solid transparent;
  border-radius:9px;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  line-height:1.3;
  transition:background .15s,border-color .15s,box-shadow .15s;
}

.btn-primary {
  background:var(--iq-blue);
  color:#fff;
  box-shadow:0 3px 5px #2449a412;
}

.btn-primary:hover:not(:disabled) {
  background:var(--iq-blue-dark);
}

.btn-outline {
  color:var(--iq-text);
  background:var(--iq-surface);
  border-color:var(--iq-border);
}

.btn-outline:hover:not(:disabled) {
  background:var(--iq-soft);
  border-color:#bdcce8;
}

.btn-ghost {
  background:transparent;
  color:#bcc9e0;
  border-color:#ffffff20;
}

.btn-ghost:hover {
  background:#ffffff0c;
  color:#fff;
}

.btn-danger {
  background:var(--iq-red);
  color:#fff;
}

.btn-sm {
  min-height:32px;
  padding:6px 12px;
  font-size:12px;
}

.btn-block {
  width:100%;
}

.btn-link {
  color:var(--iq-blue-text);
  border:0;
  background:transparent;
  text-decoration:underline;
  padding:0;
}

.app {
  display:flex;
  min-height:100vh;
}

.sidebar {
  width:var(--iq-sidebar-w);
  height:100dvh;
  position:sticky;
  top:0;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  background:var(--iq-sidebar);
  color:white;
  z-index:40;
}

.sidebar-brand {
  display:flex;
  align-items:center;
  gap:12px;
  padding:29px 24px 27px;
}

.brand-mark {
  width:37px;
  height:37px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#5076dc;
  color:white;
  font-weight:800;
  font-size:16px;
  letter-spacing:-1px;
  flex-shrink:0;
}

.sidebar-logo {
  font-size:18px;
  font-weight:800;
  letter-spacing:1px;
}

.sidebar-sub {
  font-size:10px;
  color:#92a5c8;
  letter-spacing:.8px;
  margin-top:1px;
}

.sidebar-nav {
  padding:8px 13px;
  flex:1;
  overflow-y:auto;
}

.nav-section {
  font-size:10px;
  font-weight:600;
  letter-spacing:1.3px;
  text-transform:uppercase;
  color:#8396b7;
  margin:20px 13px 10px;
}

.nav-section:first-child {
  margin-top:4px;
}

.nav-item {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:43px;
  padding:10px 13px;
  margin:3px 0;
  width:100%;
  border:0;
  border-radius:9px;
  background:transparent;
  text-align:left;
  color:#b8c7e0;
  font-size:13px;
  font-weight:500;
  transition:background .15s,color .15s;
}

.nav-item:hover {
  background:#ffffff09;
  color:white;
}

.nav-item.active {
  background:#2b4268;
  color:#fff;
  box-shadow:inset 3px 0 #86a6ff;
}

.nav-ico {
  display:grid;
  place-items:center;
  width:19px;
  flex-shrink:0;
}

.nav-ico svg {
  width:18px;
  height:18px;
  stroke-width:1.65;
}

.sidebar-footer {
  padding:16px 20px 20px;
  border-top:1px solid #ffffff12;
}

.platform-version {
  margin-top:12px;
  color:#ffffff80;
  font-size:11px;
  text-align:center;
}

.user-chip {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:15px;
}

.user-avatar {
  display:grid;
  place-items:center;
  flex-shrink:0;
  width:35px;
  height:35px;
  border-radius:10px;
  background:#314869;
  color:#cfddf5;
  font-size:14px;
  font-weight:700;
}

.user-meta {
  min-width:0;
}

.user-name {
  font-size:12px;
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
}

.user-role {
  font-size:11px;
  color:#8fa4c7;
  margin-top:2px;
}

.sidebar-footer .btn {
  font-size:12px;
  min-height:34px;
}

.sidebar-docs {
  display:flex;
  align-items:center;
  gap:8px;
  color:#a6b9d7;
  font-size:12px;
  text-decoration:none;
  margin:0 0 17px;
}

.sidebar-docs:hover {
  color:white;
}

.content {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar {
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:80px;
  padding:17px 36px;
  background:var(--iq-surface);
  border-bottom:1px solid var(--iq-border);
}

.topbar-context {
  font-size:10px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--iq-muted);
  margin-bottom:3px;
}

.topbar-title {
  font-size:17px;
  font-weight:650;
  letter-spacing:-.3px;
}

.topbar-heading {
  display:flex;
  align-items:center;
  gap:12px;
}

.topbar-actions {
  display:flex;
  align-items:center;
  gap:10px;
}

.page {
  width:100%;
  max-width:1660px;
  margin:0 auto;
  padding:30px 36px 48px;
}

.icon-button.menu-toggle {
  display:none;
}

.sidebar-backdrop {
  display:none;
}

.icon-button,.theme-toggle {
  display:inline-grid;
  place-items:center;
  min-width:36px;
  height:36px;
  border:1px solid var(--iq-border);
  border-radius:8px;
  background:var(--iq-surface);
  color:var(--iq-muted);
  font-size:17px;
}

.icon-button:hover,.theme-toggle:hover {
  background:var(--iq-soft);
}

.lang-toggle {
  display:flex;
  gap:2px;
  padding:3px;
  border-radius:8px;
  background:var(--iq-bg);
}

.lang-btn {
  border:0;
  border-radius:5px;
  background:transparent;
  color:var(--iq-muted);
  font-size:10px;
  padding:5px 7px;
  font-weight:650;
}

.lang-btn.active {
  background:var(--iq-surface);
  color:var(--iq-text);
  box-shadow:0 1px 4px #10284a12;
}

.page-intro {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:26px;
}

.eyebrow {
  color:var(--iq-blue-text);
  font-size:11px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  font-weight:650;
  margin-bottom:8px;
}

.page-intro h1 {
  font-size:27px;
  letter-spacing:-.9px;
  font-weight:650;
  line-height:1.25;
}

.page-intro p {
  color:var(--iq-muted);
  font-size:13px;
  margin-top:9px;
  max-width:650px;
}

.intro-links {
  display:flex;
  gap:8px;
  flex-shrink:0;
}

.card,.chart {
  border:1px solid var(--iq-border);
  background:var(--iq-surface);
  border-radius:var(--radius);
  padding:23px 24px;
  margin-bottom:20px;
  box-shadow:0 2px 5px #18315702;
}

.card-title {
  font-size:16px;
  font-weight:650;
  letter-spacing:-.3px;
  margin-bottom:16px;
}

.card-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
}

.card-head .card-title {
  margin:0;
}

.card-head .act {
  border-color:transparent;
  color:var(--iq-muted);
}

.stats-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:25px;
}

.stat {
  position:relative;
  display:block;
  text-align:left;
  color:inherit;
  background:var(--iq-surface);
  border:1px solid var(--iq-border);
  border-radius:12px;
  padding:20px;
  min-width:0;
}

.stat-label {
  font-size:12px;
  color:var(--iq-muted);
}

.stat-value {
  font-size:30px;
  line-height:1.2;
  letter-spacing:-1px;
  font-weight:650;
  margin-top:12px;
  color:var(--iq-text);
  font-variant-numeric:tabular-nums;
}

.stat-note {
  font-size:10px;
  color:var(--iq-muted);
  margin-top:8px;
}

.stat-icon {
  position:absolute;
  top:17px;
  right:18px;
  color:var(--iq-blue-text);
  background:var(--iq-soft);
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:9px;
}

.stat-icon svg {
  width:16px;
  height:16px;
}

.stat[data-view] {
  cursor:pointer;
}

.stat[data-view]:hover {
  border-color:#b9cbed;
  box-shadow:0 5px 18px #2449a408;
}

.export-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:15px;
  margin-bottom:26px;
}

.export-action {
  display:flex;
  align-items:flex-start;
  gap:14px;
  text-align:left;
  background:var(--iq-surface);
  border:1px solid var(--iq-border);
  border-radius:13px;
  padding:20px;
  color:var(--iq-text);
  transition:border-color .15s,box-shadow .15s;
}

.export-action:hover {
  border-color:#9ab3e5;
  box-shadow:0 5px 16px #2449a408;
}

.export-action.primary {
  border-color:#bdceef;
  background:var(--iq-soft);
}

.export-action .action-icon {
  flex-shrink:0;
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:11px;
  background:#eaf0fd;
  color:var(--iq-blue-text);
}

.export-action .action-icon svg {
  width:20px;
  height:20px;
}

.action-title {
  display:block;
  font-size:13px;
  font-weight:650;
  margin-bottom:5px;
}

.action-description {
  display:block;
  font-size:11px;
  line-height:1.65;
  color:var(--iq-muted);
}

.action-arrow {
  margin-left:auto;
  color:var(--iq-muted);
  font-size:16px;
}

.filter-bar {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:12px;
  margin-bottom:19px;
}

.filter-bar select.input {
  width:auto;
  min-width:165px;
  max-width:100%;
}

.filter-control {
  display:flex;
  flex-direction:column;
  gap:6px;
}

.filter-control>span {
  font-size:11px;
  font-weight:550;
  color:var(--iq-muted);
}

.filter-control select.input {
  min-width:170px;
}

.filter-spacer {
  flex:1;
}

.filter-caption {
  font-size:11px;
  color:var(--iq-muted);
  align-self:center;
}

.field {
  display:block;
  margin-bottom:16px;
  min-width:0;
}

.field>span,.field>label {
  display:block;
  font-size:12px;
  font-weight:550;
  color:var(--iq-muted);
  margin-bottom:7px;
}

input:not([type=checkbox]):not([type=radio]),select.input,textarea.input {
  padding:10px 12px;
  width:100%;
  min-height:40px;
  border:1px solid var(--iq-border);
  border-radius:8px;
  background:var(--iq-surface);
  color:var(--iq-text);
  outline:none;
  font-size:13px;
  transition:box-shadow .15s,border-color .15s;
}

input::placeholder,textarea::placeholder {
  color:#9aa7ba;
}

input:not([type=checkbox]):focus,select.input:focus,textarea.input:focus {
  border-color:#8ba9e9;
  box-shadow:0 0 0 3px #5278df13;
}

.filter-bar>input {
  width:auto;
  min-width:160px;
  flex:1;
}

input[type=checkbox] {
  width:15px;
  height:15px;
  accent-color:var(--iq-blue);
  flex-shrink:0;
}

input[type=password] {
  letter-spacing:2px;
}

.form-row {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:14px;
  margin-bottom:16px;
}

.form-row .field {
  flex:1 1 180px;
  margin-bottom:0;
}

.form-row .field.small {
  flex:0 1 150px;
}

.section-note {
  color:var(--iq-muted);
  font-size:12px;
  line-height:1.7;
  margin:0 0 18px;
}

.secondary-actions {
  margin-bottom:20px;
  border:1px solid var(--iq-border);
  border-radius:10px;
  padding:12px 16px;
  color:var(--iq-muted);
  font-size:12px;
}

.secondary-actions summary {
  cursor:pointer;
}

.secondary-actions .filter-bar {
  margin:14px 0 0;
}

.table-wrap {
  width:100%;
  overflow:auto;
  border:1px solid var(--iq-border);
  border-radius:10px;
}

table.data {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
  text-align:left;
}

table.data th {
  padding:12px 15px;
  background:var(--iq-soft);
  border-bottom:1px solid var(--iq-border);
  font-size:10px;
  letter-spacing:.4px;
  font-weight:600;
  color:var(--iq-muted);
  white-space:nowrap;
}

table.data td {
  padding:15px;
  border-bottom:1px solid var(--iq-border);
  vertical-align:middle;
  font-size:12px;
}

table.data tbody tr:last-child td {
  border-bottom:0;
}

table.data tbody tr:hover {
  background:var(--iq-soft);
}

table.data td:first-child {
  color:var(--iq-muted);
  font-variant-numeric:tabular-nums;
}

table.data .empty td {
  text-align:center;
  padding:55px 24px;
  color:var(--iq-muted);
  white-space:normal;
}

.file-cell {
  max-width:270px;
}

.file-cell .mono {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
}

.file-kind {
  font-size:10px;
  color:var(--iq-muted);
  margin-top:4px;
}

.actions-cell {
  white-space:nowrap;
}

.actions-cell .act+.act {
  margin-left:5px;
}

.act {
  display:inline-flex;
  align-items:center;
  gap:5px;
  border:1px solid var(--iq-border);
  border-radius:6px;
  padding:5px 9px;
  background:var(--iq-surface);
  color:var(--iq-blue-text);
  font-size:11px;
  font-weight:550;
  text-decoration:none;
}

.act:hover {
  background:var(--iq-soft);
  border-color:#aec3e7;
}

.act.danger {
  color:var(--iq-red);
}

.badge {
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  padding:4px 8px;
  font-size:10px;
  font-weight:600;
  line-height:1.3;
  border-radius:5px;
}

.badge:before {
  content:'';
  width:5px;
  height:5px;
  border-radius:50%;
  background:currentColor;
}

.badge.ok {
  color:#287c60;
  background:#e9f6ee;
}

.badge.err {
  color:#bf4955;
  background:#fff0f1;
}

.badge.warn {
  color:#ae791e;
  background:#fff5df;
}

.badge.info {
  color:#416dc3;
  background:#edf2ff;
}

.badge.neutral {
  color:#7b879b;
  background:#eef1f6;
}

.pager {
  display:flex;
  align-items:center;
  gap:9px;
  margin-top:20px;
  color:var(--iq-muted);
  font-size:11px;
}

.pager-count {
  margin-right:auto;
}

.pager .input {
  width:auto;
  min-width:65px;
  min-height:32px;
  padding:6px 9px;
  font-size:11px;
}

.pager button {
  min-width:34px;
  min-height:32px;
}

.pager-label {
  font-size:11px;
}

.page-range {
  color:var(--iq-text);
  font-weight:550;
}

.charts-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(270px,1fr));
  gap:16px;
  margin-bottom:20px;
}

.chart {
  margin:0;
  padding:22px;
}

.chart-title {
  font-size:13px;
  font-weight:600;
  margin-bottom:22px;
}

.chart-bars {
  display:flex;
  flex-direction:column;
  gap:17px;
}

.chart-bar-row {
  display:grid;
  grid-template-columns:minmax(70px,110px) 1fr 34px;
  align-items:center;
  gap:12px;
  font-size:11px;
}

.chart-bar-label {
  color:var(--iq-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.chart-bar-track {
  height:7px;
  background:var(--iq-bg);
  border-radius:4px;
  overflow:hidden;
}

.chart-bar-fill {
  height:100%;
  background:#6385db;
  border-radius:4px;
}

.chart-bar-val {
  text-align:right;
  font-variant-numeric:tabular-nums;
  font-weight:600;
}

.detail {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:12px;
  margin-bottom:20px;
}

.detail-item.detail-wide {
  grid-column:span 2;
}

.detail-item {
  padding:16px;
  border:1px solid var(--iq-border);
  border-radius:10px;
  background:var(--iq-soft);
}

.detail-item .k {
  font-size:10px;
  color:var(--iq-muted);
  margin-bottom:7px;
}

.detail-item .v {
  overflow-wrap:anywhere;
}

.back-link {
  margin-bottom:18px;
}

.modal {
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:#0d1b38a6;
  backdrop-filter:blur(3px);
}

.modal-box {
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:570px;
  max-height:calc(100dvh - 56px);
  background:var(--iq-surface);
  border:1px solid var(--iq-border);
  border-radius:17px;
  box-shadow:0 30px 100px #06102940;
  overflow:hidden;
}

.modal-box.modal-wide {
  max-width:990px;
}

.modal-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:22px 26px;
  border-bottom:1px solid var(--iq-border);
  flex-shrink:0;
}

.modal-title {
  font-size:18px;
  letter-spacing:-.4px;
  font-weight:650;
}

.modal-close {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:0;
  border-radius:6px;
  background:var(--iq-bg);
  color:var(--iq-muted);
  font-size:15px;
}

.modal-close:hover {
  color:var(--iq-text);
}

.modal-body {
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:24px 26px;
}
.modal-footer {
  flex-shrink:0;
  padding:14px 26px;
  border-top:1px solid var(--iq-border);
  background:var(--iq-surface);
}
.modal-footer .export-footer {
  margin:0;
  padding:0;
  border-top:0;
  box-shadow:none;
}

.modal-body>p {
  font-size:12px;
  line-height:1.8;
  color:var(--iq-muted);
  margin-bottom:16px;
}

.modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:20px;
}
.confirm-message {
  margin:0;
  color:var(--iq-text);
  font-size:13px;
  line-height:1.7;
}
.modal-footer .modal-actions {
  margin:0;
}

.modal-body .kv {
  display:grid;
  grid-template-columns:120px 1fr;
  gap:10px;
  margin-bottom:18px;
}

.kv .k {
  color:var(--iq-muted);
  font-size:12px;
}

.kv .v {
  padding:10px;
  border:1px solid var(--iq-border);
  border-radius:7px;
  background:var(--iq-soft);
  overflow-wrap:anywhere;
  font-size:12px;
}

.modal-body pre {
  padding:16px;
  overflow:auto;
  border-radius:9px;
  background:var(--iq-bg);
  font-size:11px;
  line-height:1.7;
  margin-bottom:18px;
}

.modal-warn {
  padding:12px;
  border-radius:8px;
  background:#fff5df;
  color:#ae791e;
  font-size:12px;
  margin-bottom:16px;
}

.export-format {
  display:flex;
  align-items:center;
  gap:16px;
  padding:15px 17px;
  background:var(--iq-soft);
  border:1px solid var(--iq-border);
  border-radius:10px;
  margin-bottom:20px;
}

.export-format label {
  font-size:12px;
  font-weight:550;
}

.export-format select {
  max-width:230px;
  margin-left:auto;
}

.export-options {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin-bottom:20px;
}
.export-options .field {
  margin:0;
}
.export-options select:disabled {
  opacity:.55;
  cursor:not-allowed;
}
.export-encoding-note {
  margin:-8px 0 18px;
  font-size:11px;
  line-height:1.65;
}
.export-period {
  min-width:0;
  margin:0 0 20px;
  padding:16px;
  border:1px solid var(--iq-border);
  border-radius:10px;
}

.export-period legend {
  padding:0 6px;
  font-size:13px;
  font-weight:550;
}

.export-period .export-grid {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
  margin-bottom:8px;
}

.export-period [role=status] {
  color:var(--iq-muted);
  font-size:12px;
}

.export-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px 16px;
  margin-bottom:20px;
}

.export-grid .field {
  margin:0;
  position:relative;
  align-self:start;
}

.export-grid .field>[role=status] {
  display:block;
  min-height:17px;
  font-size:10px;
  line-height:1.5;
  margin-top:5px;
  color:var(--iq-muted);
}

.export-grid [role=listbox] {
  position:relative;
  margin-top:6px;
  border:1px solid var(--iq-border);
  border-radius:7px;
  padding:4px;
  background:var(--iq-surface);
  box-shadow:0 5px 15px #10284a0a;
}

.export-grid [role=option] {
  border:0;
  min-height:30px;
  font-size:11px;
}

.export-grid [id^=te-picked] {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:6px;
}

.export-grid [data-remove] {
  border:0;
  background:var(--iq-soft);
  color:var(--iq-blue-text);
  font-size:10px;
  padding:4px 7px;
  min-height:26px;
  overflow-wrap:anywhere;
  max-width:100%;
}

.export-grid [id^=te-more] {
  font-size:10px;
  margin-top:5px;
}

.table-picker {
  padding:17px;
  border:1px solid var(--iq-border);
  border-radius:10px;
  margin-bottom:18px;
}

.table-picker p {
  color:var(--iq-muted);
  font-size:12px;
  margin-bottom:12px;
}

.table-picker-actions {
  display:flex;
  gap:8px;
  margin-bottom:15px;
}

.table-picker-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}

.table-picker-grid label {
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px;
  border-radius:6px;
  font-size:11px;
  background:var(--iq-soft);
  overflow-wrap:anywhere;
}

.table-picker-grid label:has(input:checked) {
  background:#eaf0fd;
  color:#2449a4;
}

.table-picker-grid small {
  font-size:9px;
  color:var(--iq-muted);
}

.export-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding-top:18px;
  border-top:1px solid var(--iq-border);
}

.export-footer p {
  font-size:11px;
  color:var(--iq-muted);
}

.export-footer .btn {
  flex-shrink:0;
}

.login-wrap {
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:30px;
  background:#f0f4fa;
  background-image:radial-gradient(ellipse at 15% 0%,#dae4f8 0%,transparent 55%);
}

.login-card {
  width:100%;
  max-width:430px;
  padding:36px;
  background:var(--iq-surface);
  border:1px solid var(--iq-border);
  border-radius:19px;
  box-shadow:0 20px 60px #1732720a;
}

.login-brand {
  text-align:center;
  margin-bottom:30px;
}

.login-brand .brand-mark {
  margin:0 auto 17px;
  width:46px;
  height:46px;
  font-size:21px;
}

.login-logo {
  font-weight:800;
  letter-spacing:2px;
  font-size:25px;
}

.login-hint {
  font-size:11px;
  line-height:1.8;
  color:var(--iq-muted);
  text-align:center;
  margin-top:22px;
}

.login-error {
  padding:11px 13px;
  background:#fff0f1;
  color:#bf4955;
  border-radius:8px;
  font-size:12px;
  margin-bottom:16px;
}

.login-card .btn-block {
  margin-top:7px;
}

.toast {
  position:fixed;
  right:28px;
  bottom:25px;
  z-index:200;
  max-width:min(460px,calc(100vw - 40px));
  padding:14px 18px;
  background:var(--iq-sidebar);
  color:#fff;
  border-radius:10px;
  box-shadow:0 8px 30px #10284a26;
  font-size:12px;
  border-left:4px solid #85a6ff;
}

.toast.err {
  border-left-color:#f4939d;
}

.toast.ok {
  border-left-color:#70d9ad;
}

.toast.warn {
  border-left-color:#e6b66e;
}

.spinner {
  display:inline-block;
  width:17px;
  height:17px;
  border:2px solid var(--iq-border);
  border-top-color:var(--iq-blue);
  border-radius:50%;
  animation:spin .7s linear infinite;
  vertical-align:middle;
}

@keyframes spin {
  to {
    transform:rotate(360deg);
  }
}

.loading-state {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:180px;
  color:var(--iq-muted);
}

body.dark {
  color-scheme:dark;
  --iq-bg:#101827;
  --iq-surface:#182235;
  --iq-text:#e0e7f4;
  --iq-muted:#98a8c0;
  --iq-border:#29364d;
  --iq-soft:#1c2940;
  --iq-blue-text:#9ab8ff;
  --iq-blue:#4068cb;
  --iq-blue-dark:#365abb;
  --iq-sidebar:#111c30;
}

.dark .badge.ok {
  background:#1a3a31;
  color:#8cd6b5;
}

.dark .badge.info {
  background:#253858;
  color:#a2bfff;
}

.dark .badge.warn {
  background:#3d3220;
  color:#e7c384;
}

.dark .badge.err {
  background:#412a34;
  color:#eea5af;
}

.dark .badge.neutral {
  background:#29364c;
  color:#b2c0d6;
}

.dark .export-action .action-icon {
  background:#253858;
}

.dark .export-action.primary {
  border-color:#3f5680;
}

.dark .login-wrap {
  background:var(--iq-bg);
}

.dark .table-picker-grid label:has(input:checked) {
  background:#253858;
  color:#b3cbff;
}

.dark .modal-warn {
  background:#3d3220;
  color:#e7c384;
}

.dark .login-error {
  background:#412a34;
  color:#eea5af;
}

@media(min-width:1600px) {
  .page {
    padding-top:36px;
  }
  .topbar {
    padding-left:44px;
    padding-right:44px;
  }
}

@media(max-width:1400px) {
  .iq-nav-ico {
    display:none;
  }
  .iq-nav-link {
    padding-left:9px;
    padding-right:9px;
  }
}

@media(max-width:1200px) {
  :root {
    --iq-sidebar-w:215px;
  }
  .page {
    padding:26px 24px 40px;
  }
  .topbar {
    padding:17px 24px;
  }
  .export-action {
    padding:16px;
    gap:10px;
  }
  .export-action .action-icon {
    width:31px;
    height:31px;
  }
  .action-arrow {
    display:none;
  }
  .stats-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:1000px) {
  .audit-table,
  .audit-table tbody {
    display:block;
  }
  .audit-table thead {
    display:none;
  }
  .audit-table tr {
    display:grid;
    grid-template-columns:1fr auto;
    grid-template-areas:"date result" "actor actions";
    gap:8px;
    padding:14px;
  }
  .audit-table tbody tr + tr {
    border-top:1px solid var(--iq-border);
  }
  .audit-table td {
    border:0;
    padding:0;
    min-width:0;
  }
  .audit-table .au-date {
    grid-area:date;
    font-size:11px;
  }
  .audit-table .au-actor {
    grid-area:actor;
    font-size:11px;
  }
  .audit-table .au-result {
    grid-area:result;
    justify-self:end;
  }
  .audit-table .au-action,
  .audit-table .au-resource,
  .audit-table .au-ip,
  .audit-table .au-cnt {
    display:none;
  }
  .audit-table .actions-cell {
    grid-area:actions;
    position:static;
    box-shadow:none;
  }
  .audit-table .empty {
    display:block;
    text-align:center;
  }
}

@media(max-width:900px) {
  .export-actions {
    grid-template-columns:1fr;
  }
  .export-action {
    align-items:center;
  }
  .export-action .action-description {
    margin:0;
  }
  .export-action .action-title {
    margin-bottom:3px;
  }
  .export-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .topbar-context {
    display:none;
  }
  .intro-links {
    flex-direction:column;
  }
  .page-intro h1 {
    font-size:24px;
  }
  .table-picker-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:720px) {
  .sidebar {
    position:fixed;
    left:0;
    transform:translateX(-100%);
    transition:transform .2s;
    width:250px;
    box-shadow:8px 0 40px #10284a20;
  }
  .sidebar-open .sidebar {
    transform:translateX(0);
  }
  .sidebar-open .sidebar-backdrop {
    display:block;
    position:fixed;
    inset:0;
    background:#0d1b3880;
    z-index:35;
    border:0;
  }
  .icon-button.menu-toggle {
    display:inline-grid;
  }
  .topbar {
    min-height:68px;
    padding:13px 17px;
    gap:10px;
  }
  .topbar-actions {
    gap:7px;
  }
  .topbar-title {
    font-size:15px;
  }
  .topbar .btn-sm {
    font-size:11px;
    padding:7px 10px;
  }
  .page {
    padding:23px 16px 35px;
  }
  .page-intro {
    align-items:flex-start;
  }
  .page-intro h1 {
    font-size:23px;
  }
  .page-intro p {
    font-size:12px;
  }
  .eyebrow {
    font-size:10px;
  }
  .intro-links {
    display:none;
  }
  .card,.chart {
    padding:18px 16px;
    border-radius:12px;
  }
  .card-head {
    margin-bottom:18px;
  }
  .stats-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .stat {
    padding:16px;
  }
  .stat-value {
    font-size:26px;
  }
  .stat-icon {
    right:12px;
    top:12px;
    width:25px;
    height:25px;
  }
  .filter-bar {
    gap:10px;
  }
  .filter-control {
    flex:1;
    min-width:130px;
  }
  .filter-control select.input,.filter-bar select.input {
    width:100%;
    min-width:0;
  }
  .filter-caption {
    display:none;
  }
  .card-title {
    font-size:14px;
  }
  .pager {
    flex-wrap:wrap;
    gap:7px;
  }
  .pager-count {
    flex-basis:100%;
    margin-bottom:3px;
  }
  .table-wrap {
    border-radius:8px;
  }
  table.data td,table.data th {
    padding:12px;
  }
  .modal {
    padding:10px;
  }
  .modal-box {
    max-height:calc(100dvh - 20px);
    border-radius:13px;
  }
  .modal-header {
    padding:17px 18px;
  }
  .modal-title {
    font-size:16px;
  }
  .modal-body {
    padding:18px;
  }
  .export-format {
    padding:12px;
    gap:10px;
  }
  .export-format label {
    font-size:11px;
  }
  .export-format select {
    max-width:170px;
  }
  .export-footer {
    align-items:stretch;
    flex-direction:column;
  }
  .export-footer .btn {
    width:100%;
  }
  .login-card {
    padding:30px 25px;
  }
  .toast {
    right:16px;
    bottom:16px;
  }
  .charts-grid {
    grid-template-columns:1fr;
  }
}

@media(max-width:440px) {
  .export-grid,.table-picker-grid {
    grid-template-columns:1fr;
  }
  .lang-toggle {
    display:none;
  }
  .topbar-title {
    font-size:14px;
  }
  .stat-note {
    display:none;
  }
  .modal-body .kv {
    grid-template-columns:1fr;
  }
  .export-format {
    align-items:stretch;
    flex-direction:column;
  }
  .export-format select {
    max-width:none;
    margin:0;
  }
  .form-row>.btn {
    width:100%;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
}

/* History rows become readable cards on phones; actions remain visible. */
@media(max-width:1400px) {
  .task-table,.task-table tbody {
    display:block;
  }
  .task-table thead {
    display:none;
  }
  .task-table tr {
    display:grid;
    grid-template-columns:1fr auto;
    grid-template-areas:"id status" "type client" "file file" "created attempts" "actions actions";
    gap:10px;
    padding:16px;
  }
  .task-table tbody tr+tr {
    border-top:1px solid var(--iq-border);
  }
  .task-table td {
    border:0;
    padding:0;
    min-width:0;
    font-size:12px;
  }
  .task-table .task-id {
    grid-area:id;
    font-weight:600;
    color:var(--iq-text);
  }
  .task-table .task-type {
    grid-area:type;
    color:var(--iq-muted);
    font-size:11px;
  }
  .task-table .task-status {
    grid-area:status;
    justify-self:end;
  }
  .task-table .task-client {
    grid-area:client;
    color:var(--iq-muted);
    font-size:10px;
  }
  .task-table .task-file {
    grid-area:file;
    max-width:none;
  }
  .task-table .task-file .mono {
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .task-table .task-created {
    grid-area:created;
    font-size:10px;
  }
  .task-table .task-attempts {
    grid-area:attempts;
    font-size:10px;
    text-align:right;
  }
  .task-table .task-attempts:before {
    content:attr(data-label) ': ';
  }
  .task-table .task-actions {
    grid-area:actions;
    display:flex;
    gap:7px;
    padding-top:4px;
  }
  .task-table .actions-cell .act+.act {
    margin-left:0;
  }
  .task-table .act {
    min-height:32px;
    padding:6px 12px;
  }
  .task-table .empty {
    display:block;
    text-align:center;
  }
}

.history-update-status {
  margin-top: 10px;
  color: var(--iq-amber);
  font-size: 11px;
}
.history-update-status:empty {
  display: none;
}


/* Export progress is based on completed tables, not elapsed time. */
.task-progress { width: 225px; max-width: 100%; margin-top: 8px; text-align: left; }
.task-progress-label, .task-progress-caption { font-size: 11px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-progress-caption { opacity: .7; white-space: normal; overflow-wrap: anywhere; }
.task-progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(110,130,160,.18); margin: 5px 0; }
.task-progress-track span { display: block; height: 100%; border-radius: inherit; background: #568df5; transition: width .3s ease; }
.task-progress.is-ready .task-progress-track span { background: #24a77a; }
.task-progress-track.is-indeterminate span { animation: export-progress 1.3s ease-in-out infinite alternate; }
@keyframes export-progress { from { transform: translateX(-100%); } to { transform: translateX(285%); } }
@media (prefers-reduced-motion: reduce) { .task-progress-track.is-indeterminate span { animation: none; margin-left: 32%; } }

/* Browser-bound transfers stay visible across page navigation. */
.download-transfers { position: fixed; right: 24px; bottom: 88px; z-index: 190; width: min(380px, calc(100vw - 32px)); max-height: 45vh; overflow-y: auto; background: var(--iq-surface); color: var(--iq-text); border: 1px solid var(--iq-border); border-radius: 12px; box-shadow: 0 8px 30px #10284a26; }
.download-transfer { padding: 16px; }
.download-transfer + .download-transfer { border-top: 1px solid var(--iq-border); }
.download-transfer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.download-transfer-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.download-transfer-heading button { flex-shrink: 0; }
.download-transfer-status { margin: 6px 0; font-size: 12px; }
.download-transfer progress { display: block; width: 100%; height: 8px; accent-color: var(--iq-blue-text); }
.download-transfer-caption { margin-top: 6px; font-size: 11px; color: var(--iq-muted); overflow-wrap: anywhere; }
.download-transfer.is-error .download-transfer-status { color: var(--iq-red); }
.download-transfer.is-warning .download-transfer-status { color: var(--iq-amber); }
@media (max-width: 600px) { .download-transfers { right: 16px; bottom: 80px; } }

/* ============================================================
   New Web UI — dark top header, second-level navigation, light workspace.
   ============================================================ */
:root {
  --iq-header:#101b3b;
  --iq-header-muted:#8d9ab8;
  --iq-nav-active:#eef3ff;
  --iq-page-bg:#f3f6fb;
}

body {
  background:var(--iq-page-bg);
}

.iq-app {
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.iq-header {
  position:sticky;
  top:0;
  z-index:60;
  background:var(--iq-header);
  color:#fff;
  box-shadow:0 2px 14px #0c17322e;
}

.iq-header-inner {
  width:100%;
  min-height:84px;
  margin:0 auto;
  padding:0 36px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.iq-brand {
  display:flex;
  align-items:center;
  gap:18px;
  min-width:0;
}

.iq-brand-logo {
  display:block;
  width:auto;
  height:43px;
}

.iq-product {
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-left:0;
  line-height:1;
}

.iq-product-name {
  color:#80a0ee;
  font-size:15px;
  font-weight:600;
  letter-spacing:.02em;
}

.iq-product-version {
  color:#8593af;
  font-size:11px;
  letter-spacing:.02em;
}

.iq-header-actions {
  display:flex;
  align-items:center;
  gap:14px;
  flex-shrink:0;
}

.iq-user {
  display:flex;
  align-items:center;
  gap:11px;
  margin-right:5px;
  color:#fff;
}

.iq-avatar {
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#294873;
  color:#dce9ff;
  font-size:15px;
  font-weight:600;
}

.iq-user-meta {
  min-width:0;
  line-height:1.25;
}

.iq-user-name {
  max-width:170px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  font-weight:500;
}

.iq-user-role {
  color:#94a2bd;
  font-size:11px;
  margin-top:2px;
}

.iq-header .lang-toggle {
  display:flex;
  background:#ffffff12;
  padding:4px;
  border-radius:7px;
}

.iq-header .lang-btn {
  min-width:32px;
  min-height:31px;
  padding:5px 8px;
  color:#aebbd2;
  font-size:11px;
}

.iq-header .lang-btn.active {
  background:#fff;
  color:#26334d;
  box-shadow:none;
}

.iq-icon-btn {
  width:38px;
  height:38px;
  display:inline-grid;
  place-items:center;
  border:1px solid #263554;
  border-radius:8px;
  background:transparent;
  color:#9eacc8;
  font-size:18px;
  transition:background .15s,border-color .15s,color .15s;
}

.iq-icon-btn:hover {
  background:#ffffff0d;
  border-color:#3a4b6e;
  color:#fff;
}

.iq-logout {
  min-height:38px;
  padding:8px 18px;
  border:1px solid #334665;
  background:#1d2944;
  color:#d8e3f7;
  font-size:12px;
  border-radius:7px;
  box-shadow:none;
}

.iq-logout:hover {
  background:#273859;
  border-color:#435a80;
}

.iq-menu-toggle {
  display:none;
}

.iq-nav {
  position:sticky;
  top:84px;
  z-index:50;
  background:#fff;
  border-bottom:1px solid var(--iq-border);
}

.iq-nav-inner {
  width:100%;
  min-height:82px;
  margin:0 auto;
  padding:0 40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
}

.iq-nav-groups {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
  min-width:0;
}

.iq-nav-group {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:9px;
  min-height:48px;
  padding:0 16px;
  border-radius:8px;
  transition:background .15s;
}

.iq-nav-group + .iq-nav-group {
  border-left:1px solid #edf1f7;
  border-top-left-radius:0;
  border-bottom-left-radius:0;
}

.iq-nav-group.has-active {
  background:#f5f8ff;
}

.iq-nav-group.has-active .iq-nav-label {
  color:#2449a4;
}

.iq-nav-label {
  width:max-content;
  margin:0;
  color:#6f7d94;
  font-size:10px;
  font-weight:600;
  letter-spacing:.06em;
  line-height:1.2;
  text-transform:uppercase;
  white-space:nowrap;
}

.iq-nav-links {
  display:flex;
  align-items:center;
  gap:2px;
}

.iq-nav-link {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:34px;
  padding:7px 12px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#4e5d74;
  font-size:13px;
  font-weight:500;
  white-space:nowrap;
  transition:background .15s,color .15s;
}

.iq-nav-ico {
  display:inline-grid;
  place-items:center;
  width:15px;
  height:15px;
  color:#8b98ac;
  flex-shrink:0;
}

.iq-nav-ico svg {
  width:15px;
  height:15px;
}

.iq-nav-link:hover .iq-nav-ico,
.iq-nav-link.active .iq-nav-ico {
  color:currentColor;
}

.iq-nav-link:hover {
  background:#f3f6fc;
  color:#1b2942;
}

.iq-nav-link.active {
  background:var(--iq-nav-active);
  color:#1f3d84;
  font-weight:600;
}

.iq-nav-docs {
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:0;
  color:#2449a4;
  font-size:13px;
  text-decoration:none;
  white-space:nowrap;
}

.iq-nav-docs svg {
  width:17px;
  height:17px;
}

.iq-nav-docs:hover {
  text-decoration:underline;
}

.iq-main {
  flex:1;
}

.iq-main .page {
  width:100%;
  max-width:1600px;
  margin:0 auto;
  padding:53px 40px 58px;
}

.page-intro {
  align-items:flex-start;
  margin-bottom:31px;
}

.page-intro h1 {
  color:#1c2840;
  font-size:34px;
  line-height:1.16;
  letter-spacing:-.035em;
  font-weight:600;
}

.page-intro p {
  color:#6e7b91;
  font-size:14px;
  line-height:1.55;
  margin-top:9px;
}

.eyebrow {
  color:#2449a4;
  font-size:11px;
  letter-spacing:.035em;
  text-transform:uppercase;
  font-weight:600;
  margin-bottom:8px;
}

.intro-links {
  align-items:center;
  gap:10px;
  padding-top:3px;
}

.intro-links .btn-outline {
  min-width:138px;
}

.page-intro .btn {
  min-height:43px;
  padding:10px 22px;
  border-radius:7px;
  font-size:13px;
}

.btn-primary {
  background:#2449a4;
  border-color:#2449a4;
}

.btn-outline {
  border-color:#dfe5ef;
  background:#fff;
  color:#34425a;
}

.stats-grid {
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px;
  margin-bottom:30px;
}

.stat {
  min-height:157px;
  padding:23px 24px;
  border:1px solid #e3e8f1;
  border-radius:11px;
  background:#fff;
  box-shadow:0 1px 2px #1a2b4910;
}

.stat-label {
  color:#7c879b;
  font-size:13px;
}

.stat-value {
  color:#1c2840;
  font-size:37px;
  font-weight:600;
  letter-spacing:-.035em;
  margin-top:14px;
}

.stat-note {
  color:#7c879b;
  font-size:12px;
  margin-top:10px;
}

.stat-icon {
  top:22px;
  right:23px;
  width:38px;
  height:38px;
  border-radius:10px;
  background:#f1f5fd;
  color:#5273c7;
}

.stat-icon svg {
  width:19px;
  height:19px;
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:0 0 17px;
}

.section-heading h2 {
  color:#1c2840;
  font-size:18px;
  line-height:1.3;
  font-weight:600;
  letter-spacing:-.015em;
}

.section-heading span {
  color:#7c879b;
  font-size:12px;
}

.card,.chart {
  border:1px solid #e3e8f1;
  border-radius:11px;
  padding:26px;
  margin-bottom:22px;
  background:#fff;
  box-shadow:0 1px 2px #1a2b4910;
}

.card-title {
  color:#1c2840;
  font-size:18px;
  font-weight:600;
  letter-spacing:-.015em;
  margin-bottom:18px;
}

.card-head {
  margin-bottom:18px;
}

.card-head .card-title {
  font-size:18px;
}

.chart {
  margin-bottom:0;
  padding:26px;
}

.chart-title {
  color:#25324a;
  font-size:16px;
  font-weight:600;
  margin-bottom:26px;
}

.chart-bars {
  gap:19px;
}

.chart-bar-row {
  grid-template-columns:135px minmax(80px,1fr) 42px;
  gap:15px;
  font-size:12px;
}

.chart-bar-label {
  color:#77849a;
}

.chart-bar-track {
  height:8px;
  background:#f0f3f9;
  border-radius:999px;
}

.chart-bar-fill {
  background:#617fd6;
  border-radius:999px;
}

.chart-bar-val {
  color:#34425a;
  font-size:12px;
}

.export-actions {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px;
  margin-top:12px;
  margin-bottom:40px;
}

.export-action {
  min-height:100px;
  padding:23px 24px;
  gap:16px;
  border:1px solid #e0e6f0;
  border-radius:11px;
  background:#fff;
  box-shadow:0 1px 2px #1a2b4910;
}

.export-action.primary {
  border-color:#b9c9ec;
  background:#f8faff;
  box-shadow:inset 0 0 0 1px #eef3ff,0 1px 2px #1a2b4910;
}

.export-action .action-icon {
  width:42px;
  height:42px;
  border-radius:10px;
  background:#edf2fd;
  color:#4e6fca;
}

.export-action .action-icon svg {
  width:21px;
  height:21px;
}

.action-title {
  color:#25324a;
  font-size:15px;
  font-weight:600;
  margin-bottom:6px;
}

.action-description {
  color:#7b879b;
  font-size:12px;
  line-height:1.55;
}

.action-arrow {
  align-self:center;
  color:#47639c;
  font-size:17px;
}

.filter-bar {
  align-items:flex-end;
  gap:13px;
  margin-bottom:19px;
}

.filter-bar select.input,
.filter-control select.input {
  min-width:198px;
  min-height:43px;
  border-color:#dfe5ef;
  border-radius:7px;
  font-size:13px;
}

.filter-control>span {
  color:#7b879b;
  font-size:12px;
  font-weight:500;
}

.filter-bar .btn {
  min-width:136px;
  min-height:43px;
  padding:9px 20px;
  border-radius:7px;
}

.filter-caption {
  color:#8a95a8;
  font-size:12px;
}

.filter-spacer {
  flex:1;
}

.table-wrap {
  border:1px solid #e3e8f1;
  border-radius:8px;
  background:#fff;
}

table.data {
  font-size:13px;
}

table.data th {
  position:sticky;
  top:0;
  z-index:2;
  padding:13px 20px;
  background:#f5f7fb;
  border-bottom:1px solid #e3e8f1;
  color:#7c879b;
  font-size:12px;
  font-weight:500;
  letter-spacing:0;
  text-transform:none;
}

table.data td {
  padding:18px 20px;
  border-bottom:1px solid #e8edf4;
  color:#34425a;
  font-size:13px;
}

table.data tbody tr:hover {
  background:#f9fbff;
}

table.data td:first-child {
  color:#7c879b;
}

table.data .empty td {
  padding:60px 24px;
}

.badge {
  min-height:24px;
  padding:4px 9px;
  border-radius:5px;
  font-size:11px;
  font-weight:500;
}

.badge:before {
  width:4px;
  height:4px;
}

.badge.ok {
  color:#2c886b;
  background:#e9f7ef;
}

.act {
  min-height:31px;
  padding:6px 12px;
  border:1px solid #dfe5ef;
  border-radius:6px;
  background:#fff;
  color:#33415a;
  font-size:12px;
  font-weight:500;
}

.act:hover {
  border-color:#b9c9e7;
  background:#f8faff;
}

.act.danger {
  color:#b84b57;
}

.actions-cell .act+.act {
  margin-left:7px;
}

.file-cell {
  max-width:310px;
}

.file-cell .mono {
  color:#34425a;
  font-size:12px;
}

.pager {
  margin-top:20px;
}

.pager .input,
.pager .btn {
  border-color:#dfe5ef;
}

/* Login */
.login-wrap {
  background:#f3f6fb;
}

.login-card {
  max-width:440px;
  padding:40px;
  border-radius:14px;
  border-color:#e3e8f1;
}

.login-logo-img {
  display:block;
  width:auto;
  height:44px;
  margin:0 auto 14px;
}

.login-logo-on-dark {
  display:none;
}

.login-brand {
  margin-bottom:28px;
}

.login-card .btn-block {
  min-height:43px;
  border-radius:7px;
}

/* Dark theme for the new shell */
body.dark {
  --iq-page-bg:#0e1728;
  --iq-header:#0b1427;
  --iq-nav-active:#233a63;
}

body.dark .iq-nav,
body.dark .card,
body.dark .chart,
body.dark .stat,
body.dark .export-action,
body.dark .table-wrap,
body.dark .act {
  background:#182235;
  border-color:#29364d;
}

body.dark .iq-nav {
  background:#111d32;
}

body.dark .iq-nav-link {
  color:#aebbd2;
}

body.dark .iq-nav-link:hover {
  background:#1c2b45;
  color:#fff;
}

body.dark .iq-nav-link.active {
  background:#233a63;
  color:#dce9ff;
}

body.dark .iq-header {
  border-bottom:1px solid #1e2b44;
}

/* Variant 2 tabs: the light-theme navy labels were unreadable on dark. */
body.dark .iq-nav-sub {
  background:#0f1a2d;
  border-color:#29364d;
}

body.dark .iq-tab {
  color:#aebbd2;
}

body.dark .iq-tab:hover {
  color:#e7edf8;
}

body.dark .iq-tab.active {
  color:#dce9ff;
  border-bottom-color:#7c9cf0;
}

body.dark .iq-subtab {
  color:#aebbd2;
}

body.dark .iq-subtab:hover {
  background:#1c2b45;
  color:#fff;
}

body.dark .iq-subtab.active {
  background:#233a63;
  color:#dce9ff;
}

body.dark .page-intro p,
body.dark .stat-label,
body.dark .stat-note,
body.dark .section-heading span,
body.dark .chart-bar-label,
body.dark .chart-bar-val,
body.dark .action-description,
body.dark .filter-control>span,
body.dark .filter-caption,
body.dark .file-cell .mono,
body.dark table.data td:first-child {
  color:#9fb0c8;
}

body.dark .chart-bar-track {
  background:#243653;
}

body.dark .login-logo-on-light {
  display:none;
}

body.dark .login-logo-on-dark {
  display:block;
}

body.dark .page-intro h1,
body.dark .section-heading h2,
body.dark .card-title,
body.dark .chart-title,
body.dark .action-title,
body.dark .stat-value {
  color:#e7edf8;
}

body.dark .eyebrow,
body.dark .iq-nav-docs {
  color:#9ab8ff;
}

body.dark .stat-icon,
body.dark .export-action .action-icon {
  background:#243653;
}

body.dark table.data th {
  background:#1c2940;
  border-color:#2b3952;
}

body.dark table.data td {
  border-color:#2b3952;
  color:#d4deee;
}

body.dark table.data tbody tr:hover {
  background:#1b2940;
}

body.dark .btn-outline,
body.dark .act,
body.dark .filter-bar select.input,
body.dark .filter-control select.input {
  background:#182235;
  border-color:#31415b;
  color:#d4deee;
}

body.dark .export-action.primary {
  background:#1a2942;
  border-color:#3c5685;
}

body.dark .login-wrap {
  background:#0e1728;
}

body.dark .login-card {
  background:#182235;
  border-color:#29364d;
}

/* Responsive */
@media(max-width:1400px) {
  .iq-nav-ico {
    display:none;
  }
  .iq-nav-link {
    padding-left:9px;
    padding-right:9px;
  }
}

@media(max-width:1200px) {
  .iq-header-inner,
  .iq-nav-inner,
  .iq-main .page {
    padding-left:24px;
    padding-right:24px;
  }
  .iq-nav-groups {
    gap:0;
  }
  .iq-nav-group {
    padding:0 14px;
  }
  .iq-nav-inner {
    gap:14px;
  }
  .stats-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:13px;
  }
}

@media(max-width:1000px) {
  .iq-nav-groups {
    gap:0;
  }
  .iq-nav-group {
    padding:0 10px;
  }
  .iq-nav-link {
    padding-left:8px;
    padding-right:8px;
  }
  .iq-user-name {
    max-width:110px;
  }
  .iq-user-role {
    font-size:10px;
  }
}

@media(max-width:900px) {
  .filter-bar {
    flex-direction:column;
    align-items:stretch;
  }
  .filter-control,
  .filter-control select.input,
  .filter-bar select.input,
  .filter-bar > .btn {
    width:100%;
    min-width:0;
  }
  .filter-spacer {
    display:none;
  }
  .filter-caption {
    align-self:flex-start;
  }
  .form-row {
    flex-direction:column;
    align-items:stretch;
  }
  .form-row .field,
  .form-row .field.small {
    flex:1 1 auto;
    width:100%;
  }
  .form-row > .btn {
    width:100%;
  }
  .iq-header-inner {
    min-height:72px;
    padding-left:17px;
    padding-right:17px;
  }
  .iq-brand {
    gap:15px;
  }
  .iq-brand-logo {
    height:29px;
  }
  .iq-product {
    padding-left:15px;
  }
  .iq-product-name {
    font-size:13px;
  }
  .iq-header-actions {
    gap:8px;
  }
  .iq-logout {
    padding:7px 12px;
  }
  .iq-menu-toggle {
    display:inline-grid;
  }
  .iq-nav {
    display:none;
    top:72px;
  }
  .nav-open .iq-nav {
    display:block;
  }
  .iq-nav-inner {
    min-height:0;
    padding:14px 17px 18px;
    display:block;
  }
  .iq-nav-groups {
    display:block;
  }
  .iq-nav-group,
  .iq-nav-group + .iq-nav-group {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:7px;
    padding:0;
    margin-bottom:16px;
    border:0;
    border-radius:0;
    background:transparent;
  }
  .iq-nav-links {
    flex-wrap:wrap;
  }
  .iq-nav-docs {
    margin-top:5px;
  }
  .iq-main .page {
    padding:23px 17px 42px;
  }
  .page-intro {
    flex-wrap:wrap;
  }
  .page-intro h1 {
    font-size:28px;
  }
  .intro-links {
    display:flex;
    flex-wrap:wrap;
    width:100%;
    padding-top:12px;
  }
  .stats-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:13px;
  }
  .export-actions {
    grid-template-columns:1fr;
    gap:13px;
  }
  .iq-nav-label {
    padding-left:0;
  }
}

@media(max-width:600px) {
  .filter-bar {
    flex-direction:column;
    align-items:stretch;
  }
  .filter-control,
  .filter-control select.input,
  .filter-bar select.input,
  .filter-bar > .btn {
    width:100%;
    min-width:0;
  }
  .filter-spacer {
    display:none;
  }
  .filter-caption {
    align-self:flex-start;
  }
  .task-table tr {
    grid-template-areas:"id status" "type type" "client client" "file file" "created attempts" "actions actions";
  }
  .iq-product {
    display:none;
  }
  .iq-header-inner {
    gap:8px;
    padding-left:12px;
    padding-right:12px;
  }
  .iq-brand-logo {
    height:25px;
  }
  .iq-header-actions {
    gap:5px;
  }
  .iq-icon-btn {
    width:35px;
    min-width:35px;
    height:35px;
  }
  .iq-avatar {
    width:34px;
    height:34px;
  }
  .iq-user {
    margin-right:0;
  }
  .iq-header .lang-toggle {
    padding:3px;
  }
  .iq-header .lang-btn {
    min-width:27px;
    padding:4px 5px;
  }
  .iq-logout {
    width:35px;
    min-width:35px;
    padding:0;
    font-size:0;
  }
  .iq-logout::before {
    content:'⎋';
    font-size:16px;
  }
  .page-intro h1 {
    font-size:25px;
  }
  .page-intro p {
    font-size:13px;
  }
  .stats-grid {
    grid-template-columns:1fr;
  }
  .stat {
    min-height:135px;
  }
  .stat-value {
    font-size:32px;
  }
  .card,.chart {
    padding:18px 16px;
  }
  .chart-bar-row {
    grid-template-columns:84px minmax(50px,1fr) 30px;
    gap:9px;
  }
  .intro-links .btn {
    flex:1;
  }
}


/* Accessibility and long-table improvements. */
.skip-link {
  position:fixed;
  top:-60px;
  left:16px;
  z-index:500;
  padding:9px 14px;
  border-radius:6px;
  background:#fff;
  color:#173272;
  font-size:12px;
  font-weight:600;
  box-shadow:0 4px 18px #10284a33;
  transition:top .15s;
}
.skip-link:focus {
  top:10px;
}


@media(max-width:450px) {
  .iq-user-meta {
    display:none;
  }
}

/* Variant 2: two-level tab navigation. */
.iq-nav-inner {
  min-height:58px;
  padding:0 40px;
}

.iq-nav-top {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:24px;
  min-width:0;
}

.iq-tab {
  min-height:44px;
  padding:12px 3px;
  border:0;
  border-bottom:2px solid transparent;
  background:transparent;
  color:#4e5d74;
  font-size:14px;
  font-weight:500;
  white-space:nowrap;
  transition:color .15s,border-color .15s;
}

.iq-tab:hover {
  color:#1f3d84;
}

.iq-tab.active {
  color:#2449a4;
  border-bottom-color:#2449a4;
  font-weight:600;
}

.iq-nav-sub {
  background:#f8faff;
  border-top:1px solid #edf2f9;
  border-bottom:1px solid var(--iq-border);
}

.iq-nav-sub-inner {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px;
  min-height:44px;
  padding:5px 40px;
}

.iq-subtab {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:34px;
  padding:7px 13px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#4e5d74;
  font-size:13px;
  font-weight:500;
  white-space:nowrap;
  transition:background .15s,color .15s;
}

.iq-subtab:hover {
  background:#eef3fb;
  color:#1f3d84;
}

.iq-subtab.active {
  background:#eef3ff;
  color:#1f3d84;
  font-weight:600;
}

.iq-subtab .iq-nav-ico {
  width:15px;
  height:15px;
}

@media(max-width:1200px) {
  .iq-nav-top {
    gap:18px;
  }
  .iq-nav-sub-inner {
    padding-left:24px;
    padding-right:24px;
  }
}

@media(max-width:900px) {
  .iq-nav-inner {
    min-height:0;
    padding:14px 17px 8px;
  }
  .iq-nav-top {
    gap:8px 18px;
  }
  .iq-tab {
    min-height:36px;
    padding:8px 2px;
  }
  .iq-nav-sub-inner {
    padding:6px 17px 12px;
  }
}

/* Modal forms: explicit vertical rhythm (global reset removes default margins). */
.export-filters {
  margin-top:10px;
}
.export-filters > p:first-of-type {
  margin:0 0 16px;
  color:var(--iq-muted);
  font-size:12px;
  line-height:1.8;
}
.checkbox-row {
  display:flex;
  align-items:center;
  gap:8px;
  margin:12px 0 12px;
  color:var(--iq-text);
  font-size:12px;
}
.checkbox-row span {
  display:inline;
}
.export-period {
  margin-top:6px;
}
.modal-body .field .muted {
  margin-top:6px;
  font-size:11px;
  line-height:1.6;
}
.export-footer {
  padding-top:18px;
  margin-top:0;
}

@media(max-width:600px) {
  .downloads-table .dl-id,
  .downloads-table .dl-client,
  .downloads-table .dl-ip,
  .downloads-table .dl-date {
    display:none;
  }
  .downloads-table,
  .downloads-table tbody {
    display:block;
  }
  .downloads-table thead {
    display:none;
  }
  .downloads-table tr {
    display:grid;
    grid-template-columns:1fr auto;
    grid-template-areas:"file file" "task actions";
    gap:8px;
    padding:14px;
  }
  .downloads-table tbody tr + tr {
    border-top:1px solid var(--iq-border);
  }
  .downloads-table td {
    border:0;
    padding:0;
    min-width:0;
  }
  .downloads-table .dl-file {
    grid-area:file;
    width:auto;
    max-width:none;
    white-space:normal;
    overflow-wrap:anywhere;
    font-size:11px;
  }
  .downloads-table .dl-task {
    grid-area:task;
    color:var(--iq-muted);
    font-size:11px;
  }
  .downloads-table .dl-task:before {
    content:attr(data-label);
  }
  .downloads-table .actions-cell {
    grid-area:actions;
    position:static;
    box-shadow:none;
    display:flex;
    gap:6px;
  }
  .downloads-table .empty {
    display:block;
    text-align:center;
  }
  .audit-table,
  .audit-table tbody {
    display:block;
  }
  .audit-table thead {
    display:none;
  }
  .audit-table tr {
    display:grid;
    grid-template-columns:1fr auto;
    grid-template-areas:"date result" "actor actions";
    gap:8px;
    padding:14px;
  }
  .audit-table tbody tr + tr {
    border-top:1px solid var(--iq-border);
  }
  .audit-table td {
    border:0;
    padding:0;
    min-width:0;
  }
  .audit-table .au-date {
    grid-area:date;
    font-size:11px;
  }
  .audit-table .au-actor {
    grid-area:actor;
    font-size:11px;
  }
  .audit-table .au-result {
    grid-area:result;
    justify-self:end;
  }
  .audit-table .au-action,
  .audit-table .au-resource,
  .audit-table .au-ip,
  .audit-table .au-cnt {
    display:none;
  }
  .audit-table .actions-cell {
    grid-area:actions;
    position:static;
    box-shadow:none;
  }
  .audit-table .empty {
    display:block;
    text-align:center;
  }
  .detail-item.detail-wide {
    grid-column:auto;
  }
  .clients-table th:nth-child(1),
  .clients-table td:nth-child(1),
  .clients-table th:nth-child(3),
  .clients-table td:nth-child(3),
  .clients-table th:nth-child(5),
  .clients-table td:nth-child(5) {
    display:none;
  }
  .subscriptions-table .sub-id,
  .subscriptions-table .sub-client {
    display:none;
  }
  .api-keys-table .key-id,
  .api-keys-table .key-exp,
  .api-keys-table .key-last {
    display:none;
  }
  .table-wrap table.data .empty td {
    text-align:left;
    padding-left:15px;
  }
  .modal-footer {
    padding:12px 16px;
  }
  .card-head {
    flex-wrap:wrap;
    align-items:flex-start;
  }
  .card-head .act {
    white-space:nowrap;
  }
  .form-row {
    flex-direction:column;
    align-items:stretch;
  }
  .form-row .field,
  .form-row .field.small {
    flex:1 1 auto;
    width:100%;
  }
  .form-row > .btn {
    width:100%;
  }
  .export-footer {
    flex-direction:column;
    align-items:stretch;
  }
  .export-footer .modal-actions {
    width:100%;
  }
  .export-footer .btn {
    flex:1;
  }
  .table-wrap table.data .actions-cell {
    position:sticky;
    right:0;
    z-index:1;
    background:var(--iq-surface);
    box-shadow:-10px 0 14px -14px #10284a90;
  }
  .table-wrap table.data tbody tr:hover .actions-cell {
    background:var(--iq-soft);
  }
  .task-table .actions-cell {
    position:static;
    box-shadow:none;
  }
}

@media(max-width:600px) {
  .export-options {
    grid-template-columns:1fr;
    gap:12px;
  }
}
