/* SiteFabric Admin Panel CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --admin-primary: #4f46e5;
  --admin-primary-dark: #4338ca;
  --admin-primary-light: #ede9fe;
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-text: rgba(255,255,255,0.7);
  --admin-sidebar-active: rgba(255,255,255,0.1);
  --admin-bg: #f1f5f9;
  --admin-surface: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --admin-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --admin-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --admin-radius: 8px;
  --admin-radius-lg: 12px;
  --admin-sidebar-w: 260px;
  --admin-header-h: 60px;
}

html, body { height: 100%; font-family: 'Inter', -apple-system, sans-serif; font-size: 14px; color: var(--admin-text); background: var(--admin-bg); }

/* Layout */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 200;
  transition: transform 0.3s ease;
}

.admin-sidebar__brand {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar__logo { font-size: 22px; font-weight: 800; color: #fff; }
.admin-sidebar__version { font-size: 11px; color: rgba(255,255,255,0.4); }

.admin-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }

.admin-nav__section { margin-bottom: 24px; }
.admin-nav__section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.3); padding: 0 12px; margin-bottom: 8px; }

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--admin-sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.admin-nav__link:hover { background: var(--admin-sidebar-active); color: #fff; }
.admin-nav__link.active { background: var(--admin-primary); color: #fff; }
.admin-nav__link i { font-size: 16px; width: 20px; text-align: center; }

.admin-sidebar__footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* Main */
.admin-main { margin-left: var(--admin-sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.admin-header {
  height: var(--admin-header-h);
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--admin-shadow);
}

.admin-header__title { font-size: 16px; font-weight: 700; }
.admin-header__actions { display: flex; align-items: center; gap: 16px; }
.admin-header__user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.admin-header__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--admin-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

.admin-content { flex: 1; padding: 28px 32px; }

/* Cards */
.admin-card {
  background: var(--admin-surface);
  border-radius: var(--admin-radius-lg);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
}

.admin-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card__title { font-size: 15px; font-weight: 700; }
.admin-card__body { padding: 20px; }

/* Stats */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }

.admin-stat-card {
  background: var(--admin-surface);
  border-radius: var(--admin-radius-lg);
  padding: 20px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--admin-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.admin-stat-card__icon--blue { background: #eff6ff; color: #3b82f6; }
.admin-stat-card__icon--green { background: #f0fdf4; color: #22c55e; }
.admin-stat-card__icon--purple { background: #faf5ff; color: #a855f7; }
.admin-stat-card__icon--orange { background: #fff7ed; color: #f97316; }
.admin-stat-card__num { font-size: 26px; font-weight: 800; color: var(--admin-text); }
.admin-stat-card__label { font-size: 12px; color: var(--admin-text-muted); }

/* Table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--admin-border); }
.admin-table th { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--admin-text-muted); background: var(--admin-bg); }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table td { font-size: 13px; }

/* Buttons */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.admin-btn--primary { background: var(--admin-primary); color: #fff; }
.admin-btn--primary:hover { background: var(--admin-primary-dark); color: #fff; }
.admin-btn--danger { background: #fee2e2; color: #991b1b; }
.admin-btn--danger:hover { background: #fca5a5; color: #7f1d1d; }
.admin-btn--secondary { background: var(--admin-bg); color: var(--admin-text); border: 1px solid var(--admin-border); }
.admin-btn--secondary:hover { background: var(--admin-border); }
.admin-btn--success { background: #d1fae5; color: #065f46; }
.admin-btn--sm { padding: 6px 12px; font-size: 12px; }
.admin-btn--lg { padding: 12px 24px; font-size: 15px; }

/* Forms */
.admin-form-group { margin-bottom: 18px; }
.admin-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--admin-text); }
.admin-required { color: #ef4444; margin-left: 2px; }

.admin-input {
  width: 100%;
  padding: 3px 9px;
  border: 1.5px solid var(--admin-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--admin-text);
  background: var(--admin-surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus { border-color: var(--admin-primary); box-shadow: 0 0 0 3px var(--admin-primary-light); }
textarea.admin-input { min-height: 100px; resize: vertical; }
select.admin-input { cursor: pointer; }

.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Badges */
.admin-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.admin-badge--success { background: #d1fae5; color: #065f46; }
.admin-badge--danger { background: #fee2e2; color: #991b1b; }
.admin-badge--info { background: #dbeafe; color: #1e40af; }
.admin-badge--warning { background: #fef3c7; color: #92400e; }

/* Alerts */
.admin-alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.admin-alert--success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.admin-alert--error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Login */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--admin-sidebar-bg); }
.admin-login__card { background: var(--admin-surface); border-radius: var(--admin-radius-lg); padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--admin-shadow-md); }
.admin-login__logo { text-align: center; margin-bottom: 32px; }
.admin-login__title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.admin-login__sub { text-align: center; color: var(--admin-text-muted); font-size: 14px; margin-bottom: 28px; }

/* Theme preview */
.theme-preview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

.theme-option { position: relative; cursor: pointer; }
.theme-option input[type="radio"] { position: absolute; opacity: 0; }

.theme-option__card {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
}

.theme-option input:checked + .theme-option__card { border-color: var(--admin-primary); box-shadow: 0 0 0 2px var(--admin-primary-light); }
.theme-option__swatch { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 8px; border: 2px solid rgba(0,0,0,0.1); }

/* Image preview */
.admin-img-preview { width: 80px; height: 60px; border-radius: 6px; object-fit: cover; border: 1px solid var(--admin-border); }

/* Responsive */
@media (max-width: 1024px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 16px; }
  .admin-form-row { grid-template-columns: 1fr; }
}
