:root {
  color-scheme: light;
  --primary: #075985;
  --primary-dark: #0c4a6e;
  --background: #f1f5f9;
  --surface: #ffffff;
  --border: #dbe4ee;
  --text: #172033;
  --muted: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

.site-header {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-dark), #0284c7);
  box-shadow: 0 4px 18px rgb(15 23 42 / 16%);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
  padding: 26px 0;
}

.brand {
  color: #fff;
  font-size: 1.65rem;
  font-weight: 800;
  text-decoration: none;
}

.header-inner p {
  margin: 7px 0 0;
  opacity: .88;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.toolbar h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.current-path {
  color: var(--muted);
  direction: ltr;
  text-align: right;
  word-break: break-all;
}

.search-box {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: .86rem;
}

.search-box input {
  width: 100%;
  padding: 11px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.search-box input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgb(2 132 199 / 15%);
}

.file-list {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgb(15 23 42 / 7%);
}

table {
  width: 100%;
  border-collapse: collapse;
  direction: ltr;
  text-align: left;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: .82rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f0f9ff;
}

td a {
  display: inline-block;
  max-width: 720px;
  overflow: hidden;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: middle;
}

td a:hover {
  text-decoration: underline;
}

.empty-result {
  margin: 20px 0;
  padding: 16px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px 34px;
  color: var(--muted);
  font-size: .86rem;
}

@media (max-width: 700px) {
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  th,
  td {
    padding: 12px;
  }

  td a {
    max-width: 65vw;
  }

  .site-footer {
    align-items: center;
    flex-direction: column;
    gap: 6px;
  }
}

.file-count {
  display: inline-block;
  padding: 3px 8px;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
}
