:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(255,255,255,.10);
  --accent: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  background: radial-gradient(circle at top right, #1e3a8a 0, transparent 30%), var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.title h1 {
  margin: 0;
  font-size: 30px;
}

.title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.badge {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  padding: 14px;
  background: rgba(17, 24, 39, .82);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

input,
select,
button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: #0b1220;
  color: var(--text);
  outline: none;
  font: inherit;
  text-align: right;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #06111f;
  font-weight: 700;
  border: 0;
  text-align: center;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 11px 12px;
  text-align: center;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.actions button,
.actions select,
.actions .ghost {
  width: auto;
  min-width: 150px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.card,
.panel {
  background: rgba(17, 24, 39, .86);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.card {
  padding: 16px;
}

.label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.value {
  font-size: 24px;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.panel h2 {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  background: rgba(255,255,255,.03);
  white-space: nowrap;
}

td {
  font-size: 14px;
}

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

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

.salary {
  font-weight: 750;
  color: #d1fae5;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56,189,248,.12);
  color: #bae6fd;
  font-size: 12px;
  margin: 2px 0 2px 2px;
}

.rtl {
  direction: rtl;
  text-align: right;
}

.ltr-value {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

.date-value {
  white-space: nowrap;
}

.bar-wrap {
  height: 7px;
  width: 100%;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0;
  transition: width .45s ease;
}

.empty {
  padding: 22px;
  color: var(--muted);
}

.log-card {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.log-card:last-child {
  border-bottom: 0;
}

.log-card h3 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.log-content {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #080e19;
  color: #d1d5db;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.download-link {
  width: fit-content;
}

.footer {
  padding: 20px 0 4px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .wrap {
    padding: 16px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .title h1 {
    font-size: 24px;
  }

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

  .actions > * {
    width: 100% !important;
  }

  th,
  td {
    padding: 10px 12px;
  }
}
