:root {
  --bg: #0c111b;
  --card: linear-gradient(135deg, rgba(26, 35, 58, 0.92), rgba(12, 18, 33, 0.92));
  --text: #e8edf9;
  --muted: #b6c0d8;
  --border: rgba(120, 163, 255, 0.2);
  --accent: linear-gradient(135deg, #7c3aed, #22d3ee);
  --accent-contrast: #0b1224;
  --shadow: 0 12px 30px rgba(9, 12, 26, 0.6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IRANSans", "Vazir", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.15), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.12), transparent 26%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page__header h1 {
  margin: 0 0 8px;
}

.page__header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-summary {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.status-summary__item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-summary__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}

.form-grid__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid__row--full {
  grid-column: 1 / -1;
}

.form-grid__label {
  font-weight: 700;
  color: var(--text);
}

.form-grid input[type="text"],
.form-grid textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fbff;
  font-size: 14px;
}

.form-grid__textarea {
  min-height: 80px;
  resize: vertical;
}

.form-grid__row--ticks {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.form-grid__ticks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.form-grid__ticks label {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-grid__actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.card__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.card__textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-contrast);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.25);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

button:disabled {
  background: #b0b7c9;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(34, 211, 238, 0.25);
  opacity: 0.95;
}

.card__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.upload__form input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
}

.notice--muted {
  background: #f8fafc;
  color: var(--muted);
}

.notice--info {
  background: #eef2ff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.notice--success {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.notice--error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecdd3;
}

.card--search {
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);
  color: #f8fbff;
}

.card--search h2 {
  color: #f8fbff;
  margin-top: 0;
}

.card--search p {
  color: var(--muted);
}

.card--search table {
  color: #f8fbff;
}

.card--search table th,
.card--search table td {
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.18);
}

.card--search table th {
  background: rgba(124, 58, 237, 0.2);
}

.card--search .card__table-wrapper::after {
  background: linear-gradient(90deg, rgba(12, 17, 27, 0) 0%, rgba(12, 17, 27, 0.9) 96%);
}

.search__controls {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.search__controls input {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fbff;
  font-size: 15px;
}

.search__controls input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.card__table-wrapper {
  overflow-x: auto;
  position: relative;
}

.card__table-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 17, 27, 0) 0%, rgba(12, 17, 27, 0.94) 96%);
}

.page__links {
  margin-top: 8px;
}

.button-link {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  font-weight: 700;
}

.button-link:hover {
  opacity: 0.92;
}

.button-link--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #e5ecff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

table th,
table td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 8px;
  text-align: right;
  vertical-align: top;
  font-size: 14px;
}

table th {
  background: rgba(124, 58, 237, 0.14);
  font-weight: 800;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 4px;
}

.pagination__status {
  color: #dbe5ff;
  font-weight: 700;
}

.pagination__btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e6edff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 84px;
}

.pagination__btn:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
}

.table--stacked {
  width: 100%;
}

.table-input,
.table-note {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.name-cell {
  display: grid;
  gap: 6px;
}

.name-cell .table-input {
  width: 100%;
}

.table-note {
  min-height: 40px;
}

.table-address {
  min-height: 64px;
  white-space: pre-wrap;
  resize: vertical;
}

.table-checkbox {
  width: 18px;
  height: 18px;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.table-actions button {
  width: auto;
  padding: 8px 12px;
}

.muted-text {
  color: #cbd5e1;
}

@media (max-width: 920px) {
  .page {
    padding: 16px 12px 32px;
  }

  .search__controls {
    flex-wrap: wrap;
  }

  .search__controls input,
  .search__controls button {
    flex: 1 1 100%;
  }

  button {
    width: 100%;
    text-align: center;
  }

  .card {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .page__header h1 {
    font-size: 20px;
  }

  .page__header p {
    font-size: 14px;
  }

  .card__label,
  button,
  input,
  textarea,
  table th,
  table td {
    font-size: 14px;
  }

  .card__table-wrapper {
    overflow: visible;
  }

  .card__table-wrapper::after {
    display: none;
  }

  table {
    border: 0;
    min-width: 0;
  }

  .table--stacked thead {
    display: none;
  }

    .table--stacked tr {
      display: block;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      margin-bottom: 12px;
      background: var(--card);
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    }

    .card--search .table--stacked tr {
      background: #0f172a;
      border-color: rgba(255, 255, 255, 0.2);
    }

    .table--stacked td {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
    border: 0;
    padding: 8px 0;
    position: relative;
    font-size: 13px;
  }

    .table--stacked td::before {
      content: attr(data-label);
      font-weight: 700;
      color: var(--muted);
      padding-left: 8px;
    }

    .card--search .table--stacked td {
      color: #fff;
    }

    .card--search .table--stacked td::before {
      color: #cbd5e1;
    }

  .table--stacked td:last-child {
    margin-bottom: 0;
  }

  .table--stacked .empty-row td {
    display: block;
    padding: 8px 0;
  }

  .card__actions {
    flex-direction: column;
  }
}