@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-2: #0c1630;
  --panel: rgba(11, 18, 33, 0.82);
  --panel-strong: rgba(14, 24, 43, 0.95);
  --line: rgba(148, 163, 184, 0.16);
  --text: #e5eefb;
  --muted: #9fb0c9;
  --accent: #7dd3fc;
  --accent-2: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.12), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: "Manrope", "IBM Plex Sans Arabic", "Avenir Next", "Segoe UI", sans-serif;
}

::selection {
  background: rgba(125, 211, 252, 0.22);
  color: var(--text);
}

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

body {
  position: relative;
  overflow-x: hidden;
}

.background-blur {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
}

.blur-a {
  width: 280px;
  height: 280px;
  background: rgba(125, 211, 252, 0.2);
  top: 10%;
  left: -80px;
}

.blur-b {
  width: 340px;
  height: 340px;
  background: rgba(52, 211, 153, 0.15);
  right: -120px;
  top: 32%;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 12px;
  margin: 0 0 10px;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  max-width: 12ch;
  text-wrap: balance;
}

.hero-copy {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  margin: 18px 0 0;
}

.hero > div:first-child {
  padding: 10px 2px;
}

.hero-panel,
.panel,
.tab,
.secondary {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 27, 49, 0.9), rgba(8, 15, 29, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  border-radius: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.08), transparent 40%, rgba(52, 211, 153, 0.08));
  pointer-events: none;
}

.hero-panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 18px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12);
}

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

.hero-panel-grid div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-panel-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.hero-panel-grid strong {
  font-size: 1.05rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 20px;
  flex-wrap: wrap;
}

.tab-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab,
.secondary {
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.secondary {
  background: rgba(255, 255, 255, 0.03);
}

.tab:hover,
.secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.45);
}

.tab.active {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.18), rgba(52, 211, 153, 0.12));
  border-color: rgba(125, 211, 252, 0.4);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.kpi {
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(13, 22, 42, 0.95), rgba(8, 15, 29, 0.92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -30% -65% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.16), transparent 70%);
  pointer-events: none;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 12px;
}

.kpi .value {
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.kpi .delta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.delta.up {
  color: #86efac;
}

.delta.down {
  color: #fda4af;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.panel {
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.24);
}

.large {
  min-height: 760px;
}

.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.panel h2 {
  font-size: 1.45rem;
}

.panel h3 {
  font-size: 1.05rem;
}

.panel p,
.panel li,
.panel td,
.panel th,
.panel label {
  color: var(--muted);
}

.panel .subtle {
  color: var(--muted);
  margin-top: -4px;
  line-height: 1.6;
}

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

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

.card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.metric-row strong {
  font-size: 1.1rem;
  color: var(--text);
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}

.list-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.list-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.list .secondary.action-button {
  width: 100%;
  justify-content: flex-start;
}

.action-button {
  text-align: left;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.table th {
  color: #dce7f9;
  font-size: 0.88rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #d6f3ff;
  font-size: 0.82rem;
}

.tag.good {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.18);
}

.tag.warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.18);
}

.tag.bad {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.18);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 7px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 8, 20, 0.7);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.import-dropzone {
  border-radius: 22px;
  border: 1px dashed rgba(125, 211, 252, 0.3);
  background: rgba(125, 211, 252, 0.05);
  padding: 18px;
  display: grid;
  gap: 8px;
}

.import-dropzone.dragover {
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.45);
}

.import-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 10px;
}

.import-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.import-card-head strong {
  color: var(--text);
}

.import-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.muted-note {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.copy-block {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-family: inherit;
  line-height: 1.7;
}

.section-stack {
  display: grid;
  gap: 14px;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.hero-copy,
.subtle,
.muted-note,
.list-item,
.table td {
  text-wrap: pretty;
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .kpi,
  .panel {
    animation: rise 0.7s ease both;
  }

  .kpi:nth-child(2) {
    animation-delay: 0.05s;
  }

  .kpi:nth-child(3) {
    animation-delay: 0.1s;
  }

  .kpi:nth-child(4) {
    animation-delay: 0.15s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .hero,
  .content-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .large {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 18px;
  }

  .hero-panel-grid,
  .grid-2,
  .grid-3,
  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
    font-size: 2.2rem;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar-actions,
  .tab-strip {
    width: 100%;
  }

  .tab,
  .secondary {
    width: 100%;
    justify-content: center;
  }
}
