/* ═══ Admin Panel — Clean Redesign ═══ */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  background: #f8f9fb;
  color: #1a1a2e;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}
.admin-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  background: #fff;
  border-right: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid #e8eaed;
}
.sidebar__logo { width: 32px; height: 32px; flex-shrink: 0; }
.sidebar__brand-text { font-weight: 700; font-size: 15px; color: #1a1a2e; }
.sidebar__section {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #9ca3af; padding: 24px 24px 8px;
}
.sidebar__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; margin: 2px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: #6b7280;
  text-decoration: none; transition: all 0.15s ease;
}
.sidebar__item:hover { background: #f3f4f6; color: #1a1a2e; }
.sidebar__item--active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.sidebar__item--danger { color: #ef4444; }
.sidebar__item--danger:hover { background: #fef2f2; }
.sidebar__bottom { padding: 16px 0; border-top: 1px solid #e8eaed; }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px; background: #fff;
  border-bottom: 1px solid #e8eaed; flex-shrink: 0;
}
.topbar__title { font-size: 20px; font-weight: 700; color: #1a1a2e; letter-spacing: -0.015em; margin: 0; }
.topbar__actions { display: flex; gap: 8px; }

/* ── Content ── */
.content { flex: 1; padding: 32px; overflow-y: auto; }

/* ── Alerts ── */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; margin-bottom: 24px;
}
.alert--success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert--error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Cards ── */
.admin-card {
  background: #fff; border-radius: 16px;
  border: 1px solid #e8eaed; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  padding: 0;
}
.admin-card.admin-form {
  padding: 32px;
}

/* ── Tables ── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; padding: 14px 24px; font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #9ca3af; background: #f9fafb;
  border-bottom: 1px solid #e8eaed; position: sticky; top: 0; z-index: 1;
}
.admin-table td {
  padding: 14px 24px; color: #374151;
  border-bottom: 1px solid #f3f4f6; vertical-align: middle;
}
.admin-table tr:hover td { background: #f9fafb; }
.admin-table tr:last-child td { border-bottom: none; }

/* ── Buttons ── */
.admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px; font-size: 14px;
  font-weight: 500; cursor: pointer; text-decoration: none;
  border: none; transition: all 0.15s ease;
}
.admin-btn--primary { background: #2563eb; color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,0.2); }
.admin-btn--primary:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.admin-btn--ghost { background: transparent; color: #2563eb; }
.admin-btn--ghost:hover { background: #eff6ff; }
.admin-btn--danger { background: transparent; color: #ef4444; }
.admin-btn--danger:hover { background: #fef2f2; }

/* ── Forms ── */
.admin-form label {
  display: block; font-size: 13px; font-weight: 600;
  color: #6b7280; margin-bottom: 6px;
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="number"],
.admin-form input[type="url"],
.admin-form input[type="password"],
.admin-form input[type="datetime-local"],
.admin-form input[type="file"],
.admin-form select,
.admin-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #d1d5db;
  border-radius: 10px; background: #fff; color: #1a1a2e;
  font-size: 14px; font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.admin-form .field { margin-bottom: 20px; }
.admin-form .field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.admin-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: #2563eb; cursor: pointer; }

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #9ca3af; margin-bottom: 24px;
}
.breadcrumbs a { color: #6b7280; text-decoration: none; }
.breadcrumbs a:hover { color: #2563eb; }
.breadcrumbs__sep { color: #d1d5db; }
.breadcrumbs__current { color: #1a1a2e; font-weight: 600; }

/* ── Form sections ── */
.form-section {
  background: #fff; border-radius: 16px; border: 1px solid #e8eaed;
  padding: 28px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.form-section__header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #f3f4f6;
}
.form-section__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.form-section__title { font-size: 16px; font-weight: 700; color: #1a1a2e; margin: 0; }
.form-section__desc { font-size: 13px; color: #9ca3af; margin: 2px 0 0; }

/* ── Row actions (inline in tables) ── */
.row-actions {
  display: flex; gap: 4px; justify-content: flex-end; opacity: 0.4;
  transition: opacity 0.15s ease;
}
tr:hover .row-actions { opacity: 1; }
.row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  color: #6b7280; text-decoration: none; transition: all 0.15s ease;
}
.row-action:hover { background: #f3f4f6; color: #1a1a2e; }
.row-action--edit:hover { background: #eff6ff; color: #2563eb; }
.row-action--delete:hover { background: #fef2f2; color: #ef4444; }

/* ── Search bar ── */
.admin-search {
  position: relative; margin-bottom: 24px; max-width: 400px;
}
.admin-search__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #9ca3af; pointer-events: none;
}
.admin-search__input {
  width: 100%; padding: 10px 14px 10px 42px;
  border: 1px solid #e8eaed; border-radius: 12px; background: #fff;
  font-size: 14px; font-family: inherit; color: #1a1a2e;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-search__input:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.admin-search__input::placeholder { color: #9ca3af; }

/* ── Stats ── */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.admin-stat {
  background: #fff; border-radius: 16px; border: 1px solid #e8eaed;
  padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.admin-stat__icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.admin-stat__value { font-size: 32px; font-weight: 800; color: #1a1a2e; letter-spacing: -0.02em; }
.admin-stat__label { font-size: 13px; color: #9ca3af; margin-top: 4px; }

/* ── Badges ── */
.admin-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.admin-badge--green { background: #f0fdf4; color: #16a34a; }
.admin-badge--red { background: #fef2f2; color: #dc2626; }
.admin-badge--blue { background: #eff6ff; color: #2563eb; }
.admin-badge--orange { background: #fff7ed; color: #ea580c; }

/* ── Empty ── */
.admin-empty { padding: 48px 32px; text-align: center; color: #9ca3af; }
.admin-empty p { font-size: 15px; margin: 8px 0; }
.admin-empty a { color: #2563eb; text-decoration: none; }

/* ── Chart ── */
.chart-bar { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.chart-bar__col {
  flex: 1; min-width: 4px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #2563eb, #3b82f6);
  transition: height 0.3s ease;
}
.chart-bar__col:hover { background: linear-gradient(180deg, #1d4ed8, #2563eb); }

/* ── Grid ── */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 20px; }
  .admin-form .field-row { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
}
