@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --blue: #1a3fa6;
  --blue-dark: #0e2870;
  --blue-light: #2e5ce8;
  --red: #d42020;
  --yellow: #f5c800;
  --white: #ffffff;
  --gray-light: #f4f6fb;
  --gray: #e8eaf0;
  --gray-mid: #9ea3b5;
  --text: #1a1f36;
  --text-light: #5a6070;
  --success: #1dbc74;
  --warning: #f59e0b;
  --shadow: 0 4px 24px rgba(26,63,166,0.10);
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Nunito', sans-serif; background: var(--gray-light); color: var(--text); min-height: 100vh; display: flex; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--text);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo img { height: 40px; filter: brightness(10); }
.sidebar-logo-text { font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-nav { padding: 20px 12px; flex: 1; }
.sidebar-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 16px 12px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-link.active { background: var(--blue); color: white; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}
.sidebar-user-name { font-size: 14px; color: white; font-weight: 700; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.45); }

/* Main */
.main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: white;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 800; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 28px; }

/* Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--gray);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.blue { background: rgba(26,63,166,0.1); }
.stat-icon.green { background: rgba(29,188,116,0.1); }
.stat-icon.yellow { background: rgba(245,200,0,0.1); }
.stat-icon.red { background: rgba(212,32,32,0.1); }
.stat-num { font-size: 26px; font-weight: 900; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-light); font-weight: 600; margin-top: 2px; }

/* Panel */
.panel {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title { font-size: 15px; font-weight: 800; color: var(--text); }
.panel-body { padding: 24px; }

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--gray);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--blue);
  background: rgba(26,63,166,0.03);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-zone-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.upload-zone-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.upload-zone-sub { font-size: 13px; color: var(--text-light); }

/* Media Grid */
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.admin-media-item {
  border-radius: 10px;
  overflow: hidden;
  background: var(--gray-light);
  aspect-ratio: 1;
  position: relative;
  border: 1px solid var(--gray);
}
.admin-media-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.admin-media-actions {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: 0.2s;
}
.admin-media-item:hover .admin-media-actions { opacity: 1; }
.admin-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text);
  transition: 0.2s;
}
.admin-icon-btn:hover { background: var(--red); color: white; }
.admin-icon-btn.edit:hover { background: var(--blue); color: white; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-blue { background: var(--blue); color: white; }
.btn-blue:hover { background: var(--blue-dark); }
.btn-outline { background: white; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.88; }
.btn-success { background: var(--success); color: white; }

/* Form */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray);
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  transition: 0.2s;
  background: white;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,63,166,0.1); }

/* Table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-mid);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray);
  font-size: 14px;
  color: var(--text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-light); }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-green { background: rgba(29,188,116,0.12); color: #0e8c52; }
.badge-blue { background: rgba(26,63,166,0.1); color: var(--blue); }
.badge-yellow { background: rgba(245,200,0,0.15); color: #996600; }
.badge-red { background: rgba(212,32,32,0.1); color: var(--red); }

/* Login */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 60px; }
.login-title { font-size: 24px; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.login-sub { font-size: 14px; color: var(--text-light); margin-bottom: 28px; }
.login-btn { width: 100%; padding: 14px; font-size: 16px; background: var(--blue); color: white; border: none; border-radius: 10px; font-weight: 800; cursor: pointer; font-family: 'Nunito', sans-serif; transition: 0.2s; }
.login-btn:hover { background: var(--blue-dark); }

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