/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
       background: #f4f5f7; color: #111827; font-size: 14px; line-height: 1.5; }
a { color: inherit; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.a-header {
  background: #0d0d0f;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 54px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  z-index: 10;
}
.a-logo {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.a-logo span { color: #b91c1c; }
.a-logo em { color: rgba(255,255,255,0.3); }

.a-nav { display: flex; gap: 2px; }
.a-link {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.15s;
}
.a-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.a-link.active { color: #fff; background: rgba(185,28,28,0.35); }

.a-spacer { flex: 1; }
.a-user { font-size: 12px; color: rgba(255,255,255,0.35); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.a-wrap { max-width: 1060px; margin: 32px auto; padding: 0 24px; }
.a-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 28px;
  margin-bottom: 20px;
}
.a-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.a-page-title { font-size: 19px; font-weight: 600; }
.a-page-sub   { font-size: 13px; color: #6b7280; margin-top: 3px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-r {
  background: #b91c1c;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-r:hover { background: #991b1b; }

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

.btn-ghost {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-ghost:hover { background: #f9fafb; border-color: #9ca3af; }

.btn-danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.btn-danger:hover { background: #fef2f2; }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.a-table { width: 100%; border-collapse: collapse; }
.a-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.a-table td {
  padding: 15px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: #fafafa; }
.a-table .actions { display: flex; gap: 8px; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group  { margin-bottom: 20px; }
.form-label  { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-hint   { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185,28,28,0.1);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
  margin-top: 8px;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-cat  { background: #f1f5f9; color: #475569; }

/* ─── Login ──────────────────────────────────────────────────────────────── */
.login-page { background: #0d0d0f; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 44px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { font-size: 22px; font-weight: 700; margin-bottom: 32px; }
.login-logo span { color: #b91c1c; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 7px; font-size: 13px; margin-bottom: 20px; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 64px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty h3   { font-size: 17px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.empty p    { color: #9ca3af; margin-bottom: 24px; }

/* ─── Stats bar ──────────────────────────────────────────────────────────── */
.stats { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 16px 22px;
  flex: 1;
  min-width: 140px;
}
.stat-num   { font-size: 26px; font-weight: 700; color: #b91c1c; line-height: 1; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* ─── Image preview ──────────────────────────────────────────────────────── */
.img-preview {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #e5e7eb;
}
.img-thumb-wrap { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* ─── Confirm dialog ─────────────────────────────────────────────────────── */
.confirm-box { max-width: 460px; margin: 80px auto; }

@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .a-wrap { padding: 0 16px; }
}
