:root {
  color-scheme: light;
  --ink: #162d32;
  --muted: #52666c;
  --line: #dfe8e7;
  --canvas: #f3f7f6;
  --surface: #fff;
  --accent: #087460;
  --accent-dark: #065a4c;
  --accent-light: #e3f5ee;
  --nav: #102d31;
  --nav-muted: #a1b7b6;
  --radius: 16px;
  --shadow: 0 5px 16px #183e3710;
  font-family: "Vazirmatn", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #38b79d; outline-offset: 3px;
}
input, select, button { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.5; }
h1 { font-size: 2.3rem; font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
bdi { unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .87rem; }
.muted { color: var(--muted); }
.svg-library { width: 0; height: 0; position: absolute; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus { position: fixed; z-index: 10; inset: 8px 8px auto auto; padding: 8px 14px; color: white; background: var(--accent-dark); border-radius: 8px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column;
  color: #e7f5f2; background: radial-gradient(ellipse at 20% 0, #1a4947 0, transparent 55%), var(--nav);
  padding: 23px 16px 18px; overflow: auto;
}
.brand { display: flex; align-items: center; gap: 12px; width: fit-content; }
.sidebar .brand { margin: 3px 8px 34px; }
.brand-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: #87e8ca; color: #113b37; flex-shrink: 0;
}
.brand-icon svg { width: 27px; height: 27px; }
.brand strong { font-size: 1.35rem; line-height: 1.1; display: block; }
.brand small { color: var(--nav-muted); font-size: .78rem; }
.main-nav { display: grid; gap: 6px; }
.nav-caption { color: var(--nav-muted); font-size: .76rem; padding-inline: 10px; margin-bottom: 4px; }
.main-nav a {
  color: #d3e6e4; display: flex; align-items: center; gap: 10px; border: 1px solid transparent;
  border-radius: 10px; padding: 10px; font-weight: 650;
}
.main-nav a:hover { background: #ffffff12; }
.main-nav a[aria-current] { color: #e5fff6; background: #26726464; border-color: #77c3b14d; }
.main-nav a[aria-current] .icon { color: #8ee8cd; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.api-version {
  display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; white-space: nowrap;
  color: #bfd6d1; border: 1px solid #ffffff2b; border-radius: 9px; padding: 7px 10px;
  font: .68rem ui-monospace, Consolas, monospace;
}
.api-version > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #85e6c6; }
.api-version b { color: #aef6db; margin-inline-start: 2px; }
.topbar {
  min-height: 65px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; padding: 8px clamp(16px, 4vw, 40px); gap: 12px;
}
.topbar-path, .operator { display: flex; align-items: center; gap: 9px; font-size: .88rem; }
.topbar-path { color: var(--muted); white-space: nowrap; }
.operator { flex-shrink: 0; }
.topbar-path strong { color: var(--ink); }
.operator bdi { max-width: min(120px, 24vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-avatar {
  width: 32px; height: 32px; display: grid; place-items: center; background: var(--accent-light);
  border-radius: 50%; color: var(--accent-dark); font-weight: 800;
}
.icon-button {
  display: grid; place-items: center; background: transparent; border: 1px solid var(--line);
  border-radius: 9px; color: var(--muted); width: 34px; height: 34px;
}
.icon-button:hover { color: var(--accent-dark); background: var(--accent-light); }
.main { width: min(100%, 1480px); margin: 0 auto; padding: 26px clamp(16px, 4vw, 40px) 40px; }
.main > .card + .card { margin-top: 16px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin-bottom: 21px; }
.page-heading h1 { overflow-wrap: anywhere; }
.page-heading p:not(.eyebrow) { color: var(--muted); margin-top: 5px; }
.eyebrow { color: var(--accent-dark); font-size: .78rem; font-weight: 750; margin-bottom: 4px; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 41px;
  border-radius: 9px; padding: 7px 13px; border: 1px solid transparent; font-weight: 700; font-size: .9rem;
  white-space: nowrap;
}
.button .icon { width: 16px; height: 16px; }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--accent-dark); background: #fff; border-color: #d2e3de; }
.button.secondary:hover { background: var(--accent-light); border-color: #b6dacd; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 9px;
  border-radius: 20px; font-size: .78rem; line-height: 1.65; font-weight: 700; white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge.neutral { background: #edf2f2; color: #455b60; }
.badge.success { background: #e3f5ea; color: #11603e; }
.badge.warning { background: #fbefdb; color: #7e4a13; }
.badge.error { background: #fcece9; color: #932f25; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-dark); font-weight: 700; font-size: .86rem; margin-bottom: 16px; }
.back-link:hover, .table-link:hover, .clear:hover { text-decoration: underline; }
.back-link .icon { width: 17px; height: 17px; }
.flash { padding: 10px 13px; border-radius: 10px; margin-bottom: 15px; border: 1px solid #c9e9dc; background: #e7f7ef; color: #135940; display: flex; align-items: center; gap: 8px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 15px; }
.metric, .card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric { padding: 14px 15px; }
.metric-head { display: flex; gap: 6px; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; font-size: .86rem; }
.metric-icon { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; }
.tone-teal { background: var(--accent-light); color: var(--accent); }
.tone-blue { background: #e6f0fc; color: #215d97; }
.tone-green { background: #e6f6ea; color: #226940; }
.tone-amber { background: #faefdc; color: #88541c; }
.metric > strong { display: block; font-size: 2.2rem; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 8px 0 5px; }
.metric > p { color: var(--muted); font-size: .75rem; }
.overview-panels, .detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 15px; align-items: start; }
.overview-panels { align-items: stretch; margin-bottom: 15px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 17px; }
.card-heading p:not(.eyebrow) { color: var(--muted); font-size: .83rem; margin-top: 2px; }
.chart {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, 1vw, 14px);
  list-style: none; padding: 0 13px; margin: 2px 0 14px;
}
.chart li { text-align: center; min-width: 0; }
.chart-track {
  height: 92px; margin: 12px 0 3px; position: relative;
  background: repeating-linear-gradient(to top, #e8efed 0, #e8efed 1px, transparent 1px, transparent 30px);
}
.bar-wrap { width: min(62%, 31px); height: var(--height); min-height: 3px; margin-inline: auto; position: absolute; inset-inline: 0; bottom: 0; }
.chart-bar { height: 100%; border-radius: 6px 6px 2px 2px; background: #82d4bf; }
.current .chart-bar { background: var(--accent); }
.bar-value { color: var(--muted); position: absolute; width: 100%; bottom: 100%; left: 0; font-size: .72rem; line-height: 1.25; }
.chart-label { font-size: .72rem; color: var(--muted); }
.current .chart-label { color: var(--accent-dark); font-weight: 800; }
.catalog-card { background: linear-gradient(145deg, #f0fcf7, #fff 72%); }
.catalog-card .card-heading { padding-bottom: 7px; }
.catalog-card > p { color: var(--muted); font-size: .83rem; margin: 1px 17px 12px; }
.catalog-card > a { margin: 0 17px 15px; }
.catalog-stat { display: flex; align-items: baseline; gap: 8px; margin: 0 17px; }
.catalog-stat strong { font-size: 2.4rem; line-height: 1.2; color: var(--accent-dark); }
.catalog-stat span { color: var(--muted); font-size: .82rem; }

.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline: 2px solid #38b79d; outline-offset: -2px; }
table { width: 100%; border-spacing: 0; text-align: start; white-space: nowrap; font-size: .86rem; }
th, td { padding: 9px 15px; border-top: 1px solid #e7eeec; text-align: start; }
th { background: #f7faf9; color: var(--muted); font-weight: 750; }
td { min-height: 43px; }
tbody tr:hover { background: #f8fcfa; }
.table-link { color: var(--accent-dark); font-weight: 750; display: inline-flex; gap: 5px; align-items: center; }
.table-link .icon { width: 14px; height: 14px; }
.table-sub { color: var(--muted); font-size: .75rem; display: block; }
.time-value { font-variant-numeric: tabular-nums; }
.empty { text-align: center; white-space: normal; display: grid; justify-items: center; gap: 5px; padding: 20px 10px; color: var(--muted); }
.empty strong { color: var(--ink); font-size: .96rem; }
.empty .icon { color: var(--accent); width: 24px; height: 24px; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; padding: 12px; border-top: 1px solid var(--line); }
.pagination span { font-size: .84rem; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 14px 15px; }
.filters > .field { flex: 0 1 210px; min-width: 0; }
.log-filters > .field { flex: 1 1 140px; }
.filters > .field:first-child { flex-basis: 220px; }
.clear { align-self: center; color: var(--muted); font-size: .82rem; font-weight: 700; }
.field label, .form-card > label { display: block; font-size: .86rem; font-weight: 750; margin-bottom: 4px; }
.field input:not([type=checkbox]), .field select, .permissions input:not([type=checkbox]), .copy-row input {
  display: block; width: 100%; height: 41px; border: 1px solid #cbded9; border-radius: 8px; color: var(--ink);
  background: #fff; padding: 6px 10px; min-width: 0; box-shadow: 0 1px 1px #123e3310;
}
.field input::placeholder, .permissions input::placeholder { color: #64777b; }
.field select { padding-inline-end: 6px; text-overflow: ellipsis; }
.field input[type=checkbox], .permissions input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.check-field label, .permission-label { display: flex; align-items: center; gap: 8px; cursor: pointer; width: fit-content; }
.help { color: var(--muted); font-size: .77rem; margin-top: 4px; }
.errorlist { color: #a12721; margin: 4px 0 0; font-size: .8rem; padding-inline-start: 17px; white-space: normal; }
.form-card { max-width: 700px; padding: 19px; }
.form-card form, .login-form form { display: grid; gap: 13px; margin-top: 12px; }
.form-card .button { justify-self: start; width: fit-content; }
.form-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-actions { padding: 13px 15px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; background: #fff; font-size: .84rem; font-weight: 700; }
.tabs a:hover, .tabs a[aria-current] { color: var(--accent-dark); border-color: #a8d4c8; background: var(--accent-light); }
.permissions td:nth-child(2) { width: 36%; min-width: 165px; }
.permissions .table-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mini-note { color: var(--accent-dark); }
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row + p { margin: 7px 0 11px; }
.log-data { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 17px 17px; }
.log-data div { padding: 8px 5px; border-top: 1px solid var(--line); min-width: 0; }
.log-data dt { color: var(--muted); font-size: .79rem; }
.log-data dd { margin: 3px 0 0; overflow-wrap: anywhere; }

.login-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(350px, 1fr); min-height: 100vh; }
.login-side {
  display: flex; flex-direction: column; justify-content: space-between; gap: 38px; padding: clamp(28px, 6vw, 80px);
  color: #e9fff8; background-color: var(--nav);
  background-image: radial-gradient(ellipse at 86% 23%, #236251, transparent 60%), repeating-linear-gradient(135deg, #ffffff06 0 1px, transparent 1px 28px);
}
.login-side .eyebrow { color: #93efd0; }
.login-display { font-size: clamp(1.9rem, 3.3vw, 3.5rem); line-height: 1.6; font-weight: 850; }
.login-copy { color: #c6e0da; max-width: 340px; font-size: .9rem; margin-top: 12px; }
.login-main { display: grid; place-items: center; padding: 25px; }
.login-form { width: min(100%, 410px); padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-form h1 { margin-top: 7px; font-size: 1.75rem; }
.login-form .button { margin-top: 4px; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding-inline: 18px; }
  .topbar { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 12px 8px; overflow: visible; }
  .sidebar .brand { margin: 0 0 8px; }
  .sidebar .brand-icon { width: 35px; height: 35px; border-radius: 8px; }
  .sidebar .brand-icon svg { width: 21px; height: 21px; }
  .sidebar .brand small { display: none; }
  .nav-caption, .sidebar-bottom { display: none; }
  .main-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main-nav a { font-size: .78rem; padding: 5px 3px; gap: 4px; justify-content: center; white-space: nowrap; }
  .main-nav .icon { width: 15px; height: 15px; }
  .topbar { min-height: 50px; padding-inline: 12px; }
  .topbar-path, .operator { gap: 5px; font-size: .78rem; }
  .main { padding: 14px 12px 25px; }
  .metrics, .overview-panels, .detail-grid { gap: 8px; }
  .overview-panels, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: start; flex-wrap: wrap; margin-bottom: 14px; }
  .metric { padding: 8px 10px; }
  .metric-icon { width: 31px; height: 31px; }
  .metric-icon .icon { width: 17px; height: 17px; }
  .card-heading { padding: 12px; }
  .card-heading .button { font-size: .76rem; padding: 5px 7px; min-height: 35px; }
  .card-heading .button .icon { width: 13px; height: 13px; }
  th, td { padding-inline: 10px; }
  .log-data { grid-template-columns: minmax(0, 1fr); }
  .filters > .field { flex: 1 1 125px; }
  .login-layout { display: block; }
  .login-side { padding: 16px; gap: 14px; }
  .login-side .api-version { display: none; }
  .login-display { font-size: 1.65rem; line-height: 1.45; }
  .login-copy { margin-top: 7px; }
  .login-main { padding: 14px; }
}
@media (max-width: 420px) {
  .main-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
