:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #18202f;
  --muted: #667085;
  --line: #d8e0ea;
  --line-strong: #bcc8d6;
  --teal: #167c80;
  --teal-soft: #e5f6f5;
  --amber: #b7791f;
  --amber-soft: #fff4dc;
  --green: #2f855a;
  --green-soft: #e8f6ee;
  --coral: #bd5b48;
  --coral-soft: #fff0ec;
  --blue: #2f6f9f;
  --blue-soft: #e8f2fb;
  --shadow: 0 14px 35px rgba(24, 32, 47, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: #111827;
  color: #f8fafc;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0c166, #167c80);
  color: #111827;
  font-weight: 800;
  font-size: 21px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
}

.brand-subtitle {
  color: #aab4c4;
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d8e0ea;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-icon,
[data-icon] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nav-icon svg,
[data-icon] svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.mini-label {
  color: #aab4c4;
  font-size: 12px;
  margin-bottom: 8px;
}

.language-pill {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  color: #133032;
  background: #c7f3ee;
  font-size: 12px;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

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

.search-wrap {
  width: min(420px, 38vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(24, 32, 47, 0.04);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
}

.status-banner {
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #f0c166;
  background: #fff8e6;
  border-radius: 8px;
  color: #6f4b12;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-grid {
  display: grid;
  gap: 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(24, 32, 47, 0.03);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 10px;
  font-size: 31px;
  font-weight: 800;
}

.metric-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.panel-header {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 16px;
}

.panel-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-body {
  padding: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.select,
.input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  color: #475467;
  background: #f3f6fa;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr:hover td {
  background: #fbfdff;
}

td[dir="rtl"],
.rtl {
  direction: rtl;
  text-align: right;
  font-family:
    "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

.row-action {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  padding: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--blue-soft);
  color: #1f5c86;
}

.tag.priority-1 {
  background: var(--green-soft);
  color: var(--green);
}

.tag.priority-2 {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.priority-3 {
  background: var(--coral-soft);
  color: var(--coral);
}

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

.action-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.action-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.markdown {
  max-height: 64vh;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  line-height: 1.65;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  margin-top: 0.8em;
  line-height: 1.2;
}

.markdown pre,
.copy-block {
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  line-height: 1.55;
}

.asset-list {
  display: grid;
  gap: 10px;
}

.asset-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.asset-path {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(620px, 94vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
  z-index: 30;
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-header h2 {
  margin: 5px 0 0;
  font-size: 20px;
}

.detail-body {
  overflow: auto;
  padding: 18px;
}

.detail-section {
  margin-bottom: 18px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #475467;
}

.detail-section p {
  margin: 0;
  line-height: 1.55;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #5bb7a8);
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metrics-grid,
  .cards-grid,
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions,
  .search-wrap {
    width: 100%;
  }

  .nav-list,
  .metrics-grid,
  .cards-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .nav-item {
    justify-content: flex-start;
  }
}
