/**
 * Admin Panel - Light Orange Theme
 */
:root {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #fff7ed;
  --bg: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 230px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  box-shadow: 1px 0 4px rgba(0,0,0,0.02);
}
.sidebar-logo {
  padding: 0 24px 20px;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-section {
  padding: 12px 16px 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.sidebar a {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.sidebar a:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.sidebar a.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 600;
}
.sidebar a .icon { margin-right: 10px; font-size: 15px; }

/* Main content */
.main {
  margin-left: 230px;
  flex: 1;
  min-height: 100vh;
}
.topbar {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-sidebar);
}
.topbar-user { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.topbar-logout {
  font-size: 12px; color: var(--error); cursor: pointer;
  background: none; border: none; margin-left: 16px; font-weight: 500;
}
.topbar-logout:hover { text-decoration: underline; }

#content { padding: 24px 28px; }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }
.stat-card .value.error { color: var(--error); }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.data-table .thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #ecfdf5; color: var(--success); }
.badge-error { background: #fef2f2; color: var(--error); }
.badge-warning { background: #fffbeb; color: var(--warning); }
.badge-info { background: var(--primary-light); color: var(--primary); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.pg-btn {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.pg-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pg-info { font-size: 13px; color: var(--text-muted); }

/* Module loading */
.module-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state, .error-state {
  text-align: center; padding: 60px; color: var(--text-muted); font-size: 14px;
}
.error-state { color: var(--error); }

/* Section title */
.section-title {
  font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--text);
}


/* Image Modal */
.img-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  backdrop-filter: blur(3px);
}
.img-modal {
  background: #fff; border-radius: 16px; width: 700px; max-width: 90vw;
  max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.img-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.img-modal-header h3 { font-size: 15px; font-weight: 600; }
.img-modal-header button {
  background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted);
}
.img-modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.img-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.img-grid-item {
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
}
.img-grid-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.img-grid-info {
  padding: 6px 8px; font-size: 10px; color: var(--text-muted);
  display: flex; justify-content: space-between;
}
