:root {
  --primary: #275efe;
  --primary-dark: #1c46b5;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1f1f2f;
  --muted: #6b6b7c;
  --danger: #f25f5c;
  --success: #34c759;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
}

.admin-header {
  background: var(--surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header .container {
  width: min(1200px, 92%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand .logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand .name {
  font-weight: 600;
  margin: 0;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 500;
}

.admin-nav a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.2s ease;
  color: var(--muted);
}

.admin-nav a.active,
.admin-nav a:hover {
  background: rgba(39, 94, 254, 0.12);
  color: var(--primary-dark);
}

.admin-nav .btn {
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
}

.admin-nav .btn:hover {
  background: var(--primary-dark);
}

.page {
  width: min(1200px, 92%);
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.page h1 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(20, 30, 60, 0.08);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  margin: 0;
}

.table-card {
  margin-top: 2rem;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
}

th {
  background: #f0f2f9;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:nth-child(every) {
  background: var(--surface);
}

tbody tr + tr {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.badge {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge.success {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
}

.badge.pending {
  background: rgba(252, 195, 55, 0.2);
  color: #c27a00;
}

.badge.danger {
  background: rgba(242, 95, 92, 0.18);
  color: var(--danger);
}

.badge.info {
  background: rgba(39, 94, 254, 0.15);
  color: var(--primary);
}

.badge.warning {
  background: rgba(252, 195, 55, 0.2);
  color: #c27a00;
}

.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.alert-success {
  background: #efe;
  border: 1px solid #cfc;
  color: #3c3;
}

.section-head {
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(0, 0, 0, 0.1);
}

.action-btns .info {
  background: rgba(39, 94, 254, 0.1);
  color: var(--primary);
}

.action-btns .info:hover {
  background: rgba(39, 94, 254, 0.2);
}

.action-btns .success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
}

.action-btns .success:hover {
  background: rgba(52, 199, 89, 0.2);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-bar select,
.filter-bar input {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-family: inherit;
}

.action-btns {
  display: flex;
  gap: 0.5rem;
}

.action-btns button,
.action-btns a {
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.action-btns .primary {
  background: var(--primary);
  color: #fff;
}

.action-btns .ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.form-card {
  max-width: 640px;
  margin-top: 2rem;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 500;
}

form input,
form select,
form textarea {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.9rem 1rem;
  font-family: inherit;
}

form textarea {
  resize: vertical;
  min-height: 120px;
}

form button {
  margin-top: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease;
}

form button:hover {
  background: var(--primary-dark);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.timeline .card {
  position: relative;
  padding-left: 2.5rem;
}

.timeline .card::before {
  content: attr(data-step);
  position: absolute;
  left: 1rem;
  top: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: rgba(39, 94, 254, 0.2);
}

.message-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.message-item {
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 15px 35px rgba(20, 30, 60, 0.07);
}

.message-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.message-item time {
  color: var(--muted);
  font-size: 0.85rem;
}

footer {
  text-align: center;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .admin-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .admin-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .admin-nav .btn {
    width: 100%;
    text-align: center;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar input,
  .filter-bar select,
  .filter-bar button {
    width: 100%;
  }

  .action-btns {
    flex-wrap: wrap;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 0.5rem;
  }

  .page {
    padding: 1.5rem 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .message-item header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .page h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

