/* ============================================================
   admin.css — Admin panel styling
   ============================================================ */

/* ---- Layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1e293b;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  transition: transform 0.3s;
}

.admin-sidebar__brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-sidebar__nav {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}

.admin-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.admin-sidebar__item:hover,
.admin-sidebar__item.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-left-color: #3b82f6;
  text-decoration: none;
}

.admin-sidebar__icon { font-size: 16px; width: 20px; text-align: center; }

.admin-sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: #64748b;
}

/* ---- Main content area ---- */
.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.admin-topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.admin-topbar__title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.admin-topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #475569;
}

/* ---- Content wrapper ---- */
.admin-content {
  padding: 24px;
  flex: 1;
}

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

/* ---- Cards ---- */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* ---- Stats row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card__icon--blue   { background: #dbeafe; }
.stat-card__icon--green  { background: #dcfce7; }
.stat-card__icon--yellow { background: #fef9c3; }
.stat-card__icon--gray   { background: #f1f5f9; }

.stat-card__val {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.stat-card__label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* ---- Table ---- */
.table-responsive { overflow-x: auto; }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table thead th {
  text-align: left;
  padding: 11px 16px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.admin-table tbody tr:hover td { background: #f8fafc; }
.admin-table tbody tr:last-child td { border-bottom: none; }

.table-cover {
  width: 40px; height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: #f1f5f9;
  flex-shrink: 0;
}

/* ---- Form ---- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-label .required { color: #ef4444; margin-left: 3px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; }

.form-hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }
.form-error { font-size: 12px; color: #ef4444; margin-top: 5px; display: none; }
.form-control.is-error { border-color: #ef4444; }

/* ---- Upload zone ---- */
.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #f8fafc;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.upload-zone__icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone__title { font-weight: 600; color: #334155; font-size: 15px; }
.upload-zone__sub { font-size: 13px; color: #94a3b8; margin-top: 4px; }

/* Upload progress */
.upload-progress {
  display: none;
  margin-top: 16px;
}

.upload-progress.show { display: block; }

.progress-bar-wrap {
  background: #e2e8f0;
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 20px;
  width: 0%;
  transition: width 0.3s;
}

.progress-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; text-decoration: none; }
.btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; color: #334155; text-decoration: none; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; text-decoration: none; }
.btn-success   { background: #22c55e; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

/* ---- Alert ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- Modal confirm ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  max-width: 420px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal h2 { font-size: 18px; margin-bottom: 10px; }
.modal p  { font-size: 14px; color: #475569; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Responsive sidebar ---- */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 7px;
    cursor: pointer;
    font-size: 18px;
  }
}

@media (min-width: 901px) {
  .sidebar-toggle { display: none; }
}
